From a95ff9b2cecfd3466ffe2b2811d774cd07208a12 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 25 Aug 2014 11:47:12 +0200 Subject: [PATCH 001/147] changement titres dialogues fissure --- src/Tools/blocFissure/ihm/fissureCoude.ui | 9 +++------ src/Tools/blocFissure/ihm/fissureGenerale.ui | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Tools/blocFissure/ihm/fissureCoude.ui b/src/Tools/blocFissure/ihm/fissureCoude.ui index 2fc5575f1..d6ab64019 100644 --- a/src/Tools/blocFissure/ihm/fissureCoude.ui +++ b/src/Tools/blocFissure/ihm/fissureCoude.ui @@ -6,12 +6,12 @@ 0 0 - 826 - 540 + 959 + 618 - Dialog + Génération de coude avec fissure @@ -978,9 +978,6 @@ verticalSpacer_2 - horizontalSpacer - lb_calcul - horizontalSpacer_9 diff --git a/src/Tools/blocFissure/ihm/fissureGenerale.ui b/src/Tools/blocFissure/ihm/fissureGenerale.ui index c18b3c18d..3f1528ff0 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale.ui +++ b/src/Tools/blocFissure/ihm/fissureGenerale.ui @@ -11,7 +11,7 @@ - Dialog + Insertion de fissure dans un maillage sain <html><head/><body><p>Insertion d'un maillage de fissure dans un maillage hexaédrique sain.</p><p>Le maillage sain est fourni sous forme de fichier Med.</p><p>La face de fissure est décrite par une géométrie dans un fichier brep.</p><p>La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.</p><p>La procédure identfie des mailles saines à enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone à remailler en tétraèdres.</p></body></html> From 6b00ce33267c1c9523dc350bb49bd80d6919c6b9 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 25 Aug 2014 17:26:29 +0200 Subject: [PATCH 002/147] merge manuel developpements Olivier Hoareau --- src/Tools/blocFissure/AREextradosLauncher.py | 36 ++ src/Tools/blocFissure/AREintradosLauncher.py | 36 ++ src/Tools/blocFissure/exemple2.py | 9 +- src/Tools/blocFissure/fissureLauncher.py | 36 ++ .../gmu/creeZoneDefautDansObjetSain.py | 12 +- .../blocFissure/gmu/creeZoneDefautFilling.py | 2 +- .../gmu/fusionMaillageAttributionDefaut.py | 85 +++ .../gmu/genereMeshCalculZoneDefaut.py | 15 +- .../blocFissure/gmu/insereFissureGenerale.py | 34 +- .../blocFissure/gmu/listOfExtraFunctions.py | 199 +++++++ src/Tools/blocFissure/gmu/peauInterne.py | 12 +- .../gmu/quadranglesToShapeNoCorner.py | 327 ++++++++++++ .../gmu/quadranglesToShapeWithCorner.py | 115 ++++ .../blocFissure/ihm/fissureCoude_plugin.py | 4 +- src/Tools/blocFissure/ihm/fissureCoude_ui.py | 492 ++++++++++++++++++ .../blocFissure/ihm/fissureGenerale_ui.py | 220 ++++++++ .../blocFissure/lanceurCasTestCoinTriple.py | 29 ++ .../lanceurCasTestCoinTripleMilieu.py | 29 ++ .../lanceurCasTestCoinTripleTransverse.py | 29 ++ .../blocFissure/lanceurSoudureArrondieTest.py | 32 ++ .../blocFissure/lanceurSoudureViveTest.py | 32 ++ src/Tools/blocFissure/lanceurTestAubry.py | 32 ++ 22 files changed, 1790 insertions(+), 27 deletions(-) create mode 100644 src/Tools/blocFissure/AREextradosLauncher.py create mode 100644 src/Tools/blocFissure/AREintradosLauncher.py create mode 100644 src/Tools/blocFissure/fissureLauncher.py create mode 100644 src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py create mode 100644 src/Tools/blocFissure/gmu/listOfExtraFunctions.py create mode 100644 src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py create mode 100644 src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py create mode 100644 src/Tools/blocFissure/ihm/fissureCoude_ui.py create mode 100644 src/Tools/blocFissure/ihm/fissureGenerale_ui.py create mode 100644 src/Tools/blocFissure/lanceurCasTestCoinTriple.py create mode 100644 src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py create mode 100644 src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py create mode 100644 src/Tools/blocFissure/lanceurSoudureArrondieTest.py create mode 100644 src/Tools/blocFissure/lanceurSoudureViveTest.py create mode 100644 src/Tools/blocFissure/lanceurTestAubry.py diff --git a/src/Tools/blocFissure/AREextradosLauncher.py b/src/Tools/blocFissure/AREextradosLauncher.py new file mode 100644 index 000000000..f256b4cc3 --- /dev/null +++ b/src/Tools/blocFissure/AREextradosLauncher.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +""" FissureLauncher: + Permet de lancer le script 'casStandard' + en fonction des paramètres contenus dans 'dicoParams'. """ + +#import sys +import salome + +#import os +#from blocFissure import gmu +from blocFissure.gmu import initLog +initLog.setDebug() +#initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +mesh = 'ARE_sain_lin_rotated.med' +crack = 'fissureExtrados.brep' + +dicoParams = dict(nomCas = 'fissTuyau', + maillageSain = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh), + brepFaceFissure = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack), + edgeFissIds = [4], + lgInfluence = 12, + meshBrep = (0.05, 2.0), + rayonPipe = 1.0, + lenSegPipe = 1, #9, + nbSegRad = 8, + nbSegCercle = 20, + areteFaceFissure = 1.0) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/AREintradosLauncher.py b/src/Tools/blocFissure/AREintradosLauncher.py new file mode 100644 index 000000000..f95fea280 --- /dev/null +++ b/src/Tools/blocFissure/AREintradosLauncher.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +""" FissureLauncher: + Permet de lancer le script 'casStandard' + en fonction des paramètres contenus dans 'dicoParams'. """ + +#import sys +import salome + +#import os +#from blocFissure import gmu +from blocFissure.gmu import initLog +initLog.setDebug() +#initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +mesh = 'ARE_sain_lin_rotated.med' +crack = 'fissureIntrados.brep' + +dicoParams = dict(nomCas = 'fissTuyau', + maillageSain = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh), + brepFaceFissure = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack), + edgeFissIds = [4], + lgInfluence = 14, + meshBrep = (0.05, 2.0), + rayonPipe = 1.0, + lenSegPipe = 1, #9, + nbSegRad = 5, + nbSegCercle = 16, + areteFaceFissure = 1.0) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/exemple2.py b/src/Tools/blocFissure/exemple2.py index c6d20eb27..e2f80738c 100644 --- a/src/Tools/blocFissure/exemple2.py +++ b/src/Tools/blocFissure/exemple2.py @@ -80,12 +80,13 @@ dicoParams = dict(nomCas = 'angleCube2', maillageSain = 'boite.med', brepFaceFissure = "disk.brep", edgeFissIds = [4], - lgInfluence = 20, + lgInfluence = 50, meshBrep = (5,10), - rayonPipe = 10, + rayonPipe = 15, + lenSegPipe = 20, nbSegRad = 5, - nbSegCercle = 8, - areteFaceFissure = 10) + nbSegCercle = 12, + areteFaceFissure = 2) execInstance = casStandard(dicoParams) diff --git a/src/Tools/blocFissure/fissureLauncher.py b/src/Tools/blocFissure/fissureLauncher.py new file mode 100644 index 000000000..10f7b0ffb --- /dev/null +++ b/src/Tools/blocFissure/fissureLauncher.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +""" FissureLauncher: + Permet de lancer le script 'casStandard' + en fonction des paramètres contenus dans 'dicoParams'. """ + +#import sys +import salome + +#import os +#from blocFissure import gmu +from blocFissure.gmu import initLog +initLog.setDebug() +#initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +mesh = 'maillageSainTuyauFEM.med' +crack = 'fissureQuartEllipse.brep' + +dicoParams = dict(nomCas = 'fissTuyau', + maillageSain = '/local00/home/I48174/Bureau/supportMaillage/{0}'.format(mesh), + brepFaceFissure = '/local00/home/I48174/Bureau/supportMaillage/{0}'.format(crack), + edgeFissIds = [9], + lgInfluence = 250, + meshBrep = (10, 50), + rayonPipe = 35, + lenSegPipe = 7, #9, + nbSegRad = 6, + nbSegCercle = 30, + areteFaceFissure = 20) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py index edd6855db..d4270fcea 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py @@ -7,7 +7,7 @@ import SALOMEDS from creeZoneDefautMaillage import creeZoneDefautMaillage from peauInterne import peauInterne -from quadranglesToShape import quadranglesToShape +from quadranglesToShapeNoCorner import quadranglesToShapeNoCorner from creeZoneDefautFilling import creeZoneDefautFilling from creeZoneDefautGeom import creeZoneDefautGeom from getCentreFondFiss import getCentreFondFiss @@ -18,7 +18,7 @@ from getCentreFondFiss import getCentreFondFiss def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): """ - TODO: a compléter + #TODO: a compléter """ logging.info('start') @@ -62,7 +62,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, maillageSain.ExportMED( fichierMaillageSain, 0, SMESH.MED_V2_2, 1 ) logging.debug("fichier maillage sain %s", fichierMaillageSain) [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \ - peauInterne(fichierMaillageSain, nomZones) + peauInterne(fichierMaillageSain, shapeDefaut, nomZones) facesDefaut = [] centresDefaut = [] @@ -71,7 +71,9 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, isPlane = False if isHexa and not isPlane: meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0) - fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss) + + fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss) + for filling in fillings: [faceDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \ creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion) @@ -82,7 +84,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, else: [facesDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \ creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion) - bordsPartages =[] + bordsPartages = [] for face in facesDefaut: bordsPartages.append([None,None]) # TODO : traitement des arêtes vives ? fillconts = facesDefaut diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py b/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py index ed3229eb8..fd98acab2 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py @@ -9,7 +9,7 @@ from geomsmesh import geompy def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50): """ Construction CAO de la zone à remailler, quand on utilise un filling, - après appel creeZoneDefautMaillage et quadranglesToShape + après appel creeZoneDefautMaillage et quadranglesToShapeNoCorner @param filling : la CAO de la peau du défaut reconstituée @param shapeDefaut : objet géométrique représentant la fissure (selon les cas, un point central, ou une shape plus complexe, diff --git a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py new file mode 100644 index 000000000..d7736d213 --- /dev/null +++ b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 24 09:14:13 2014 + +@author: I48174 +""" + +import logging +from geomsmesh import geompy +from geomsmesh import smesh +import GEOM +import SMESH + +from listOfExtraFunctions import createNewMeshesFromCorner +from listOfExtraFunctions import createLinesFromMesh + +# ----------------------------------------------------------------------------- +# --- groupe de quadrangles de face transformé en face géométrique par filling + +def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible, zoneDefaut_skin, shapeDefaut, listOfCorners): + """ """ + # TODO: rédiger la docstring + + logging.info("start") + + facesNonCoupees = [] + facesCoupees = [] + maillagesNonCoupes = [] + maillagesCoupes = [] + + # On crée une liste contenant le maillage de chaque face. + listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners) + + i = 0 + while i < len(listOfNewMeshes): + lines = createLinesFromMesh(listOfNewMeshes[i]) + setOfLines = [] + for line in lines: + # On possède l'information 'ID' de chaque noeud composant chaque + # ligne de la face. A partir de l'ID, on crée un vertex. Un + # ensemble de vertices constitue une ligne. Un ensemble de lignes + # constitue la face. + tmpCoords = [maillageDefautCible.GetNodeXYZ(node) for node in line] + tmpPoints = [geompy.MakeVertex(val[0], val[1], val[2]) for val in tmpCoords] + line = geompy.MakeInterpol(tmpPoints, False, False) + setOfLines.append(line) + + # A partir des lignes de la face, + # on recrée un objet GEOM temporaire par filling. + filling = geompy.MakeFilling(geompy.MakeCompound(setOfLines), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) + geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) + + tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0, True) + tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True) + tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + if len(tmpExplodeRef) == len(tmpExplodeNum): + geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1)) + facesNonCoupees.append(filling) + maillagesNonCoupes.append(listOfNewMeshes[i]) + else: + geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1)) + facesCoupees.append(filling) + maillagesCoupes.append(listOfNewMeshes[i]) + + i += 1 + + listOfInternMeshes = [maillageInterneCible] + [msh.GetMesh() for msh in maillagesNonCoupes] + + newMaillageInterne = smesh.Concatenate(listOfInternMeshes, 1, 1, 1e-05, False) + + facesEnTrop = [] + + criteres = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGenSurface, SMESH.FT_Undefined, face) for face in facesNonCoupees] + filtres = [smesh.GetFilterFromCriteria([critere]) for critere in criteres] + for i, filtre in enumerate(filtres): + filtre.SetMesh(maillageSain.GetMesh()) + faceEnTrop = maillageSain.GroupOnFilter(SMESH.FACE, 'faceEnTrop_{0}'.format(i + 1), filtre) + facesEnTrop.append(faceEnTrop) + + newZoneDefaut_skin = maillageSain.GetMesh().CutListOfGroups([zoneDefaut_skin], facesEnTrop, 'newZoneDefaut_skin') + + smesh.SetName(newMaillageInterne, 'newInternalBoundary') + + return newZoneDefaut_skin, newMaillageInterne + \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py index a08664bad..08e24748c 100644 --- a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py +++ b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py @@ -9,8 +9,19 @@ from salome.smesh import smeshBuilder def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize): """ - TODO: a completer - """ + -Permet de générer un maillage sur l'objet géométrique 'facefiss' via + l'algorithme NETGEN_1D2D : + -SetMaxSize = dimension max d'un élément (maxSize) + -SetSecondOrder = élément quadratique (Y=1, N=0) + -SetOptimize = élément régulier (Y=1, N=0) + -SetFineness = finesse du maillage + [very_coarse, coarse, moderate, fine, very_fine, custom] + [0, 1, 2, 3, 4, 5 ] + -SetMinSize = dimension min d'un élément (minSize) + -SetQuadAllowed = permission quadrangle dans maillage triangle + -On récupère les coordonnées de chaque noeud de la fissure qu'on stocke + dans une liste sous la forme : [X0, Y0, Z0, ..., Xn, Yn, Zn]""" + logging.info('start') meshFissure = smesh.Mesh(facefiss) diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index 3204084a5..2611fa616 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -82,12 +82,13 @@ def insereFissureGenerale(maillagesSains, #fichierMaillageSain = nomRep + '/' + nomFicSain + '.med' fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med' - facesDefaut = elementsDefaut[0] # fillings des faces en peau + # fillings des faces en peau + facesDefaut = elementsDefaut[0] #centresDefaut = elementsDefaut[1] #normalsDefaut = elementsDefaut[2] #extrusionsDefaut = elementsDefaut[3] dmoyen = elementsDefaut[4] - bordsPartages = elementsDefaut[5] + bordsPartages = elementsDefaut[5] fillconts = elementsDefaut[6] idFilToCont = elementsDefaut[7] maillageSain = elementsDefaut[8] @@ -172,7 +173,7 @@ def insereFissureGenerale(maillagesSains, # il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure # liste de faces externes : facesDefaut # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection) - + partitionsPeauFissFond = [] ipart = 0 for filling in facesDefaut: @@ -190,18 +191,27 @@ def insereFissureGenerale(maillagesSains, else: partitionsPeauFissFond.append(None) ipart = ipart +1 + + + # --- arêtes vives détectées (dans quadranglesToShapeNoCorner + # et quadranglesToShapeWithCorner) - # --- arêtes vives détectées (dans quadranglesToShape) - aretesVives = [] aretesVivesCoupees = [] ia = 0 for a in bordsPartages: - if a[0] is not None: - aretesVives.append(a[0]) - name = "areteVive%d"%ia - geompy.addToStudy(a[0], name) - ia += 1 + if not isinstance(a, list): + aretesVives.append(a) + name = "areteVive%d"%ia + geompy.addToStudy(a, name) + ia += 1 + else: + if a[0] is not None: + aretesVives.append(a[0]) + name = "areteVive%d"%ia + geompy.addToStudy(a[0], name) + ia += 1 + aretesVivesC = None if len(aretesVives) > 0: aretesVivesC =geompy.MakeCompound(aretesVives) @@ -228,7 +238,7 @@ def insereFissureGenerale(maillagesSains, for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond): fillingFaceExterne = facesDefaut[ifil] - fillingSansDecoupe = fillconts[idFilToCont[ifil]] + #fillingSansDecoupe = fillconts[idFilToCont[ifil]] if partitionPeauFissFond is not None: logging.debug("traitement partitionPeauFissFond %s", ifil) # ----------------------------------------------------------------------- @@ -1210,7 +1220,7 @@ def insereFissureGenerale(maillagesSains, grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) # --- maillage faces de peau - + boutFromIfil = [None for i in range(nbFacesFilling)] if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes boutFromIfil[idFillingFromBout[0]] = 0 diff --git a/src/Tools/blocFissure/gmu/listOfExtraFunctions.py b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py new file mode 100644 index 000000000..535396226 --- /dev/null +++ b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +""" +Created on Mon Jun 23 14:49:36 2014 + +@author: I48174 +""" + +import logging +import SMESH +from geomsmesh import smesh + +def lookForCorner(maillageAScanner): + + """ Cette fonction permet de scanner la liste de noeuds qui composent le + maillage passé en paramètre. On recherche un ou plusieurs coins, ce + qui implique les caractéristiques suivantes: + - le noeud doit appartenir au moins à trois éléments distinctes + - chaque élément doit appartenir à un ensemble distincte + La fonction renvoie une liste de coins par l'intermédiaire de l'IDs + chaque noeud. La liste contient en général au maximum deux coins. """ + + logging.info("start") + + allNodeIds = maillageAScanner.GetNodesId() # On stocke tout les noeuds + listOfCorners = [] + for ND in allNodeIds: + # On parcours la liste de noeuds + listOfElements = maillageAScanner.GetNodeInverseElements(ND) + if len(listOfElements) >=3: + # On teste le nombre d'éléments qui partage le même noeud + # --- Filtre selon le critère 'coplanar' --- # + listOfCriterion = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \ + SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) \ + for elem in listOfElements] + listOfFilters = [smesh.GetFilterFromCriteria([criteria]) \ + for criteria in listOfCriterion] + # ------------------------------------------ # + listOfSets = [maillageAScanner.GetIdsFromFilter(filter) \ + for filter in listOfFilters] + if listOfSets.count(listOfSets[0]) == len(listOfSets): + # Si toutes les listes d'éléments sont similaires, on retourne + # au début pour éviter de travailler sur des éléments inutils. + # Exemple : un noeud appartenant à 4 éléments sur la même face. + continue + for s in listOfSets: + while listOfSets.count(s) > 1: + # On supprime tant que la liste d'éléments n'est pas unique. + listOfSets.remove(s) + if len(listOfSets) >= 3: + # Si on a au moins 3 listes d'élements différentes, on considère + # qu'il y a présence d'un coin. + listOfCorners.append(ND) + return listOfCorners + +def createLinesFromMesh(maillageSupport): + + """ Cette fonction permet de générer une liste de lignes à partir du + maillage support passé en paramètre. On démarre à partir d'un coin + simple et on parcourt tout les noeuds pour former un ligne. Soit la + figure ci-dessous : + + 1_____4_____7 On part du coin N1, et on cherche les noeuds + | | | successifs tels que [1, 2, 3]. Lorsqu'on arrive + | 1 | 3 | arrive sur le noeud de fin de ligne N3, on repart + | | | du noeud précédent du premier élément (E1), à + 2_____5_____8 savoir le noeud N4. On suit les noeuds succesifs + | | | [4, 5, 6] comme précédemment et ainsi de suite. + | 2 | 4 | Lorsqu'on arrive sur le dernier noeud de la + | | | dernière ligne, à savoir le noeud N9, on considère + 3_____6_____9 que toutes les lignes sont créées. + + La fonction retourne une liste de lignes utilisées par la suite. """ + + logging.info("start") + + allNodeIds = maillageSupport.GetNodesId() + while len(allNodeIds): + nodeIds = allNodeIds + for idNode in nodeIds: # rechercher un coin + elems = maillageSupport.GetNodeInverseElements(idNode) + if len(elems) == 1: + # un coin: un noeud, un element quadrangle + elem = elems[0] + break; + idStart = idNode # le noeud de coin + elemStart = elem # l'élément quadrangle au coin + xyz = maillageSupport.GetNodeXYZ(idStart) + logging.debug("idStart %s, coords %s", idStart, str(xyz)) + + nodelines =[] # on va constituer une liste de lignes de points + nextLine = True + ligneFinale = False + while nextLine: + logging.debug("--- une ligne") + idNode = idStart + elem = elemStart + if ligneFinale: + agauche = False # sens de parcours des 4 noeuds d'un quadrangle + nextLine = False + else: + agauche = True + ligneIncomplete = True # on commence une ligne de points + debutLigne = True + nodeline = [] + elemline = [] + while ligneIncomplete: # compléter la ligne de points + nodeline.append(idNode) + allNodeIds.remove(idNode) + elemline.append(elem) + nodes = maillageSupport.GetElemNodes(elem) + i = nodes.index(idNode) # repérer l'index du noeud courant (i) dans l'élément quadrangle (0 a 3) + if agauche: # déterminer le noeud suivant (j) et celui opposé (k) dans le quadrangle + if i < 3: + j = i+1 + else: + j = 0 + if j < 3: + k = j+1 + else: + k = 0 + else: + if i > 0: + j = i -1 + else: + j = 3 + if j > 0: + k = j -1 + else: + k = 3 + isuiv = nodes[j] # noeud suivant + iapres = nodes[k] # noeud opposé + if debutLigne: + debutLigne = False + # précédent a trouver, dernière ligne : précédent au lieu de suivant + if agauche: + if i > 0: + iprec = nodes[i -1] + else: + iprec = nodes[3] + idStart = iprec + elems3 = maillageSupport.GetNodeInverseElements(iprec) + if len(elems3) == 1: # autre coin + ligneFinale = True + else: + for elem3 in elems3: + if elem3 != elem: + elemStart = elem3 + break + #print nodes, idNode, isuiv, iapres + elems1 = maillageSupport.GetNodeInverseElements(isuiv) + elems2 = maillageSupport.GetNodeInverseElements(iapres) + ligneIncomplete = False + for elem2 in elems2: + if elems1.count(elem2) and elem2 != elem: + ligneIncomplete = True + idNode = isuiv + elem = elem2 + break + if not ligneIncomplete: + nodeline.append(isuiv) + allNodeIds.remove(isuiv) + logging.debug("nodeline %s", nodeline) + logging.debug("elemline %s", elemline) + nodelines.append(nodeline) + + # on a constitué une liste de lignes de points connexes + logging.debug("dimensions [%s, %s]", len(nodelines), len(nodeline)) + + return nodelines + +def createNewMeshesFromCorner(maillageSupport, listOfCorners): + + """ Cette fonction permet de générer un nouveau maillage plus facile à + utiliser. On démarre d'un coin et on récupère les trois éléments + auquel le noeud appartient. Grâce à un filtre 'coplanar' sur les trois + éléments, on peut générer des faces distinctes. """ + + logging.info("start") + + tmp = [] + listOfNewMeshes = [] + for corner in listOfCorners: + elems = maillageSupport.GetNodeInverseElements(corner) + for i, elem in enumerate(elems): + # --- Filtre selon le critère 'coplanar' --- # + critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \ + SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) + filtre = smesh.GetFilterFromCriteria([critere]) + # ------------------------------------------ # + grp = maillageSupport.GroupOnFilter(SMESH.FACE, 'grp', filtre) + # On copie le maillage en fonction du filtre + msh = smesh.CopyMesh(grp, 'new_{0}'.format(i + 1), False, True) + # On stocke l'ensemble des noeuds du maillage dans tmp + # On ajoute le maillage à la liste des nouveaux maillages + # seulement s'il n'y est pas déjà + tmp.append(msh.GetNodesId()) + if tmp.count(msh.GetNodesId()) <= 1: + listOfNewMeshes.append(msh) + return listOfNewMeshes \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/peauInterne.py b/src/Tools/blocFissure/gmu/peauInterne.py index 6790061b9..3899a72be 100644 --- a/src/Tools/blocFissure/gmu/peauInterne.py +++ b/src/Tools/blocFissure/gmu/peauInterne.py @@ -4,10 +4,13 @@ import logging from geomsmesh import smesh import SMESH +from listOfExtraFunctions import lookForCorner +from fusionMaillageAttributionDefaut import fusionMaillageDefaut + # ----------------------------------------------------------------------------- # --- peau interne du defaut dans le maillage sain -def peauInterne(fichierMaillage, nomZones): +def peauInterne(fichierMaillage, shapeDefaut, nomZones): """ Retrouve les groupes de défaut dans le maillage sain modifié par CreateHoleSkin (CreeZoneDefautMaillage) On récupère le volume et la peau de la zone de défaut, les éventuelles faces et arêtes internes de cette zone. @@ -41,6 +44,13 @@ def peauInterne(fichierMaillage, nomZones): nbAdded, maillageSain, DefautBoundary = maillageSain.MakeBoundaryElements( SMESH.BND_2DFROM3D, 'DefBound', '', 0, [ zoneDefaut ]) internal = maillageSain.GetMesh().CutListOfGroups( [ DefautBoundary ], [ zoneDefaut_skin ], 'internal' ) internalBoundary = smesh.CopyMesh( internal, 'internalBoundary', 0, 0) + + maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0) + listOfCorner = lookForCorner(maillageDefautCible) + print "listOfCorner = ", listOfCorner + if len(listOfCorner) > 0: + print " /!\ SUITE DU SCRIPT EN CONSTRUCTION /!\\" + zoneDefaut_skin, internalBoundary = fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner) return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py new file mode 100644 index 000000000..15b74a516 --- /dev/null +++ b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- + +import logging +from geomsmesh import geompy +import GEOM +import math +import numpy as np + +def mydot(a): + return np.dot(a,a) + +# ----------------------------------------------------------------------------- +# --- groupe de quadrangles de face transformé en face géométrique par filling + +def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): + """ + groupe de quadrangles de face transformée en faces géométriques par filling + on part de quadrangles définissant une zone a 4 cotés (convexe), et on reconstitue n lignes de p points. + Ces n lignes de p points sont transformées en n courbes géométriques, + à partir desquelles on reconstitue une surface géométrique. + Il peut y avoir plusieurs faces géométriques reconstituées, si on fournit des groupes de quadrangles non connexes. + On détecte les angles vifs, pour conserver des arêtes vives délimitant des faces connexes. + @param meshQuad : maillages constitué de quadrangles constituant une ou plusieurs zones convexes + @return (fillings, noeuds_Bords) : liste de geomObject, listes des bords (bord = liste ordonnée de noeuds (geomObject)) + """ + logging.info("start") + + isVecteurDefaut = False + if shapeFissureParams.has_key('vecteurDefaut'): + isVecteurDefaut = True + vecteurDefaut = shapeFissureParams['vecteurDefaut'] + + fillings = [] # les faces reconstituées, découpées selon les arêtes vives + noeuds_bords = [] # + bords_Partages = [] # contient a la fin les courbes correspondant aux arêtes vives + fillconts = [] # les faces reconstituées, sans découpage selon les arêtes vives + idFilToCont = [] # index face découpée vers face sans découpe + iface = 0 # index face découpée + icont = 0 # index face continue + + allNodeIds = meshQuad.GetNodesId() + while len(allNodeIds): + nodeIds = allNodeIds + for idNode in nodeIds: # rechercher un coin + elems = meshQuad.GetNodeInverseElements(idNode) + if len(elems) == 1: + # un coin: un noeud, un element quadrangle + elem = elems[0] + break; + idStart = idNode # le noeud de coin + elemStart = elem # l'élément quadrangle au coin + xyz = meshQuad.GetNodeXYZ(idStart) + print "xyz = ", xyz + logging.debug("idStart %s, coords %s", idStart, str(xyz)) + + nodelines =[] # on va constituer une liste de lignes de points + nextLine = True + ligneFinale = False + while nextLine: + logging.debug("--- une ligne") + idNode = idStart + elem = elemStart + if ligneFinale: + agauche = False # sens de parcours des 4 noeuds d'un quadrangle + nextLine = False + else: + agauche = True + ligneIncomplete = True # on commence une ligne de points + debutLigne = True + nodeline = [] + elemline = [] + while ligneIncomplete: # compléter la ligne de points + nodeline.append(idNode) + allNodeIds.remove(idNode) + elemline.append(elem) + nodes = meshQuad.GetElemNodes(elem) + i = nodes.index(idNode) # repérer l'index du noeud courant (i) dans l'élément quadrangle (0 a 3) + if agauche: # déterminer le noeud suivant (j) et celui opposé (k) dans le quadrangle + if i < 3: + j = i+1 + else: + j = 0 + if j < 3: + k = j+1 + else: + k = 0 + else: + if i > 0: + j = i -1 + else: + j = 3 + if j > 0: + k = j -1 + else: + k = 3 + isuiv = nodes[j] #noeud suivant + iapres = nodes[k] #noeud opposé + if debutLigne: + debutLigne = False + # précédent a trouver, dernière ligne : précédent au lieu de suivant + if agauche: + if i > 0: + iprec = nodes[i -1] + else: + iprec = nodes[3] + idStart = iprec + elems3 = meshQuad.GetNodeInverseElements(iprec) + if len(elems3) == 1: # autre coin + ligneFinale = True + else: + for elem3 in elems3: + if elem3 != elem: + elemStart = elem3 + break + #print nodes, idNode, isuiv, iapres + elems1 = meshQuad.GetNodeInverseElements(isuiv) + elems2 = meshQuad.GetNodeInverseElements(iapres) + ligneIncomplete = False + for elem2 in elems2: + if elems1.count(elem2) and elem2 != elem: + ligneIncomplete = True + idNode = isuiv + elem = elem2 + break + if not ligneIncomplete: + nodeline.append(isuiv) + allNodeIds.remove(isuiv) + logging.debug("nodeline %s", nodeline) + logging.debug("elemline %s", elemline) + nodelines.append(nodeline) + print "nodelines = ", nodelines + longueur = [len(val) for val in nodelines] + print "longueur = ", longueur + # on a constitué une liste de lignes de points connexes + logging.debug("dimensions [%s, %s]", len(nodelines), len(nodeline)) + + # stockage des coordonnées dans un tableau numpy + mat = np.zeros((len(nodelines), len(nodeline), 3)) + for i, ligne in enumerate(nodelines): + for j, nodeId in enumerate(ligne): + mat[i,j] = meshQuad.GetNodeXYZ(nodeId) + logging.debug("matrice de coordonnées: \n%s",mat) + logging.debug("dimensions %s", mat.shape) + + # recherche d'angles supérieurs a un seuil sur une ligne : angle entre deux vecteurs successifs + cosmin = math.cos(math.pi/4.) # TODO: angle reference en paramètre + vecx = mat[:, 1:, :] - mat[:, :-1, :] # vecteurs selon direction "x" + vx0 = vecx[:, :-1, :] # vecteurs amont + vx1 = vecx[:, 1:, :] # vecteurs aval + e = np.einsum('ijk,ijk->ij', vx0, vx1) # produit scalaire des vecteurs + f = np.apply_along_axis(mydot, 2, vx0) # normes carrées vecteurs amont + g = np.apply_along_axis(mydot, 2, vx1) # normes carrées vecteurs aval + h = e/(np.sqrt(f*g)) # cosinus + ruptureX = h < cosmin # True si angle > reference + logging.debug("matrice de rupture X: \n%s",ruptureX) + rupX = filter(lambda x: np.prod(ruptureX[:,x]), range(len(nodeline)-2)) + logging.debug("colonnes de rupture: %s",rupX) + # recherche d'angles supérieurs a un seuil sur une colonne : angle entre deux vecteurs successifs + vecy = mat[ 1:, :, :] - mat[:-1, :, :] # vecteurs selon direction "y" + vy0 = vecy[:-1, :, :] # vecteurs amont + vy1 = vecy[ 1:, :, :] # vecteurs aval + e = np.einsum('ijk,ijk->ij', vy0, vy1) # produit scalaire des vecteurs + f = np.apply_along_axis(mydot, 2, vy0) # normes carrées vecteurs amont + g = np.apply_along_axis(mydot, 2, vy1) # normes carrées vecteurs aval + h = e/(np.sqrt(f*g)) # cosinus + ruptureY = h < cosmin # True si angle > reference + logging.debug("matrice de rupture Y: \n%s",ruptureY) + rupY = filter(lambda x: np.prod(ruptureY[x, :]), range(len(nodelines)-2)) + logging.debug("lignes de rupture: %s",rupY) + if (len(rupX)*len(rupY)) > 0: + logging.critical("""Cas non traité: présence d'angles vifs dans 2 directions, + lors de la reconstitution des faces géométriques dans la zone remaillée""") + + mats = [] + bordsPartages = [] + if (len(rupX)> 0): + rupX.append(mat.shape[1]-1) + for i, index in enumerate(rupX): + imax = index+2 + imin = 0 + if i > 0: + imin = rupX[i-1] + 1 + mats.append(mat[:, imin:imax, :]) + if imax == mat.shape[1] + 1: + ifin = 0 + else: + ifin = imax + bordsPartages.append([imin,ifin]) # les indices différents de 0 correspondent à des bords partagés + elif (len(rupY)> 0): + rupY.append(mat.shape[0]-1) + for i, index in enumerate(rupY): + imax = index+2 + imin = 0 + if i > 0: + imin = rupY[i-1] + 1 + mats.append(mat[imin:imax, :, :]) + if imax == mat.shape[0] + 1: + ifin = 0 + else: + ifin = imax + bordsPartages.append([imin,ifin]) # les indices différents de 0 correspondent à des bords partagés + else: + mats.append(mat) + bordsPartages.append([0,0]) # les indices différents de 0 correspondent à des bords partagés + + curvconts = [] + for nmat, amat in enumerate(mats): + logging.debug("dimensions matrice %s: %s", nmat, amat.shape) + nbLignes = amat.shape[1] # pas de rupture, ou rupture selon des colonnes: on transpose + nbCols = amat.shape[0] + if len(rupY) > 0 : # rupture selon des lignes: pas de transposition + nbLignes = amat.shape[0] + nbCols = amat.shape[1] + curves = [] + noeudsBords = [] + for i in range(4): + noeudsBords.append([]) + k = 0 + for i in range(nbLignes): + nodeList = [] + for j in range(nbCols): + #logging.debug("point[%s,%s] = (%s, %s, %s)",i,j,amat[i,j,0], amat[i,j,1], amat[i,j,2]) + if len(rupY) > 0 : # pas de transposition + node = geompy.MakeVertex(amat[i,j,0], amat[i,j,1], amat[i,j,2]) + else: # transposition + node = geompy.MakeVertex(amat[j,i,0], amat[j,i,1], amat[j,i,2]) + nodeList.append(node) + if i == 0: + noeudsBords[0].append(node) + #name = "bord0_%d"%k + #geompy.addToStudy( node, name ) + if i == (nbLignes -1): + noeudsBords[2].append(node) + #name = "bord2_%d"%k + #geompy.addToStudy( node, name ) + if j == 0: + noeudsBords[1].append(node) + #name = "bord1_%d"%k + #geompy.addToStudy( node, name ) + if j == (nbCols -1): + noeudsBords[3].append(node) + #name = "bord3_%d"%k + #geompy.addToStudy( node, name ) + k += 1 + curve = geompy.MakeInterpol(nodeList, False, False) + #name = "curve_%d"%i + #geompy.addToStudy( curve, name ) + if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe + curvconts.append(nodeList) + curves.append(curve) + if bordsPartages[nmat][0] : + bordsPartages[nmat][0] = curves[0] # la première ligne est un bord partagé + else: + bordsPartages[nmat][0] = None + if bordsPartages[nmat][1] : + bordsPartages[nmat][1] = curves[-1] # la dernière ligne est un bord partagé + else: + bordsPartages[nmat][1] = None + filling = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) + # --- test orientation filling + vertex = geompy.MakeVertexOnSurface(filling, 0.5, 0.5) + normal = geompy.GetNormal(filling, vertex) + + if centreFondFiss is not None: + logging.debug("orientation filling a l'aide du centre de fond de fissure") + vecteurDefaut = geompy.MakeVector(centreFondFiss, vertex) + + if not isVecteurDefaut: + pointIn_x = 0.0 + pointIn_y = 0.0 + pointIn_z = 0.0 + pointExplicite = False + if shapeFissureParams.has_key('pointIn_x'): + pointExplicite = True + pointIn_x = shapeFissureParams['pointIn_x'] + if shapeFissureParams.has_key('pointIn_y'): + pointExplicite = True + pointIn_y = shapeFissureParams['pointIn_y'] + if shapeFissureParams.has_key('pointIn_z'): + pointExplicite = True + pointIn_z = shapeFissureParams['pointIn_z'] + if pointExplicite: + cdg = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z) + logging.debug("orientation filling par point intérieur %s", (pointIn_x, pointIn_y, pointIn_z)) + vecteurDefaut = geompy.MakeVector(cdg, vertex) + + if shapeFissureParams.has_key('convexe'): + isConvexe = shapeFissureParams['convexe'] + logging.debug("orientation filling par indication de convexité %s", isConvexe) + cdg = geompy.MakeCDG(filling) + if isConvexe: + vecteurDefaut = geompy.MakeVector(cdg, vertex) + else: + vecteurDefaut = geompy.MakeVector(vertex, cdg) + + if vecteurDefaut is not None: + geompy.addToStudy(normal, "normFillOrig%d"%iface) + geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface) + if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0: + filling = geompy.ChangeOrientation(filling) + geompy.addToStudy( filling, "filling%d"%iface ) + #geompy.ExportBREP(filling, "filling.brep") + iface = iface+1 + fillings.append(filling) + noeuds_bords.append(noeudsBords) + idFilToCont.append(icont) + bords_Partages += bordsPartages + print "bords_Partages = ", bords_Partages + pass # --- loop on mats + # --- reconstruction des faces continues à partir des listes de noeuds + # les courbes doivent suivre la courbure pour éviter les oscillations + if icont == iface - 1: # pas de découpe, on garde la même face + fillcont = fillings[-1] + else: + nbLignes = len(curvconts[0]) + curves = [] + for i in range(nbLignes): + nodes = [curvconts[j][i] for j in range(len(curvconts))] + curve = geompy.MakeInterpol(nodes, False, False) + curves.append(curve) + fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) + geompy.addToStudy( fillcont, "filcont%d"%icont ) + fillconts.append(fillcont) + icont = icont+1 + pass # --- loop while there are remaining nodes + + return fillings, noeuds_bords, bords_Partages, fillconts, idFilToCont diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py new file mode 100644 index 000000000..83fba6078 --- /dev/null +++ b/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 24 09:14:13 2014 + +@author: I48174 +""" + +import logging +from geomsmesh import geompy +import GEOM + +from listOfExtraFunctions import createNewMeshesFromCorner +from listOfExtraFunctions import createLinesFromMesh + +# ----------------------------------------------------------------------------- +# --- groupe de quadrangles de face transformé en face géométrique par filling + +def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, centreFondFiss, listOfCorners): + """ """ + # TODO: rédiger la docstring + + logging.info("start") + + #fillings = [[], []] + tmpFillings = [] + noeuds_bords = [] + #bords_Partages = [[], []] + tmpBords = [] + fillconts = [] + idFilToCont = [] + + facesNonCoupees = [] + facesCoupees = [] + aretesNonCoupees = [] + aretesCoupees = [] + + setOfNodes = [] + setOfLines = [] + listOfEdges = [] + # On crée une liste contenant le maillage de chaque face. + listOfNewMeshes = createNewMeshesFromCorner(meshQuad, listOfCorners) + for msh in listOfNewMeshes: + # On crée une liste de noeuds correspondant aux faces suivant + # le modèle liste[face][ligne][noeud]. + lines = createLinesFromMesh(msh, listOfCorners[0]) + setOfNodes.append(lines) + + for face in setOfNodes: + tmpFace = [] + for line in face: + # On possède l'information 'ID' de chaque noeud composant chaque + # ligne de chaque face. A partir de l'ID, on crée un vertex. Un + # ensemble de vertices constitue une ligne. Un ensemble de lignes + # constitue une face. + tmpCoords = [meshQuad.GetNodeXYZ(node) for node in line] + tmpPoints = [geompy.MakeVertex(val[0], val[1], val[2]) for val in tmpCoords] + line = geompy.MakeInterpol(tmpPoints, False, False) + tmpFace.append(line) + setOfLines.append(tmpFace) + + for i, face in enumerate(setOfLines): + # A partir des lignes de chaque face, + # on recrée un objet GEOM temporaire par filling. + filling = geompy.MakeFilling(geompy.MakeCompound(face), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) + geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) + tmpFillings.append(filling) + + for face in setOfNodes: + # On prend la première ligne qui correspond aux bords partagés + listOfEdges.append(face[0]) + + for edge in listOfEdges: + # On utilise les points de bords pour créer des aretes vives + tmpCoords = [meshQuad.GetNodeXYZ(node) for node in list(edge)] + tmpPoints = [geompy.MakeVertex(val[0], val[1], val[2]) for val in tmpCoords] + line = geompy.MakeInterpol(tmpPoints, False, False) + tmpBords.append(line) + + for i, filling in enumerate(tmpFillings): + tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0, True) + tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True) + tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + if len(tmpExplodeRef) == len(tmpExplodeNum): + geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1)) + facesNonCoupees.append(filling) + else: + geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1)) + facesCoupees.append(filling) + fillings = facesCoupees, facesNonCoupees + + for i, filling in enumerate(tmpBords): + tmpPartition = geompy.MakePartition([shapeDefaut], [filling], [], [], geompy.ShapeType["SHELL"], 0, [], 0, True) + tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True) + tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True) + if len(tmpExplodeRef) == len(tmpExplodeNum): + geompy.addToStudy(filling, "areteNonCoupee_{0}".format(i + 1)) + aretesNonCoupees.append(filling) + else: + geompy.addToStudy(filling, "areteCoupee_{0}".format(i + 1)) + aretesCoupees.append(filling) + bords_Partages = aretesCoupees, aretesNonCoupees + +# TODO: A enlever +# for i, face in enumerate(setOfLines): +# for j, line in enumerate(face): +# geompy.addToStudy(line, 'face{0}_ligne{1}'.format(i + 1, j + 1)) + + #TODO: A enlever +# for i, filling in enumerate(fillings[0]): +# geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) +# for j, line in enumerate(setOfLines[i]): +# geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1)) + + return fillings, noeuds_bords, bords_Partages, fillconts, idFilToCont + \ No newline at end of file diff --git a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py index 9771d6c3c..4e4453f25 100644 --- a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2006-2014 EDF R&D +# Copyright (C) 2006-2013 EDF R&D # # 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, or (at your option) any later version. +# version 2.1 of the License. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/Tools/blocFissure/ihm/fissureCoude_ui.py b/src/Tools/blocFissure/ihm/fissureCoude_ui.py new file mode 100644 index 000000000..1f7fcb0e2 --- /dev/null +++ b/src/Tools/blocFissure/ihm/fissureCoude_ui.py @@ -0,0 +1,492 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/scratch/I27518/V7_3_build/V7_3_0/modules/src/SMESH_V7_3_0p2/src/Tools/blocFissure/ihm/fissureCoude.ui' +# +# Created: Wed Mar 5 09:49:21 2014 +# by: PyQt4 UI code generator 4.9.6 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + def _fromUtf8(s): + return s + +try: + _encoding = QtGui.QApplication.UnicodeUTF8 + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig, _encoding) +except AttributeError: + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig) + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName(_fromUtf8("Dialog")) + Dialog.resize(826, 540) + self.gridLayout_8 = QtGui.QGridLayout(Dialog) + self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) + self.horizontalLayout_5 = QtGui.QHBoxLayout() + self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) + self.groupBox = QtGui.QGroupBox(Dialog) + self.groupBox.setObjectName(_fromUtf8("groupBox")) + self.verticalLayout_3 = QtGui.QVBoxLayout(self.groupBox) + self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) + self.groupBox_3 = QtGui.QGroupBox(self.groupBox) + self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) + self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_3) + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) + self.gridLayout = QtGui.QGridLayout() + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.label_3 = QtGui.QLabel(self.groupBox_3) + self.label_3.setObjectName(_fromUtf8("label_3")) + self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) + self.dsb_angle = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_angle.setDecimals(5) + self.dsb_angle.setMinimum(-181.0) + self.dsb_angle.setMaximum(180.0) + self.dsb_angle.setProperty("value", -181.0) + self.dsb_angle.setObjectName(_fromUtf8("dsb_angle")) + self.gridLayout.addWidget(self.dsb_angle, 0, 1, 1, 1) + self.label_2 = QtGui.QLabel(self.groupBox_3) + self.label_2.setObjectName(_fromUtf8("label_2")) + self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) + self.label_5 = QtGui.QLabel(self.groupBox_3) + self.label_5.setObjectName(_fromUtf8("label_5")) + self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1) + self.dsb_epais = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_epais.setDecimals(5) + self.dsb_epais.setMaximum(1000000.0) + self.dsb_epais.setObjectName(_fromUtf8("dsb_epais")) + self.gridLayout.addWidget(self.dsb_epais, 4, 1, 1, 1) + self.label_4 = QtGui.QLabel(self.groupBox_3) + self.label_4.setObjectName(_fromUtf8("label_4")) + self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1) + self.dsb_lTubeP2 = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_lTubeP2.setDecimals(5) + self.dsb_lTubeP2.setMaximum(1000000.0) + self.dsb_lTubeP2.setObjectName(_fromUtf8("dsb_lTubeP2")) + self.gridLayout.addWidget(self.dsb_lTubeP2, 3, 1, 1, 1) + self.label_6 = QtGui.QLabel(self.groupBox_3) + self.label_6.setObjectName(_fromUtf8("label_6")) + self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1) + self.label = QtGui.QLabel(self.groupBox_3) + self.label.setObjectName(_fromUtf8("label")) + self.gridLayout.addWidget(self.label, 0, 0, 1, 1) + self.dsb_dext = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_dext.setDecimals(5) + self.dsb_dext.setMaximum(1000000.0) + self.dsb_dext.setObjectName(_fromUtf8("dsb_dext")) + self.gridLayout.addWidget(self.dsb_dext, 5, 1, 1, 1) + self.dsb_lTubeP1 = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_lTubeP1.setDecimals(5) + self.dsb_lTubeP1.setMaximum(1000000.0) + self.dsb_lTubeP1.setObjectName(_fromUtf8("dsb_lTubeP1")) + self.gridLayout.addWidget(self.dsb_lTubeP1, 2, 1, 1, 1) + self.dsb_rCintr = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_rCintr.setDecimals(5) + self.dsb_rCintr.setMaximum(1000000.0) + self.dsb_rCintr.setObjectName(_fromUtf8("dsb_rCintr")) + self.gridLayout.addWidget(self.dsb_rCintr, 1, 1, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) + self.verticalLayout_3.addWidget(self.groupBox_3) + self.verticalLayout_2.addWidget(self.groupBox) + self.cb_optDiscrSain = QtGui.QCheckBox(Dialog) + self.cb_optDiscrSain.setObjectName(_fromUtf8("cb_optDiscrSain")) + self.verticalLayout_2.addWidget(self.cb_optDiscrSain) + self.gb_discrSain = QtGui.QGroupBox(Dialog) + self.gb_discrSain.setObjectName(_fromUtf8("gb_discrSain")) + self.gridLayout_4 = QtGui.QGridLayout(self.gb_discrSain) + self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.label_7 = QtGui.QLabel(self.gb_discrSain) + self.label_7.setObjectName(_fromUtf8("label_7")) + self.verticalLayout.addWidget(self.label_7) + self.gridLayout_3 = QtGui.QGridLayout() + self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) + self.label_8 = QtGui.QLabel(self.gb_discrSain) + self.label_8.setObjectName(_fromUtf8("label_8")) + self.gridLayout_3.addWidget(self.label_8, 0, 0, 1, 1) + self.sb_nbAxeTubeP1 = QtGui.QSpinBox(self.gb_discrSain) + self.sb_nbAxeTubeP1.setMaximum(10000) + self.sb_nbAxeTubeP1.setProperty("value", 15) + self.sb_nbAxeTubeP1.setObjectName(_fromUtf8("sb_nbAxeTubeP1")) + self.gridLayout_3.addWidget(self.sb_nbAxeTubeP1, 0, 1, 1, 1) + self.label_9 = QtGui.QLabel(self.gb_discrSain) + self.label_9.setObjectName(_fromUtf8("label_9")) + self.gridLayout_3.addWidget(self.label_9, 1, 0, 1, 1) + self.sb_nbAxeTubeP2 = QtGui.QSpinBox(self.gb_discrSain) + self.sb_nbAxeTubeP2.setMaximum(10000) + self.sb_nbAxeTubeP2.setProperty("value", 15) + self.sb_nbAxeTubeP2.setObjectName(_fromUtf8("sb_nbAxeTubeP2")) + self.gridLayout_3.addWidget(self.sb_nbAxeTubeP2, 1, 1, 1, 1) + self.label_10 = QtGui.QLabel(self.gb_discrSain) + self.label_10.setObjectName(_fromUtf8("label_10")) + self.gridLayout_3.addWidget(self.label_10, 2, 0, 1, 1) + self.sb_nbAxeCoude = QtGui.QSpinBox(self.gb_discrSain) + self.sb_nbAxeCoude.setMaximum(10000) + self.sb_nbAxeCoude.setProperty("value", 10) + self.sb_nbAxeCoude.setObjectName(_fromUtf8("sb_nbAxeCoude")) + self.gridLayout_3.addWidget(self.sb_nbAxeCoude, 2, 1, 1, 1) + self.label_11 = QtGui.QLabel(self.gb_discrSain) + self.label_11.setObjectName(_fromUtf8("label_11")) + self.gridLayout_3.addWidget(self.label_11, 3, 0, 1, 1) + self.sb_nbCirconf = QtGui.QSpinBox(self.gb_discrSain) + self.sb_nbCirconf.setMaximum(10000) + self.sb_nbCirconf.setProperty("value", 20) + self.sb_nbCirconf.setObjectName(_fromUtf8("sb_nbCirconf")) + self.gridLayout_3.addWidget(self.sb_nbCirconf, 3, 1, 1, 1) + self.label_13 = QtGui.QLabel(self.gb_discrSain) + self.label_13.setObjectName(_fromUtf8("label_13")) + self.gridLayout_3.addWidget(self.label_13, 4, 0, 1, 1) + self.sb_nbEpaisseur = QtGui.QSpinBox(self.gb_discrSain) + self.sb_nbEpaisseur.setMaximum(10000) + self.sb_nbEpaisseur.setProperty("value", 3) + self.sb_nbEpaisseur.setObjectName(_fromUtf8("sb_nbEpaisseur")) + self.gridLayout_3.addWidget(self.sb_nbEpaisseur, 4, 1, 1, 1) + self.verticalLayout.addLayout(self.gridLayout_3) + self.gridLayout_4.addLayout(self.verticalLayout, 0, 0, 1, 1) + self.verticalLayout_2.addWidget(self.gb_discrSain) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_2.addItem(spacerItem) + self.horizontalLayout_5.addLayout(self.verticalLayout_2) + spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_5.addItem(spacerItem1) + self.groupBox_2 = QtGui.QGroupBox(Dialog) + self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) + self.horizontalLayout_2 = QtGui.QHBoxLayout(self.groupBox_2) + self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) + self.verticalLayout_4 = QtGui.QVBoxLayout() + self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) + self.groupBox_5 = QtGui.QGroupBox(self.groupBox_2) + self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) + self.gridLayout_12 = QtGui.QGridLayout(self.groupBox_5) + self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) + self.gridLayout_10 = QtGui.QGridLayout() + self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) + self.groupBox_4 = QtGui.QGroupBox(self.groupBox_5) + self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) + self.verticalLayout_7 = QtGui.QVBoxLayout(self.groupBox_4) + self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7")) + self.rb_fissInt = QtGui.QRadioButton(self.groupBox_4) + self.rb_fissInt.setObjectName(_fromUtf8("rb_fissInt")) + self.verticalLayout_7.addWidget(self.rb_fissInt) + self.rb_fissExt = QtGui.QRadioButton(self.groupBox_4) + self.rb_fissExt.setObjectName(_fromUtf8("rb_fissExt")) + self.verticalLayout_7.addWidget(self.rb_fissExt) + self.gridLayout_10.addWidget(self.groupBox_4, 0, 0, 1, 1) + spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_10.addItem(spacerItem2, 0, 1, 1, 1) + self.cb_forceEllipse = QtGui.QCheckBox(self.groupBox_5) + self.cb_forceEllipse.setAccessibleDescription(_fromUtf8("")) + self.cb_forceEllipse.setObjectName(_fromUtf8("cb_forceEllipse")) + self.gridLayout_10.addWidget(self.cb_forceEllipse, 1, 0, 1, 1) + spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_10.addItem(spacerItem3, 1, 1, 1, 1) + self.gridLayout_12.addLayout(self.gridLayout_10, 0, 0, 1, 1) + self.gridLayout_5 = QtGui.QGridLayout() + self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) + self.dsb_azimut = QtGui.QDoubleSpinBox(self.groupBox_5) + self.dsb_azimut.setDecimals(5) + self.dsb_azimut.setMinimum(-181.0) + self.dsb_azimut.setMaximum(180.0) + self.dsb_azimut.setProperty("value", -181.0) + self.dsb_azimut.setObjectName(_fromUtf8("dsb_azimut")) + self.gridLayout_5.addWidget(self.dsb_azimut, 2, 1, 1, 1) + self.label_18 = QtGui.QLabel(self.groupBox_5) + self.label_18.setObjectName(_fromUtf8("label_18")) + self.gridLayout_5.addWidget(self.label_18, 0, 0, 1, 1) + self.dsb_profondeur = QtGui.QDoubleSpinBox(self.groupBox_5) + self.dsb_profondeur.setDecimals(5) + self.dsb_profondeur.setMaximum(1000000.0) + self.dsb_profondeur.setObjectName(_fromUtf8("dsb_profondeur")) + self.gridLayout_5.addWidget(self.dsb_profondeur, 0, 1, 1, 1) + self.label_19 = QtGui.QLabel(self.groupBox_5) + self.label_19.setObjectName(_fromUtf8("label_19")) + self.gridLayout_5.addWidget(self.label_19, 1, 0, 1, 1) + self.label_14 = QtGui.QLabel(self.groupBox_5) + self.label_14.setObjectName(_fromUtf8("label_14")) + self.gridLayout_5.addWidget(self.label_14, 2, 0, 1, 1) + self.label_15 = QtGui.QLabel(self.groupBox_5) + self.label_15.setObjectName(_fromUtf8("label_15")) + self.gridLayout_5.addWidget(self.label_15, 3, 0, 1, 1) + self.dsb_orientation = QtGui.QDoubleSpinBox(self.groupBox_5) + self.dsb_orientation.setDecimals(5) + self.dsb_orientation.setMinimum(-1.0) + self.dsb_orientation.setMaximum(90.0) + self.dsb_orientation.setProperty("value", -1.0) + self.dsb_orientation.setObjectName(_fromUtf8("dsb_orientation")) + self.gridLayout_5.addWidget(self.dsb_orientation, 3, 1, 1, 1) + self.dsb_longueur = QtGui.QDoubleSpinBox(self.groupBox_5) + self.dsb_longueur.setDecimals(5) + self.dsb_longueur.setMaximum(1000000.0) + self.dsb_longueur.setObjectName(_fromUtf8("dsb_longueur")) + self.gridLayout_5.addWidget(self.dsb_longueur, 1, 1, 1, 1) + self.gridLayout_12.addLayout(self.gridLayout_5, 1, 0, 1, 1) + self.groupBox_11 = QtGui.QGroupBox(self.groupBox_5) + self.groupBox_11.setObjectName(_fromUtf8("groupBox_11")) + self.gridLayout_11 = QtGui.QGridLayout(self.groupBox_11) + self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) + self.rb_absCurv = QtGui.QRadioButton(self.groupBox_11) + self.rb_absCurv.setObjectName(_fromUtf8("rb_absCurv")) + self.gridLayout_11.addWidget(self.rb_absCurv, 0, 0, 1, 1) + self.rb_posiAngul = QtGui.QRadioButton(self.groupBox_11) + self.rb_posiAngul.setObjectName(_fromUtf8("rb_posiAngul")) + self.gridLayout_11.addWidget(self.rb_posiAngul, 1, 0, 1, 1) + self.dsb_absCurv = QtGui.QDoubleSpinBox(self.groupBox_11) + self.dsb_absCurv.setDecimals(5) + self.dsb_absCurv.setMaximum(1000000.0) + self.dsb_absCurv.setObjectName(_fromUtf8("dsb_absCurv")) + self.gridLayout_11.addWidget(self.dsb_absCurv, 0, 1, 1, 1) + self.dsb_posiAngul = QtGui.QDoubleSpinBox(self.groupBox_11) + self.dsb_posiAngul.setDecimals(5) + self.dsb_posiAngul.setMinimum(-181.0) + self.dsb_posiAngul.setMaximum(180.0) + self.dsb_posiAngul.setProperty("value", -181.0) + self.dsb_posiAngul.setObjectName(_fromUtf8("dsb_posiAngul")) + self.gridLayout_11.addWidget(self.dsb_posiAngul, 1, 1, 1, 1) + self.gridLayout_12.addWidget(self.groupBox_11, 2, 0, 1, 1) + self.verticalLayout_4.addWidget(self.groupBox_5) + spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_4.addItem(spacerItem4) + self.horizontalLayout_2.addLayout(self.verticalLayout_4) + self.verticalLayout_6 = QtGui.QVBoxLayout() + self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6")) + self.groupBox_6 = QtGui.QGroupBox(self.groupBox_2) + self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) + self.gridLayout_7 = QtGui.QGridLayout(self.groupBox_6) + self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) + self.groupBox_8 = QtGui.QGroupBox(self.groupBox_6) + self.groupBox_8.setObjectName(_fromUtf8("groupBox_8")) + self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox_8) + self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) + self.groupBox_9 = QtGui.QGroupBox(self.groupBox_8) + self.groupBox_9.setObjectName(_fromUtf8("groupBox_9")) + self.horizontalLayout_4 = QtGui.QHBoxLayout(self.groupBox_9) + self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) + self.gridLayout_6 = QtGui.QGridLayout() + self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) + self.label_21 = QtGui.QLabel(self.groupBox_9) + self.label_21.setObjectName(_fromUtf8("label_21")) + self.gridLayout_6.addWidget(self.label_21, 1, 0, 1, 1) + self.label_22 = QtGui.QLabel(self.groupBox_9) + self.label_22.setObjectName(_fromUtf8("label_22")) + self.gridLayout_6.addWidget(self.label_22, 2, 0, 1, 1) + self.sb_nbCouronne = QtGui.QSpinBox(self.groupBox_9) + self.sb_nbCouronne.setMinimum(1) + self.sb_nbCouronne.setMaximum(10000) + self.sb_nbCouronne.setProperty("value", 1) + self.sb_nbCouronne.setObjectName(_fromUtf8("sb_nbCouronne")) + self.gridLayout_6.addWidget(self.sb_nbCouronne, 2, 1, 1, 1) + self.label_23 = QtGui.QLabel(self.groupBox_9) + self.label_23.setObjectName(_fromUtf8("label_23")) + self.gridLayout_6.addWidget(self.label_23, 3, 0, 1, 1) + self.sb_nbSecteur = QtGui.QSpinBox(self.groupBox_9) + self.sb_nbSecteur.setMinimum(3) + self.sb_nbSecteur.setMaximum(10000) + self.sb_nbSecteur.setProperty("value", 3) + self.sb_nbSecteur.setObjectName(_fromUtf8("sb_nbSecteur")) + self.gridLayout_6.addWidget(self.sb_nbSecteur, 3, 1, 1, 1) + self.sb_nbTranches = QtGui.QSpinBox(self.groupBox_9) + self.sb_nbTranches.setMinimum(7) + self.sb_nbTranches.setMaximum(100000) + self.sb_nbTranches.setProperty("value", 7) + self.sb_nbTranches.setObjectName(_fromUtf8("sb_nbTranches")) + self.gridLayout_6.addWidget(self.sb_nbTranches, 1, 1, 1, 1) + self.label_20 = QtGui.QLabel(self.groupBox_9) + self.label_20.setObjectName(_fromUtf8("label_20")) + self.gridLayout_6.addWidget(self.label_20, 4, 0, 1, 1) + self.dsb_rayonTore = QtGui.QDoubleSpinBox(self.groupBox_9) + self.dsb_rayonTore.setEnabled(False) + self.dsb_rayonTore.setDecimals(5) + self.dsb_rayonTore.setMaximum(1000000.0) + self.dsb_rayonTore.setProperty("value", 2.0) + self.dsb_rayonTore.setObjectName(_fromUtf8("dsb_rayonTore")) + self.gridLayout_6.addWidget(self.dsb_rayonTore, 4, 1, 1, 1) + self.horizontalLayout_4.addLayout(self.gridLayout_6) + spacerItem5 = QtGui.QSpacerItem(6, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_4.addItem(spacerItem5) + self.verticalLayout_5.addWidget(self.groupBox_9) + self.cb_optDiscrFiss = QtGui.QCheckBox(self.groupBox_8) + self.cb_optDiscrFiss.setObjectName(_fromUtf8("cb_optDiscrFiss")) + self.verticalLayout_5.addWidget(self.cb_optDiscrFiss) + self.gb_discrFacesExternes = QtGui.QGroupBox(self.groupBox_8) + self.gb_discrFacesExternes.setEnabled(True) + self.gb_discrFacesExternes.setObjectName(_fromUtf8("gb_discrFacesExternes")) + self.horizontalLayout_3 = QtGui.QHBoxLayout(self.gb_discrFacesExternes) + self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) + self.label_24 = QtGui.QLabel(self.gb_discrFacesExternes) + self.label_24.setObjectName(_fromUtf8("label_24")) + self.horizontalLayout_3.addWidget(self.label_24) + self.dsb_aretesFaceFissure = QtGui.QDoubleSpinBox(self.gb_discrFacesExternes) + self.dsb_aretesFaceFissure.setDecimals(5) + self.dsb_aretesFaceFissure.setMaximum(1000000.0) + self.dsb_aretesFaceFissure.setObjectName(_fromUtf8("dsb_aretesFaceFissure")) + self.horizontalLayout_3.addWidget(self.dsb_aretesFaceFissure) + spacerItem6 = QtGui.QSpacerItem(1, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_3.addItem(spacerItem6) + self.verticalLayout_5.addWidget(self.gb_discrFacesExternes) + self.gridLayout_7.addWidget(self.groupBox_8, 1, 0, 1, 2) + self.gb_zoneRemail = QtGui.QGroupBox(self.groupBox_6) + self.gb_zoneRemail.setEnabled(True) + self.gb_zoneRemail.setObjectName(_fromUtf8("gb_zoneRemail")) + self.gridLayout_16 = QtGui.QGridLayout(self.gb_zoneRemail) + self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) + self.gridLayout_17 = QtGui.QGridLayout() + self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) + self.dsb_influence = QtGui.QDoubleSpinBox(self.gb_zoneRemail) + self.dsb_influence.setDecimals(5) + self.dsb_influence.setMaximum(1000000.0) + self.dsb_influence.setObjectName(_fromUtf8("dsb_influence")) + self.gridLayout_17.addWidget(self.dsb_influence, 1, 1, 1, 1) + self.label_25 = QtGui.QLabel(self.gb_zoneRemail) + self.label_25.setObjectName(_fromUtf8("label_25")) + self.gridLayout_17.addWidget(self.label_25, 1, 0, 1, 1) + self.gridLayout_16.addLayout(self.gridLayout_17, 0, 0, 1, 1) + spacerItem7 = QtGui.QSpacerItem(47, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_16.addItem(spacerItem7, 0, 1, 1, 1) + self.gridLayout_7.addWidget(self.gb_zoneRemail, 2, 0, 1, 1) + self.verticalLayout_6.addWidget(self.groupBox_6) + spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_6.addItem(spacerItem8) + self.horizontalLayout_2.addLayout(self.verticalLayout_6) + self.horizontalLayout_5.addWidget(self.groupBox_2) + self.gridLayout_8.addLayout(self.horizontalLayout_5, 0, 0, 1, 1) + self.horizontalLayout_6 = QtGui.QHBoxLayout() + self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) + spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_6.addItem(spacerItem9) + self.lb_calcul = QtGui.QLabel(Dialog) + font = QtGui.QFont() + font.setPointSize(24) + self.lb_calcul.setFont(font) + self.lb_calcul.setObjectName(_fromUtf8("lb_calcul")) + self.horizontalLayout_6.addWidget(self.lb_calcul) + spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_6.addItem(spacerItem10) + self.gridLayout_8.addLayout(self.horizontalLayout_6, 1, 0, 1, 1) + spacerItem11 = QtGui.QSpacerItem(20, 4, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_8.addItem(spacerItem11, 2, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.pb_reset = QtGui.QPushButton(Dialog) + self.pb_reset.setObjectName(_fromUtf8("pb_reset")) + self.horizontalLayout.addWidget(self.pb_reset) + self.pb_valPrec = QtGui.QPushButton(Dialog) + self.pb_valPrec.setObjectName(_fromUtf8("pb_valPrec")) + self.horizontalLayout.addWidget(self.pb_valPrec) + self.pb_recharger = QtGui.QPushButton(Dialog) + self.pb_recharger.setObjectName(_fromUtf8("pb_recharger")) + self.horizontalLayout.addWidget(self.pb_recharger) + self.pb_sauver = QtGui.QPushButton(Dialog) + self.pb_sauver.setObjectName(_fromUtf8("pb_sauver")) + self.horizontalLayout.addWidget(self.pb_sauver) + spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem12) + self.buttonBox = QtGui.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.horizontalLayout.addWidget(self.buttonBox) + self.gridLayout_8.addLayout(self.horizontalLayout, 3, 0, 1, 1) + + self.retranslateUi(Dialog) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) + QtCore.QObject.connect(self.cb_optDiscrSain, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.gb_discrSain.setShown) + QtCore.QObject.connect(self.cb_optDiscrFiss, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.gb_discrFacesExternes.setShown) + QtCore.QObject.connect(self.cb_optDiscrFiss, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.gb_zoneRemail.setShown) + QtCore.QObject.connect(self.cb_optDiscrFiss, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.dsb_rayonTore.setEnabled) + QtCore.QObject.connect(self.rb_absCurv, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.dsb_absCurv.setEnabled) + QtCore.QObject.connect(self.rb_posiAngul, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.dsb_posiAngul.setEnabled) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) + self.groupBox.setTitle(_translate("Dialog", "Coude Sain", None)) + self.groupBox_3.setTitle(_translate("Dialog", "Géométrie", None)) + self.label_3.setText(_translate("Dialog", "L_TUBE_P1", None)) + self.dsb_angle.setToolTip(_translate("Dialog", "Valeur de l\'angle du coude en degrés", None)) + self.label_2.setText(_translate("Dialog", "R_CINTR", None)) + self.label_5.setText(_translate("Dialog", "EPAIS", None)) + self.dsb_epais.setToolTip(_translate("Dialog", "Valeur de l’épaisseur du coude et des embouts", None)) + self.label_4.setText(_translate("Dialog", "L_TUBE_P2", None)) + self.dsb_lTubeP2.setToolTip(_translate("Dialog", "Valeur de la longueur de l’embout P2 à l’extrémité duquel seront appliqués les chargements", None)) + self.label_6.setText(_translate("Dialog", "DEXT", None)) + self.label.setText(_translate("Dialog", "ANGLE", None)) + self.dsb_dext.setToolTip(_translate("Dialog", "Valeur du diamètre externe du coude et des embouts droits", None)) + self.dsb_lTubeP1.setToolTip(_translate("Dialog", "Valeur de la longueur de l’embout P1 à l’extrémité duquel seront appliqués les chargements", None)) + self.dsb_rCintr.setToolTip(_translate("Dialog", "Valeur du rayon de cintrage du coude", None)) + self.cb_optDiscrSain.setToolTip(_translate("Dialog", "Paramètres optionnels de discretisation", None)) + self.cb_optDiscrSain.setText(_translate("Dialog", "Options de discretisation", None)) + self.gb_discrSain.setTitle(_translate("Dialog", "Maillage", None)) + self.label_7.setText(_translate("Dialog", "Nombres de segments", None)) + self.label_8.setText(_translate("Dialog", "NB_AXE_TUBE_P1", None)) + self.sb_nbAxeTubeP1.setToolTip(_translate("Dialog", "Nombre d’éléments le long de l’embout P1", None)) + self.label_9.setText(_translate("Dialog", "NB_AXE_TUBE_P2", None)) + self.sb_nbAxeTubeP2.setToolTip(_translate("Dialog", "Nombre d’éléments le long de l’embout P2", None)) + self.label_10.setText(_translate("Dialog", "NB_AXE_COUDE", None)) + self.sb_nbAxeCoude.setToolTip(_translate("Dialog", "Nombre d’éléments le long de l’axe du coude", None)) + self.label_11.setText(_translate("Dialog", "NB_CIRCONF", None)) + self.sb_nbCirconf.setToolTip(_translate("Dialog", "

Nombre d’éléments le long de la circonférence

(nombre pair)

", None)) + self.label_13.setText(_translate("Dialog", "NB_EPAISSEUR", None)) + self.sb_nbEpaisseur.setToolTip(_translate("Dialog", "Nombre d\'éléments dans l\'épaisseur", None)) + self.groupBox_2.setTitle(_translate("Dialog", "Fissure", None)) + self.groupBox_5.setTitle(_translate("Dialog", "Géométrie fissure", None)) + self.groupBox_4.setTitle(_translate("Dialog", "position", None)) + self.rb_fissInt.setToolTip(_translate("Dialog", "

Fissure positionnée sur la face interne

", None)) + self.rb_fissInt.setText(_translate("Dialog", "fissure interne", None)) + self.rb_fissExt.setToolTip(_translate("Dialog", "

Fissure positionnée sur la face externe

", None)) + self.rb_fissExt.setText(_translate("Dialog", "fissure externe", None)) + self.cb_forceEllipse.setToolTip(_translate("Dialog", "

Forcer une fissure de forme elliptique, même si elle est longue

", None)) + self.cb_forceEllipse.setText(_translate("Dialog", "forcer elliptique", None)) + self.dsb_azimut.setToolTip(_translate("Dialog", "Valeur de la position circonférentielle du centre de la fissure comptée positivement en degrés à partir de l’extrados jusqu’à l’intrados en passant par le flanc gauche", None)) + self.label_18.setText(_translate("Dialog", "PROFONDEUR", None)) + self.dsb_profondeur.setToolTip(_translate("Dialog", "

Profondeur de la fissure :

distance maximale entre le fond de fissure et la peau interne ou externe sur laquelle débouche la fissure

", None)) + self.label_19.setText(_translate("Dialog", "LONGUEUR", None)) + self.label_14.setText(_translate("Dialog", "AZIMUT", None)) + self.label_15.setText(_translate("Dialog", "ORIEN", None)) + self.dsb_orientation.setToolTip(_translate("Dialog", "Valeur de l’angle en degrés formé par le grand axe de la fissure et la génératrice du coude donnant ainsi l’orientation du défaut", None)) + self.dsb_longueur.setToolTip(_translate("Dialog", "Longueur du grand axe de la fissure mesurée sur le coude en peau interne ou externe, suivant la peau sur laquelle se trouve la fissure", None)) + self.groupBox_11.setTitle(_translate("Dialog", "position longitudinale", None)) + self.rb_absCurv.setToolTip(_translate("Dialog", "Définition de la position longitudinale par une abscisse curiviligne", None)) + self.rb_absCurv.setText(_translate("Dialog", "ABS_CURV", None)) + self.rb_posiAngul.setToolTip(_translate("Dialog", "Définition de la position longitudinale par un angle", None)) + self.rb_posiAngul.setText(_translate("Dialog", "POSI_ANGUL", None)) + self.dsb_absCurv.setToolTip(_translate("Dialog", "

Valeur de la position longitudinale du centre de la fissure définie par rapport à l\'interface de l\'embout P1 :

Abcisse curviligne le long de l\'axe du coude, sur la peau interne ou externe, selon la position de la fissure.


", None)) + self.dsb_posiAngul.setToolTip(_translate("Dialog", "

Valeur de la position longitudinale du centre de la fissure définie par rapport à l\'interface de l\'embout P1 :

Angle en degrés formé par la section contenant le centre de la fissure et l\'interface de l\'embout P1.


", None)) + self.groupBox_6.setTitle(_translate("Dialog", "Maillage fissure", None)) + self.groupBox_8.setTitle(_translate("Dialog", "maillage zone de fissure", None)) + self.groupBox_9.setTitle(_translate("Dialog", "pipe rayonnant", None)) + self.label_21.setText(_translate("Dialog", "NB_TRANCHES", None)) + self.label_22.setText(_translate("Dialog", "NB_COURONNE", None)) + self.sb_nbCouronne.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de couronnes du maillage rayonnant autour de la ligne de fond de fissure, y compris la couronne centrale formée de prismes.

", None)) + self.label_23.setText(_translate("Dialog", "NB_SECTEUR", None)) + self.sb_nbSecteur.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de secteurs selon un cercle normal au fond de fissure.

", None)) + self.sb_nbTranches.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Nombre de mailles (approximatif) le long de la ligne de fond de fissure.

", None)) + self.label_20.setText(_translate("Dialog", "RAYON_TORE", None)) + self.dsb_rayonTore.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Rayon du pipe.

", None)) + self.cb_optDiscrFiss.setToolTip(_translate("Dialog", "Paramètres optionnels de discrétisation", None)) + self.cb_optDiscrFiss.setText(_translate("Dialog", "Options de discretisation", None)) + self.gb_discrFacesExternes.setTitle(_translate("Dialog", "faces externes", None)) + self.label_24.setText(_translate("Dialog", "aretes face fissure", None)) + self.dsb_aretesFaceFissure.setToolTip(_translate("Dialog", "

Faces externes de la zone à remailler.

Mailage en triangles : valeur cible des arêtes.

", None)) + self.gb_zoneRemail.setTitle(_translate("Dialog", "identification zone à remailler", None)) + self.dsb_influence.setToolTip(_translate("Dialog", "

La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.

", None)) + self.label_25.setText(_translate("Dialog", "distance influence", None)) + self.lb_calcul.setText(_translate("Dialog", "--- Calcul en cours ---", None)) + self.pb_reset.setToolTip(_translate("Dialog", "réinitialisation de tous les paramètres à leur valeur par défaut", None)) + self.pb_reset.setText(_translate("Dialog", "Reset", None)) + self.pb_valPrec.setToolTip(_translate("Dialog", "réinitialisation de tous les paramètres à leur valeur de la précédente éxécution", None)) + self.pb_valPrec.setText(_translate("Dialog", "Précédent", None)) + self.pb_recharger.setToolTip(_translate("Dialog", "réinitialisation des paramètres à partir d\'un fichier préalablement sauvegardé", None)) + self.pb_recharger.setText(_translate("Dialog", "Recharger", None)) + self.pb_sauver.setToolTip(_translate("Dialog", "sauvegarde des paramètres dans un fichier à choisir", None)) + self.pb_sauver.setText(_translate("Dialog", "Sauver", None)) + diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_ui.py b/src/Tools/blocFissure/ihm/fissureGenerale_ui.py new file mode 100644 index 000000000..63ea2f3cf --- /dev/null +++ b/src/Tools/blocFissure/ihm/fissureGenerale_ui.py @@ -0,0 +1,220 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/scratch/I27518/V7_3_build/V7_3_0/modules/src/SMESH_V7_3_0p2/src/Tools/blocFissure/ihm/fissureGenerale.ui' +# +# Created: Wed Mar 5 09:49:21 2014 +# by: PyQt4 UI code generator 4.9.6 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + def _fromUtf8(s): + return s + +try: + _encoding = QtGui.QApplication.UnicodeUTF8 + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig, _encoding) +except AttributeError: + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig) + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName(_fromUtf8("Dialog")) + Dialog.resize(631, 490) + self.gridLayout_11 = QtGui.QGridLayout(Dialog) + self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) + self.groupBox = QtGui.QGroupBox(Dialog) + self.groupBox.setObjectName(_fromUtf8("groupBox")) + self.gridLayout_4 = QtGui.QGridLayout(self.groupBox) + self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) + self.gridLayout = QtGui.QGridLayout() + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.pb_maillage = QtGui.QPushButton(self.groupBox) + self.pb_maillage.setObjectName(_fromUtf8("pb_maillage")) + self.gridLayout.addWidget(self.pb_maillage, 0, 0, 1, 1) + self.le_maillage = QtGui.QLineEdit(self.groupBox) + self.le_maillage.setObjectName(_fromUtf8("le_maillage")) + self.gridLayout.addWidget(self.le_maillage, 0, 1, 1, 1) + self.pb_facefiss = QtGui.QPushButton(self.groupBox) + self.pb_facefiss.setObjectName(_fromUtf8("pb_facefiss")) + self.gridLayout.addWidget(self.pb_facefiss, 1, 0, 1, 1) + self.le_facefiss = QtGui.QLineEdit(self.groupBox) + self.le_facefiss.setObjectName(_fromUtf8("le_facefiss")) + self.gridLayout.addWidget(self.le_facefiss, 1, 1, 1, 1) + self.gridLayout_4.addLayout(self.gridLayout, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.label = QtGui.QLabel(self.groupBox) + self.label.setObjectName(_fromUtf8("label")) + self.horizontalLayout.addWidget(self.label) + self.le_fondfiss = QtGui.QLineEdit(self.groupBox) + self.le_fondfiss.setObjectName(_fromUtf8("le_fondfiss")) + self.horizontalLayout.addWidget(self.le_fondfiss) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.gridLayout_4.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.gridLayout_11.addWidget(self.groupBox, 0, 0, 1, 2) + self.gridLayout_10 = QtGui.QGridLayout() + self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) + self.groupBox_2 = QtGui.QGroupBox(Dialog) + self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) + self.gridLayout_12 = QtGui.QGridLayout(self.groupBox_2) + self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) + self.gridLayout_6 = QtGui.QGridLayout() + self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) + self.label_2 = QtGui.QLabel(self.groupBox_2) + self.label_2.setObjectName(_fromUtf8("label_2")) + self.gridLayout_6.addWidget(self.label_2, 0, 0, 1, 1) + self.dsb_influence = QtGui.QDoubleSpinBox(self.groupBox_2) + self.dsb_influence.setObjectName(_fromUtf8("dsb_influence")) + self.gridLayout_6.addWidget(self.dsb_influence, 0, 1, 1, 1) + self.gridLayout_12.addLayout(self.gridLayout_6, 0, 0, 1, 1) + spacerItem1 = QtGui.QSpacerItem(0, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_12.addItem(spacerItem1, 0, 1, 1, 1) + self.groupBox_3 = QtGui.QGroupBox(self.groupBox_2) + self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) + self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_3) + self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) + self.gridLayout_2 = QtGui.QGridLayout() + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) + self.label_3 = QtGui.QLabel(self.groupBox_3) + self.label_3.setObjectName(_fromUtf8("label_3")) + self.gridLayout_2.addWidget(self.label_3, 0, 0, 1, 1) + self.dsb_meshBrepMin = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_meshBrepMin.setMaximum(1000000.0) + self.dsb_meshBrepMin.setObjectName(_fromUtf8("dsb_meshBrepMin")) + self.gridLayout_2.addWidget(self.dsb_meshBrepMin, 0, 1, 1, 1) + self.label_4 = QtGui.QLabel(self.groupBox_3) + self.label_4.setObjectName(_fromUtf8("label_4")) + self.gridLayout_2.addWidget(self.label_4, 1, 0, 1, 1) + self.dsb_meshBrepMax = QtGui.QDoubleSpinBox(self.groupBox_3) + self.dsb_meshBrepMax.setMaximum(1000000.0) + self.dsb_meshBrepMax.setObjectName(_fromUtf8("dsb_meshBrepMax")) + self.gridLayout_2.addWidget(self.dsb_meshBrepMax, 1, 1, 1, 1) + self.gridLayout_5.addLayout(self.gridLayout_2, 0, 0, 1, 1) + spacerItem2 = QtGui.QSpacerItem(34, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_5.addItem(spacerItem2, 0, 1, 1, 1) + self.gridLayout_12.addWidget(self.groupBox_3, 1, 0, 1, 2) + self.gridLayout_10.addWidget(self.groupBox_2, 0, 0, 1, 1) + self.groupBox_4 = QtGui.QGroupBox(Dialog) + self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) + self.gridLayout_9 = QtGui.QGridLayout(self.groupBox_4) + self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) + self.groupBox_5 = QtGui.QGroupBox(self.groupBox_4) + self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) + self.gridLayout_7 = QtGui.QGridLayout(self.groupBox_5) + self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) + self.gridLayout_3 = QtGui.QGridLayout() + self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) + self.label_5 = QtGui.QLabel(self.groupBox_5) + self.label_5.setObjectName(_fromUtf8("label_5")) + self.gridLayout_3.addWidget(self.label_5, 0, 0, 1, 1) + self.dsb_rayonPipe = QtGui.QDoubleSpinBox(self.groupBox_5) + self.dsb_rayonPipe.setMaximum(1000000.0) + self.dsb_rayonPipe.setObjectName(_fromUtf8("dsb_rayonPipe")) + self.gridLayout_3.addWidget(self.dsb_rayonPipe, 0, 1, 1, 1) + self.label_6 = QtGui.QLabel(self.groupBox_5) + self.label_6.setObjectName(_fromUtf8("label_6")) + self.gridLayout_3.addWidget(self.label_6, 1, 0, 1, 1) + self.dsb_lenSegPipe = QtGui.QDoubleSpinBox(self.groupBox_5) + self.dsb_lenSegPipe.setMaximum(1000000.0) + self.dsb_lenSegPipe.setObjectName(_fromUtf8("dsb_lenSegPipe")) + self.gridLayout_3.addWidget(self.dsb_lenSegPipe, 1, 1, 1, 1) + self.label_7 = QtGui.QLabel(self.groupBox_5) + self.label_7.setObjectName(_fromUtf8("label_7")) + self.gridLayout_3.addWidget(self.label_7, 2, 0, 1, 1) + self.sb_couronnes = QtGui.QSpinBox(self.groupBox_5) + self.sb_couronnes.setMinimum(2) + self.sb_couronnes.setMaximum(10000) + self.sb_couronnes.setProperty("value", 4) + self.sb_couronnes.setObjectName(_fromUtf8("sb_couronnes")) + self.gridLayout_3.addWidget(self.sb_couronnes, 2, 1, 1, 1) + self.label_8 = QtGui.QLabel(self.groupBox_5) + self.label_8.setObjectName(_fromUtf8("label_8")) + self.gridLayout_3.addWidget(self.label_8, 3, 0, 1, 1) + self.sb_secteurs = QtGui.QSpinBox(self.groupBox_5) + self.sb_secteurs.setMinimum(4) + self.sb_secteurs.setMaximum(10000) + self.sb_secteurs.setProperty("value", 8) + self.sb_secteurs.setObjectName(_fromUtf8("sb_secteurs")) + self.gridLayout_3.addWidget(self.sb_secteurs, 3, 1, 1, 1) + self.gridLayout_7.addLayout(self.gridLayout_3, 0, 0, 1, 1) + spacerItem3 = QtGui.QSpacerItem(6, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_7.addItem(spacerItem3, 0, 1, 1, 1) + self.gridLayout_9.addWidget(self.groupBox_5, 0, 0, 1, 1) + self.groupBox_6 = QtGui.QGroupBox(self.groupBox_4) + self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) + self.gridLayout_8 = QtGui.QGridLayout(self.groupBox_6) + self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) + self.label_9 = QtGui.QLabel(self.groupBox_6) + self.label_9.setObjectName(_fromUtf8("label_9")) + self.gridLayout_8.addWidget(self.label_9, 0, 0, 1, 1) + self.dsb_areteFaceFissure = QtGui.QDoubleSpinBox(self.groupBox_6) + self.dsb_areteFaceFissure.setMaximum(1000000.0) + self.dsb_areteFaceFissure.setObjectName(_fromUtf8("dsb_areteFaceFissure")) + self.gridLayout_8.addWidget(self.dsb_areteFaceFissure, 0, 1, 1, 1) + spacerItem4 = QtGui.QSpacerItem(1, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout_8.addItem(spacerItem4, 0, 2, 1, 1) + self.gridLayout_9.addWidget(self.groupBox_6, 1, 0, 1, 1) + self.gridLayout_10.addWidget(self.groupBox_4, 0, 1, 2, 1) + spacerItem5 = QtGui.QSpacerItem(20, 112, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_10.addItem(spacerItem5, 1, 0, 1, 1) + self.gridLayout_11.addLayout(self.gridLayout_10, 1, 0, 1, 2) + spacerItem6 = QtGui.QSpacerItem(20, 13, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_11.addItem(spacerItem6, 2, 1, 1, 1) + self.horizontalLayout_5 = QtGui.QHBoxLayout() + self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) + spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_5.addItem(spacerItem7) + self.bb_OkCancel = QtGui.QDialogButtonBox(Dialog) + self.bb_OkCancel.setOrientation(QtCore.Qt.Horizontal) + self.bb_OkCancel.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.bb_OkCancel.setObjectName(_fromUtf8("bb_OkCancel")) + self.horizontalLayout_5.addWidget(self.bb_OkCancel) + self.gridLayout_11.addLayout(self.horizontalLayout_5, 3, 0, 1, 1) + + self.retranslateUi(Dialog) + QtCore.QObject.connect(self.bb_OkCancel, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) + QtCore.QObject.connect(self.bb_OkCancel, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) + Dialog.setToolTip(_translate("Dialog", "

Insertion d\'un maillage de fissure dans un maillage hexaédrique sain.

Le maillage sain est fourni sous forme de fichier Med.

La face de fissure est décrite par une géométrie dans un fichier brep.

La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.

La procédure identfie des mailles saines à enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone à remailler en tétraèdres.

", None)) + self.groupBox.setTitle(_translate("Dialog", "maillage sain et géometries de fissure", None)) + self.pb_maillage.setToolTip(_translate("Dialog", "

sélection du fichier med du maillage sain (hexaèdres)

", None)) + self.pb_maillage.setText(_translate("Dialog", "maillage sain", None)) + self.le_maillage.setToolTip(_translate("Dialog", "

fichier med du maillage sain (hexaèdres)

", None)) + self.pb_facefiss.setToolTip(_translate("Dialog", "

sélection du fichier brep (géométrie) décrivant la face de fissure.

", None)) + self.pb_facefiss.setText(_translate("Dialog", "face fissure", None)) + self.le_facefiss.setToolTip(_translate("Dialog", "

fichier brep (géométrie) décrivant la face de fissure.

", None)) + self.label.setText(_translate("Dialog", "index edges fond fissure", None)) + self.le_fondfiss.setToolTip(_translate("Dialog", "

Index des edges décrivant le fond de fissure, dans la face de fissure.

Sous forme d\'une liste Python.

Exemples :[5,9] ou [3]

(on peut récupérer ces valeurs à l\'aide du dialogue de création de groupes d\'edges, dans GEOM)

", None)) + self.groupBox_2.setTitle(_translate("Dialog", "identification zone à remailler", None)) + self.label_2.setText(_translate("Dialog", "distance influence", None)) + self.dsb_influence.setToolTip(_translate("Dialog", "

La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.

", None)) + self.groupBox_3.setTitle(_translate("Dialog", "prémaillage face fissure", None)) + self.label_3.setText(_translate("Dialog", "min", None)) + self.dsb_meshBrepMin.setToolTip(_translate("Dialog", "

Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.

Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.

", None)) + self.label_4.setText(_translate("Dialog", "max", None)) + self.dsb_meshBrepMax.setToolTip(_translate("Dialog", "

Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.

Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.

", None)) + self.groupBox_4.setTitle(_translate("Dialog", "maillage zone de fissure", None)) + self.groupBox_5.setTitle(_translate("Dialog", "pipe rayonnant", None)) + self.label_5.setText(_translate("Dialog", "rayon pipe", None)) + self.dsb_rayonPipe.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Rayon du pipe.

", None)) + self.label_6.setText(_translate("Dialog", "longueur mailles", None)) + self.dsb_lenSegPipe.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Longueur des mailles le long de la ligne de fond de fissure.

", None)) + self.label_7.setText(_translate("Dialog", "couronnes", None)) + self.sb_couronnes.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de couronnes de mailles autour de la ligne de fond de fissure.

", None)) + self.label_8.setText(_translate("Dialog", "secteurs", None)) + self.sb_secteurs.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de secteurs selon un cercle normal au fond de fissure.

", None)) + self.groupBox_6.setTitle(_translate("Dialog", "faces externes", None)) + self.label_9.setText(_translate("Dialog", "aretes face fissure", None)) + self.dsb_areteFaceFissure.setToolTip(_translate("Dialog", "

Faces externes de la zone à remailler.

Mailage en triangles : valeur cible des arêtes.

", None)) + diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTriple.py b/src/Tools/blocFissure/lanceurCasTestCoinTriple.py new file mode 100644 index 000000000..48836a4d8 --- /dev/null +++ b/src/Tools/blocFissure/lanceurCasTestCoinTriple.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +import sys +import salome + +import os +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +dicoParams = dict(nomCas = 'casTestCoinTripleOlivier', + maillageSain = '/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', + brepFaceFissure = "/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/fissureTestCoinTriple.brep", + edgeFissIds = [4], + lgInfluence = 50, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 10) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py b/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py new file mode 100644 index 000000000..ff1e295b4 --- /dev/null +++ b/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py @@ -0,0 +1,29 @@ +# -*- coding: iso-8859-1 -*- + +import sys +import salome + +import os +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +dicoParams = dict(nomCas = 'casTestCoinTriple', + maillageSain = '/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', + brepFaceFissure = "/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/fissureMilieuTestCoinTriple.brep", + edgeFissIds = [4], + lgInfluence = 50, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 10) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py b/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py new file mode 100644 index 000000000..365628818 --- /dev/null +++ b/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py @@ -0,0 +1,29 @@ +# -*- coding: iso-8859-1 -*- + +import sys +import salome + +import os +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +dicoParams = dict(nomCas = 'casTestCoinTriple', + maillageSain = '/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', + brepFaceFissure = "/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/fissureTransverseTestCoinTriple.brep", + edgeFissIds = [6], + lgInfluence = 50, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 10) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurSoudureArrondieTest.py b/src/Tools/blocFissure/lanceurSoudureArrondieTest.py new file mode 100644 index 000000000..bd91562b6 --- /dev/null +++ b/src/Tools/blocFissure/lanceurSoudureArrondieTest.py @@ -0,0 +1,32 @@ +# -*- coding: iso-8859-1 -*- + +import sys +import salome + +import os +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +mesh = 'areteArrondieSoudure.med' +crack = 'fissureSoudureTest.brep' + +dicoParams = dict(nomCas = 'casTestCoinTriple', + maillageSain = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh), + brepFaceFissure = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack), + edgeFissIds = [4], + lgInfluence = 30, + meshBrep = (5,10), + rayonPipe = 5, + lenSegPipe = 7, + nbSegRad = 8, + nbSegCercle = 20, + areteFaceFissure = 8) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurSoudureViveTest.py b/src/Tools/blocFissure/lanceurSoudureViveTest.py new file mode 100644 index 000000000..aa4d8039a --- /dev/null +++ b/src/Tools/blocFissure/lanceurSoudureViveTest.py @@ -0,0 +1,32 @@ +# -*- coding: iso-8859-1 -*- + +import sys +import salome + +import os +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +mesh = 'areteViveSoudure.med' +crack = 'fissureSoudureTest.brep' + +dicoParams = dict(nomCas = 'casTestCoinTriple', + maillageSain = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(mesh), + brepFaceFissure = '/local00/home/I48174/Documents/soudure/essaiFissure/{0}'.format(crack), + edgeFissIds = [4], + lgInfluence = 30, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 10) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurTestAubry.py b/src/Tools/blocFissure/lanceurTestAubry.py new file mode 100644 index 000000000..6e4311170 --- /dev/null +++ b/src/Tools/blocFissure/lanceurTestAubry.py @@ -0,0 +1,32 @@ +# -*- coding: iso-8859-1 -*- + +import sys +import salome + +import os +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.casStandard import casStandard + +mesh = 'huehue.med' +crack = 'hue.brep' + +dicoParams = dict(nomCas = 'testAubry', + maillageSain = '/local00/home/I48174/Bureau/{0}'.format(mesh), + brepFaceFissure = '/local00/home/I48174/Bureau/{0}'.format(crack), + edgeFissIds = [8], + lgInfluence = 0.01, + meshBrep = (0.0002,0.003), + rayonPipe = 0.005, + lenSegPipe = 0.0015, + nbSegRad = 8, + nbSegCercle = 18, + areteFaceFissure = 0.0015) + +execInstance = casStandard(dicoParams) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) From dc7608eb1faad45cf83dd801d0f8344c44f3a36a Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 27 Aug 2014 17:40:22 +0200 Subject: [PATCH 003/147] =?UTF-8?q?ajout=20des=20cas=20tests=20avec=20coin?= =?UTF-8?q?=20vif=20potentiel=20:=20cubeFin=20(Coin,=20Milieu,=20Transvers?= =?UTF-8?q?e).=20Il=20manque=20la=20g=C3=A9n=C3=A9ration=20des=20.med=20et?= =?UTF-8?q?=20.brep=20associ=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/CasTests/cubeCoin.py | 28 +++++++++++++++++++ src/Tools/blocFissure/CasTests/cubeMilieu.py | 28 +++++++++++++++++++ .../blocFissure/CasTests/cubeTransverse.py | 28 +++++++++++++++++++ .../blocFissure/{ => gmu}/casStandard.py | 0 4 files changed, 84 insertions(+) create mode 100644 src/Tools/blocFissure/CasTests/cubeCoin.py create mode 100644 src/Tools/blocFissure/CasTests/cubeMilieu.py create mode 100644 src/Tools/blocFissure/CasTests/cubeTransverse.py rename src/Tools/blocFissure/{ => gmu}/casStandard.py (100%) diff --git a/src/Tools/blocFissure/CasTests/cubeCoin.py b/src/Tools/blocFissure/CasTests/cubeCoin.py new file mode 100644 index 000000000..0e39a3224 --- /dev/null +++ b/src/Tools/blocFissure/CasTests/cubeCoin.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +import os +from blocFissure import gmu + +dicoParams = dict(nomCas = 'cubeCoin', + maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'), + brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"), + edgeFissIds = [4], + lgInfluence = 50, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 20) + + # --------------------------------------------------------------------------- + +referencesMaillageFissure = dict(Entity_Quad_Pyramid = 0, + Entity_Quad_Triangle = 0, + Entity_Quad_Edge = 0, + Entity_Quad_Penta = 0, + Entity_Quad_Hexa = 0, + Entity_Node = 0, + Entity_Quad_Tetra = 0, + Entity_Quad_Quadrangle = 0) + diff --git a/src/Tools/blocFissure/CasTests/cubeMilieu.py b/src/Tools/blocFissure/CasTests/cubeMilieu.py new file mode 100644 index 000000000..913fa7fce --- /dev/null +++ b/src/Tools/blocFissure/CasTests/cubeMilieu.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +import os +from blocFissure import gmu + +dicoParams = dict(nomCas = 'cubeMilieu', + maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'), + brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"), + edgeFissIds = [4], + lgInfluence = 50, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 10) + +# --------------------------------------------------------------------------- + +referencesMaillageFissure = dict(Entity_Quad_Pyramid = 0, + Entity_Quad_Triangle = 0, + Entity_Quad_Edge = 0, + Entity_Quad_Penta = 0, + Entity_Quad_Hexa = 0, + Entity_Node = 0, + Entity_Quad_Tetra = 0, + Entity_Quad_Quadrangle = 0) + diff --git a/src/Tools/blocFissure/CasTests/cubeTransverse.py b/src/Tools/blocFissure/CasTests/cubeTransverse.py new file mode 100644 index 000000000..c003d38f9 --- /dev/null +++ b/src/Tools/blocFissure/CasTests/cubeTransverse.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +import os +from blocFissure import gmu + +dicoParams = dict(nomCas = 'cubeTransverse', + maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'), + brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep"), + edgeFissIds = [6], + lgInfluence = 50, + meshBrep = (5,10), + rayonPipe = 10, + lenSegPipe = 7, + nbSegRad = 5, + nbSegCercle = 10, + areteFaceFissure = 10) + +# --------------------------------------------------------------------------- + +referencesMaillageFissure = dict(Entity_Quad_Pyramid = 0, + Entity_Quad_Triangle = 0, + Entity_Quad_Edge = 0, + Entity_Quad_Penta = 0, + Entity_Quad_Hexa = 0, + Entity_Node = 0, + Entity_Quad_Tetra = 0, + Entity_Quad_Quadrangle = 0) + diff --git a/src/Tools/blocFissure/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py similarity index 100% rename from src/Tools/blocFissure/casStandard.py rename to src/Tools/blocFissure/gmu/casStandard.py From 24792d78f65fc60ab9a6b7e80eb7be68a5160e60 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 28 Aug 2014 10:06:35 +0200 Subject: [PATCH 004/147] oubli de commit --- .../blocFissure/CasTests/execution_Cas.py | 23 +++++++++++++++---- src/Tools/blocFissure/exemple.py | 2 +- src/Tools/blocFissure/exemple2.py | 2 +- .../blocFissure/gmu/insereFissureGenerale.py | 2 +- .../blocFissure/lanceurCasTestCoinTriple.py | 8 +++---- .../lanceurCasTestCoinTripleMilieu.py | 8 +++---- .../lanceurCasTestCoinTripleTransverse.py | 6 ++--- 7 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 2d7b80dbe..138aebf21 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -7,7 +7,7 @@ from blocFissure.gmu import initLog initLog.setVerbose() from blocFissure.gmu import geomsmesh -from blocFissure.casStandard import casStandard +from blocFissure.gmu.casStandard import casStandard problemes = [] @@ -111,12 +111,25 @@ cas=24 from blocFissure.CasTests.vis_1 import vis_1 problemes.append(vis_1(cas)) +cas=25 +from blocFissure.CasTests import cubeCoin +problemes.append(casStandard(cubeCoin.dicoParams, cubeCoin.referencesMaillageFissure, cas)) + +cas=26 +from blocFissure.CasTests import cubeMilieu +problemes.append(casStandard(cubeMilieu.dicoParams, cubeMilieu.referencesMaillageFissure, cas)) + +cas=27 +from blocFissure.CasTests import cubeTransverse +problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, cas)) + + # ---tous les cas en sequence, ou les cas selectionnés ... -runall = True +runall = False if runall: - torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] -else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 - torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,] + torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] +else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 + torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,] for i in range(len(problemes)): if torun[i]: diff --git a/src/Tools/blocFissure/exemple.py b/src/Tools/blocFissure/exemple.py index f351d59c9..d43618f9c 100644 --- a/src/Tools/blocFissure/exemple.py +++ b/src/Tools/blocFissure/exemple.py @@ -6,7 +6,7 @@ from blocFissure.gmu import initLog initLog.setDebug() #initLog.setVerbose() -from blocFissure.casStandard import casStandard +from blocFissure.gmu.casStandard import casStandard dicoParams = dict(nomCas = 'angleCube', maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/CubeAngle.med'), diff --git a/src/Tools/blocFissure/exemple2.py b/src/Tools/blocFissure/exemple2.py index e2f80738c..e7320f55b 100644 --- a/src/Tools/blocFissure/exemple2.py +++ b/src/Tools/blocFissure/exemple2.py @@ -74,7 +74,7 @@ from blocFissure.gmu import initLog #initLog.setDebug() initLog.setVerbose() -from blocFissure.casStandard import casStandard +from blocFissure.gmu.casStandard import casStandard dicoParams = dict(nomCas = 'angleCube2', maillageSain = 'boite.med', diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index 2611fa616..e3f0d0837 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -1179,7 +1179,7 @@ def insereFissureGenerale(maillagesSains, aretesVivesC = geompy.MakeCompound(aretesVivesCoupees) meshAretesVives = smesh.Mesh(aretesVivesC) algo1d = meshAretesVives.Segment() - hypo1d = algo1d.LocalLength(dmoyen/3.0,[],1e-07) + hypo1d = algo1d.LocalLength(dmoyen,[],1e-07) putName(algo1d.GetSubMesh(), "aretesVives") putName(algo1d, "algo1d_aretesVives") putName(hypo1d, "hypo1d_aretesVives") diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTriple.py b/src/Tools/blocFissure/lanceurCasTestCoinTriple.py index 48836a4d8..ba11c013c 100644 --- a/src/Tools/blocFissure/lanceurCasTestCoinTriple.py +++ b/src/Tools/blocFissure/lanceurCasTestCoinTriple.py @@ -11,9 +11,9 @@ initLog.setVerbose() from blocFissure.casStandard import casStandard -dicoParams = dict(nomCas = 'casTestCoinTripleOlivier', - maillageSain = '/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', - brepFaceFissure = "/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/fissureTestCoinTriple.brep", +dicoParams = dict(nomCas = 'casTestCoinTriple', + maillageSain = '/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', + brepFaceFissure = "/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/fissureTestCoinTriple.brep", edgeFissIds = [4], lgInfluence = 50, meshBrep = (5,10), @@ -21,7 +21,7 @@ dicoParams = dict(nomCas = 'casTestCoinTripleOlivier', lenSegPipe = 7, nbSegRad = 5, nbSegCercle = 10, - areteFaceFissure = 10) + areteFaceFissure = 20) execInstance = casStandard(dicoParams) diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py b/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py index ff1e295b4..f41774c9e 100644 --- a/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py +++ b/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -11,9 +11,9 @@ initLog.setVerbose() from blocFissure.casStandard import casStandard -dicoParams = dict(nomCas = 'casTestCoinTriple', - maillageSain = '/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', - brepFaceFissure = "/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/fissureMilieuTestCoinTriple.brep", +dicoParams = dict(nomCas = 'casTestCoinTripleMilieu', + maillageSain = '/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', + brepFaceFissure = "/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/fissureMilieuTestCoinTriple.brep", edgeFissIds = [4], lgInfluence = 50, meshBrep = (5,10), diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py b/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py index 365628818..134eba131 100644 --- a/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py +++ b/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -12,8 +12,8 @@ initLog.setVerbose() from blocFissure.casStandard import casStandard dicoParams = dict(nomCas = 'casTestCoinTriple', - maillageSain = '/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', - brepFaceFissure = "/local00/home/I48174/Documents/tubulure_simple/blocFissure/materielCoinSymetrie/fissureTransverseTestCoinTriple.brep", + maillageSain = '/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', + brepFaceFissure = "/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/fissureTransverseTestCoinTriple.brep", edgeFissIds = [6], lgInfluence = 50, meshBrep = (5,10), From 4f325d707665e544c2b2441457222a9cc6497619 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 28 Aug 2014 10:10:56 +0200 Subject: [PATCH 005/147] =?UTF-8?q?enlever=20les=20lanceurs=20sp=C3=A9cifi?= =?UTF-8?q?ques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocFissure/lanceurCasTestCoinTriple.py | 29 ------------------- .../lanceurCasTestCoinTripleMilieu.py | 29 ------------------- .../lanceurCasTestCoinTripleTransverse.py | 29 ------------------- 3 files changed, 87 deletions(-) delete mode 100644 src/Tools/blocFissure/lanceurCasTestCoinTriple.py delete mode 100644 src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py delete mode 100644 src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTriple.py b/src/Tools/blocFissure/lanceurCasTestCoinTriple.py deleted file mode 100644 index ba11c013c..000000000 --- a/src/Tools/blocFissure/lanceurCasTestCoinTriple.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -import sys -import salome - -import os -from blocFissure import gmu -from blocFissure.gmu import initLog -#initLog.setDebug() -initLog.setVerbose() - -from blocFissure.casStandard import casStandard - -dicoParams = dict(nomCas = 'casTestCoinTriple', - maillageSain = '/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', - brepFaceFissure = "/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/fissureTestCoinTriple.brep", - edgeFissIds = [4], - lgInfluence = 50, - meshBrep = (5,10), - rayonPipe = 10, - lenSegPipe = 7, - nbSegRad = 5, - nbSegCercle = 10, - areteFaceFissure = 20) - -execInstance = casStandard(dicoParams) - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py b/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py deleted file mode 100644 index f41774c9e..000000000 --- a/src/Tools/blocFissure/lanceurCasTestCoinTripleMilieu.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -import sys -import salome - -import os -from blocFissure import gmu -from blocFissure.gmu import initLog -#initLog.setDebug() -initLog.setVerbose() - -from blocFissure.casStandard import casStandard - -dicoParams = dict(nomCas = 'casTestCoinTripleMilieu', - maillageSain = '/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', - brepFaceFissure = "/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/fissureMilieuTestCoinTriple.brep", - edgeFissIds = [4], - lgInfluence = 50, - meshBrep = (5,10), - rayonPipe = 10, - lenSegPipe = 7, - nbSegRad = 5, - nbSegCercle = 10, - areteFaceFissure = 10) - -execInstance = casStandard(dicoParams) - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py b/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py deleted file mode 100644 index 134eba131..000000000 --- a/src/Tools/blocFissure/lanceurCasTestCoinTripleTransverse.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -import sys -import salome - -import os -from blocFissure import gmu -from blocFissure.gmu import initLog -#initLog.setDebug() -initLog.setVerbose() - -from blocFissure.casStandard import casStandard - -dicoParams = dict(nomCas = 'casTestCoinTriple', - maillageSain = '/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/cubeTestCoinTriple.med', - brepFaceFissure = "/local00/home/B27118/projets/blocFissure/blocFissure/materielCoinSymetrie/fissureTransverseTestCoinTriple.brep", - edgeFissIds = [6], - lgInfluence = 50, - meshBrep = (5,10), - rayonPipe = 10, - lenSegPipe = 7, - nbSegRad = 5, - nbSegCercle = 10, - areteFaceFissure = 10) - -execInstance = casStandard(dicoParams) - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) From a55e1001a657f030116c13e82cf4c2bfcd088133 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 28 Aug 2014 16:10:45 +0200 Subject: [PATCH 006/147] generation du materiel pour les cas cubeFin --- .../blocFissure/materielCasTests/cubeFin.py | 130 ++++++++++++++++++ .../materielCasTests/genereMateriel.py | 1 + 2 files changed, 131 insertions(+) create mode 100644 src/Tools/blocFissure/materielCasTests/cubeFin.py diff --git a/src/Tools/blocFissure/materielCasTests/cubeFin.py b/src/Tools/blocFissure/materielCasTests/cubeFin.py new file mode 100644 index 000000000..219fa4e81 --- /dev/null +++ b/src/Tools/blocFissure/materielCasTests/cubeFin.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- + +import sys +import salome + +salome.salome_init() +theStudy = salome.myStudy + +import salome_notebook +notebook = salome_notebook.NoteBook(theStudy) + +import os +from blocFissure import gmu + +### +### GEOM component +### + +import GEOM +from salome.geom import geomBuilder +import math +import SALOMEDS + + +geompy = geomBuilder.New(theStudy) + +O = geompy.MakeVertex(0, 0, 0) +OX = geompy.MakeVectorDXDYDZ(1, 0, 0) +OY = geompy.MakeVectorDXDYDZ(0, 1, 0) +OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) +cubeFin = geompy.MakeBoxDXDYDZ(200, 200, 200) +[DEPL,ENCASTR] = geompy.SubShapes(cubeFin, [27, 23]) +origCoin = geompy.MakeVertex(0, 160, 200) +Disk_1 = geompy.MakeDiskPntVecR(origCoin, OY, 50) +Translation_1 = geompy.MakeTranslation(origCoin, 0, 10, 0) +Vector_1 = geompy.MakeVector(origCoin, Translation_1) +Rotation_1 = geompy.MakeRotation(Disk_1, Vector_1, 90*math.pi/180.0) +origMilieu = geompy.MakeVertex(0, 160, 100) +Translation_2 = geompy.MakeTranslationTwoPoints(Rotation_1, origCoin, origMilieu) +Scale_1 = geompy.MakeScaleAlongAxes(Translation_2, origMilieu, 0.984, 1, 1.2) +Vertex_1 = geompy.MakeVertex(-10, 160, 210) +Vertex_2 = geompy.MakeVertex(50, 160, 210) +Vertex_3 = geompy.MakeVertex(50, 160, -10) +Vertex_4 = geompy.MakeVertex(-10, 160, -10) +Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2) +Line_2 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3) +Line_3 = geompy.MakeLineTwoPnt(Vertex_3, Vertex_4) +Line_4 = geompy.MakeLineTwoPnt(Vertex_4, Vertex_1) +cubeFin_Transverse = geompy.MakeFaceWires([Line_1, Line_2, Line_3, Line_4], 1) +Vertex_5 = geompy.MakeVertex(55, 160, 100) +Line_1_vertex_3 = geompy.GetSubShape(Line_1, [3]) +Line_3_vertex_2 = geompy.GetSubShape(Line_3, [2]) +Arc_1 = geompy.MakeArc(Line_1_vertex_3, Vertex_5, Line_3_vertex_2) +Face_1 = geompy.MakeFaceWires([Line_1, Line_3, Line_4, Arc_1], 1) +cubeFin_Coin = geompy.MakeCommonList([Rotation_1, Face_1], True) +cubeFin_milieu = geompy.MakeCommonList([Scale_1, cubeFin_Transverse], True) +O_1 = geompy.MakeVertex(0, 0, 0) +OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) +OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0) +OZ_1 = geompy.MakeVectorDXDYDZ(0, 0, 1) +geompy.addToStudy( O, 'O' ) +geompy.addToStudy( OX, 'OX' ) +geompy.addToStudy( OY, 'OY' ) +geompy.addToStudy( OZ, 'OZ' ) +geompy.addToStudy( cubeFin, 'cubeFin' ) +geompy.addToStudyInFather( cubeFin, DEPL, 'DEPL' ) +geompy.addToStudyInFather( cubeFin, ENCASTR, 'ENCASTR' ) +geompy.addToStudy( origCoin, 'origCoin' ) +geompy.addToStudy( Disk_1, 'Disk_1' ) +geompy.addToStudy( Translation_1, 'Translation_1' ) +geompy.addToStudy( Vector_1, 'Vector_1' ) +geompy.addToStudy( Rotation_1, 'Rotation_1' ) +geompy.addToStudy( origMilieu, 'origMilieu' ) +geompy.addToStudy( Translation_2, 'Translation_2' ) +geompy.addToStudy( Scale_1, 'Scale_1' ) +geompy.addToStudy( Vertex_1, 'Vertex_1' ) +geompy.addToStudy( Vertex_2, 'Vertex_2' ) +geompy.addToStudy( Vertex_3, 'Vertex_3' ) +geompy.addToStudy( Vertex_4, 'Vertex_4' ) +geompy.addToStudy( Line_1, 'Line_1' ) +geompy.addToStudy( Line_2, 'Line_2' ) +geompy.addToStudy( Line_3, 'Line_3' ) +geompy.addToStudy( Line_4, 'Line_4' ) +geompy.addToStudy( cubeFin_Transverse, 'cubeFin_Transverse' ) +geompy.addToStudyInFather( Line_1, Line_1_vertex_3, 'Line_1:vertex_3' ) +geompy.addToStudy( Vertex_5, 'Vertex_5' ) +geompy.addToStudyInFather( Line_3, Line_3_vertex_2, 'Line_3:vertex_2' ) +geompy.addToStudy( Arc_1, 'Arc_1' ) +geompy.addToStudy( Face_1, 'Face_1' ) +geompy.addToStudy( cubeFin_Coin, 'cubeFin_Coin' ) +geompy.addToStudy( cubeFin_milieu, 'cubeFin_milieu' ) +geompy.addToStudy( O_1, 'O' ) +geompy.addToStudy( OX_1, 'OX' ) +geompy.addToStudy( OY_1, 'OY' ) +geompy.addToStudy( OZ_1, 'OZ' ) +geompy.Export(cubeFin_Transverse, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep"), "BREP") +geompy.Export(cubeFin_Coin, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"), "BREP") +geompy.Export(cubeFin_milieu, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_milieu.brep"), "BREP") + +### +### SMESH component +### + +import SMESH, SALOMEDS +from salome.smesh import smeshBuilder + +smesh = smeshBuilder.New(theStudy) +cubeFin_1 = smesh.Mesh(cubeFin) +Regular_1D = cubeFin_1.Segment() +Nb_Segments_1 = Regular_1D.NumberOfSegments(20) +Nb_Segments_1.SetDistrType( 0 ) +Quadrangle_2D = cubeFin_1.Quadrangle(algo=smeshBuilder.QUADRANGLE) +Hexa_3D = cubeFin_1.Hexahedron(algo=smeshBuilder.Hexa) +isDone = cubeFin_1.Compute() +DEPL_1 = cubeFin_1.GroupOnGeom(DEPL,'DEPL',SMESH.FACE) +ENCASTR_1 = cubeFin_1.GroupOnGeom(ENCASTR,'ENCASTR',SMESH.FACE) + +## Set names of Mesh objects +smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D') +smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D') +smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D') +smesh.SetName(DEPL_1, 'DEPL') +smesh.SetName(ENCASTR_1, 'ENCASTR') +smesh.SetName(cubeFin_1.GetMesh(), 'cubeFin') +smesh.SetName(Nb_Segments_1, 'Nb. Segments_1') + +cubeFin_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/cubeFin.med"), 0, SMESH.MED_V2_2, 1 ) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/src/Tools/blocFissure/materielCasTests/genereMateriel.py b/src/Tools/blocFissure/materielCasTests/genereMateriel.py index 919b2a16a..24aaeffc7 100644 --- a/src/Tools/blocFissure/materielCasTests/genereMateriel.py +++ b/src/Tools/blocFissure/materielCasTests/genereMateriel.py @@ -11,3 +11,4 @@ from blocFissure.materielCasTests import ellipse_probleme from blocFissure.materielCasTests import disque_perce from blocFissure.materielCasTests import ellipse_disque from blocFissure.materielCasTests import vis +from blocFissure.materielCasTests import cubeFin From c4c25faa11060887e248a3dca21d7b5b506c9f7a Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 28 Aug 2014 16:14:30 +0200 Subject: [PATCH 007/147] =?UTF-8?q?enlever=20les=20fichiers=20g=C3=A9n?= =?UTF-8?q?=C3=A9r=C3=A9s=20par=20pyuic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/ihm/fissureCoude_ui.py | 492 ------------------ .../blocFissure/ihm/fissureGenerale_ui.py | 220 -------- 2 files changed, 712 deletions(-) delete mode 100644 src/Tools/blocFissure/ihm/fissureCoude_ui.py delete mode 100644 src/Tools/blocFissure/ihm/fissureGenerale_ui.py diff --git a/src/Tools/blocFissure/ihm/fissureCoude_ui.py b/src/Tools/blocFissure/ihm/fissureCoude_ui.py deleted file mode 100644 index 1f7fcb0e2..000000000 --- a/src/Tools/blocFissure/ihm/fissureCoude_ui.py +++ /dev/null @@ -1,492 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/scratch/I27518/V7_3_build/V7_3_0/modules/src/SMESH_V7_3_0p2/src/Tools/blocFissure/ihm/fissureCoude.ui' -# -# Created: Wed Mar 5 09:49:21 2014 -# by: PyQt4 UI code generator 4.9.6 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName(_fromUtf8("Dialog")) - Dialog.resize(826, 540) - self.gridLayout_8 = QtGui.QGridLayout(Dialog) - self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) - self.horizontalLayout_5 = QtGui.QHBoxLayout() - self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) - self.verticalLayout_2 = QtGui.QVBoxLayout() - self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) - self.groupBox = QtGui.QGroupBox(Dialog) - self.groupBox.setObjectName(_fromUtf8("groupBox")) - self.verticalLayout_3 = QtGui.QVBoxLayout(self.groupBox) - self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) - self.groupBox_3 = QtGui.QGroupBox(self.groupBox) - self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) - self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_3) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.gridLayout = QtGui.QGridLayout() - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label_3 = QtGui.QLabel(self.groupBox_3) - self.label_3.setObjectName(_fromUtf8("label_3")) - self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) - self.dsb_angle = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_angle.setDecimals(5) - self.dsb_angle.setMinimum(-181.0) - self.dsb_angle.setMaximum(180.0) - self.dsb_angle.setProperty("value", -181.0) - self.dsb_angle.setObjectName(_fromUtf8("dsb_angle")) - self.gridLayout.addWidget(self.dsb_angle, 0, 1, 1, 1) - self.label_2 = QtGui.QLabel(self.groupBox_3) - self.label_2.setObjectName(_fromUtf8("label_2")) - self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) - self.label_5 = QtGui.QLabel(self.groupBox_3) - self.label_5.setObjectName(_fromUtf8("label_5")) - self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1) - self.dsb_epais = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_epais.setDecimals(5) - self.dsb_epais.setMaximum(1000000.0) - self.dsb_epais.setObjectName(_fromUtf8("dsb_epais")) - self.gridLayout.addWidget(self.dsb_epais, 4, 1, 1, 1) - self.label_4 = QtGui.QLabel(self.groupBox_3) - self.label_4.setObjectName(_fromUtf8("label_4")) - self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1) - self.dsb_lTubeP2 = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_lTubeP2.setDecimals(5) - self.dsb_lTubeP2.setMaximum(1000000.0) - self.dsb_lTubeP2.setObjectName(_fromUtf8("dsb_lTubeP2")) - self.gridLayout.addWidget(self.dsb_lTubeP2, 3, 1, 1, 1) - self.label_6 = QtGui.QLabel(self.groupBox_3) - self.label_6.setObjectName(_fromUtf8("label_6")) - self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1) - self.label = QtGui.QLabel(self.groupBox_3) - self.label.setObjectName(_fromUtf8("label")) - self.gridLayout.addWidget(self.label, 0, 0, 1, 1) - self.dsb_dext = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_dext.setDecimals(5) - self.dsb_dext.setMaximum(1000000.0) - self.dsb_dext.setObjectName(_fromUtf8("dsb_dext")) - self.gridLayout.addWidget(self.dsb_dext, 5, 1, 1, 1) - self.dsb_lTubeP1 = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_lTubeP1.setDecimals(5) - self.dsb_lTubeP1.setMaximum(1000000.0) - self.dsb_lTubeP1.setObjectName(_fromUtf8("dsb_lTubeP1")) - self.gridLayout.addWidget(self.dsb_lTubeP1, 2, 1, 1, 1) - self.dsb_rCintr = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_rCintr.setDecimals(5) - self.dsb_rCintr.setMaximum(1000000.0) - self.dsb_rCintr.setObjectName(_fromUtf8("dsb_rCintr")) - self.gridLayout.addWidget(self.dsb_rCintr, 1, 1, 1, 1) - self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) - self.verticalLayout_3.addWidget(self.groupBox_3) - self.verticalLayout_2.addWidget(self.groupBox) - self.cb_optDiscrSain = QtGui.QCheckBox(Dialog) - self.cb_optDiscrSain.setObjectName(_fromUtf8("cb_optDiscrSain")) - self.verticalLayout_2.addWidget(self.cb_optDiscrSain) - self.gb_discrSain = QtGui.QGroupBox(Dialog) - self.gb_discrSain.setObjectName(_fromUtf8("gb_discrSain")) - self.gridLayout_4 = QtGui.QGridLayout(self.gb_discrSain) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.label_7 = QtGui.QLabel(self.gb_discrSain) - self.label_7.setObjectName(_fromUtf8("label_7")) - self.verticalLayout.addWidget(self.label_7) - self.gridLayout_3 = QtGui.QGridLayout() - self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.label_8 = QtGui.QLabel(self.gb_discrSain) - self.label_8.setObjectName(_fromUtf8("label_8")) - self.gridLayout_3.addWidget(self.label_8, 0, 0, 1, 1) - self.sb_nbAxeTubeP1 = QtGui.QSpinBox(self.gb_discrSain) - self.sb_nbAxeTubeP1.setMaximum(10000) - self.sb_nbAxeTubeP1.setProperty("value", 15) - self.sb_nbAxeTubeP1.setObjectName(_fromUtf8("sb_nbAxeTubeP1")) - self.gridLayout_3.addWidget(self.sb_nbAxeTubeP1, 0, 1, 1, 1) - self.label_9 = QtGui.QLabel(self.gb_discrSain) - self.label_9.setObjectName(_fromUtf8("label_9")) - self.gridLayout_3.addWidget(self.label_9, 1, 0, 1, 1) - self.sb_nbAxeTubeP2 = QtGui.QSpinBox(self.gb_discrSain) - self.sb_nbAxeTubeP2.setMaximum(10000) - self.sb_nbAxeTubeP2.setProperty("value", 15) - self.sb_nbAxeTubeP2.setObjectName(_fromUtf8("sb_nbAxeTubeP2")) - self.gridLayout_3.addWidget(self.sb_nbAxeTubeP2, 1, 1, 1, 1) - self.label_10 = QtGui.QLabel(self.gb_discrSain) - self.label_10.setObjectName(_fromUtf8("label_10")) - self.gridLayout_3.addWidget(self.label_10, 2, 0, 1, 1) - self.sb_nbAxeCoude = QtGui.QSpinBox(self.gb_discrSain) - self.sb_nbAxeCoude.setMaximum(10000) - self.sb_nbAxeCoude.setProperty("value", 10) - self.sb_nbAxeCoude.setObjectName(_fromUtf8("sb_nbAxeCoude")) - self.gridLayout_3.addWidget(self.sb_nbAxeCoude, 2, 1, 1, 1) - self.label_11 = QtGui.QLabel(self.gb_discrSain) - self.label_11.setObjectName(_fromUtf8("label_11")) - self.gridLayout_3.addWidget(self.label_11, 3, 0, 1, 1) - self.sb_nbCirconf = QtGui.QSpinBox(self.gb_discrSain) - self.sb_nbCirconf.setMaximum(10000) - self.sb_nbCirconf.setProperty("value", 20) - self.sb_nbCirconf.setObjectName(_fromUtf8("sb_nbCirconf")) - self.gridLayout_3.addWidget(self.sb_nbCirconf, 3, 1, 1, 1) - self.label_13 = QtGui.QLabel(self.gb_discrSain) - self.label_13.setObjectName(_fromUtf8("label_13")) - self.gridLayout_3.addWidget(self.label_13, 4, 0, 1, 1) - self.sb_nbEpaisseur = QtGui.QSpinBox(self.gb_discrSain) - self.sb_nbEpaisseur.setMaximum(10000) - self.sb_nbEpaisseur.setProperty("value", 3) - self.sb_nbEpaisseur.setObjectName(_fromUtf8("sb_nbEpaisseur")) - self.gridLayout_3.addWidget(self.sb_nbEpaisseur, 4, 1, 1, 1) - self.verticalLayout.addLayout(self.gridLayout_3) - self.gridLayout_4.addLayout(self.verticalLayout, 0, 0, 1, 1) - self.verticalLayout_2.addWidget(self.gb_discrSain) - spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.verticalLayout_2.addItem(spacerItem) - self.horizontalLayout_5.addLayout(self.verticalLayout_2) - spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_5.addItem(spacerItem1) - self.groupBox_2 = QtGui.QGroupBox(Dialog) - self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) - self.horizontalLayout_2 = QtGui.QHBoxLayout(self.groupBox_2) - self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) - self.verticalLayout_4 = QtGui.QVBoxLayout() - self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) - self.groupBox_5 = QtGui.QGroupBox(self.groupBox_2) - self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) - self.gridLayout_12 = QtGui.QGridLayout(self.groupBox_5) - self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) - self.gridLayout_10 = QtGui.QGridLayout() - self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) - self.groupBox_4 = QtGui.QGroupBox(self.groupBox_5) - self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) - self.verticalLayout_7 = QtGui.QVBoxLayout(self.groupBox_4) - self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7")) - self.rb_fissInt = QtGui.QRadioButton(self.groupBox_4) - self.rb_fissInt.setObjectName(_fromUtf8("rb_fissInt")) - self.verticalLayout_7.addWidget(self.rb_fissInt) - self.rb_fissExt = QtGui.QRadioButton(self.groupBox_4) - self.rb_fissExt.setObjectName(_fromUtf8("rb_fissExt")) - self.verticalLayout_7.addWidget(self.rb_fissExt) - self.gridLayout_10.addWidget(self.groupBox_4, 0, 0, 1, 1) - spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_10.addItem(spacerItem2, 0, 1, 1, 1) - self.cb_forceEllipse = QtGui.QCheckBox(self.groupBox_5) - self.cb_forceEllipse.setAccessibleDescription(_fromUtf8("")) - self.cb_forceEllipse.setObjectName(_fromUtf8("cb_forceEllipse")) - self.gridLayout_10.addWidget(self.cb_forceEllipse, 1, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_10.addItem(spacerItem3, 1, 1, 1, 1) - self.gridLayout_12.addLayout(self.gridLayout_10, 0, 0, 1, 1) - self.gridLayout_5 = QtGui.QGridLayout() - self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) - self.dsb_azimut = QtGui.QDoubleSpinBox(self.groupBox_5) - self.dsb_azimut.setDecimals(5) - self.dsb_azimut.setMinimum(-181.0) - self.dsb_azimut.setMaximum(180.0) - self.dsb_azimut.setProperty("value", -181.0) - self.dsb_azimut.setObjectName(_fromUtf8("dsb_azimut")) - self.gridLayout_5.addWidget(self.dsb_azimut, 2, 1, 1, 1) - self.label_18 = QtGui.QLabel(self.groupBox_5) - self.label_18.setObjectName(_fromUtf8("label_18")) - self.gridLayout_5.addWidget(self.label_18, 0, 0, 1, 1) - self.dsb_profondeur = QtGui.QDoubleSpinBox(self.groupBox_5) - self.dsb_profondeur.setDecimals(5) - self.dsb_profondeur.setMaximum(1000000.0) - self.dsb_profondeur.setObjectName(_fromUtf8("dsb_profondeur")) - self.gridLayout_5.addWidget(self.dsb_profondeur, 0, 1, 1, 1) - self.label_19 = QtGui.QLabel(self.groupBox_5) - self.label_19.setObjectName(_fromUtf8("label_19")) - self.gridLayout_5.addWidget(self.label_19, 1, 0, 1, 1) - self.label_14 = QtGui.QLabel(self.groupBox_5) - self.label_14.setObjectName(_fromUtf8("label_14")) - self.gridLayout_5.addWidget(self.label_14, 2, 0, 1, 1) - self.label_15 = QtGui.QLabel(self.groupBox_5) - self.label_15.setObjectName(_fromUtf8("label_15")) - self.gridLayout_5.addWidget(self.label_15, 3, 0, 1, 1) - self.dsb_orientation = QtGui.QDoubleSpinBox(self.groupBox_5) - self.dsb_orientation.setDecimals(5) - self.dsb_orientation.setMinimum(-1.0) - self.dsb_orientation.setMaximum(90.0) - self.dsb_orientation.setProperty("value", -1.0) - self.dsb_orientation.setObjectName(_fromUtf8("dsb_orientation")) - self.gridLayout_5.addWidget(self.dsb_orientation, 3, 1, 1, 1) - self.dsb_longueur = QtGui.QDoubleSpinBox(self.groupBox_5) - self.dsb_longueur.setDecimals(5) - self.dsb_longueur.setMaximum(1000000.0) - self.dsb_longueur.setObjectName(_fromUtf8("dsb_longueur")) - self.gridLayout_5.addWidget(self.dsb_longueur, 1, 1, 1, 1) - self.gridLayout_12.addLayout(self.gridLayout_5, 1, 0, 1, 1) - self.groupBox_11 = QtGui.QGroupBox(self.groupBox_5) - self.groupBox_11.setObjectName(_fromUtf8("groupBox_11")) - self.gridLayout_11 = QtGui.QGridLayout(self.groupBox_11) - self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) - self.rb_absCurv = QtGui.QRadioButton(self.groupBox_11) - self.rb_absCurv.setObjectName(_fromUtf8("rb_absCurv")) - self.gridLayout_11.addWidget(self.rb_absCurv, 0, 0, 1, 1) - self.rb_posiAngul = QtGui.QRadioButton(self.groupBox_11) - self.rb_posiAngul.setObjectName(_fromUtf8("rb_posiAngul")) - self.gridLayout_11.addWidget(self.rb_posiAngul, 1, 0, 1, 1) - self.dsb_absCurv = QtGui.QDoubleSpinBox(self.groupBox_11) - self.dsb_absCurv.setDecimals(5) - self.dsb_absCurv.setMaximum(1000000.0) - self.dsb_absCurv.setObjectName(_fromUtf8("dsb_absCurv")) - self.gridLayout_11.addWidget(self.dsb_absCurv, 0, 1, 1, 1) - self.dsb_posiAngul = QtGui.QDoubleSpinBox(self.groupBox_11) - self.dsb_posiAngul.setDecimals(5) - self.dsb_posiAngul.setMinimum(-181.0) - self.dsb_posiAngul.setMaximum(180.0) - self.dsb_posiAngul.setProperty("value", -181.0) - self.dsb_posiAngul.setObjectName(_fromUtf8("dsb_posiAngul")) - self.gridLayout_11.addWidget(self.dsb_posiAngul, 1, 1, 1, 1) - self.gridLayout_12.addWidget(self.groupBox_11, 2, 0, 1, 1) - self.verticalLayout_4.addWidget(self.groupBox_5) - spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.verticalLayout_4.addItem(spacerItem4) - self.horizontalLayout_2.addLayout(self.verticalLayout_4) - self.verticalLayout_6 = QtGui.QVBoxLayout() - self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6")) - self.groupBox_6 = QtGui.QGroupBox(self.groupBox_2) - self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) - self.gridLayout_7 = QtGui.QGridLayout(self.groupBox_6) - self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) - self.groupBox_8 = QtGui.QGroupBox(self.groupBox_6) - self.groupBox_8.setObjectName(_fromUtf8("groupBox_8")) - self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox_8) - self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) - self.groupBox_9 = QtGui.QGroupBox(self.groupBox_8) - self.groupBox_9.setObjectName(_fromUtf8("groupBox_9")) - self.horizontalLayout_4 = QtGui.QHBoxLayout(self.groupBox_9) - self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) - self.gridLayout_6 = QtGui.QGridLayout() - self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) - self.label_21 = QtGui.QLabel(self.groupBox_9) - self.label_21.setObjectName(_fromUtf8("label_21")) - self.gridLayout_6.addWidget(self.label_21, 1, 0, 1, 1) - self.label_22 = QtGui.QLabel(self.groupBox_9) - self.label_22.setObjectName(_fromUtf8("label_22")) - self.gridLayout_6.addWidget(self.label_22, 2, 0, 1, 1) - self.sb_nbCouronne = QtGui.QSpinBox(self.groupBox_9) - self.sb_nbCouronne.setMinimum(1) - self.sb_nbCouronne.setMaximum(10000) - self.sb_nbCouronne.setProperty("value", 1) - self.sb_nbCouronne.setObjectName(_fromUtf8("sb_nbCouronne")) - self.gridLayout_6.addWidget(self.sb_nbCouronne, 2, 1, 1, 1) - self.label_23 = QtGui.QLabel(self.groupBox_9) - self.label_23.setObjectName(_fromUtf8("label_23")) - self.gridLayout_6.addWidget(self.label_23, 3, 0, 1, 1) - self.sb_nbSecteur = QtGui.QSpinBox(self.groupBox_9) - self.sb_nbSecteur.setMinimum(3) - self.sb_nbSecteur.setMaximum(10000) - self.sb_nbSecteur.setProperty("value", 3) - self.sb_nbSecteur.setObjectName(_fromUtf8("sb_nbSecteur")) - self.gridLayout_6.addWidget(self.sb_nbSecteur, 3, 1, 1, 1) - self.sb_nbTranches = QtGui.QSpinBox(self.groupBox_9) - self.sb_nbTranches.setMinimum(7) - self.sb_nbTranches.setMaximum(100000) - self.sb_nbTranches.setProperty("value", 7) - self.sb_nbTranches.setObjectName(_fromUtf8("sb_nbTranches")) - self.gridLayout_6.addWidget(self.sb_nbTranches, 1, 1, 1, 1) - self.label_20 = QtGui.QLabel(self.groupBox_9) - self.label_20.setObjectName(_fromUtf8("label_20")) - self.gridLayout_6.addWidget(self.label_20, 4, 0, 1, 1) - self.dsb_rayonTore = QtGui.QDoubleSpinBox(self.groupBox_9) - self.dsb_rayonTore.setEnabled(False) - self.dsb_rayonTore.setDecimals(5) - self.dsb_rayonTore.setMaximum(1000000.0) - self.dsb_rayonTore.setProperty("value", 2.0) - self.dsb_rayonTore.setObjectName(_fromUtf8("dsb_rayonTore")) - self.gridLayout_6.addWidget(self.dsb_rayonTore, 4, 1, 1, 1) - self.horizontalLayout_4.addLayout(self.gridLayout_6) - spacerItem5 = QtGui.QSpacerItem(6, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_4.addItem(spacerItem5) - self.verticalLayout_5.addWidget(self.groupBox_9) - self.cb_optDiscrFiss = QtGui.QCheckBox(self.groupBox_8) - self.cb_optDiscrFiss.setObjectName(_fromUtf8("cb_optDiscrFiss")) - self.verticalLayout_5.addWidget(self.cb_optDiscrFiss) - self.gb_discrFacesExternes = QtGui.QGroupBox(self.groupBox_8) - self.gb_discrFacesExternes.setEnabled(True) - self.gb_discrFacesExternes.setObjectName(_fromUtf8("gb_discrFacesExternes")) - self.horizontalLayout_3 = QtGui.QHBoxLayout(self.gb_discrFacesExternes) - self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) - self.label_24 = QtGui.QLabel(self.gb_discrFacesExternes) - self.label_24.setObjectName(_fromUtf8("label_24")) - self.horizontalLayout_3.addWidget(self.label_24) - self.dsb_aretesFaceFissure = QtGui.QDoubleSpinBox(self.gb_discrFacesExternes) - self.dsb_aretesFaceFissure.setDecimals(5) - self.dsb_aretesFaceFissure.setMaximum(1000000.0) - self.dsb_aretesFaceFissure.setObjectName(_fromUtf8("dsb_aretesFaceFissure")) - self.horizontalLayout_3.addWidget(self.dsb_aretesFaceFissure) - spacerItem6 = QtGui.QSpacerItem(1, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_3.addItem(spacerItem6) - self.verticalLayout_5.addWidget(self.gb_discrFacesExternes) - self.gridLayout_7.addWidget(self.groupBox_8, 1, 0, 1, 2) - self.gb_zoneRemail = QtGui.QGroupBox(self.groupBox_6) - self.gb_zoneRemail.setEnabled(True) - self.gb_zoneRemail.setObjectName(_fromUtf8("gb_zoneRemail")) - self.gridLayout_16 = QtGui.QGridLayout(self.gb_zoneRemail) - self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) - self.gridLayout_17 = QtGui.QGridLayout() - self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) - self.dsb_influence = QtGui.QDoubleSpinBox(self.gb_zoneRemail) - self.dsb_influence.setDecimals(5) - self.dsb_influence.setMaximum(1000000.0) - self.dsb_influence.setObjectName(_fromUtf8("dsb_influence")) - self.gridLayout_17.addWidget(self.dsb_influence, 1, 1, 1, 1) - self.label_25 = QtGui.QLabel(self.gb_zoneRemail) - self.label_25.setObjectName(_fromUtf8("label_25")) - self.gridLayout_17.addWidget(self.label_25, 1, 0, 1, 1) - self.gridLayout_16.addLayout(self.gridLayout_17, 0, 0, 1, 1) - spacerItem7 = QtGui.QSpacerItem(47, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_16.addItem(spacerItem7, 0, 1, 1, 1) - self.gridLayout_7.addWidget(self.gb_zoneRemail, 2, 0, 1, 1) - self.verticalLayout_6.addWidget(self.groupBox_6) - spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.verticalLayout_6.addItem(spacerItem8) - self.horizontalLayout_2.addLayout(self.verticalLayout_6) - self.horizontalLayout_5.addWidget(self.groupBox_2) - self.gridLayout_8.addLayout(self.horizontalLayout_5, 0, 0, 1, 1) - self.horizontalLayout_6 = QtGui.QHBoxLayout() - self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) - spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_6.addItem(spacerItem9) - self.lb_calcul = QtGui.QLabel(Dialog) - font = QtGui.QFont() - font.setPointSize(24) - self.lb_calcul.setFont(font) - self.lb_calcul.setObjectName(_fromUtf8("lb_calcul")) - self.horizontalLayout_6.addWidget(self.lb_calcul) - spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_6.addItem(spacerItem10) - self.gridLayout_8.addLayout(self.horizontalLayout_6, 1, 0, 1, 1) - spacerItem11 = QtGui.QSpacerItem(20, 4, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_8.addItem(spacerItem11, 2, 0, 1, 1) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.pb_reset = QtGui.QPushButton(Dialog) - self.pb_reset.setObjectName(_fromUtf8("pb_reset")) - self.horizontalLayout.addWidget(self.pb_reset) - self.pb_valPrec = QtGui.QPushButton(Dialog) - self.pb_valPrec.setObjectName(_fromUtf8("pb_valPrec")) - self.horizontalLayout.addWidget(self.pb_valPrec) - self.pb_recharger = QtGui.QPushButton(Dialog) - self.pb_recharger.setObjectName(_fromUtf8("pb_recharger")) - self.horizontalLayout.addWidget(self.pb_recharger) - self.pb_sauver = QtGui.QPushButton(Dialog) - self.pb_sauver.setObjectName(_fromUtf8("pb_sauver")) - self.horizontalLayout.addWidget(self.pb_sauver) - spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem12) - self.buttonBox = QtGui.QDialogButtonBox(Dialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.horizontalLayout.addWidget(self.buttonBox) - self.gridLayout_8.addLayout(self.horizontalLayout, 3, 0, 1, 1) - - self.retranslateUi(Dialog) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) - QtCore.QObject.connect(self.cb_optDiscrSain, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.gb_discrSain.setShown) - QtCore.QObject.connect(self.cb_optDiscrFiss, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.gb_discrFacesExternes.setShown) - QtCore.QObject.connect(self.cb_optDiscrFiss, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.gb_zoneRemail.setShown) - QtCore.QObject.connect(self.cb_optDiscrFiss, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.dsb_rayonTore.setEnabled) - QtCore.QObject.connect(self.rb_absCurv, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.dsb_absCurv.setEnabled) - QtCore.QObject.connect(self.rb_posiAngul, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.dsb_posiAngul.setEnabled) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - def retranslateUi(self, Dialog): - Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) - self.groupBox.setTitle(_translate("Dialog", "Coude Sain", None)) - self.groupBox_3.setTitle(_translate("Dialog", "Géométrie", None)) - self.label_3.setText(_translate("Dialog", "L_TUBE_P1", None)) - self.dsb_angle.setToolTip(_translate("Dialog", "Valeur de l\'angle du coude en degrés", None)) - self.label_2.setText(_translate("Dialog", "R_CINTR", None)) - self.label_5.setText(_translate("Dialog", "EPAIS", None)) - self.dsb_epais.setToolTip(_translate("Dialog", "Valeur de l’épaisseur du coude et des embouts", None)) - self.label_4.setText(_translate("Dialog", "L_TUBE_P2", None)) - self.dsb_lTubeP2.setToolTip(_translate("Dialog", "Valeur de la longueur de l’embout P2 à l’extrémité duquel seront appliqués les chargements", None)) - self.label_6.setText(_translate("Dialog", "DEXT", None)) - self.label.setText(_translate("Dialog", "ANGLE", None)) - self.dsb_dext.setToolTip(_translate("Dialog", "Valeur du diamètre externe du coude et des embouts droits", None)) - self.dsb_lTubeP1.setToolTip(_translate("Dialog", "Valeur de la longueur de l’embout P1 à l’extrémité duquel seront appliqués les chargements", None)) - self.dsb_rCintr.setToolTip(_translate("Dialog", "Valeur du rayon de cintrage du coude", None)) - self.cb_optDiscrSain.setToolTip(_translate("Dialog", "Paramètres optionnels de discretisation", None)) - self.cb_optDiscrSain.setText(_translate("Dialog", "Options de discretisation", None)) - self.gb_discrSain.setTitle(_translate("Dialog", "Maillage", None)) - self.label_7.setText(_translate("Dialog", "Nombres de segments", None)) - self.label_8.setText(_translate("Dialog", "NB_AXE_TUBE_P1", None)) - self.sb_nbAxeTubeP1.setToolTip(_translate("Dialog", "Nombre d’éléments le long de l’embout P1", None)) - self.label_9.setText(_translate("Dialog", "NB_AXE_TUBE_P2", None)) - self.sb_nbAxeTubeP2.setToolTip(_translate("Dialog", "Nombre d’éléments le long de l’embout P2", None)) - self.label_10.setText(_translate("Dialog", "NB_AXE_COUDE", None)) - self.sb_nbAxeCoude.setToolTip(_translate("Dialog", "Nombre d’éléments le long de l’axe du coude", None)) - self.label_11.setText(_translate("Dialog", "NB_CIRCONF", None)) - self.sb_nbCirconf.setToolTip(_translate("Dialog", "

Nombre d’éléments le long de la circonférence

(nombre pair)

", None)) - self.label_13.setText(_translate("Dialog", "NB_EPAISSEUR", None)) - self.sb_nbEpaisseur.setToolTip(_translate("Dialog", "Nombre d\'éléments dans l\'épaisseur", None)) - self.groupBox_2.setTitle(_translate("Dialog", "Fissure", None)) - self.groupBox_5.setTitle(_translate("Dialog", "Géométrie fissure", None)) - self.groupBox_4.setTitle(_translate("Dialog", "position", None)) - self.rb_fissInt.setToolTip(_translate("Dialog", "

Fissure positionnée sur la face interne

", None)) - self.rb_fissInt.setText(_translate("Dialog", "fissure interne", None)) - self.rb_fissExt.setToolTip(_translate("Dialog", "

Fissure positionnée sur la face externe

", None)) - self.rb_fissExt.setText(_translate("Dialog", "fissure externe", None)) - self.cb_forceEllipse.setToolTip(_translate("Dialog", "

Forcer une fissure de forme elliptique, même si elle est longue

", None)) - self.cb_forceEllipse.setText(_translate("Dialog", "forcer elliptique", None)) - self.dsb_azimut.setToolTip(_translate("Dialog", "Valeur de la position circonférentielle du centre de la fissure comptée positivement en degrés à partir de l’extrados jusqu’à l’intrados en passant par le flanc gauche", None)) - self.label_18.setText(_translate("Dialog", "PROFONDEUR", None)) - self.dsb_profondeur.setToolTip(_translate("Dialog", "

Profondeur de la fissure :

distance maximale entre le fond de fissure et la peau interne ou externe sur laquelle débouche la fissure

", None)) - self.label_19.setText(_translate("Dialog", "LONGUEUR", None)) - self.label_14.setText(_translate("Dialog", "AZIMUT", None)) - self.label_15.setText(_translate("Dialog", "ORIEN", None)) - self.dsb_orientation.setToolTip(_translate("Dialog", "Valeur de l’angle en degrés formé par le grand axe de la fissure et la génératrice du coude donnant ainsi l’orientation du défaut", None)) - self.dsb_longueur.setToolTip(_translate("Dialog", "Longueur du grand axe de la fissure mesurée sur le coude en peau interne ou externe, suivant la peau sur laquelle se trouve la fissure", None)) - self.groupBox_11.setTitle(_translate("Dialog", "position longitudinale", None)) - self.rb_absCurv.setToolTip(_translate("Dialog", "Définition de la position longitudinale par une abscisse curiviligne", None)) - self.rb_absCurv.setText(_translate("Dialog", "ABS_CURV", None)) - self.rb_posiAngul.setToolTip(_translate("Dialog", "Définition de la position longitudinale par un angle", None)) - self.rb_posiAngul.setText(_translate("Dialog", "POSI_ANGUL", None)) - self.dsb_absCurv.setToolTip(_translate("Dialog", "

Valeur de la position longitudinale du centre de la fissure définie par rapport à l\'interface de l\'embout P1 :

Abcisse curviligne le long de l\'axe du coude, sur la peau interne ou externe, selon la position de la fissure.


", None)) - self.dsb_posiAngul.setToolTip(_translate("Dialog", "

Valeur de la position longitudinale du centre de la fissure définie par rapport à l\'interface de l\'embout P1 :

Angle en degrés formé par la section contenant le centre de la fissure et l\'interface de l\'embout P1.


", None)) - self.groupBox_6.setTitle(_translate("Dialog", "Maillage fissure", None)) - self.groupBox_8.setTitle(_translate("Dialog", "maillage zone de fissure", None)) - self.groupBox_9.setTitle(_translate("Dialog", "pipe rayonnant", None)) - self.label_21.setText(_translate("Dialog", "NB_TRANCHES", None)) - self.label_22.setText(_translate("Dialog", "NB_COURONNE", None)) - self.sb_nbCouronne.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de couronnes du maillage rayonnant autour de la ligne de fond de fissure, y compris la couronne centrale formée de prismes.

", None)) - self.label_23.setText(_translate("Dialog", "NB_SECTEUR", None)) - self.sb_nbSecteur.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de secteurs selon un cercle normal au fond de fissure.

", None)) - self.sb_nbTranches.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Nombre de mailles (approximatif) le long de la ligne de fond de fissure.

", None)) - self.label_20.setText(_translate("Dialog", "RAYON_TORE", None)) - self.dsb_rayonTore.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Rayon du pipe.

", None)) - self.cb_optDiscrFiss.setToolTip(_translate("Dialog", "Paramètres optionnels de discrétisation", None)) - self.cb_optDiscrFiss.setText(_translate("Dialog", "Options de discretisation", None)) - self.gb_discrFacesExternes.setTitle(_translate("Dialog", "faces externes", None)) - self.label_24.setText(_translate("Dialog", "aretes face fissure", None)) - self.dsb_aretesFaceFissure.setToolTip(_translate("Dialog", "

Faces externes de la zone à remailler.

Mailage en triangles : valeur cible des arêtes.

", None)) - self.gb_zoneRemail.setTitle(_translate("Dialog", "identification zone à remailler", None)) - self.dsb_influence.setToolTip(_translate("Dialog", "

La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.

", None)) - self.label_25.setText(_translate("Dialog", "distance influence", None)) - self.lb_calcul.setText(_translate("Dialog", "--- Calcul en cours ---", None)) - self.pb_reset.setToolTip(_translate("Dialog", "réinitialisation de tous les paramètres à leur valeur par défaut", None)) - self.pb_reset.setText(_translate("Dialog", "Reset", None)) - self.pb_valPrec.setToolTip(_translate("Dialog", "réinitialisation de tous les paramètres à leur valeur de la précédente éxécution", None)) - self.pb_valPrec.setText(_translate("Dialog", "Précédent", None)) - self.pb_recharger.setToolTip(_translate("Dialog", "réinitialisation des paramètres à partir d\'un fichier préalablement sauvegardé", None)) - self.pb_recharger.setText(_translate("Dialog", "Recharger", None)) - self.pb_sauver.setToolTip(_translate("Dialog", "sauvegarde des paramètres dans un fichier à choisir", None)) - self.pb_sauver.setText(_translate("Dialog", "Sauver", None)) - diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_ui.py b/src/Tools/blocFissure/ihm/fissureGenerale_ui.py deleted file mode 100644 index 63ea2f3cf..000000000 --- a/src/Tools/blocFissure/ihm/fissureGenerale_ui.py +++ /dev/null @@ -1,220 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file '/scratch/I27518/V7_3_build/V7_3_0/modules/src/SMESH_V7_3_0p2/src/Tools/blocFissure/ihm/fissureGenerale.ui' -# -# Created: Wed Mar 5 09:49:21 2014 -# by: PyQt4 UI code generator 4.9.6 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName(_fromUtf8("Dialog")) - Dialog.resize(631, 490) - self.gridLayout_11 = QtGui.QGridLayout(Dialog) - self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) - self.groupBox = QtGui.QGroupBox(Dialog) - self.groupBox.setObjectName(_fromUtf8("groupBox")) - self.gridLayout_4 = QtGui.QGridLayout(self.groupBox) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.gridLayout = QtGui.QGridLayout() - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.pb_maillage = QtGui.QPushButton(self.groupBox) - self.pb_maillage.setObjectName(_fromUtf8("pb_maillage")) - self.gridLayout.addWidget(self.pb_maillage, 0, 0, 1, 1) - self.le_maillage = QtGui.QLineEdit(self.groupBox) - self.le_maillage.setObjectName(_fromUtf8("le_maillage")) - self.gridLayout.addWidget(self.le_maillage, 0, 1, 1, 1) - self.pb_facefiss = QtGui.QPushButton(self.groupBox) - self.pb_facefiss.setObjectName(_fromUtf8("pb_facefiss")) - self.gridLayout.addWidget(self.pb_facefiss, 1, 0, 1, 1) - self.le_facefiss = QtGui.QLineEdit(self.groupBox) - self.le_facefiss.setObjectName(_fromUtf8("le_facefiss")) - self.gridLayout.addWidget(self.le_facefiss, 1, 1, 1, 1) - self.gridLayout_4.addLayout(self.gridLayout, 0, 0, 1, 1) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.label = QtGui.QLabel(self.groupBox) - self.label.setObjectName(_fromUtf8("label")) - self.horizontalLayout.addWidget(self.label) - self.le_fondfiss = QtGui.QLineEdit(self.groupBox) - self.le_fondfiss.setObjectName(_fromUtf8("le_fondfiss")) - self.horizontalLayout.addWidget(self.le_fondfiss) - spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.gridLayout_4.addLayout(self.horizontalLayout, 1, 0, 1, 1) - self.gridLayout_11.addWidget(self.groupBox, 0, 0, 1, 2) - self.gridLayout_10 = QtGui.QGridLayout() - self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) - self.groupBox_2 = QtGui.QGroupBox(Dialog) - self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) - self.gridLayout_12 = QtGui.QGridLayout(self.groupBox_2) - self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) - self.gridLayout_6 = QtGui.QGridLayout() - self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) - self.label_2 = QtGui.QLabel(self.groupBox_2) - self.label_2.setObjectName(_fromUtf8("label_2")) - self.gridLayout_6.addWidget(self.label_2, 0, 0, 1, 1) - self.dsb_influence = QtGui.QDoubleSpinBox(self.groupBox_2) - self.dsb_influence.setObjectName(_fromUtf8("dsb_influence")) - self.gridLayout_6.addWidget(self.dsb_influence, 0, 1, 1, 1) - self.gridLayout_12.addLayout(self.gridLayout_6, 0, 0, 1, 1) - spacerItem1 = QtGui.QSpacerItem(0, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_12.addItem(spacerItem1, 0, 1, 1, 1) - self.groupBox_3 = QtGui.QGroupBox(self.groupBox_2) - self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) - self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_3) - self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) - self.gridLayout_2 = QtGui.QGridLayout() - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.label_3 = QtGui.QLabel(self.groupBox_3) - self.label_3.setObjectName(_fromUtf8("label_3")) - self.gridLayout_2.addWidget(self.label_3, 0, 0, 1, 1) - self.dsb_meshBrepMin = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_meshBrepMin.setMaximum(1000000.0) - self.dsb_meshBrepMin.setObjectName(_fromUtf8("dsb_meshBrepMin")) - self.gridLayout_2.addWidget(self.dsb_meshBrepMin, 0, 1, 1, 1) - self.label_4 = QtGui.QLabel(self.groupBox_3) - self.label_4.setObjectName(_fromUtf8("label_4")) - self.gridLayout_2.addWidget(self.label_4, 1, 0, 1, 1) - self.dsb_meshBrepMax = QtGui.QDoubleSpinBox(self.groupBox_3) - self.dsb_meshBrepMax.setMaximum(1000000.0) - self.dsb_meshBrepMax.setObjectName(_fromUtf8("dsb_meshBrepMax")) - self.gridLayout_2.addWidget(self.dsb_meshBrepMax, 1, 1, 1, 1) - self.gridLayout_5.addLayout(self.gridLayout_2, 0, 0, 1, 1) - spacerItem2 = QtGui.QSpacerItem(34, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_5.addItem(spacerItem2, 0, 1, 1, 1) - self.gridLayout_12.addWidget(self.groupBox_3, 1, 0, 1, 2) - self.gridLayout_10.addWidget(self.groupBox_2, 0, 0, 1, 1) - self.groupBox_4 = QtGui.QGroupBox(Dialog) - self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) - self.gridLayout_9 = QtGui.QGridLayout(self.groupBox_4) - self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) - self.groupBox_5 = QtGui.QGroupBox(self.groupBox_4) - self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) - self.gridLayout_7 = QtGui.QGridLayout(self.groupBox_5) - self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) - self.gridLayout_3 = QtGui.QGridLayout() - self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.label_5 = QtGui.QLabel(self.groupBox_5) - self.label_5.setObjectName(_fromUtf8("label_5")) - self.gridLayout_3.addWidget(self.label_5, 0, 0, 1, 1) - self.dsb_rayonPipe = QtGui.QDoubleSpinBox(self.groupBox_5) - self.dsb_rayonPipe.setMaximum(1000000.0) - self.dsb_rayonPipe.setObjectName(_fromUtf8("dsb_rayonPipe")) - self.gridLayout_3.addWidget(self.dsb_rayonPipe, 0, 1, 1, 1) - self.label_6 = QtGui.QLabel(self.groupBox_5) - self.label_6.setObjectName(_fromUtf8("label_6")) - self.gridLayout_3.addWidget(self.label_6, 1, 0, 1, 1) - self.dsb_lenSegPipe = QtGui.QDoubleSpinBox(self.groupBox_5) - self.dsb_lenSegPipe.setMaximum(1000000.0) - self.dsb_lenSegPipe.setObjectName(_fromUtf8("dsb_lenSegPipe")) - self.gridLayout_3.addWidget(self.dsb_lenSegPipe, 1, 1, 1, 1) - self.label_7 = QtGui.QLabel(self.groupBox_5) - self.label_7.setObjectName(_fromUtf8("label_7")) - self.gridLayout_3.addWidget(self.label_7, 2, 0, 1, 1) - self.sb_couronnes = QtGui.QSpinBox(self.groupBox_5) - self.sb_couronnes.setMinimum(2) - self.sb_couronnes.setMaximum(10000) - self.sb_couronnes.setProperty("value", 4) - self.sb_couronnes.setObjectName(_fromUtf8("sb_couronnes")) - self.gridLayout_3.addWidget(self.sb_couronnes, 2, 1, 1, 1) - self.label_8 = QtGui.QLabel(self.groupBox_5) - self.label_8.setObjectName(_fromUtf8("label_8")) - self.gridLayout_3.addWidget(self.label_8, 3, 0, 1, 1) - self.sb_secteurs = QtGui.QSpinBox(self.groupBox_5) - self.sb_secteurs.setMinimum(4) - self.sb_secteurs.setMaximum(10000) - self.sb_secteurs.setProperty("value", 8) - self.sb_secteurs.setObjectName(_fromUtf8("sb_secteurs")) - self.gridLayout_3.addWidget(self.sb_secteurs, 3, 1, 1, 1) - self.gridLayout_7.addLayout(self.gridLayout_3, 0, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(6, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_7.addItem(spacerItem3, 0, 1, 1, 1) - self.gridLayout_9.addWidget(self.groupBox_5, 0, 0, 1, 1) - self.groupBox_6 = QtGui.QGroupBox(self.groupBox_4) - self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) - self.gridLayout_8 = QtGui.QGridLayout(self.groupBox_6) - self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) - self.label_9 = QtGui.QLabel(self.groupBox_6) - self.label_9.setObjectName(_fromUtf8("label_9")) - self.gridLayout_8.addWidget(self.label_9, 0, 0, 1, 1) - self.dsb_areteFaceFissure = QtGui.QDoubleSpinBox(self.groupBox_6) - self.dsb_areteFaceFissure.setMaximum(1000000.0) - self.dsb_areteFaceFissure.setObjectName(_fromUtf8("dsb_areteFaceFissure")) - self.gridLayout_8.addWidget(self.dsb_areteFaceFissure, 0, 1, 1, 1) - spacerItem4 = QtGui.QSpacerItem(1, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_8.addItem(spacerItem4, 0, 2, 1, 1) - self.gridLayout_9.addWidget(self.groupBox_6, 1, 0, 1, 1) - self.gridLayout_10.addWidget(self.groupBox_4, 0, 1, 2, 1) - spacerItem5 = QtGui.QSpacerItem(20, 112, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_10.addItem(spacerItem5, 1, 0, 1, 1) - self.gridLayout_11.addLayout(self.gridLayout_10, 1, 0, 1, 2) - spacerItem6 = QtGui.QSpacerItem(20, 13, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_11.addItem(spacerItem6, 2, 1, 1, 1) - self.horizontalLayout_5 = QtGui.QHBoxLayout() - self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) - spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_5.addItem(spacerItem7) - self.bb_OkCancel = QtGui.QDialogButtonBox(Dialog) - self.bb_OkCancel.setOrientation(QtCore.Qt.Horizontal) - self.bb_OkCancel.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.bb_OkCancel.setObjectName(_fromUtf8("bb_OkCancel")) - self.horizontalLayout_5.addWidget(self.bb_OkCancel) - self.gridLayout_11.addLayout(self.horizontalLayout_5, 3, 0, 1, 1) - - self.retranslateUi(Dialog) - QtCore.QObject.connect(self.bb_OkCancel, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) - QtCore.QObject.connect(self.bb_OkCancel, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - def retranslateUi(self, Dialog): - Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) - Dialog.setToolTip(_translate("Dialog", "

Insertion d\'un maillage de fissure dans un maillage hexaédrique sain.

Le maillage sain est fourni sous forme de fichier Med.

La face de fissure est décrite par une géométrie dans un fichier brep.

La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.

La procédure identfie des mailles saines à enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone à remailler en tétraèdres.

", None)) - self.groupBox.setTitle(_translate("Dialog", "maillage sain et géometries de fissure", None)) - self.pb_maillage.setToolTip(_translate("Dialog", "

sélection du fichier med du maillage sain (hexaèdres)

", None)) - self.pb_maillage.setText(_translate("Dialog", "maillage sain", None)) - self.le_maillage.setToolTip(_translate("Dialog", "

fichier med du maillage sain (hexaèdres)

", None)) - self.pb_facefiss.setToolTip(_translate("Dialog", "

sélection du fichier brep (géométrie) décrivant la face de fissure.

", None)) - self.pb_facefiss.setText(_translate("Dialog", "face fissure", None)) - self.le_facefiss.setToolTip(_translate("Dialog", "

fichier brep (géométrie) décrivant la face de fissure.

", None)) - self.label.setText(_translate("Dialog", "index edges fond fissure", None)) - self.le_fondfiss.setToolTip(_translate("Dialog", "

Index des edges décrivant le fond de fissure, dans la face de fissure.

Sous forme d\'une liste Python.

Exemples :[5,9] ou [3]

(on peut récupérer ces valeurs à l\'aide du dialogue de création de groupes d\'edges, dans GEOM)

", None)) - self.groupBox_2.setTitle(_translate("Dialog", "identification zone à remailler", None)) - self.label_2.setText(_translate("Dialog", "distance influence", None)) - self.dsb_influence.setToolTip(_translate("Dialog", "

La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.

", None)) - self.groupBox_3.setTitle(_translate("Dialog", "prémaillage face fissure", None)) - self.label_3.setText(_translate("Dialog", "min", None)) - self.dsb_meshBrepMin.setToolTip(_translate("Dialog", "

Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.

Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.

", None)) - self.label_4.setText(_translate("Dialog", "max", None)) - self.dsb_meshBrepMax.setToolTip(_translate("Dialog", "

Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.

Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.

", None)) - self.groupBox_4.setTitle(_translate("Dialog", "maillage zone de fissure", None)) - self.groupBox_5.setTitle(_translate("Dialog", "pipe rayonnant", None)) - self.label_5.setText(_translate("Dialog", "rayon pipe", None)) - self.dsb_rayonPipe.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Rayon du pipe.

", None)) - self.label_6.setText(_translate("Dialog", "longueur mailles", None)) - self.dsb_lenSegPipe.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

Longueur des mailles le long de la ligne de fond de fissure.

", None)) - self.label_7.setText(_translate("Dialog", "couronnes", None)) - self.sb_couronnes.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de couronnes de mailles autour de la ligne de fond de fissure.

", None)) - self.label_8.setText(_translate("Dialog", "secteurs", None)) - self.sb_secteurs.setToolTip(_translate("Dialog", "

Pipe rayonnant construit sur le fond de fissure :

nombre de secteurs selon un cercle normal au fond de fissure.

", None)) - self.groupBox_6.setTitle(_translate("Dialog", "faces externes", None)) - self.label_9.setText(_translate("Dialog", "aretes face fissure", None)) - self.dsb_areteFaceFissure.setToolTip(_translate("Dialog", "

Faces externes de la zone à remailler.

Mailage en triangles : valeur cible des arêtes.

", None)) - From d1d19caf57524c6da08849c77ad242adb66e6d0e Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 28 Aug 2014 16:39:53 +0200 Subject: [PATCH 008/147] debug parametrage cas tests cubeFin --- src/Tools/blocFissure/CasTests/cubeCoin.py | 2 +- src/Tools/blocFissure/gmu/fissureGenerique.py | 4 +++- src/Tools/blocFissure/materielCasTests/cubeFin.py | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/cubeCoin.py b/src/Tools/blocFissure/CasTests/cubeCoin.py index 0e39a3224..97d18a45d 100644 --- a/src/Tools/blocFissure/CasTests/cubeCoin.py +++ b/src/Tools/blocFissure/CasTests/cubeCoin.py @@ -6,7 +6,7 @@ from blocFissure import gmu dicoParams = dict(nomCas = 'cubeCoin', maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'), brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"), - edgeFissIds = [4], + edgeFissIds = [7], lgInfluence = 50, meshBrep = (5,10), rayonPipe = 10, diff --git a/src/Tools/blocFissure/gmu/fissureGenerique.py b/src/Tools/blocFissure/gmu/fissureGenerique.py index 17518e871..3296c39ce 100644 --- a/src/Tools/blocFissure/gmu/fissureGenerique.py +++ b/src/Tools/blocFissure/gmu/fissureGenerique.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import logging + from blocFissure import gmu from blocFissure.gmu.initEtude import initEtude from blocFissure.gmu.getStatsMaillageFissure import getStatsMaillageFissure @@ -60,7 +62,7 @@ class fissureGenerique(): # --------------------------------------------------------------------------- def executeProbleme(self, step=-1): - print "executeProbleme", self.nomCas + logging.info(" --- executeProbleme %s", self.nomCas) if step == 0: return diff --git a/src/Tools/blocFissure/materielCasTests/cubeFin.py b/src/Tools/blocFissure/materielCasTests/cubeFin.py index 219fa4e81..6f9129bfe 100644 --- a/src/Tools/blocFissure/materielCasTests/cubeFin.py +++ b/src/Tools/blocFissure/materielCasTests/cubeFin.py @@ -53,7 +53,7 @@ Line_3_vertex_2 = geompy.GetSubShape(Line_3, [2]) Arc_1 = geompy.MakeArc(Line_1_vertex_3, Vertex_5, Line_3_vertex_2) Face_1 = geompy.MakeFaceWires([Line_1, Line_3, Line_4, Arc_1], 1) cubeFin_Coin = geompy.MakeCommonList([Rotation_1, Face_1], True) -cubeFin_milieu = geompy.MakeCommonList([Scale_1, cubeFin_Transverse], True) +cubeFin_Milieu = geompy.MakeCommonList([Scale_1, cubeFin_Transverse], True) O_1 = geompy.MakeVertex(0, 0, 0) OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0) @@ -88,14 +88,14 @@ geompy.addToStudyInFather( Line_3, Line_3_vertex_2, 'Line_3:vertex_2' ) geompy.addToStudy( Arc_1, 'Arc_1' ) geompy.addToStudy( Face_1, 'Face_1' ) geompy.addToStudy( cubeFin_Coin, 'cubeFin_Coin' ) -geompy.addToStudy( cubeFin_milieu, 'cubeFin_milieu' ) +geompy.addToStudy( cubeFin_Milieu, 'cubeFin_Milieu' ) geompy.addToStudy( O_1, 'O' ) geompy.addToStudy( OX_1, 'OX' ) geompy.addToStudy( OY_1, 'OY' ) geompy.addToStudy( OZ_1, 'OZ' ) geompy.Export(cubeFin_Transverse, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep"), "BREP") geompy.Export(cubeFin_Coin, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"), "BREP") -geompy.Export(cubeFin_milieu, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_milieu.brep"), "BREP") +geompy.Export(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"), "BREP") ### ### SMESH component From b5aa15f7caa1e8f24eda3ba66f1c51c7460bfac9 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 29 Aug 2014 15:11:49 +0200 Subject: [PATCH 009/147] remplacement de print et corrections mineures --- .../blocFissure/CasTests/execution_Cas.py | 2 +- .../blocFissure/gmu/creeZoneDefautMaillage.py | 2 +- .../gmu/fusionMaillageAttributionDefaut.py | 9 +++-- .../blocFissure/gmu/insereFissureLongue.py | 2 +- .../blocFissure/gmu/listOfExtraFunctions.py | 35 +++++++++---------- src/Tools/blocFissure/gmu/peauInterne.py | 6 ++-- .../gmu/quadranglesToShapeNoCorner.py | 7 ++-- 7 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 138aebf21..633484499 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -129,7 +129,7 @@ runall = False if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 - torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,] + torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,] for i in range(len(problemes)): if torun[i]: diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py b/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py index 9fcb7d58e..dee9bf84f 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py @@ -12,7 +12,7 @@ def creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, nomZones, coordsNoeudsFissure): """ Identification de la zone à remailler, opérations sur le maillage - de l'objet sain + de l'objet sain. La zone à remailler est définie à partir d'un objet géométrique ou à partir d'un jeu de points et d'une distance d'influence. @param maillagesSains : (le maillage de l'objet initial, booleen isHexa) diff --git a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py index d7736d213..89fef3ae5 100644 --- a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py +++ b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py @@ -2,7 +2,7 @@ """ Created on Tue Jun 24 09:14:13 2014 -@author: I48174 +@author: I48174 (Olivier HOAREAU) """ import logging @@ -48,16 +48,19 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible # A partir des lignes de la face, # on recrée un objet GEOM temporaire par filling. filling = geompy.MakeFilling(geompy.MakeCompound(setOfLines), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) - geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) + #logging.debug("face de filling") + #geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) - tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0, True) + tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0) tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True) tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) if len(tmpExplodeRef) == len(tmpExplodeNum): + logging.debug("face de filling non coupee") geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1)) facesNonCoupees.append(filling) maillagesNonCoupes.append(listOfNewMeshes[i]) else: + logging.debug("face de filling coupee") geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1)) facesCoupees.append(filling) maillagesCoupes.append(listOfNewMeshes[i]) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue.py b/src/Tools/blocFissure/gmu/insereFissureLongue.py index ec8307c9d..8f9515846 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue.py @@ -79,7 +79,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, facePorteFissure = shapeDefaut WirePorteFondFissure = wiretube fillingFaceExterne = facesDefaut[0] - print fillingFaceExterne + logging.debug("fillingFaceExterne %s", fillingFaceExterne) geompy.addToStudy(fillingFaceExterne, "fillingFaceExterne") edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False) diff --git a/src/Tools/blocFissure/gmu/listOfExtraFunctions.py b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py index 535396226..fbdd5cf97 100644 --- a/src/Tools/blocFissure/gmu/listOfExtraFunctions.py +++ b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py @@ -2,7 +2,7 @@ """ Created on Mon Jun 23 14:49:36 2014 -@author: I48174 +@author: I48174 (Olivier HOAREAU) """ import logging @@ -14,10 +14,11 @@ def lookForCorner(maillageAScanner): """ Cette fonction permet de scanner la liste de noeuds qui composent le maillage passé en paramètre. On recherche un ou plusieurs coins, ce qui implique les caractéristiques suivantes: - - le noeud doit appartenir au moins à trois éléments distinctes - - chaque élément doit appartenir à un ensemble distincte + - le noeud doit appartenir au moins à trois éléments distincts + - chaque élément doit appartenir à un ensemble distinct La fonction renvoie une liste de coins par l'intermédiaire de l'IDs - chaque noeud. La liste contient en général au maximum deux coins. """ + chaque noeud. La liste contient en général au maximum deux coins. + """ logging.info("start") @@ -27,19 +28,16 @@ def lookForCorner(maillageAScanner): # On parcours la liste de noeuds listOfElements = maillageAScanner.GetNodeInverseElements(ND) if len(listOfElements) >=3: - # On teste le nombre d'éléments qui partage le même noeud + # On teste le nombre d'éléments qui partagent le même noeud # --- Filtre selon le critère 'coplanar' --- # listOfCriterion = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \ - SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) \ - for elem in listOfElements] - listOfFilters = [smesh.GetFilterFromCriteria([criteria]) \ - for criteria in listOfCriterion] - # ------------------------------------------ # - listOfSets = [maillageAScanner.GetIdsFromFilter(filter) \ - for filter in listOfFilters] + SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) \ + for elem in listOfElements] + listOfFilters = [smesh.GetFilterFromCriteria([criteria]) for criteria in listOfCriterion] + listOfSets = [maillageAScanner.GetIdsFromFilter(filter) for filter in listOfFilters] if listOfSets.count(listOfSets[0]) == len(listOfSets): # Si toutes les listes d'éléments sont similaires, on retourne - # au début pour éviter de travailler sur des éléments inutils. + # au début pour éviter de travailler sur des éléments inutiles. # Exemple : un noeud appartenant à 4 éléments sur la même face. continue for s in listOfSets: @@ -56,7 +54,7 @@ def createLinesFromMesh(maillageSupport): """ Cette fonction permet de générer une liste de lignes à partir du maillage support passé en paramètre. On démarre à partir d'un coin - simple et on parcourt tout les noeuds pour former un ligne. Soit la + simple et on parcourt tout les noeuds pour former une ligne. Soit la figure ci-dessous : 1_____4_____7 On part du coin N1, et on cherche les noeuds @@ -69,7 +67,8 @@ def createLinesFromMesh(maillageSupport): | | | dernière ligne, à savoir le noeud N9, on considère 3_____6_____9 que toutes les lignes sont créées. - La fonction retourne une liste de lignes utilisées par la suite. """ + La fonction retourne une liste de lignes utilisées par la suite. + """ logging.info("start") @@ -173,7 +172,8 @@ def createNewMeshesFromCorner(maillageSupport, listOfCorners): """ Cette fonction permet de générer un nouveau maillage plus facile à utiliser. On démarre d'un coin et on récupère les trois éléments auquel le noeud appartient. Grâce à un filtre 'coplanar' sur les trois - éléments, on peut générer des faces distinctes. """ + éléments, on peut générer des faces distinctes. + """ logging.info("start") @@ -184,9 +184,8 @@ def createNewMeshesFromCorner(maillageSupport, listOfCorners): for i, elem in enumerate(elems): # --- Filtre selon le critère 'coplanar' --- # critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \ - SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) + SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) filtre = smesh.GetFilterFromCriteria([critere]) - # ------------------------------------------ # grp = maillageSupport.GroupOnFilter(SMESH.FACE, 'grp', filtre) # On copie le maillage en fonction du filtre msh = smesh.CopyMesh(grp, 'new_{0}'.format(i + 1), False, True) diff --git a/src/Tools/blocFissure/gmu/peauInterne.py b/src/Tools/blocFissure/gmu/peauInterne.py index 3899a72be..b1915042e 100644 --- a/src/Tools/blocFissure/gmu/peauInterne.py +++ b/src/Tools/blocFissure/gmu/peauInterne.py @@ -21,7 +21,7 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones): groups = maillageSain.GetGroups() zoneDefaut = None for grp in groups: - #print " ",grp.GetName() + logging.debug("groupe %s",grp.GetName()) if grp.GetName() == nomZones + "_vol": zoneDefaut = grp break @@ -47,9 +47,9 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones): maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0) listOfCorner = lookForCorner(maillageDefautCible) - print "listOfCorner = ", listOfCorner + logging.debug("listOfCorner = %s", listOfCorner) if len(listOfCorner) > 0: - print " /!\ SUITE DU SCRIPT EN CONSTRUCTION /!\\" + logging.info("présence de coins à la surface externe de la zone à reconstruire") zoneDefaut_skin, internalBoundary = fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner) return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py index 15b74a516..a305a05d9 100644 --- a/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py +++ b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py @@ -50,7 +50,6 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): idStart = idNode # le noeud de coin elemStart = elem # l'élément quadrangle au coin xyz = meshQuad.GetNodeXYZ(idStart) - print "xyz = ", xyz logging.debug("idStart %s, coords %s", idStart, str(xyz)) nodelines =[] # on va constituer une liste de lignes de points @@ -128,9 +127,9 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): logging.debug("nodeline %s", nodeline) logging.debug("elemline %s", elemline) nodelines.append(nodeline) - print "nodelines = ", nodelines + logging.debug("nodelines = %s", nodelines) longueur = [len(val) for val in nodelines] - print "longueur = ", longueur + logging.debug("longueur = %s", longueur) # on a constitué une liste de lignes de points connexes logging.debug("dimensions [%s, %s]", len(nodelines), len(nodeline)) @@ -305,7 +304,7 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): noeuds_bords.append(noeudsBords) idFilToCont.append(icont) bords_Partages += bordsPartages - print "bords_Partages = ", bords_Partages + logging.debug("bords_Partages = %s", bords_Partages) pass # --- loop on mats # --- reconstruction des faces continues à partir des listes de noeuds # les courbes doivent suivre la courbure pour éviter les oscillations From 3bd39da0ba609177294e4f34f1bc0244cd8d38d8 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 29 Aug 2014 16:37:55 +0200 Subject: [PATCH 010/147] =?UTF-8?q?encore=20un=20peu=20de=20m=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/CasTests/execution_Cas.py | 7 +++++-- src/Tools/blocFissure/CasTests/fissureCoude_1.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_10.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_2.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_3.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_4.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_5.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_6.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_7.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_8.py | 1 - src/Tools/blocFissure/CasTests/fissureCoude_9.py | 1 - src/Tools/blocFissure/gmu/initLog.py | 5 +++++ 12 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 633484499..49e91611d 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- import sys, traceback +import logging from blocFissure import gmu from blocFissure.gmu import initLog #initLog.setDebug() -initLog.setVerbose() +#initLog.setVerbose() +initLog.setPerfTests() from blocFissure.gmu import geomsmesh from blocFissure.gmu.casStandard import casStandard @@ -125,7 +127,7 @@ problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.reference # ---tous les cas en sequence, ou les cas selectionnés ... -runall = False +runall = True if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 @@ -133,6 +135,7 @@ else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22, for i in range(len(problemes)): if torun[i]: + logging.critical("=== Execution cas %s", i) try: problemes[i].executeProbleme() except: diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_1.py b/src/Tools/blocFissure/CasTests/fissureCoude_1.py index 9e7636599..5f3053f3a 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_1.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_1.py @@ -51,7 +51,6 @@ class fissureCoude_1(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 2.5, lenSegPipe = 2.5, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_10.py b/src/Tools/blocFissure/CasTests/fissureCoude_10.py index 33ab3e012..ba74c5983 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_10.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_10.py @@ -50,7 +50,6 @@ class fissureCoude_10(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ -# logging.info("setParamShapeFissure %s", self.nomCas) self.shapeFissureParams = dict(profondeur = 2.5, rayonPipe = 1.5, lenSegPipe = 6, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_2.py b/src/Tools/blocFissure/CasTests/fissureCoude_2.py index 0690c01d6..53479bfef 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_2.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_2.py @@ -51,7 +51,6 @@ class fissureCoude_2(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 2.5, lenSegPipe = 2.5, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_3.py b/src/Tools/blocFissure/CasTests/fissureCoude_3.py index 653192d5b..f21b11a38 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_3.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_3.py @@ -51,7 +51,6 @@ class fissureCoude_3(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 2.5, lenSegPipe = 2.5, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_4.py b/src/Tools/blocFissure/CasTests/fissureCoude_4.py index 8d43dcc41..7f8c53570 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_4.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_4.py @@ -51,7 +51,6 @@ class fissureCoude_4(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 2.5, lenSegPipe =2.5, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_5.py b/src/Tools/blocFissure/CasTests/fissureCoude_5.py index 23477e134..320947b0c 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_5.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_5.py @@ -51,7 +51,6 @@ class fissureCoude_5(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 2.5, lenSegPipe = 2.5, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_6.py b/src/Tools/blocFissure/CasTests/fissureCoude_6.py index 0952579a8..18becbc7a 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_6.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_6.py @@ -48,7 +48,6 @@ class fissureCoude_6(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 4, lenSegPipe = 4, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_7.py b/src/Tools/blocFissure/CasTests/fissureCoude_7.py index d19a4b14c..78df23afa 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_7.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_7.py @@ -49,7 +49,6 @@ class fissureCoude_7(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ -# logging.info("setParamShapeFissure %s", self.nomCas) self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 4, lenSegPipe = 4, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_8.py b/src/Tools/blocFissure/CasTests/fissureCoude_8.py index 49439b6ec..2f189cb3c 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_8.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_8.py @@ -50,7 +50,6 @@ class fissureCoude_8(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ -# logging.info("setParamShapeFissure %s", self.nomCas) self.shapeFissureParams = dict(profondeur = 8, rayonPipe = 1, lenSegPipe = 1.5, diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_9.py b/src/Tools/blocFissure/CasTests/fissureCoude_9.py index d7370d1ed..5a5139959 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_9.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_9.py @@ -49,7 +49,6 @@ class fissureCoude_9(fissureCoude): pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z) externe : True : fissure face externe, False : fissure face interne """ - print "setParamShapeFissure", self.nomCas self.shapeFissureParams = dict(profondeur = 10, rayonPipe = 2, lenSegPipe = 6, diff --git a/src/Tools/blocFissure/gmu/initLog.py b/src/Tools/blocFissure/gmu/initLog.py index 63908c1d0..696a26ebe 100644 --- a/src/Tools/blocFissure/gmu/initLog.py +++ b/src/Tools/blocFissure/gmu/initLog.py @@ -22,6 +22,11 @@ def setUnitTests(): level=logging.CRITICAL) logging.critical('start UnitTests') +def setPerfTests(): + logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.CRITICAL) + logging.info('start PerfTests') + #logging.basicConfig(filename='myapp.log', # format='%(asctime)s %(message)s', # datefmt='%m/%d/%Y %I:%M:%S %p', From cfbaf62c424a8aebacdfb0182e59cab08926008d Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 8 Sep 2014 14:58:52 +0200 Subject: [PATCH 011/147] =?UTF-8?q?decoupage=20insereFissureGenerale,=20re?= =?UTF-8?q?nomm=C3=A9e=20construitFissureGenerale,=20premiere=20phase=20:?= =?UTF-8?q?=20g=C3=A9ometrie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/CasTests/cubeAngle.py | 10 +- src/Tools/blocFissure/CasTests/cubeAngle2.py | 2 +- src/Tools/blocFissure/CasTests/cylindre.py | 10 +- src/Tools/blocFissure/CasTests/cylindre_2.py | 2 +- src/Tools/blocFissure/CasTests/ellipse_1.py | 10 +- src/Tools/blocFissure/CasTests/ellipse_2.py | 2 +- .../blocFissure/CasTests/eprouvetteCourbe.py | 10 +- .../blocFissure/CasTests/eprouvetteDroite.py | 10 +- .../CasTests/eprouvetteDroite_2.py | 2 +- .../blocFissure/CasTests/execution_Cas.py | 6 +- src/Tools/blocFissure/CasTests/faceGauche.py | 10 +- .../blocFissure/CasTests/faceGauche_2.py | 10 +- src/Tools/blocFissure/CasTests/vis_1.py | 10 +- src/Tools/blocFissure/gmu/__init__.py | 3 - src/Tools/blocFissure/gmu/casStandard.py | 8 +- src/Tools/blocFissure/gmu/compoundFromList.py | 31 + .../gmu/construitFissureGenerale.py | 937 ++++++++++++++++++ .../gmu/construitPartitionsPeauFissure.py | 43 + src/Tools/blocFissure/gmu/fissureCoude.py | 8 +- .../blocFissure/gmu/getCentreFondFiss.py | 6 +- .../blocFissure/gmu/identifieEdgesPeau.py | 137 +++ .../gmu/identifieElementsDebouchants.py | 148 +++ .../gmu/identifieElementsFissure.py | 55 + .../gmu/identifieElementsGeometriquesPeau.py | 82 ++ .../blocFissure/gmu/identifieFacesPeau.py | 78 ++ .../blocFissure/gmu/insereFissureGenerale.py | 47 +- .../gmu/partitionneFissureParPipe.py | 61 ++ .../blocFissure/gmu/restreintFaceFissure.py | 27 + .../blocFissure/gmu/trouveEdgesFissPeau.py | 29 + 29 files changed, 1710 insertions(+), 84 deletions(-) create mode 100644 src/Tools/blocFissure/gmu/compoundFromList.py create mode 100644 src/Tools/blocFissure/gmu/construitFissureGenerale.py create mode 100644 src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py create mode 100644 src/Tools/blocFissure/gmu/identifieEdgesPeau.py create mode 100644 src/Tools/blocFissure/gmu/identifieElementsDebouchants.py create mode 100644 src/Tools/blocFissure/gmu/identifieElementsFissure.py create mode 100644 src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py create mode 100644 src/Tools/blocFissure/gmu/identifieFacesPeau.py create mode 100644 src/Tools/blocFissure/gmu/partitionneFissureParPipe.py create mode 100644 src/Tools/blocFissure/gmu/restreintFaceFissure.py create mode 100644 src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py diff --git a/src/Tools/blocFissure/CasTests/cubeAngle.py b/src/Tools/blocFissure/CasTests/cubeAngle.py index 579d24140..38d11ea40 100644 --- a/src/Tools/blocFissure/CasTests/cubeAngle.py +++ b/src/Tools/blocFissure/CasTests/cubeAngle.py @@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -41,7 +41,7 @@ class cubeAngle(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure """ @@ -85,9 +85,9 @@ class cubeAngle(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/cubeAngle2.py b/src/Tools/blocFissure/CasTests/cubeAngle2.py index a33fc2acc..b7d31c405 100644 --- a/src/Tools/blocFissure/CasTests/cubeAngle2.py +++ b/src/Tools/blocFissure/CasTests/cubeAngle2.py @@ -13,7 +13,7 @@ class cubeAngle2(cubeAngle): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure """ diff --git a/src/Tools/blocFissure/CasTests/cylindre.py b/src/Tools/blocFissure/CasTests/cylindre.py index 87657a1e6..9885a96a3 100644 --- a/src/Tools/blocFissure/CasTests/cylindre.py +++ b/src/Tools/blocFissure/CasTests/cylindre.py @@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -45,7 +45,7 @@ class cylindre(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure """ @@ -89,9 +89,9 @@ class cylindre(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/cylindre_2.py b/src/Tools/blocFissure/CasTests/cylindre_2.py index e2023fe67..8d83ec103 100644 --- a/src/Tools/blocFissure/CasTests/cylindre_2.py +++ b/src/Tools/blocFissure/CasTests/cylindre_2.py @@ -15,7 +15,7 @@ from cylindre import cylindre from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() diff --git a/src/Tools/blocFissure/CasTests/ellipse_1.py b/src/Tools/blocFissure/CasTests/ellipse_1.py index 00eef0df6..2e39357ae 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_1.py +++ b/src/Tools/blocFissure/CasTests/ellipse_1.py @@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -47,7 +47,7 @@ class ellipse_1(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure convexe : optionnel, True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne @@ -93,9 +93,9 @@ class ellipse_1(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/ellipse_2.py b/src/Tools/blocFissure/CasTests/ellipse_2.py index 15e0c1b60..69ae3ed95 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_2.py +++ b/src/Tools/blocFissure/CasTests/ellipse_2.py @@ -18,7 +18,7 @@ from ellipse_1 import ellipse_1 from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() diff --git a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py index 66f9774bf..1980367f4 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py @@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -41,7 +41,7 @@ class eprouvetteCourbe(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne @@ -87,9 +87,9 @@ class eprouvetteCourbe(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py index 8e08dd8e5..202a96a44 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py @@ -19,7 +19,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -42,7 +42,7 @@ class eprouvetteDroite(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne @@ -89,9 +89,9 @@ class eprouvetteDroite(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py index de55fd25f..8f7808190 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py @@ -18,7 +18,7 @@ from eprouvetteDroite import eprouvetteDroite from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 49e91611d..9936248f3 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -5,8 +5,8 @@ import logging from blocFissure import gmu from blocFissure.gmu import initLog #initLog.setDebug() -#initLog.setVerbose() -initLog.setPerfTests() +initLog.setVerbose() +#initLog.setPerfTests() from blocFissure.gmu import geomsmesh from blocFissure.gmu.casStandard import casStandard @@ -131,7 +131,7 @@ runall = True if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 - torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,] + torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,] for i in range(len(problemes)): if torun[i]: diff --git a/src/Tools/blocFissure/CasTests/faceGauche.py b/src/Tools/blocFissure/CasTests/faceGauche.py index dfb251cc0..890a76ea8 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche.py +++ b/src/Tools/blocFissure/CasTests/faceGauche.py @@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -41,7 +41,7 @@ class faceGauche(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne @@ -87,9 +87,9 @@ class faceGauche(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index cc8a03db8..c9e0e0fbc 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -19,7 +19,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -42,7 +42,7 @@ class faceGauche_2(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne @@ -88,9 +88,9 @@ class faceGauche_2(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/vis_1.py b/src/Tools/blocFissure/CasTests/vis_1.py index fdcb5c94f..cc7c6a1fd 100644 --- a/src/Tools/blocFissure/CasTests/vis_1.py +++ b/src/Tools/blocFissure/CasTests/vis_1.py @@ -18,7 +18,7 @@ from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -41,7 +41,7 @@ class vis_1(fissureGenerique): # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure pour méthode insereFissureGenerale + paramètres de la fissure pour méthode construitFissureGenerale lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne @@ -87,9 +87,9 @@ class vis_1(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/__init__.py b/src/Tools/blocFissure/gmu/__init__.py index 728082fb2..5f144fb6f 100644 --- a/src/Tools/blocFissure/gmu/__init__.py +++ b/src/Tools/blocFissure/gmu/__init__.py @@ -2,9 +2,6 @@ import os import initLog -#initLog.setDebug() -#initLog.setVerbose() -#initLog.setRelease() # --- calcul path blocFissure diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index 9c1ac5505..4bfedef33 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -19,7 +19,7 @@ from blocFissure.gmu.initEtude import initEtude from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale +from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -124,9 +124,9 @@ class casStandard(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/compoundFromList.py b/src/Tools/blocFissure/gmu/compoundFromList.py new file mode 100644 index 000000000..6787b2520 --- /dev/null +++ b/src/Tools/blocFissure/gmu/compoundFromList.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +import logging +from geomsmesh import geompy + +def compoundFromList(elements, nom=None): + """ + + """ + logging.debug('start') + + shapeList = [] + for a in elements: + if not isinstance(a, list): + shapeList.append(a) + else: + if a[0] is not None: + shapeList.append(a[0]) + + if nom is not None: + for i,a in enumerate(shapeList): + nom = nom +"%d"%i + logging.debug('nom: %s',nom) + geompy.addToStudy(a, nom) + + shapeCompound = None + if len(shapeList) > 0: + shapeCompound =geompy.MakeCompound(shapeList) + + return shapeCompound + diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py new file mode 100644 index 000000000..64aad5642 --- /dev/null +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -0,0 +1,937 @@ +# -*- coding: utf-8 -*- + +import logging +import salome +from geomsmesh import geompy +import GEOM +from geomsmesh import smesh +from salome.smesh import smeshBuilder +import SMESH +import math +import bisect + +from extractionOrientee import extractionOrientee +from extractionOrienteeMulti import extractionOrienteeMulti +from sortFaces import sortFaces +from sortEdges import sortEdges +from eliminateDoubles import eliminateDoubles +from substractSubShapes import substractSubShapes +from produitMixte import produitMixte +from findWireEndVertices import findWireEndVertices +from findWireIntermediateVertices import findWireIntermediateVertices +from orderEdgesFromWire import orderEdgesFromWire +from getSubshapeIds import getSubshapeIds +from putName import putName +from distance2 import distance2 +from enleveDefaut import enleveDefaut +from shapeSurFissure import shapeSurFissure +from regroupeSainEtDefaut import RegroupeSainEtDefaut +from triedreBase import triedreBase +from checkDecoupePartition import checkDecoupePartition +from whichSide import whichSide +from whichSideMulti import whichSideMulti +from whichSideVertex import whichSideVertex +from projettePointSurCourbe import projettePointSurCourbe +from prolongeWire import prolongeWire +from restreintFaceFissure import restreintFaceFissure +from partitionneFissureParPipe import partitionneFissureParPipe +from construitPartitionsPeauFissure import construitPartitionsPeauFissure +from compoundFromList import compoundFromList +from identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau + +# ----------------------------------------------------------------------------- +# --- procédure complète fissure générale + +def construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step=-1): + """ + TODO: a completer + """ + logging.info('start') + + shapeDefaut = shapesFissure[0] # faces de fissure, débordant + fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure + + rayonPipe = shapeFissureParams['rayonPipe'] + if shapeFissureParams.has_key('lenSegPipe'): + lenSegPipe = shapeFissureParams['lenSegPipe'] + else: + lenSegPipe = rayonPipe + + nomRep = maillageFissureParams['nomRep'] + nomFicSain = maillageFissureParams['nomFicSain'] + nomFicFissure = maillageFissureParams['nomFicFissure'] + + nbsegRad = maillageFissureParams['nbsegRad'] # nombre de couches selon un rayon du pipe + nbsegCercle = maillageFissureParams['nbsegCercle'] # nombre de secteur dans un cercle du pipe + areteFaceFissure = maillageFissureParams['areteFaceFissure'] + + pointIn_x = 0.0 + pointIn_y = 0.0 + pointIn_z = 0.0 + isPointInterne = False + if shapeFissureParams.has_key('pointIn_x'): + pointIn_x = shapeFissureParams['pointIn_x'] + isPointInterne = True + if shapeFissureParams.has_key('pointIn_y'): + pointIn_y = shapeFissureParams['pointIn_y'] + isPointInterne = True + if shapeFissureParams.has_key('pointIn_z'): + pointIn_z = shapeFissureParams['pointIn_z'] + isPointInterne = True + if isPointInterne: + pointInterne = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z) + else: + pointInterne = None + + #fichierMaillageSain = nomRep + '/' + nomFicSain + '.med' + fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med' + + # fillings des faces en peau + facesDefaut = elementsDefaut[0] + #centresDefaut = elementsDefaut[1] + #normalsDefaut = elementsDefaut[2] + #extrusionsDefaut = elementsDefaut[3] + dmoyen = elementsDefaut[4] + bordsPartages = elementsDefaut[5] + fillconts = elementsDefaut[6] + idFilToCont = elementsDefaut[7] + maillageSain = elementsDefaut[8] + internalBoundary = elementsDefaut[9] + zoneDefaut = elementsDefaut[10] + zoneDefaut_skin = elementsDefaut[11] + zoneDefaut_internalFaces = elementsDefaut[12] + zoneDefaut_internalEdges = elementsDefaut[13] + edgeFondExt = elementsDefaut[14] + centreFondFiss = elementsDefaut[15] + tgtCentre = elementsDefaut[16] + + O, OX, OY, OZ = triedreBase() + + # --- restriction de la face de fissure au domaine solide : + # partition face fissure étendue par fillings, on garde la face interne + + facesPortFissure = restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne) + + # --- pipe de fond de fissure, prolongé, partition face fissure par pipe + # identification des edges communes pipe et face fissure + + (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe) + edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss) + for i,edge in enumerate(edgesFondFiss): + geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i) + + # --- peau et face de fissure + # + # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée + # il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure + # liste de faces externes : facesDefaut + # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection) + + partitionsPeauFissFond = construitPartitionsPeauFissure(facesDefaut, fissPipe) + + # --- arêtes vives détectées (dans quadranglesToShapeNoCorner + # et quadranglesToShapeWithCorner) + + aretesVivesCoupees = [] #= global + + aretesVivesC = compoundFromList(bordsPartages, "areteVive") + + # ------------------------------------------------------- + # --- inventaire des faces de peau coupées par la fissure + # pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure + # 0, 1 ou plus edges de la face de fissure externe au pipe + + nbFacesFilling = len(partitionsPeauFissFond) + + ptEdgeFond = [ [] for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe] + fsPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] + edRadFPiPo = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] + fsFissuExt = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe] + edFisExtPe = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)] + edFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes] + facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) + edCircPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] + ptCircPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] + gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine + gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings + edFissPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] + ptFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau] + + for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond): + if partitionPeauFissFond is not None: + dataPPFF,aretesVivesCoupees = identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, + edgesFondFiss, wireFondFiss, aretesVivesC, + facesDefaut, centreFondFiss, rayonPipe, + aretesVivesCoupees) + + ptEdgeFond[ifil] = dataPPFF['endsEdgeFond'] + fsPipePeau[ifil] = dataPPFF['facesPipePeau'] + edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau'] + fsFissuExt[ifil] = dataPPFF['facesFissExt'] + edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau'] + edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe'] + facesPeaux[ifil] = dataPPFF['facePeau'] + edCircPeau[ifil] = dataPPFF['edgesCircPeau'] + ptCircPeau[ifil] = dataPPFF['verticesCircPeau'] + gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau'] + gpedgeVifs[ifil] = dataPPFF['bordsVifs'] + edFissPeau[ifil] = dataPPFF['edgesFissurePeau'] + ptFisExtPi[ifil] = dataPPFF['verticesPipePeau'] + + # ----------------------------------------------------------------------- + # fin de la boucle sur les faces de filling + # ----------------------------------------------------------------------- + + for i, avc in enumerate(aretesVivesCoupees): + name = "areteViveCoupee%d"%i + geompy.addToStudy(avc, name) + + # --- identification des faces et edges de fissure externe pour maillage + + facesFissExt = [] + edgesFissExtPeau = [] + edgesFissExtPipe = [] + for ifil in range(nbFacesFilling): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?) + facesFissExt += fsFissuExt[ifil] + edgesFissExtPeau += edFisExtPe[ifil] + edgesFissExtPipe += edFisExtPi[ifil] + logging.debug("---------------------------- identification faces de fissure externes au pipe :%s ", len(facesFissExt)) + # regroupement des faces de fissure externes au pipe. + + if len(facesFissExt) > 1: + faceFissureExterne = geompy.MakePartition(facesFissExt, [], [], [], geompy.ShapeType["FACE"], 0, [], 0) + edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss)) # edgesFissExtPipe peut ne pas couvrir toute la longueur + # edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau)) + # il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau + (isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne) + edgesBordFFE = [] + for bound in closedFreeBoundaries: + edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False) + edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE] + logging.debug("edgesBordFFEid %s", edgesBordFFEid) + edgesPPE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) + edgesPPEid = [ geompy.GetSubShapeID(faceFissureExterne, ed) for ed in edgesPPE] + logging.debug("edgesPPEid %s", edgesPPEid) + edgesPFE = [ edid[0] for edid in edgesBordFFEid if edid[1] not in edgesPPEid] # on garde toutes les edges de bord non en contact avec le pipe + logging.debug("edgesPFE %s", edgesPFE) + edgesPeauFissureExterneC = geompy.MakeCompound(edgesPFE) + else: + faceFissureExterne = facesFissExt[0] + edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau) + edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe) + wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)) + geompy.addToStudy(faceFissureExterne, "faceFissureExterne") + geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") + geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") + + logging.debug("---------------------------- Preparation Maillage du Pipe --------------") + # ----------------------------------------------------------------------- + # --- preparation maillage du pipe : + # - détections des points a respecter : jonction des edges/faces constituant + # la face de fissure externe au pipe + # - points sur les edges de fond de fissure et edges pipe/face fissure, + # - vecteurs tangents au fond de fissure (normal au disque maillé) + + # --- option de maillage selon le rayon de courbure du fond de fissure + lenEdgeFondExt = 0 + for edff in edgesFondFiss: + lenEdgeFondExt += geompy.BasicProperties(edff)[0] + + disfond = [] + for filling in facesDefaut: + disfond.append(geompy.MinDistance(centreFondFiss, filling)) + disfond.sort() + rcourb = disfond[0] + nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle + alpha = math.pi/(4*nbSegQuart) + deflexion = rcourb*(1.0 -math.cos(alpha)) + lgmin = lenSegPipe*0.25 + lgmax = lenSegPipe*1.5 + logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax) + + meshFondExt = smesh.Mesh(wireFondFiss) + algo1d = meshFondExt.Segment() + hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure + isDone = meshFondExt.Compute() + + ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique + allNodeIds = meshFondExt.GetNodesId() + for nodeId in allNodeIds: + xyz = meshFondExt.GetNodeXYZ(nodeId) + #logging.debug("nodeId %s, coords %s", nodeId, str(xyz)) + pt = geompy.MakeVertex(xyz[0], xyz[1], xyz[2]) + u, PointOnEdge, EdgeInWireIndex = geompy.MakeProjectionOnWire(pt, wireFondFiss) # u compris entre 0 et 1 + edgeOrder = edgesIdByOrientation[EdgeInWireIndex] + ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt + #logging.debug("nodeId %s, u %s", nodeId, str(u)) + usort = sorted(ptGSdic) + logging.debug("nombre de points obtenus par deflexion %s",len(usort)) + + centres = [] + origins = [] + normals = [] + for edu in usort: + ied = edu[1] + u = edu[2] + vertcx = ptGSdic[edu] + norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u) + plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe) + part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0) + liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True) + if len(liste) == 5: # 4 coins du plan plus intersection recherchée + for point in liste: + if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin + vertpx = point + break + centres.append(vertcx) + origins.append(vertpx) + normals.append(norm) +# name = "vertcx%d"%i +# geompy.addToStudyInFather(wireFondFiss, vertcx, name) +# name = "vertpx%d"%i +# geompy.addToStudyInFather(wireFondFiss, vertpx, name) +# name = "plan%d"%i +# geompy.addToStudyInFather(wireFondFiss, plan, name) + + # --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau + + logging.debug("nbsegCercle %s", nbsegCercle) + + # ----------------------------------------------------------------------- + # --- points géométriques + + gptsdisks = [] # vertices géométrie de tous les disques + raydisks = [[] for i in range(nbsegCercle)] + for i in range(len(centres)): # boucle sur les disques + gptdsk = [] # vertices géométrie d'un disque + vertcx = centres[i] + vertpx = origins[i] + normal = normals[i] + vec1 = geompy.MakeVector(vertcx, vertpx) + + points = [vertcx] # les points du rayon de référence + for j in range(nbsegRad): + pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*float(rayonPipe)/nbsegRad) + points.append(pt) + gptdsk.append(points) + pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe) + rayon = geompy.MakeLineTwoPnt(vertcx, pt) + raydisks[0].append(rayon) + + for k in range(nbsegCercle-1): + angle = (k+1)*2*math.pi/nbsegCercle + pts = [vertcx] # les points d'un rayon obtenu par rotation + for j in range(nbsegRad): + pt = geompy.MakeRotation(points[j+1], normal, angle) + pts.append(pt) + gptdsk.append(pts) + ray = geompy.MakeRotation(rayon, normal, angle) + raydisks[k+1].append(ray) + + gptsdisks.append(gptdsk) + + # ----------------------------------------------------------------------- + # --- recherche des points en trop (externes au volume à remailler) + # - on associe chaque extrémité du pipe à une face filling + # - on part des disques aux extrémités du pipe + # - pour chaque disque, on prend les vertices de géométrie, + # on marque leur position relative à la face. + # - on s'arrete quand tous les noeuds sont dedans + + logging.debug("---------------------------- recherche des points du pipe a éliminer --------------") + + pt0 = centres[0] + pt1 = centres[-1] + idFillingFromBout = [None, None] # contiendra l'index du filling pour les extrémités 0 et 1 + for ifil in range(nbFacesFilling): + for ipt, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face + if geompy.MinDistance(pt,pt0) < geompy.MinDistance(pt,pt1): # TODO: trouver plus fiable pour les cas tordus... + idFillingFromBout[0] = ifil + else: + idFillingFromBout[1] = ifil + logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout) + + facesPipePeau = [] + edgeRadFacePipePeau = [] + for ifil in range(nbFacesFilling): + facesPipePeau += fsPipePeau[ifil] + edgeRadFacePipePeau += edRadFPiPo[ifil] + + logging.debug("recherche des disques de noeuds complètement internes") + idisklim = [] # indices des premier et dernier disques internes + idiskout = [] # indices des premier et dernier disques externes + for bout in range(2): + if bout == 0: + idisk = -1 + inc = 1 + numout = -1 + else: + idisk = len(gptsdisks) + inc = -1 + numout = len(gptsdisks) + inside = False + outside = True + while not inside: + idisk = idisk + inc + logging.debug("examen disque %s", idisk) + gptdsk = gptsdisks[idisk] + inside = True + for k in range(nbsegCercle): + points = gptdsk[k] + for j, pt in enumerate(points): + side = whichSideVertex(facesDefaut[idFillingFromBout[bout]], pt) + if side < 0: + if outside: # premier point detecté dedans + outside = False + numout = idisk -inc # le disque précédent était dehors + else: + inside = False # ce point est dehors + if not inside and not outside: + break + idisklim.append(idisk) # premier et dernier disques internes + idiskout.append(numout) # premier et dernier disques externes + + # --- listes de nappes radiales en filling à chaque extrémité débouchante + facesDebouchantes = [False, False] + idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau) + listNappes =[] + for i, idisk in enumerate(idisklim): + numout = idiskout[i] + logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout) + nappes = [] + if (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante + for k in range(nbsegCercle): + if i == 0: + iddeb = max(0, numout) + idfin = max(iddeb+3,idisk+1) # il faut 3 rayons pour faire un filling qui suive le fond de fissure + #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) + comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) + name='compoundRay%d'%k + geompy.addToStudy(comp, name) + else: + idfin = min(len(gptsdisks), numout+1) + iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure + #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) + comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) + name='compoundRay%d'%k + geompy.addToStudy(comp, name) + nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default) + nappes.append(nappe) + name='nappe%d'%k + geompy.addToStudy(nappe, name) + facesDebouchantes[i] = True + listNappes.append(nappes) + + # --- mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau) + for i, nappes in enumerate(listNappes): + if facesDebouchantes[i]: + for k, face in enumerate(facesPipePeau): + edge = geompy.MakeSection(face, nappes[0]) + if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0: + idFacesDebouchantes[i] = k + break + logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes) + + # --- construction des listes d'edges radiales sur chaque extrémité débouchante + listEdges = [] + for i, nappes in enumerate(listNappes): + id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) + if id < 0: + listEdges.append([]) + else: + face = facesPipePeau[id] + edges = [edgeRadFacePipePeau[id]] + for k, nappe in enumerate(nappes): + if k > 0: + obj = geompy.MakeSection(face, nappes[k]) # normalement une edge, parfois un compound d'edges dont un tout petit + edge = obj + vs = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False) + if len(vs) > 2: + eds = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False) + [edsorted, minl,maxl] = sortEdges(eds) + edge = edsorted[-1] + else: + maxl = geompy.BasicProperties(edge)[0] + if maxl < 0.01: # problème MakeSection + logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl) + partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0) + edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False) + ednouv = [] + for ii, ed in enumerate(edps): + vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False) + distx = [geompy.MinDistance(vx, face) for vx in vxs] + distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs] + dmax = max(distx) + logging.debug(" dmax %s",dmax) + if dmax < 0.01: + ednouv.append(ed) + logging.debug(" edges issues de la partition: %s", ednouv) + for ii, ed in enumerate(ednouv): + geompy.addToStudy(ed, "ednouv%d"%ii) + [edsorted, minl,maxl] = sortEdges(ednouv) + logging.debug(" longueur edge trouvée: %s", maxl) + edge = edsorted[-1] + edges.append(edge) + name = 'edgeEndPipe%d'%k + geompy.addToStudy(edge, name) + listEdges.append(edges) + + # --- création des points du maillage du pipe sur la face de peau + for i, edges in enumerate(listEdges): + id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) + if id >= 0: + gptdsk = [] + if id > 0: # id vaut 0 ou 1 + id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) + centre = ptEdgeFond[idFillingFromBout[i]][id] + name = "centre%d"%id + geompy.addToStudy(centre, name) + vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id] + geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau") + grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes + edgesCirc = [] + for grpEdgesCirc in grpsEdgesCirc: + edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False) + for k, edge in enumerate(edges): + extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True) + if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]): + bout = extrems[1] + else: + bout = extrems[0] + # ajustement du point extrémité (bout) sur l'edge circulaire en face de peau + logging.debug("edgesCirc: %s", edgesCirc) + distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)] + distEdgeCirc.sort() + logging.debug("distEdgeCirc: %s", distEdgeCirc) + u = projettePointSurCourbe(bout, distEdgeCirc[0][2]) + if (abs(u) < 0.02) or (abs(1-u) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément. + extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True) + if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]): + bout = extrCircs[0] + else: + bout = extrCircs[1] + pass + else: + bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u) + name ="bout%d"%k + geompy.addToStudyInFather(centre, bout, name) + # enregistrement des points dans la structure + points = [] + for j in range(nbsegRad +1): + u = j/float(nbsegRad) + points.append(geompy.MakeVertexOnCurve(edge, u)) + if geompy.MinDistance(bout, points[0]) < geompy.MinDistance(centre, points[0]): + points.reverse() + points[0] = centre + points[-1] = bout + gptdsk.append(points) + if i == 0: + gptsdisks[idisklim[0] -1] = gptdsk + idisklim[0] = idisklim[0] -1 + else: + gptsdisks[idisklim[1] +1] = gptdsk + idisklim[1] = idisklim[1] +1 + + # --- ajustement precis des points sur edgesPipeFissureExterneC + + edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) + verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe) + idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté + idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté + idiskint = [] + for vtx in verticesPFE: + distPtVt = [] + for idisk in range(idiskmin, idiskmax): + gptdsk = gptsdisks[idisk] + pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe + distPtVt.append((geompy.MinDistance(pt, vtx), idisk)) + distPtVt.sort() + idiskint.append(distPtVt[0][1]) + gptsdisks[idiskint[-1]][0][-1] = vtx + logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0]) + for idisk in range(idiskmin, idiskmax): + if idisk in idiskint: + break + logging.debug("ajustement point sur edgePipeFissureExterne: %s", idisk) + gptdsk = gptsdisks[idisk] + pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe + distPtEd = [(geompy.MinDistance(pt, edgePFE), k, edgePFE) for k, edgePFE in enumerate(edgesPFE)] + distPtEd.sort() + edgePFE = distPtEd[0][2] + u = projettePointSurCourbe(pt, edgePFE) + ptproj = geompy.MakeVertexOnCurve(edgePFE, u) + gptsdisks[idisk][0][-1] = ptproj + + # ----------------------------------------------------------------------- + # --- maillage effectif du pipe + + logging.debug("---------------------------- maillage effectif du pipe --------------") + meshPipe = smesh.Mesh(None, "meshPipe") + fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS") + nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis") + faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi") + edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss") + edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0") + edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1") + faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0") + faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1") + mptsdisks = [] # vertices maillage de tous les disques + mEdges = [] # identifiants edges maillage fond de fissure + mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe + mFaces = [] # identifiants faces maillage fissure + mVols = [] # identifiants volumes maillage pipe + + mptdsk = None + for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes + + # ----------------------------------------------------------------------- + # --- points + + gptdsk = gptsdisks[idisk] + if idisk > idisklim[0]: + oldmpts = mptdsk + mptdsk = [] # vertices maillage d'un disque + for k in range(nbsegCercle): + points = gptdsk[k] + mptids = [] + for j, pt in enumerate(points): + if j == 0 and k > 0: + id = mptdsk[0][0] + else: + coords = geompy.PointCoordinates(pt) + id = meshPipe.AddNode(coords[0], coords[1], coords[2]) + mptids.append(id) + mptdsk.append(mptids) + mptsdisks.append(mptdsk) + + # ----------------------------------------------------------------------- + # --- groupes edges cercles debouchants + + if idisk == idisklim[0]: + pts = [] + for k in range(nbsegCercle): + pts.append(mptdsk[k][-1]) + edges = [] + for k in range(len(pts)): + k1 = (k+1)%len(pts) + idEdge = meshPipe.AddEdge([pts[k], pts[k1]]) + edges.append(idEdge) + edgeCircPipe0Group.Add(edges) + + if idisk == idisklim[1]: + pts = [] + for k in range(nbsegCercle): + pts.append(mptdsk[k][-1]) + edges = [] + for k in range(len(pts)): + k1 = (k+1)%len(pts) + idEdge = meshPipe.AddEdge([pts[k], pts[k1]]) + edges.append(idEdge) + edgeCircPipe1Group.Add(edges) + + # ----------------------------------------------------------------------- + # --- groupes faces debouchantes + + if idisk == idisklim[0]: + faces = [] + for j in range(nbsegRad): + for k in range(nbsegCercle): + k1 = k+1 + if k == nbsegCercle-1: + k1 = 0 + if j == 0: + idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle + else: + idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle + faces.append(idf) + faceCircPipe0Group.Add(faces) + + if idisk == idisklim[1]: + faces = [] + for j in range(nbsegRad): + for k in range(nbsegCercle): + k1 = k+1 + if k == nbsegCercle-1: + k1 = 0 + if j == 0: + idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle + else: + idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle + faces.append(idf) + faceCircPipe1Group.Add(faces) + + # ----------------------------------------------------------------------- + # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure + + if idisk == idisklim[0]: + mEdges.append(0) + mEdgeFaces.append(0) + mFaces.append([0]) + mVols.append([[0]]) + nodesFondFissGroup.Add([mptdsk[0][0]]) + else: + ide = meshPipe.AddEdge([oldmpts[0][0], mptdsk[0][0]]) + mEdges.append(ide) + fondFissGroup.Add([ide]) + nodesFondFissGroup.Add([mptdsk[0][0]]) + ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]]) + mEdgeFaces.append(ide2) + edgeFaceFissGroup.Add([ide2]) + idFaces = [] + idVols = [] + + for j in range(nbsegRad): + idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]]) + faceFissGroup.Add([idf]) + idFaces.append(idf) + + idVolCercle = [] + for k in range(nbsegCercle): + k1 = k+1 + if k == nbsegCercle-1: + k1 = 0 + if j == 0: + idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], + oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1]]) + else: + idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j], + oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1], oldmpts[k1][j]]) + idVolCercle.append(idv) + idVols.append(idVolCercle) + + mFaces.append(idFaces) + mVols.append(idVols) + + pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' ) + nbAdd = pipeFissGroup.AddFrom( meshPipe.GetMesh() ) + + nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries") + edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group] + + # --- fin du maillage du pipe + # ----------------------------------------------------------------------- + # --- edges de bord, faces défaut à respecter + + aFilterManager = smesh.CreateFilterManager() + nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ]) + criteres = [] + unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0) + criteres.append(unCritere) + filtre = smesh.GetFilterFromCriteria(criteres) + bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre ) + smesh.SetName(bordsLibres, 'bordsLibres') + + # --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes + # on désigne les faces de peau en quadrangles par le groupe "skinFaces" + + skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' ) + nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() ) + + # --- maillage des éventuelles arêtes vives entre faces reconstruites + + if len(aretesVivesCoupees) > 0: + aretesVivesC = geompy.MakeCompound(aretesVivesCoupees) + meshAretesVives = smesh.Mesh(aretesVivesC) + algo1d = meshAretesVives.Segment() + hypo1d = algo1d.LocalLength(dmoyen,[],1e-07) + putName(algo1d.GetSubMesh(), "aretesVives") + putName(algo1d, "algo1d_aretesVives") + putName(hypo1d, "hypo1d_aretesVives") + isDone = meshAretesVives.Compute() + logging.info("aretesVives fini") + grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' ) + nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() ) + + # ----------------------------------------------------------------------- + # --- maillage faces de fissure + + logging.debug("---------------------------- maillage faces de fissure externes au pipe :%s --------------", len(facesFissExt)) + + meshFaceFiss = smesh.Mesh(faceFissureExterne) + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( areteFaceFissure ) + hypo2d.SetSecondOrder( 0 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) + putName(algo2d.GetSubMesh(), "faceFiss") + putName(algo2d, "algo2d_faceFiss") + putName(hypo2d, "hypo2d_faceFiss") + + algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) + hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0) + putName(algo1d.GetSubMesh(), "edgeFissPeau") + putName(algo1d, "algo1d_edgeFissPeau") + putName(hypo1d, "hypo1d_edgeFissPeau") + + isDone = meshFaceFiss.Compute() + logging.info("meshFaceFiss fini") + + grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE) + grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE) + grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) + + # --- maillage faces de peau + + boutFromIfil = [None for i in range(nbFacesFilling)] + if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes + boutFromIfil[idFillingFromBout[0]] = 0 + boutFromIfil[idFillingFromBout[1]] = 1 + + logging.debug("---------------------------- maillage faces de peau --------------") + meshesFacesPeau = [] + for ifil in range(nbFacesFilling): + meshFacePeau = None + if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte + + # --- edges de bord de la face de filling + filling = facesDefaut[ifil] + edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) + groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) + geompy.UnionList(groupEdgesBordPeau, edgesFilling) + geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords") + + meshFacePeau = smesh.Mesh(facesDefaut[ifil]) + + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(algo1d.GetSubMesh(), "bordsLibres", ifil) + putName(algo1d, "algo1d_bordsLibres", ifil) + putName(hypo1d, "hypo1d_bordsLibres", ifil) + + else: + + facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) + edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] + verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] + groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine + bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives + edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] + + meshFacePeau = smesh.Mesh(facePeau) + + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(algo1d.GetSubMesh(), "bordsLibres", ifil) + putName(algo1d, "algo1d_bordsLibres", ifil) + putName(hypo1d, "hypo1d_bordsLibres", ifil) + + algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau)) + hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) + putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil) + putName(algo1d, "algo1d_edgePeauFiss", ifil) + putName(hypo1d, "hypo1d_edgePeauFiss", ifil) + + if bordsVifs is not None: + algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) + hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) + putName(algo1d.GetSubMesh(), "bordsVifs", ifil) + putName(algo1d, "algo1d_bordsVifs", ifil) + putName(hypo1d, "hypo1d_bordsVifs", ifil) + + for i, edgeCirc in enumerate(edgesCircPeau): + if edgeCirc is not None: + algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) + if boutFromIfil[ifil] is None: + hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i] ],0,0) + else: + hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) + name = "cercle%d"%i + putName(algo1d.GetSubMesh(), name, ifil) + putName(algo1d, "algo1d_" + name, ifil) + putName(hypo1d, "hypo1d_" + name, ifil) + + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( dmoyen ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) + putName(algo2d.GetSubMesh(), "facePeau", ifil) + putName(algo2d, "algo2d_facePeau", ifil) + putName(hypo2d, "hypo2d_facePeau", ifil) + + isDone = meshFacePeau.Compute() + logging.info("meshFacePeau %d fini", ifil) + GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) + nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) + meshesFacesPeau.append(meshFacePeau) + + # --- regroupement des maillages du défaut + + listMeshes = [internalBoundary.GetMesh(), + meshPipe.GetMesh(), + meshFaceFiss.GetMesh()] + for mp in meshesFacesPeau: + listMeshes.append(mp.GetMesh()) + + meshBoiteDefaut = smesh.Concatenate(listMeshes, 1, 1, 1e-05,False) + # pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes + # on désigne les faces de peau en quadrangles par le groupe "skinFaces" + group_faceFissOutPipe = None + group_faceFissInPipe = None + groups = meshBoiteDefaut.GetGroups() + for grp in groups: + if grp.GetType() == SMESH.FACE: + #if "internalBoundary" in grp.GetName(): + # grp.SetName("skinFaces") + if grp.GetName() == "fisOutPi": + group_faceFissOutPipe = grp + elif grp.GetName() == "fisInPi": + group_faceFissInPipe = grp + + # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D + distene=True + if distene: + algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D) + else: + algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN) + hypo3d = algo3d.MaxElementVolume(1000.0) + putName(algo3d.GetSubMesh(), "boiteDefaut") + putName(algo3d, "algo3d_boiteDefaut") + isDone = meshBoiteDefaut.Compute() + putName(meshBoiteDefaut, "boiteDefaut") + logging.info("meshBoiteDefaut fini") + + faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' ) + maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, + zoneDefaut_internalFaces, zoneDefaut_internalEdges) + putName(maillageSain, nomFicSain+"_coupe") + extrusionFaceFissure, normfiss = shapeSurFissure(facesPortFissure) + maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, + None, None, 'COMPLET', normfiss) + + logging.info("conversion quadratique") + maillageComplet.ConvertToQuadratic( 1 ) + logging.info("groupes") + groups = maillageComplet.GetGroups() + grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS'] + fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' ) + + logging.info("réorientation face de fissure FACE1") + grps = [ grp for grp in groups if grp.GetName() == 'FACE1'] + nb = maillageComplet.Reorient2D( grps[0], normfiss, grps[0].GetID(1)) + + logging.info("réorientation face de fissure FACE2") + plansim = geompy.MakePlane(O, normfiss, 10000) + fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim) + grps = [ grp for grp in groups if grp.GetName() == 'FACE2'] + nb = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1)) + fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' ) + + logging.info("export maillage fini") + maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 ) + putName(maillageComplet, nomFicFissure) + logging.info("fichier maillage fissure %s", fichierMaillageFissure) + + if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) + + logging.info("maillage fissure fini") + + return maillageComplet diff --git a/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py new file mode 100644 index 000000000..05430c750 --- /dev/null +++ b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import logging +from geomsmesh import geompy +from checkDecoupePartition import checkDecoupePartition + + # ----------------------------------------------------------------------------- + # --- peau et face de fissure + # + # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée + # il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure + # liste de faces externes : facesDefaut + # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection) + +def construitPartitionsPeauFissure(facesDefaut, fissPipe): + """ + partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée. + Il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure. + @param facesDefaut liste de faces externes + @param fissPipe partition face de fissure etendue par pipe prolongé + @return partitionsPeauFissFond : liste de partitions face externe - fissure (None quand pas d'intersection) + """ + + logging.info('start') + partitionsPeauFissFond = [] + ipart = 0 + for filling in facesDefaut: + part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) + isPart = checkDecoupePartition([fissPipe, filling], part) + if isPart: # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte + otherFD = [fd for fd in facesDefaut if fd != filling] + if len(otherFD) > 0: + fissPipePart = geompy.MakePartition([fissPipe], otherFD, [], [], geompy.ShapeType["FACE"], 0, [], 0) + else: + fissPipePart = fissPipe + part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) + partitionsPeauFissFond.append(part) + geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart ) + else: + partitionsPeauFissFond.append(None) + ipart = ipart +1 + + return partitionsPeauFissFond \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index 0490611aa..fdeb69ab2 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -16,7 +16,7 @@ from fissureGenerique import fissureGenerique from triedreBase import triedreBase from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from insereFissureGenerale import insereFissureGenerale +from construitFissureGenerale import construitFissureGenerale from sortEdges import sortEdges O, OX, OY, OZ = triedreBase() @@ -651,9 +651,9 @@ class fissureCoude(fissureGenerique): def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams, elementsDefaut, step): - maillageFissure = insereFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissure = construitFissureGenerale(maillagesSains, + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/getCentreFondFiss.py b/src/Tools/blocFissure/gmu/getCentreFondFiss.py index 6c04d3627..f8f53d7ba 100644 --- a/src/Tools/blocFissure/gmu/getCentreFondFiss.py +++ b/src/Tools/blocFissure/gmu/getCentreFondFiss.py @@ -9,14 +9,14 @@ publie = False def getCentreFondFiss(shapesFissure): """ identification du centre de fond de fissure, - transformation fond de fissure en edge unique (seulement pour la procédure insereFissureGenerale). + transformation fond de fissure en edge unique (seulement pour la procédure construitFissureGenerale). On distingue le cas d'utilisation de la procédure insereFissureLongue par le nombre d'éléments de shapesFissure. """ global publie logging.debug("start") fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure - if len(shapesFissure) == 6: # procédure insereFissureGenerale, et edge fond de fissure fournie explicitement + if len(shapesFissure) == 6: # procédure construitFissureGenerale, et edge fond de fissure fournie explicitement edgeFondExt = shapesFissure[5] else: edgeFondExt = None @@ -24,7 +24,7 @@ def getCentreFondFiss(shapesFissure): if len(shapesFissure) > 6: # procédure insereFissureLongue (fissure plane, plusieurs edges sur le fond de fissure) centreFondFiss = shapesFissure[1] tgtCentre = None - else: # procédure insereFissureGenerale, détermination edge unique et milieu de l'edge + else: # procédure construitFissureGenerale, détermination edge unique et milieu de l'edge if geompy.NumberOfEdges(fondFiss) > 1: if geompy.NbShapes(fondFiss, geompy.ShapeType["WIRE"]) > 0: # wire aWire = fondFiss diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py new file mode 100644 index 000000000..ff138f329 --- /dev/null +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from substractSubShapes import substractSubShapes + +def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSorted, + edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees): + """ + identification précise des edges et disques des faces de peau selon index extremité fissure + """ + logging.info('start') + + facesPipePeau = [None for i in range(len(edgesFissExtPipe))] + endsEdgeFond = [None for i in range(len(edgesFissExtPipe))] + edgeRadFacePipePeau = [None for i in range(len(edgesFissExtPipe))] + + edgesListees = [] + edgesCircPeau = [] + verticesCircPeau = [] + if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau + + for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau + logging.debug("examen face debouchante circulaire") + for i,efep in enumerate(edgesFissExtPipe): + dist = geompy.MinDistance(face, efep) + logging.debug(" distance face circulaire edge %s", dist) + if dist < 1e-3: + for ik, edpfi in enumerate(edgesPeauFondIn): + if geompy.MinDistance(face, edpfi) < 1e-3: + break + sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[ik]], geompy.ShapeType["VERTEX"]) + nameFace = "facePipePeau%d"%i + nameVert = "endEdgeFond%d"%i + nameEdge = "edgeRadFacePipePeau%d"%i + facesPipePeau[i] = face + endsEdgeFond[i] = sharedVertices[0] + geompy.addToStudy(face, nameFace) + geompy.addToStudy(sharedVertices[0], nameVert) + edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True) + for edge in edgesFace: + if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3: + edgeRadFacePipePeau[i] = edge + geompy.addToStudy(edge, nameEdge) + break + pass + pass + pass + pass + + # --- edges circulaires de la face de peau et points de jonction de la face externe de fissure + logging.debug("facesPipePeau: %s", facesPipePeau) + edgesCircPeau = [None for i in range(len(facesPipePeau))] + verticesCircPeau = [None for i in range(len(facesPipePeau))] + for i,fcirc in enumerate(facesPipePeau): + edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"]) + grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"]) + geompy.UnionList(grpEdgesCirc, edges) + edgesCircPeau[i] = grpEdgesCirc + name = "edgeCirc%d"%i + geompy.addToStudyInFather(facePeau, grpEdgesCirc, name) + edgesListees = edgesListees + edges + vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"]) + grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"]) + geompy.UnionList(grpVertCircPeau, vertices) + verticesCircPeau[i] = grpVertCircPeau + name = "pointEdgeCirc%d"%i + geompy.addToStudyInFather(facePeau, grpVertCircPeau, name) + pass + pass # --- au moins une extrémité du pipe sur cette face de peau + + # --- edges de bord de la face de peau + + edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False) + edgesBords = [] + for i, edge in enumerate(edgesFilling): + edgepeau = geompy.GetInPlace(facePeau, edge) + name = "edgepeau%d"%i + geompy.addToStudyInFather(facePeau,edgepeau, name) + logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau)) + if geompy.ShapeInfo(edgepeau)['EDGE'] > 1: + logging.debug(" EDGES multiples") + edgs = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False) + edgesBords += edgs + edgesListees += edgs + else: + logging.debug(" EDGE") + edgesBords.append(edgepeau) + edgesListees.append(edgepeau) + groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"]) + geompy.UnionList(groupEdgesBordPeau, edgesBords) + bordsVifs = None + if aretesVivesC is not None: + bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC) + if bordsVifs is not None: + geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs") + groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs) + grptmp = None + if len(aretesVivesCoupees) > 0: + grpC = geompy.MakeCompound(aretesVivesCoupees) + grptmp = geompy.GetInPlace(facePeau, grpC) + if grptmp is not None: + grpnew = geompy.CutGroups(bordsVifs, grptmp) # ce qui est nouveau dans bordsVifs + else: + grpnew = bordsVifs + if grpnew is not None: + edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False) + aretesVivesCoupees += edv + logging.debug("aretesVivesCoupees %s",aretesVivesCoupees) + geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords") + + # --- edges de la face de peau partagées avec la face de fissure + + edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False) + edges = substractSubShapes(facePeau, edgesPeau, edgesListees) + edgesFissurePeau = [] + if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau + edgesFissurePeau = [None for i in range(len(verticesCircPeau))] # edges associés aux extrémités du pipe, en premier + for edge in edges: + for i, grpVert in enumerate(verticesCircPeau): + if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau): + edgesFissurePeau[i] = edge + name = "edgeFissurePeau%d"%i + geompy.addToStudyInFather(facePeau, edge, name) + for edge in edges: # on ajoute après les edges manquantes + if edge not in edgesFissurePeau: + edgesFissurePeau.append(edge) + else: + for i, edge in enumerate(edges): + edgesFissurePeau.append(edge) + name = "edgeFissurePeau%d"%i + geompy.addToStudyInFather(facePeau, edge, name) + + return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, + edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, + bordsVifs, edgesFissurePeau) diff --git a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py new file mode 100644 index 000000000..4f6de333c --- /dev/null +++ b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- + +import logging +import math + +from geomsmesh import geompy + +from produitMixte import produitMixte +from whichSide import whichSide + +def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, + edgesFondIn, edgesFondFiss, wireFondFiss, + aretesVivesC, fillingFaceExterne, + edgesPipeIn, verticesPipePeau, rayonPipe, + facesInside, facesOnside): + """ + elements débouchants (intersection pipe et peau), indexés selon les edges du fond de fissure (edgesFondIn) + """ + + logging.info('start') + + verticesEdgesFondIn = [] # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn) + pipexts = [] # les segments de pipe associés au points de fond de fissure débouchants (même indice) + cercles = [] # les cercles de generation des pipes débouchant (même indice) + facesFissExt = [] # les faces de la fissure externe associés au points de fond de fissure débouchants (même indice) + edgesFissExtPeau = [] # edges des faces de fissure externe sur la peau (même indice) + edgesFissExtPipe = [] # edges des faces de fissure externe sur le pipe (même indice) + + #logging.debug("edgesFondIn %s", edgesFondIn) + for iedf, edge in enumerate(edgesFondIn): + name = "edgeFondIn%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, edge, name) + dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau] + ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge + [u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss) + logging.debug("u:%s, EdgeInWireIndex: %s, len(edgesFondFiss): %s", u, EdgeInWireIndex, len(edgesFondFiss)) + localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex] + centre = PointOnEdge + centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u) + geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf) + verticesEdgesFondIn.append(centre) + name = "verticeEdgesFondIn%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, centre, name) + norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u) + geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf) + cercle = geompy.MakeCircle(centre, norm, rayonPipe) + geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf) + [vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False) + vec1 = geompy.MakeVector(centre, vertex) + vec2 = geompy.MakeVector(centre, ptPeau) + angle = geompy.GetAngleRadians(vec1, vec2) + # cas général : on reconstitue une portion de pipe, avec l'arête de couture qui coincide + # avec la face de fissure, au niveau du débouché sur la face externe + # cas dégénéré : le pipe débouche perpendiculairement à une surface plane à l'origine. + # La partition filling / pipe reconstruit échoue. + # - Si on partitionne le filling avec un simple pipe obtenu par extrusion droite du cercle, + # cela donne un point en trop sur le cercle. + # - Si on prend une vraie surface plane (pas un filling), on peut faire la partition avec + # les pipes reconstruits + logging.debug("angle=%s", angle) + #if abs(angle) > 1.e-7: + sommetAxe = geompy.MakeTranslationVector(centre, norm) + pm = produitMixte(centre, vertex, ptPeau, sommetAxe) + if pm > 0: # ajout de pi a (-)angle pour éviter des points confondus (partition échoue) dans les cas dégénérés + cercle = geompy.MakeRotation(cercle, norm, angle + math.pi) + else: + cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi) + name = "cercle%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, cercle, name) + cercles.append(cercle) + + # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie + if aretesVivesC is None: + faceTestPeau = fillingFaceExterne + else: + faceTestPeau = facesDefaut[ifil] + sideCentre = whichSide(faceTestPeau, centre) + locPt0 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 0.0) + locPt1 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 1.0) + sidePt0 = whichSide(faceTestPeau, locPt0) + sidePt1 = whichSide(faceTestPeau, locPt1) + logging.debug("position centre cercle: %s, extremité edge u0: %s, u1: %s", sideCentre, sidePt0, sidePt1) + normFace = geompy.GetNormal(faceTestPeau, ptPeau) + inclPipe = abs(geompy.GetAngleRadians(norm, normFace)) + lgp = max(rayonPipe/2., abs(3*rayonPipe*math.tan(inclPipe))) + logging.debug("angle inclinaison Pipe en sortie: %s degres, lgp: %s", inclPipe*180/math.pi, lgp) + + # --- position des points extremite du pipe sur l'edge debouchante + # il faut la distance curviligne ofp du point central par rapport à une extrémité de l'edge débouchante + locEdgePart = geompy.MakePartition([localEdgeInFondFiss],[centre], [], [], geompy.ShapeType["EDGE"], 0, [], 0) + edgesLoc = geompy.ExtractShapes(locEdgePart, geompy.ShapeType["EDGE"], False) + edgesLocSorted =[(geompy.MinDistance(edge, locPt0), kk, edge) for kk, edge in enumerate(edgesLoc)] + edgesLocSorted.sort() + ofp = geompy.BasicProperties(edgesLocSorted[0][2])[0] # distance curviligne centre locPt0 + logging.debug("distance curviligne centre extremite0: %s", ofp) + p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0) + p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0) + geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf) + geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf) + + edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0) + edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True) + for edp in edps: + if geompy.MinDistance(centre, edp) < 1.e-3: + pipext = geompy.MakePipe(cercle, edp) + name = "pipeExt%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, pipext, name) + pipexts.append(pipext) + + for ifa, face in enumerate(facesInside): + logging.debug("recherche edges communes entre une face inside et (faces onside, edges pipe et fond débouchante)") + edgesPeauFis = [] + edgesPipeFis = [] + edgesPipeFnd = [] + try: + edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"]) + logging.debug(" faces onside %s",edgesPeauFis) + edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"]) + logging.debug(" edgesPipeIn %s", edgesPipeFis) + edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"]) + logging.debug(" edgesFondIn %s ", edgesPipeFnd) + except: + logging.debug(" pb edges communes %s %s %s",edgesPeauFis, edgesPipeFis, edgesPipeFnd) + pass + if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0): + dist = geompy.MinDistance(geompy.MakeCompound(edgesPeauFis), ptPeau) + logging.debug(" test distance extrémité reference %s", dist) + if dist < 1.e-3: # c'est la face de fissure externe associée + logging.debug(" face %s inside ajoutée", ifa) + facesFissExt.append(face) + name="faceFissExt%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, face, name) + dist = 1. + for ipe, edpe in enumerate(edgesPeauFis): + for ipi, edpi in enumerate(edgesPipeFis): + dist = geompy.MinDistance(edpe, edpi) + if dist < 1.e-3: + edgesFissExtPeau.append(edpe) + name="edgesFissExtPeau%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, edpe, name) + edgesFissExtPipe.append(edpi) + name="edgesFissExtPipe%d"%iedf + geompy.addToStudyInFather(partitionPeauFissFond, edpi, name) + break + if dist < 1.e-3: + break + + return (verticesEdgesFondIn, pipexts, cercles, facesFissExt, edgesFissExtPeau, edgesFissExtPipe) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/identifieElementsFissure.py b/src/Tools/blocFissure/gmu/identifieElementsFissure.py new file mode 100644 index 000000000..e88624034 --- /dev/null +++ b/src/Tools/blocFissure/gmu/identifieElementsFissure.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from extractionOrientee import extractionOrientee +from extractionOrienteeMulti import extractionOrienteeMulti + +def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond, + edgesPipeFiss, edgesFondFiss, aretesVivesC, + fillingFaceExterne, centreFondFiss): + """ + # ----------------------------------------------------------------------- + # --- identification edges fond de fissure, edges pipe sur la face de fissure, + # edges prolongées + # edges internes communes pipe et fissure, points communs edges fissure peau et edges circulaires + """ + + logging.info('start') + + edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) + geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss") + edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) + geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss") + + if aretesVivesC is None: + [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) + [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) + else: + [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) + [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) + + edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) + verticesPipePeau = [] + + for i, edge in enumerate(edgesPipeIn): + try: + vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"]) + verticesPipePeau.append(vertices[0]) + name = "edgePipeIn%d"%i + geompy.addToStudyInFather(partitionPeauFissFond, edge, name) + name = "verticePipePeau%d"%i + geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name) + logging.debug("edgePipeIn%s coupe les faces OnSide", i) + except: + logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i) + + edgesFondIn =[] + if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau + #tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"]) + #edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] + tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) + edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] + + return (edgesPipeIn, verticesPipePeau, edgesFondIn, facesInside, facesOnside) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py new file mode 100644 index 000000000..397bf18f9 --- /dev/null +++ b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +import logging +import math + +from geomsmesh import geompy + +from extractionOrientee import extractionOrientee +from extractionOrienteeMulti import extractionOrienteeMulti +from orderEdgesFromWire import orderEdgesFromWire +from produitMixte import produitMixte +from whichSide import whichSide +from sortFaces import sortFaces +from substractSubShapes import substractSubShapes +from identifieElementsFissure import identifieElementsFissure +from identifieElementsDebouchants import identifieElementsDebouchants +from trouveEdgesFissPeau import trouveEdgesFissPeau +from identifieFacesPeau import identifieFacesPeau +from identifieEdgesPeau import identifieEdgesPeau + +def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, + edgesFondFiss, wireFondFiss, aretesVivesC, + facesDefaut, centreFondFiss, rayonPipe, + aretesVivesCoupees): + """ + """ + logging.info('start') + fillingFaceExterne = facesDefaut[ifil] + + logging.debug("traitement partitionPeauFissFond %s", ifil) + + # --- identification edges fond de fissure, edges pipe sur la face de fissure, edges prolongées + # edges internes communes pipe et fissure, points communs edges fissure peau et edges circulaires + + (edgesPipeIn, verticesPipePeau, edgesFondIn, facesInside, facesOnside) = identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond, + edgesPipeFiss, edgesFondFiss, aretesVivesC, + fillingFaceExterne, centreFondFiss) + + # --- elements débouchants (intersection pipe et peau), indexés selon les edges du fond de fissure (edgesFondIn) + + (verticesEdgesFondIn, pipexts, cercles, + facesFissExt, edgesFissExtPeau, edgesFissExtPipe) = identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, + edgesFondIn, edgesFondFiss, wireFondFiss, + aretesVivesC, fillingFaceExterne, + edgesPipeIn, verticesPipePeau, rayonPipe, + facesInside, facesOnside) + + # --- pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau + + if len(verticesPipePeau) == 0: # aucune extrémité du pipe sur cette face de peau + edgesFissExtPeau = trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau) + + # --- inventaire des faces de peau : face de peau percée du pipe, extrémités du pipe + + (facePeau, facesPeauSorted, edgesPeauFondIn) = identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss, + verticesEdgesFondIn, pipexts, cercles, + fillingFaceExterne, centreFondFiss) + + # --- identification précise des edges et disques des faces de peau selon index extremité fissure + + (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, + edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, + bordsVifs, edgesFissurePeau) = identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, + edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees) + + dataPPFF = dict(endsEdgeFond = endsEdgeFond, # pour chaque face [points edge fond de fissure aux débouchés du pipe] + facesPipePeau = facesPipePeau, # pour chaque face [face + edgeRadFacePipePeau = edgeRadFacePipePeau, # pour chaque face [edge radiale des faces du pipe débouchantes ] + facesFissExt = facesFissExt, # pour chaque face [faces de fissure externes au pipe] + edgesFissExtPeau = edgesFissExtPeau, # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)] + edgesFissExtPipe = edgesFissExtPipe, # pour chaque face [edge commun au pipe des faces de fissure externes] + facePeau = facePeau, # pour chaque face : la face de peau finale a mailler (percee des faces débouchantes) + edgesCircPeau = edgesCircPeau, # pour chaque face de peau : [groupe subshapes edges circulaires aux débouchés du pipe] + verticesCircPeau = verticesCircPeau, # pour chaque face de peau : [groupe subshapes points sur edges circulaires aux débouchés du pipe] + groupEdgesBordPeau = groupEdgesBordPeau, # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine + bordsVifs = bordsVifs, # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives + edgesFissurePeau = edgesFissurePeau, # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] + verticesPipePeau = verticesPipePeau # pour chaque face de peau : [point commun edFissPeau edCircPeau] + ) + + return dataPPFF, aretesVivesCoupees + diff --git a/src/Tools/blocFissure/gmu/identifieFacesPeau.py b/src/Tools/blocFissure/gmu/identifieFacesPeau.py new file mode 100644 index 000000000..693586b8f --- /dev/null +++ b/src/Tools/blocFissure/gmu/identifieFacesPeau.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy + +from sortFaces import sortFaces +from extractionOrientee import extractionOrientee + +def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss, + verticesEdgesFondIn, pipexts, cercles, + fillingFaceExterne, centreFondFiss): + """ + inventaire des faces de peau : face de peau percée du pipe, extrémités du pipe + La partition avec le pipe peut créer un vertex (et un edge) de trop sur le cercle projeté, + quand le cercle est très proche de la face. + dans ce cas, la projection du cercle sur la face suivie d'une partition permet + d'éviter le point en trop + """ + logging.info('start') + + facesAndFond = facesOnside + facesAndFond.append(wireFondFiss) + try: + partitionPeauByPipe = geompy.MakePartition(facesAndFond, pipexts, [], [], geompy.ShapeType["FACE"], 0, [], 1) + except: + logging.debug("probleme partition face pipe, contournement avec MakeSection") + sections = [] + for pipext in pipexts: + sections.append(geompy.MakeSection(facesOnside[0], pipext)) + partitionPeauByPipe = geompy.MakePartition(facesAndFond, sections, [], [], geompy.ShapeType["FACE"], 0, [], 1) + + # contrôle edge en trop sur edges circulaires + if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau + edgeEnTrop = [] + outilPart = pipexts + facesPeau = geompy.ExtractShapes(partitionPeauByPipe, geompy.ShapeType["FACE"], False) + facesPeauSorted, minsur, maxsurf = sortFaces(facesPeau) + for i, face in enumerate(facesPeauSorted[:-1]): # on ne teste que la ou les petites faces "circulaires" + nbv = geompy.NumberOfEdges(face) + logging.debug("nombre d'edges sur face circulaire: %s", nbv) + if nbv > 3: + edgeEnTrop.append(True) # TODO : distinguer les cas avec deux faces circulaires dont l'une est correcte + else: + edgeEnTrop.append(False) + refaire = sum(edgeEnTrop) + if refaire > 0: + dc = [(geompy.MinDistance(verticesEdgesFondIn[0], fac), i) for i, fac in enumerate(facesPeauSorted[:-1])] + dc.sort() + logging.debug("dc sorted: %s", dc) + i0 = dc[0][1] # indice de facesPeauSorted qui correspond à verticesEdgesFondIn[0], donc 0 pour cercles + direct = (i0 == 0) + for i, bad in enumerate(edgeEnTrop): + if direct: + j = i + else: + j = 1-i + if bad: + outilPart[j] = geompy.MakeProjection(cercles[j],facesOnside[0]) + pass + partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, [], [], geompy.ShapeType["FACE"], 0, [], 1) + pass + + name="partitionPeauByPipe%d"%ifil + geompy.addToStudy(partitionPeauByPipe, name) + [edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3) + [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3) + + if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau + facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFondOn) + facePeau = facesPeauSorted[-1] # la plus grande face + else: + facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1) + facesPeauSorted = [facePeau] + name="facePeau%d"%ifil + geompy.addToStudy(facePeau, name) + + return (facePeau, facesPeauSorted, edgesPeauFondIn) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index e3f0d0837..e3816ab85 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -115,7 +115,7 @@ def insereFissureGenerale(maillagesSains, else: facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf) - facesPortFissure = facesPartShapeDefautSorted[-1] + facesPortFissure = facesPartShapeDefautSorted[-1] #= global geompy.addToStudy(facesPortFissure, "facesPortFissure") @@ -127,10 +127,10 @@ def insereFissureGenerale(maillagesSains, if geompy.NumberOfFaces(shapeDefaut) == 1: plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000) - shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) - fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) + shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #= local + #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe') - geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe') + #geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe') extrem, norms = findWireEndVertices(fondFiss, True) logging.debug("extrem: %s, norm: %s",extrem, norms) @@ -142,17 +142,17 @@ def insereFissureGenerale(maillagesSains, geompy.addToStudy(pipeFiss, 'pipeFiss') partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) geompy.addToStudy(partFissPipe, 'partFissPipe') - fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) + fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) #= global geompy.addToStudy(fissPipe, 'fissPipe') - partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) + partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) #= local geompy.addToStudy(partPipe, 'partPipe') - edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) + edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) #= global for i, edge in enumerate(edgesPipeFiss): name = "edgePipe%d"%i geompy.addToStudyInFather(fissPipe, edge, name) try: - wirePipeFiss = geompy.MakeWire(edgesPipeFiss) + wirePipeFiss = geompy.MakeWire(edgesPipeFiss) #= global except: wirePipeFiss = geompy.MakeCompound(edgesPipeFiss) logging.debug("wirePipeFiss construit sous forme de compound") @@ -163,7 +163,7 @@ def insereFissureGenerale(maillagesSains, for i, edge in enumerate(edgesFondFiss): name = "edgeFondFiss%d"%i geompy.addToStudyInFather(fissPipe, edge, name) - wireFondFiss = geompy.MakeWire(edgesFondFiss) + wireFondFiss = geompy.MakeWire(edgesFondFiss) #= global geompy.addToStudy(wireFondFiss,"wireFondFiss") # ----------------------------------------------------------------------------- @@ -174,7 +174,7 @@ def insereFissureGenerale(maillagesSains, # liste de faces externes : facesDefaut # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection) - partitionsPeauFissFond = [] + partitionsPeauFissFond = [] #= global ipart = 0 for filling in facesDefaut: part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) @@ -197,7 +197,7 @@ def insereFissureGenerale(maillagesSains, # et quadranglesToShapeWithCorner) aretesVives = [] - aretesVivesCoupees = [] + aretesVivesCoupees = [] #= global ia = 0 for a in bordsPartages: if not isinstance(a, list): @@ -212,7 +212,7 @@ def insereFissureGenerale(maillagesSains, geompy.addToStudy(a[0], name) ia += 1 - aretesVivesC = None + aretesVivesC = None #= global if len(aretesVives) > 0: aretesVivesC =geompy.MakeCompound(aretesVives) @@ -237,28 +237,28 @@ def insereFissureGenerale(maillagesSains, ptFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau] for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond): - fillingFaceExterne = facesDefaut[ifil] - #fillingSansDecoupe = fillconts[idFilToCont[ifil]] if partitionPeauFissFond is not None: + fillingFaceExterne = facesDefaut[ifil] + #fillingSansDecoupe = fillconts[idFilToCont[ifil]] logging.debug("traitement partitionPeauFissFond %s", ifil) # ----------------------------------------------------------------------- # --- identification edges fond de fissure, edges pipe sur la face de fissure, # edges prolongées - edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) + edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) #= local geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss") - edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) + edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) #= local geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss") - if aretesVivesC is None: + if aretesVivesC is None: #= global facesInside facesOnside [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) else: [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) - edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) - verticesPipePeau = [] + edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) #= global + verticesPipePeau = [] #= global for i, edge in enumerate(edgesPipeIn): try: @@ -271,13 +271,14 @@ def insereFissureGenerale(maillagesSains, logging.debug("edgePipeIn%s coupe les faces OnSide", i) except: logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i) - edgesFondOut = [] - edgesFondIn =[] + #edgesFondOut = [] #= inutile + edgesFondIn =[] #= global if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau - tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"]) - edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] + #tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"]) + #edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3] + verticesEdgesFondIn = [] # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn) pipexts = [] # les segments de pipe associés au points de fond de fissure débouchants (même indice) cercles = [] # les cercles de generation des pipes débouchant (même indice) diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py new file mode 100644 index 000000000..8f770fa51 --- /dev/null +++ b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- + +import math +import logging +from geomsmesh import geompy +from findWireEndVertices import findWireEndVertices +from prolongeWire import prolongeWire + +def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): + """ + pipe de fond de fissure, prolongé, partition face fissure par pipe + identification des edges communes pipe et face fissure + """ + logging.info('start') + shapeDefaut = shapesFissure[0] # faces de fissure, débordant + fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure + centreFondFiss = elementsDefaut[15] + tgtCentre = elementsDefaut[16] + + if geompy.NumberOfFaces(shapeDefaut) == 1: + plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000) + shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) + #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile + geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe') + #geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe') + + extrem, norms = findWireEndVertices(fondFiss, True) + logging.debug("extrem: %s, norm: %s",extrem, norms) + cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe) + cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure + geompy.addToStudy(cercle, 'cercle') + fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe) + pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) + geompy.addToStudy(pipeFiss, 'pipeFiss') + partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) + geompy.addToStudy(partFissPipe, 'partFissPipe') + fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) + geompy.addToStudy(fissPipe, 'fissPipe') + partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) + geompy.addToStudy(partPipe, 'partPipe') + + edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) + for i, edge in enumerate(edgesPipeFiss): + name = "edgePipe%d"%i + geompy.addToStudyInFather(fissPipe, edge, name) + try: + wirePipeFiss = geompy.MakeWire(edgesPipeFiss) + except: + wirePipeFiss = geompy.MakeCompound(edgesPipeFiss) + logging.debug("wirePipeFiss construit sous forme de compound") + geompy.addToStudy(wirePipeFiss, "wirePipeFiss") + + wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss) + edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"]) + for i, edge in enumerate(edgesFondFiss): + name = "edgeFondFiss%d"%i + geompy.addToStudyInFather(fissPipe, edge, name) + wireFondFiss = geompy.MakeWire(edgesFondFiss) + geompy.addToStudy(wireFondFiss,"wireFondFiss") + + return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/restreintFaceFissure.py b/src/Tools/blocFissure/gmu/restreintFaceFissure.py new file mode 100644 index 000000000..4cadb4984 --- /dev/null +++ b/src/Tools/blocFissure/gmu/restreintFaceFissure.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- + +import logging +from geomsmesh import geompy +from sortFaces import sortFaces + +def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): + """ + restriction de la face de fissure au domaine solide + partition face fissure étendue par fillings + """ + logging.info('start') + partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0) + geompy.addToStudy(partShapeDefaut, 'partShapeDefaut') + facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False) + if pointInterne is not None: + distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)] + distfaces.sort() + logging.debug("selection de la face la plus proche du point interne, distance=%s",distfaces[0][0]) + facesPortFissure = distfaces[0][2] + else: + facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande + logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf) + facesPortFissure = facesPartShapeDefautSorted[-1] + + geompy.addToStudy(facesPortFissure, "facesPortFissure") + return facesPortFissure diff --git a/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py b/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py new file mode 100644 index 000000000..13289ac2c --- /dev/null +++ b/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy + +def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau): + """ + pour les faces de peau sans extremité débouchante de fissure, il faut recenser les edges de fissure sur la face de peau + """ + logging.info('start') + + j = 0 + for face in facesInside: + edgesPeauFis = [] + edgesPipeFis = [] + edgesPipeFnd = [] + try: + edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"]) + edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"]) + edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"]) + except: + pass + if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0): + edgesFissExtPeau.append(edgesPeauFis[0]) + name="edgesFissExtPeau%d"%j + geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name) + j += 1 + return edgesFissExtPeau \ No newline at end of file From 106415d543316ec2bcd80c173da165c9b8baa084 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 14 Sep 2014 21:38:46 +0200 Subject: [PATCH 012/147] =?UTF-8?q?poursuite=20du=20d=C3=A9coupage=20en=20?= =?UTF-8?q?fonctions=20plus=20simples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gmu/ajustePointsEdgePipeFissure.py | 43 + .../gmu/calculePointsAxiauxPipe.py | 120 +++ .../gmu/construitEdgesRadialesDebouchantes.py | 101 +++ .../gmu/construitFissureGenerale.py | 755 ++---------------- .../blocFissure/gmu/construitMaillagePipe.py | 168 ++++ .../blocFissure/gmu/creePointsPipePeau.py | 69 ++ .../blocFissure/gmu/elimineExtremitesPipe.py | 66 ++ .../blocFissure/gmu/identifieEdgesPeau.py | 2 +- .../gmu/identifieElementsGeometriquesPeau.py | 14 +- .../gmu/identifieFacesEdgesFissureExterne.py | 49 ++ .../blocFissure/gmu/mailleAretesEtJonction.py | 46 ++ .../blocFissure/gmu/mailleFacesFissure.py | 44 + src/Tools/blocFissure/gmu/mailleFacesPeau.py | 105 +++ 13 files changed, 885 insertions(+), 697 deletions(-) create mode 100644 src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py create mode 100644 src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py create mode 100644 src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py create mode 100644 src/Tools/blocFissure/gmu/construitMaillagePipe.py create mode 100644 src/Tools/blocFissure/gmu/creePointsPipePeau.py create mode 100644 src/Tools/blocFissure/gmu/elimineExtremitesPipe.py create mode 100644 src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py create mode 100644 src/Tools/blocFissure/gmu/mailleAretesEtJonction.py create mode 100644 src/Tools/blocFissure/gmu/mailleFacesFissure.py create mode 100644 src/Tools/blocFissure/gmu/mailleFacesPeau.py diff --git a/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py b/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py new file mode 100644 index 000000000..acce0d0e7 --- /dev/null +++ b/src/Tools/blocFissure/gmu/ajustePointsEdgePipeFissure.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from findWireIntermediateVertices import findWireIntermediateVertices +from projettePointSurCourbe import projettePointSurCourbe + +def ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne, gptsdisks, idisklim): + """ + ajustement precis des points sur edgesPipeFissureExterneC + """ + logging.info('start') + + edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) + verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe) + idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté + idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté + idiskint = [] + for vtx in verticesPFE: + distPtVt = [] + for idisk in range(idiskmin, idiskmax): + gptdsk = gptsdisks[idisk] + pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe + distPtVt.append((geompy.MinDistance(pt, vtx), idisk)) + distPtVt.sort() + idiskint.append(distPtVt[0][1]) + gptsdisks[idiskint[-1]][0][-1] = vtx + logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0]) + for idisk in range(idiskmin, idiskmax): + if idisk in idiskint: + break + logging.debug("ajustement point sur edgePipeFissureExterne: %s", idisk) + gptdsk = gptsdisks[idisk] + pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe + distPtEd = [(geompy.MinDistance(pt, edgePFE), k, edgePFE) for k, edgePFE in enumerate(edgesPFE)] + distPtEd.sort() + edgePFE = distPtEd[0][2] + u = projettePointSurCourbe(pt, edgePFE) + ptproj = geompy.MakeVertexOnCurve(edgePFE, u) + gptsdisks[idisk][0][-1] = ptproj + + return gptsdisks \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py new file mode 100644 index 000000000..8a21e72ea --- /dev/null +++ b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- + +import logging +import math + +from geomsmesh import geompy +from geomsmesh import smesh + +def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, + centreFondFiss, wireFondFiss, wirePipeFiss, + lenSegPipe, rayonPipe, nbsegCercle, nbsegRad): + """ + preparation maillage du pipe : + - détections des points a respecter : jonction des edges/faces constituant + la face de fissure externe au pipe + - points sur les edges de fond de fissure et edges pipe/face fissure, + - vecteurs tangents au fond de fissure (normal au disque maillé) + """ + + logging.info('start') + + # --- option de maillage selon le rayon de courbure du fond de fissure + lenEdgeFondExt = 0 + for edff in edgesFondFiss: + lenEdgeFondExt += geompy.BasicProperties(edff)[0] + + disfond = [] + for filling in facesDefaut: + disfond.append(geompy.MinDistance(centreFondFiss, filling)) + disfond.sort() + rcourb = disfond[0] + nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle + alpha = math.pi/(4*nbSegQuart) + deflexion = rcourb*(1.0 -math.cos(alpha)) + lgmin = lenSegPipe*0.25 + lgmax = lenSegPipe*1.5 + logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax) + + meshFondExt = smesh.Mesh(wireFondFiss) + algo1d = meshFondExt.Segment() + hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure + isDone = meshFondExt.Compute() + + ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique + allNodeIds = meshFondExt.GetNodesId() + for nodeId in allNodeIds: + xyz = meshFondExt.GetNodeXYZ(nodeId) + #logging.debug("nodeId %s, coords %s", nodeId, str(xyz)) + pt = geompy.MakeVertex(xyz[0], xyz[1], xyz[2]) + u, PointOnEdge, EdgeInWireIndex = geompy.MakeProjectionOnWire(pt, wireFondFiss) # u compris entre 0 et 1 + edgeOrder = edgesIdByOrientation[EdgeInWireIndex] + ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt + #logging.debug("nodeId %s, u %s", nodeId, str(u)) + usort = sorted(ptGSdic) + logging.debug("nombre de points obtenus par deflexion %s",len(usort)) + + centres = [] + origins = [] + normals = [] + for edu in usort: + ied = edu[1] + u = edu[2] + vertcx = ptGSdic[edu] + norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u) + plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe) + part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0) + liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True) + if len(liste) == 5: # 4 coins du plan plus intersection recherchée + for point in liste: + if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin + vertpx = point + break + centres.append(vertcx) + origins.append(vertpx) + normals.append(norm) +# name = "vertcx%d"%i +# geompy.addToStudyInFather(wireFondFiss, vertcx, name) +# name = "vertpx%d"%i +# geompy.addToStudyInFather(wireFondFiss, vertpx, name) +# name = "plan%d"%i +# geompy.addToStudyInFather(wireFondFiss, plan, name) + + # --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau + + logging.debug("nbsegCercle %s", nbsegCercle) + + # ----------------------------------------------------------------------- + # --- points géométriques + + gptsdisks = [] # vertices géométrie de tous les disques + raydisks = [[] for i in range(nbsegCercle)] + for i in range(len(centres)): # boucle sur les disques + gptdsk = [] # vertices géométrie d'un disque + vertcx = centres[i] + vertpx = origins[i] + normal = normals[i] + vec1 = geompy.MakeVector(vertcx, vertpx) + + points = [vertcx] # les points du rayon de référence + for j in range(nbsegRad): + pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*float(rayonPipe)/nbsegRad) + points.append(pt) + gptdsk.append(points) + pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe) + rayon = geompy.MakeLineTwoPnt(vertcx, pt) + raydisks[0].append(rayon) + + for k in range(nbsegCercle-1): + angle = (k+1)*2*math.pi/nbsegCercle + pts = [vertcx] # les points d'un rayon obtenu par rotation + for j in range(nbsegRad): + pt = geompy.MakeRotation(points[j+1], normal, angle) + pts.append(pt) + gptdsk.append(pts) + ray = geompy.MakeRotation(rayon, normal, angle) + raydisks[k+1].append(ray) + + gptsdisks.append(gptdsk) + + return (centres, gptsdisks, raydisks) diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py new file mode 100644 index 000000000..294309177 --- /dev/null +++ b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from sortEdges import sortEdges + +def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, + facesPipePeau, edgeRadFacePipePeau, nbsegCercle): + """ + construction des listes d'edges radiales sur chaque extrémité débouchante + """ + logging.info('start') + + # --- listes de nappes radiales en filling à chaque extrémité débouchante + + facesDebouchantes = [False, False] + idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau) + listNappes =[] + for i, idisk in enumerate(idisklim): + numout = idiskout[i] + logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout) + nappes = [] + if (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante + for k in range(nbsegCercle): + if i == 0: + iddeb = max(0, numout) + idfin = max(iddeb+3,idisk+1) # il faut 3 rayons pour faire un filling qui suive le fond de fissure + #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) + comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) + name='compoundRay%d'%k + geompy.addToStudy(comp, name) + else: + idfin = min(len(gptsdisks), numout+1) + iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure + #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) + comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) + name='compoundRay%d'%k + geompy.addToStudy(comp, name) + nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default) + nappes.append(nappe) + name='nappe%d'%k + geompy.addToStudy(nappe, name) + facesDebouchantes[i] = True + listNappes.append(nappes) + + # --- mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau) + for i, nappes in enumerate(listNappes): + if facesDebouchantes[i]: + for k, face in enumerate(facesPipePeau): + edge = geompy.MakeSection(face, nappes[0]) + if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0: + idFacesDebouchantes[i] = k + break + logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes) + + # --- construction des listes d'edges radiales sur chaque extrémité débouchante + listEdges = [] + for i, nappes in enumerate(listNappes): + ifd = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) + if ifd < 0: + listEdges.append([]) + else: + face = facesPipePeau[ifd] + edges = [edgeRadFacePipePeau[ifd]] + for k, nappe in enumerate(nappes): + if k > 0: + obj = geompy.MakeSection(face, nappes[k]) # normalement une edge, parfois un compound d'edges dont un tout petit + edge = obj + vs = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False) + if len(vs) > 2: + eds = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False) + [edsorted, minl,maxl] = sortEdges(eds) + edge = edsorted[-1] + else: + maxl = geompy.BasicProperties(edge)[0] + if maxl < 0.01: # problème MakeSection + logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl) + partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0) + edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False) + ednouv = [] + for ii, ed in enumerate(edps): + vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False) + distx = [geompy.MinDistance(vx, face) for vx in vxs] + distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs] + dmax = max(distx) + logging.debug(" dmax %s",dmax) + if dmax < 0.01: + ednouv.append(ed) + logging.debug(" edges issues de la partition: %s", ednouv) + for ii, ed in enumerate(ednouv): + geompy.addToStudy(ed, "ednouv%d"%ii) + [edsorted, minl,maxl] = sortEdges(ednouv) + logging.debug(" longueur edge trouvée: %s", maxl) + edge = edsorted[-1] + edges.append(edge) + name = 'edgeEndPipe%d'%k + geompy.addToStudy(edge, name) + listEdges.append(edges) + + return (listEdges, idFacesDebouchantes) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index 64aad5642..f6858132f 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -10,34 +10,44 @@ import SMESH import math import bisect -from extractionOrientee import extractionOrientee -from extractionOrienteeMulti import extractionOrienteeMulti -from sortFaces import sortFaces -from sortEdges import sortEdges -from eliminateDoubles import eliminateDoubles -from substractSubShapes import substractSubShapes -from produitMixte import produitMixte -from findWireEndVertices import findWireEndVertices -from findWireIntermediateVertices import findWireIntermediateVertices +# from extractionOrientee import extractionOrientee +# from extractionOrienteeMulti import extractionOrienteeMulti +# from sortFaces import sortFaces +#from sortEdges import sortEdges +# from eliminateDoubles import eliminateDoubles +# from substractSubShapes import substractSubShapes +# from produitMixte import produitMixte +# from findWireEndVertices import findWireEndVertices +#from findWireIntermediateVertices import findWireIntermediateVertices from orderEdgesFromWire import orderEdgesFromWire -from getSubshapeIds import getSubshapeIds +# from getSubshapeIds import getSubshapeIds from putName import putName -from distance2 import distance2 +# from distance2 import distance2 from enleveDefaut import enleveDefaut from shapeSurFissure import shapeSurFissure from regroupeSainEtDefaut import RegroupeSainEtDefaut from triedreBase import triedreBase -from checkDecoupePartition import checkDecoupePartition -from whichSide import whichSide -from whichSideMulti import whichSideMulti -from whichSideVertex import whichSideVertex -from projettePointSurCourbe import projettePointSurCourbe -from prolongeWire import prolongeWire +# from checkDecoupePartition import checkDecoupePartition +# from whichSide import whichSide +# from whichSideMulti import whichSideMulti +#from whichSideVertex import whichSideVertex +#from projettePointSurCourbe import projettePointSurCourbe +# from prolongeWire import prolongeWire from restreintFaceFissure import restreintFaceFissure from partitionneFissureParPipe import partitionneFissureParPipe from construitPartitionsPeauFissure import construitPartitionsPeauFissure from compoundFromList import compoundFromList from identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau +from identifieFacesEdgesFissureExterne import identifieFacesEdgesFissureExterne +from calculePointsAxiauxPipe import calculePointsAxiauxPipe +from elimineExtremitesPipe import elimineExtremitesPipe +from construitEdgesRadialesDebouchantes import construitEdgesRadialesDebouchantes +from creePointsPipePeau import creePointsPipePeau +from ajustePointsEdgePipeFissure import ajustePointsEdgePipeFissure +from construitMaillagePipe import construitMaillagePipe +from mailleAretesEtJonction import mailleAretesEtJonction +from mailleFacesFissure import mailleFacesFissure +from mailleFacesPeau import mailleFacesPeau # ----------------------------------------------------------------------------- # --- procédure complète fissure générale @@ -89,23 +99,23 @@ def construitFissureGenerale(maillagesSains, fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med' # fillings des faces en peau - facesDefaut = elementsDefaut[0] + facesDefaut = elementsDefaut[0] #centresDefaut = elementsDefaut[1] #normalsDefaut = elementsDefaut[2] #extrusionsDefaut = elementsDefaut[3] dmoyen = elementsDefaut[4] - bordsPartages = elementsDefaut[5] - fillconts = elementsDefaut[6] - idFilToCont = elementsDefaut[7] + bordsPartages = elementsDefaut[5] + #fillconts = elementsDefaut[6] + #idFilToCont = elementsDefaut[7] maillageSain = elementsDefaut[8] internalBoundary = elementsDefaut[9] zoneDefaut = elementsDefaut[10] zoneDefaut_skin = elementsDefaut[11] zoneDefaut_internalFaces = elementsDefaut[12] zoneDefaut_internalEdges = elementsDefaut[13] - edgeFondExt = elementsDefaut[14] + #edgeFondExt = elementsDefaut[14] centreFondFiss = elementsDefaut[15] - tgtCentre = elementsDefaut[16] + #tgtCentre = elementsDefaut[16] O, OX, OY, OZ = triedreBase() @@ -134,11 +144,9 @@ def construitFissureGenerale(maillagesSains, # --- arêtes vives détectées (dans quadranglesToShapeNoCorner # et quadranglesToShapeWithCorner) - aretesVivesCoupees = [] #= global - aretesVivesC = compoundFromList(bordsPartages, "areteVive") - - # ------------------------------------------------------- + aretesVivesCoupees = [] # ensembles des arêtes vives identifiées sur les faces de peau dans l'itération sur partitionsPeauFissFond + # --- inventaire des faces de peau coupées par la fissure # pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure # 0, 1 ou plus edges de la face de fissure externe au pipe @@ -146,8 +154,8 @@ def construitFissureGenerale(maillagesSains, nbFacesFilling = len(partitionsPeauFissFond) ptEdgeFond = [ [] for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe] - fsPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] - edRadFPiPo = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] + facesPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] + edgeRadFacePipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] fsFissuExt = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe] edFisExtPe = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)] edFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes] @@ -164,11 +172,10 @@ def construitFissureGenerale(maillagesSains, dataPPFF,aretesVivesCoupees = identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, facesDefaut, centreFondFiss, rayonPipe, - aretesVivesCoupees) - + aretesVivesCoupees) ptEdgeFond[ifil] = dataPPFF['endsEdgeFond'] - fsPipePeau[ifil] = dataPPFF['facesPipePeau'] - edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau'] + facesPipePeau[ifil] = dataPPFF['facesPipePeau'] + edgeRadFacePipePeau[ifil] = dataPPFF['edgeRadFacePipePeau'] fsFissuExt[ifil] = dataPPFF['facesFissExt'] edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau'] edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe'] @@ -180,9 +187,6 @@ def construitFissureGenerale(maillagesSains, edFissPeau[ifil] = dataPPFF['edgesFissurePeau'] ptFisExtPi[ifil] = dataPPFF['verticesPipePeau'] - # ----------------------------------------------------------------------- - # fin de la boucle sur les faces de filling - # ----------------------------------------------------------------------- for i, avc in enumerate(aretesVivesCoupees): name = "areteViveCoupee%d"%i @@ -190,149 +194,19 @@ def construitFissureGenerale(maillagesSains, # --- identification des faces et edges de fissure externe pour maillage - facesFissExt = [] - edgesFissExtPeau = [] - edgesFissExtPipe = [] - for ifil in range(nbFacesFilling): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?) - facesFissExt += fsFissuExt[ifil] - edgesFissExtPeau += edFisExtPe[ifil] - edgesFissExtPipe += edFisExtPi[ifil] - logging.debug("---------------------------- identification faces de fissure externes au pipe :%s ", len(facesFissExt)) - # regroupement des faces de fissure externes au pipe. - - if len(facesFissExt) > 1: - faceFissureExterne = geompy.MakePartition(facesFissExt, [], [], [], geompy.ShapeType["FACE"], 0, [], 0) - edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss)) # edgesFissExtPipe peut ne pas couvrir toute la longueur - # edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau)) - # il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau - (isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne) - edgesBordFFE = [] - for bound in closedFreeBoundaries: - edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False) - edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE] - logging.debug("edgesBordFFEid %s", edgesBordFFEid) - edgesPPE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) - edgesPPEid = [ geompy.GetSubShapeID(faceFissureExterne, ed) for ed in edgesPPE] - logging.debug("edgesPPEid %s", edgesPPEid) - edgesPFE = [ edid[0] for edid in edgesBordFFEid if edid[1] not in edgesPPEid] # on garde toutes les edges de bord non en contact avec le pipe - logging.debug("edgesPFE %s", edgesPFE) - edgesPeauFissureExterneC = geompy.MakeCompound(edgesPFE) - else: - faceFissureExterne = facesFissExt[0] - edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau) - edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe) - wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)) - geompy.addToStudy(faceFissureExterne, "faceFissureExterne") - geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") - geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") - - logging.debug("---------------------------- Preparation Maillage du Pipe --------------") - # ----------------------------------------------------------------------- + (faceFissureExterne, edgesPipeFissureExterneC, + wirePipeFissureExterne, edgesPeauFissureExterneC) = identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, + edFisExtPi, edgesPipeFiss) + # --- preparation maillage du pipe : - # - détections des points a respecter : jonction des edges/faces constituant - # la face de fissure externe au pipe + # - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe # - points sur les edges de fond de fissure et edges pipe/face fissure, # - vecteurs tangents au fond de fissure (normal au disque maillé) - - # --- option de maillage selon le rayon de courbure du fond de fissure - lenEdgeFondExt = 0 - for edff in edgesFondFiss: - lenEdgeFondExt += geompy.BasicProperties(edff)[0] - disfond = [] - for filling in facesDefaut: - disfond.append(geompy.MinDistance(centreFondFiss, filling)) - disfond.sort() - rcourb = disfond[0] - nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle - alpha = math.pi/(4*nbSegQuart) - deflexion = rcourb*(1.0 -math.cos(alpha)) - lgmin = lenSegPipe*0.25 - lgmax = lenSegPipe*1.5 - logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax) - - meshFondExt = smesh.Mesh(wireFondFiss) - algo1d = meshFondExt.Segment() - hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure - isDone = meshFondExt.Compute() - - ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique - allNodeIds = meshFondExt.GetNodesId() - for nodeId in allNodeIds: - xyz = meshFondExt.GetNodeXYZ(nodeId) - #logging.debug("nodeId %s, coords %s", nodeId, str(xyz)) - pt = geompy.MakeVertex(xyz[0], xyz[1], xyz[2]) - u, PointOnEdge, EdgeInWireIndex = geompy.MakeProjectionOnWire(pt, wireFondFiss) # u compris entre 0 et 1 - edgeOrder = edgesIdByOrientation[EdgeInWireIndex] - ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt - #logging.debug("nodeId %s, u %s", nodeId, str(u)) - usort = sorted(ptGSdic) - logging.debug("nombre de points obtenus par deflexion %s",len(usort)) - - centres = [] - origins = [] - normals = [] - for edu in usort: - ied = edu[1] - u = edu[2] - vertcx = ptGSdic[edu] - norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u) - plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe) - part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0) - liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True) - if len(liste) == 5: # 4 coins du plan plus intersection recherchée - for point in liste: - if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin - vertpx = point - break - centres.append(vertcx) - origins.append(vertpx) - normals.append(norm) -# name = "vertcx%d"%i -# geompy.addToStudyInFather(wireFondFiss, vertcx, name) -# name = "vertpx%d"%i -# geompy.addToStudyInFather(wireFondFiss, vertpx, name) -# name = "plan%d"%i -# geompy.addToStudyInFather(wireFondFiss, plan, name) - - # --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau - - logging.debug("nbsegCercle %s", nbsegCercle) - - # ----------------------------------------------------------------------- - # --- points géométriques - - gptsdisks = [] # vertices géométrie de tous les disques - raydisks = [[] for i in range(nbsegCercle)] - for i in range(len(centres)): # boucle sur les disques - gptdsk = [] # vertices géométrie d'un disque - vertcx = centres[i] - vertpx = origins[i] - normal = normals[i] - vec1 = geompy.MakeVector(vertcx, vertpx) - - points = [vertcx] # les points du rayon de référence - for j in range(nbsegRad): - pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*float(rayonPipe)/nbsegRad) - points.append(pt) - gptdsk.append(points) - pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe) - rayon = geompy.MakeLineTwoPnt(vertcx, pt) - raydisks[0].append(rayon) - - for k in range(nbsegCercle-1): - angle = (k+1)*2*math.pi/nbsegCercle - pts = [vertcx] # les points d'un rayon obtenu par rotation - for j in range(nbsegRad): - pt = geompy.MakeRotation(points[j+1], normal, angle) - pts.append(pt) - gptdsk.append(pts) - ray = geompy.MakeRotation(rayon, normal, angle) - raydisks[k+1].append(ray) - - gptsdisks.append(gptdsk) - - # ----------------------------------------------------------------------- + (centres, gptsdisks, raydisks) = calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, + centreFondFiss, wireFondFiss, wirePipeFiss, + lenSegPipe, rayonPipe, nbsegCercle, nbsegRad) + # --- recherche des points en trop (externes au volume à remailler) # - on associe chaque extrémité du pipe à une face filling # - on part des disques aux extrémités du pipe @@ -340,527 +214,42 @@ def construitFissureGenerale(maillagesSains, # on marque leur position relative à la face. # - on s'arrete quand tous les noeuds sont dedans - logging.debug("---------------------------- recherche des points du pipe a éliminer --------------") - - pt0 = centres[0] - pt1 = centres[-1] - idFillingFromBout = [None, None] # contiendra l'index du filling pour les extrémités 0 et 1 - for ifil in range(nbFacesFilling): - for ipt, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face - if geompy.MinDistance(pt,pt0) < geompy.MinDistance(pt,pt1): # TODO: trouver plus fiable pour les cas tordus... - idFillingFromBout[0] = ifil - else: - idFillingFromBout[1] = ifil - logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout) - - facesPipePeau = [] - edgeRadFacePipePeau = [] - for ifil in range(nbFacesFilling): - facesPipePeau += fsPipePeau[ifil] - edgeRadFacePipePeau += edRadFPiPo[ifil] - - logging.debug("recherche des disques de noeuds complètement internes") - idisklim = [] # indices des premier et dernier disques internes - idiskout = [] # indices des premier et dernier disques externes - for bout in range(2): - if bout == 0: - idisk = -1 - inc = 1 - numout = -1 - else: - idisk = len(gptsdisks) - inc = -1 - numout = len(gptsdisks) - inside = False - outside = True - while not inside: - idisk = idisk + inc - logging.debug("examen disque %s", idisk) - gptdsk = gptsdisks[idisk] - inside = True - for k in range(nbsegCercle): - points = gptdsk[k] - for j, pt in enumerate(points): - side = whichSideVertex(facesDefaut[idFillingFromBout[bout]], pt) - if side < 0: - if outside: # premier point detecté dedans - outside = False - numout = idisk -inc # le disque précédent était dehors - else: - inside = False # ce point est dehors - if not inside and not outside: - break - idisklim.append(idisk) # premier et dernier disques internes - idiskout.append(numout) # premier et dernier disques externes - - # --- listes de nappes radiales en filling à chaque extrémité débouchante - facesDebouchantes = [False, False] - idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau) - listNappes =[] - for i, idisk in enumerate(idisklim): - numout = idiskout[i] - logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout) - nappes = [] - if (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante - for k in range(nbsegCercle): - if i == 0: - iddeb = max(0, numout) - idfin = max(iddeb+3,idisk+1) # il faut 3 rayons pour faire un filling qui suive le fond de fissure - #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) - comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) - name='compoundRay%d'%k - geompy.addToStudy(comp, name) - else: - idfin = min(len(gptsdisks), numout+1) - iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure - #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) - comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) - name='compoundRay%d'%k - geompy.addToStudy(comp, name) - nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default) - nappes.append(nappe) - name='nappe%d'%k - geompy.addToStudy(nappe, name) - facesDebouchantes[i] = True - listNappes.append(nappes) - - # --- mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau) - for i, nappes in enumerate(listNappes): - if facesDebouchantes[i]: - for k, face in enumerate(facesPipePeau): - edge = geompy.MakeSection(face, nappes[0]) - if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0: - idFacesDebouchantes[i] = k - break - logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes) + (idFillingFromBout, idisklim, idiskout) = elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle) # --- construction des listes d'edges radiales sur chaque extrémité débouchante - listEdges = [] - for i, nappes in enumerate(listNappes): - id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) - if id < 0: - listEdges.append([]) - else: - face = facesPipePeau[id] - edges = [edgeRadFacePipePeau[id]] - for k, nappe in enumerate(nappes): - if k > 0: - obj = geompy.MakeSection(face, nappes[k]) # normalement une edge, parfois un compound d'edges dont un tout petit - edge = obj - vs = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False) - if len(vs) > 2: - eds = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False) - [edsorted, minl,maxl] = sortEdges(eds) - edge = edsorted[-1] - else: - maxl = geompy.BasicProperties(edge)[0] - if maxl < 0.01: # problème MakeSection - logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl) - partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0) - edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False) - ednouv = [] - for ii, ed in enumerate(edps): - vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False) - distx = [geompy.MinDistance(vx, face) for vx in vxs] - distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs] - dmax = max(distx) - logging.debug(" dmax %s",dmax) - if dmax < 0.01: - ednouv.append(ed) - logging.debug(" edges issues de la partition: %s", ednouv) - for ii, ed in enumerate(ednouv): - geompy.addToStudy(ed, "ednouv%d"%ii) - [edsorted, minl,maxl] = sortEdges(ednouv) - logging.debug(" longueur edge trouvée: %s", maxl) - edge = edsorted[-1] - edges.append(edge) - name = 'edgeEndPipe%d'%k - geompy.addToStudy(edge, name) - listEdges.append(edges) - + + (listEdges, idFacesDebouchantes) = construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, + facesPipePeau, edgeRadFacePipePeau, nbsegCercle) + # --- création des points du maillage du pipe sur la face de peau - for i, edges in enumerate(listEdges): - id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) - if id >= 0: - gptdsk = [] - if id > 0: # id vaut 0 ou 1 - id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) - centre = ptEdgeFond[idFillingFromBout[i]][id] - name = "centre%d"%id - geompy.addToStudy(centre, name) - vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id] - geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau") - grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes - edgesCirc = [] - for grpEdgesCirc in grpsEdgesCirc: - edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False) - for k, edge in enumerate(edges): - extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True) - if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]): - bout = extrems[1] - else: - bout = extrems[0] - # ajustement du point extrémité (bout) sur l'edge circulaire en face de peau - logging.debug("edgesCirc: %s", edgesCirc) - distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)] - distEdgeCirc.sort() - logging.debug("distEdgeCirc: %s", distEdgeCirc) - u = projettePointSurCourbe(bout, distEdgeCirc[0][2]) - if (abs(u) < 0.02) or (abs(1-u) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément. - extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True) - if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]): - bout = extrCircs[0] - else: - bout = extrCircs[1] - pass - else: - bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u) - name ="bout%d"%k - geompy.addToStudyInFather(centre, bout, name) - # enregistrement des points dans la structure - points = [] - for j in range(nbsegRad +1): - u = j/float(nbsegRad) - points.append(geompy.MakeVertexOnCurve(edge, u)) - if geompy.MinDistance(bout, points[0]) < geompy.MinDistance(centre, points[0]): - points.reverse() - points[0] = centre - points[-1] = bout - gptdsk.append(points) - if i == 0: - gptsdisks[idisklim[0] -1] = gptdsk - idisklim[0] = idisklim[0] -1 - else: - gptsdisks[idisklim[1] +1] = gptdsk - idisklim[1] = idisklim[1] +1 - + + (gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, + ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad) + # --- ajustement precis des points sur edgesPipeFissureExterneC - edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) - verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe) - idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté - idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté - idiskint = [] - for vtx in verticesPFE: - distPtVt = [] - for idisk in range(idiskmin, idiskmax): - gptdsk = gptsdisks[idisk] - pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe - distPtVt.append((geompy.MinDistance(pt, vtx), idisk)) - distPtVt.sort() - idiskint.append(distPtVt[0][1]) - gptsdisks[idiskint[-1]][0][-1] = vtx - logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0]) - for idisk in range(idiskmin, idiskmax): - if idisk in idiskint: - break - logging.debug("ajustement point sur edgePipeFissureExterne: %s", idisk) - gptdsk = gptsdisks[idisk] - pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe - distPtEd = [(geompy.MinDistance(pt, edgePFE), k, edgePFE) for k, edgePFE in enumerate(edgesPFE)] - distPtEd.sort() - edgePFE = distPtEd[0][2] - u = projettePointSurCourbe(pt, edgePFE) - ptproj = geompy.MakeVertexOnCurve(edgePFE, u) - gptsdisks[idisk][0][-1] = ptproj + gptsdisks = ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne, gptsdisks, idisklim) + + # --- maillage effectif du pipe + + (meshPipe, meshPipeGroups, edgesCircPipeGroup) = construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad) - # ----------------------------------------------------------------------- - # --- maillage effectif du pipe - - logging.debug("---------------------------- maillage effectif du pipe --------------") - meshPipe = smesh.Mesh(None, "meshPipe") - fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS") - nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis") - faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi") - edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss") - edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0") - edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1") - faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0") - faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1") - mptsdisks = [] # vertices maillage de tous les disques - mEdges = [] # identifiants edges maillage fond de fissure - mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe - mFaces = [] # identifiants faces maillage fissure - mVols = [] # identifiants volumes maillage pipe - - mptdsk = None - for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes - - # ----------------------------------------------------------------------- - # --- points - - gptdsk = gptsdisks[idisk] - if idisk > idisklim[0]: - oldmpts = mptdsk - mptdsk = [] # vertices maillage d'un disque - for k in range(nbsegCercle): - points = gptdsk[k] - mptids = [] - for j, pt in enumerate(points): - if j == 0 and k > 0: - id = mptdsk[0][0] - else: - coords = geompy.PointCoordinates(pt) - id = meshPipe.AddNode(coords[0], coords[1], coords[2]) - mptids.append(id) - mptdsk.append(mptids) - mptsdisks.append(mptdsk) - - # ----------------------------------------------------------------------- - # --- groupes edges cercles debouchants - - if idisk == idisklim[0]: - pts = [] - for k in range(nbsegCercle): - pts.append(mptdsk[k][-1]) - edges = [] - for k in range(len(pts)): - k1 = (k+1)%len(pts) - idEdge = meshPipe.AddEdge([pts[k], pts[k1]]) - edges.append(idEdge) - edgeCircPipe0Group.Add(edges) - - if idisk == idisklim[1]: - pts = [] - for k in range(nbsegCercle): - pts.append(mptdsk[k][-1]) - edges = [] - for k in range(len(pts)): - k1 = (k+1)%len(pts) - idEdge = meshPipe.AddEdge([pts[k], pts[k1]]) - edges.append(idEdge) - edgeCircPipe1Group.Add(edges) - - # ----------------------------------------------------------------------- - # --- groupes faces debouchantes - - if idisk == idisklim[0]: - faces = [] - for j in range(nbsegRad): - for k in range(nbsegCercle): - k1 = k+1 - if k == nbsegCercle-1: - k1 = 0 - if j == 0: - idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle - else: - idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle - faces.append(idf) - faceCircPipe0Group.Add(faces) - - if idisk == idisklim[1]: - faces = [] - for j in range(nbsegRad): - for k in range(nbsegCercle): - k1 = k+1 - if k == nbsegCercle-1: - k1 = 0 - if j == 0: - idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle - else: - idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle - faces.append(idf) - faceCircPipe1Group.Add(faces) - - # ----------------------------------------------------------------------- - # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure - - if idisk == idisklim[0]: - mEdges.append(0) - mEdgeFaces.append(0) - mFaces.append([0]) - mVols.append([[0]]) - nodesFondFissGroup.Add([mptdsk[0][0]]) - else: - ide = meshPipe.AddEdge([oldmpts[0][0], mptdsk[0][0]]) - mEdges.append(ide) - fondFissGroup.Add([ide]) - nodesFondFissGroup.Add([mptdsk[0][0]]) - ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]]) - mEdgeFaces.append(ide2) - edgeFaceFissGroup.Add([ide2]) - idFaces = [] - idVols = [] - - for j in range(nbsegRad): - idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]]) - faceFissGroup.Add([idf]) - idFaces.append(idf) - - idVolCercle = [] - for k in range(nbsegCercle): - k1 = k+1 - if k == nbsegCercle-1: - k1 = 0 - if j == 0: - idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], - oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1]]) - else: - idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j], - oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1], oldmpts[k1][j]]) - idVolCercle.append(idv) - idVols.append(idVolCercle) - - mFaces.append(idFaces) - mVols.append(idVols) - - pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' ) - nbAdd = pipeFissGroup.AddFrom( meshPipe.GetMesh() ) - - nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries") - edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group] - - # --- fin du maillage du pipe - # ----------------------------------------------------------------------- # --- edges de bord, faces défaut à respecter - - aFilterManager = smesh.CreateFilterManager() - nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ]) - criteres = [] - unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0) - criteres.append(unCritere) - filtre = smesh.GetFilterFromCriteria(criteres) - bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre ) - smesh.SetName(bordsLibres, 'bordsLibres') - - # --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes - # on désigne les faces de peau en quadrangles par le groupe "skinFaces" - - skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' ) - nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() ) - - # --- maillage des éventuelles arêtes vives entre faces reconstruites - if len(aretesVivesCoupees) > 0: - aretesVivesC = geompy.MakeCompound(aretesVivesCoupees) - meshAretesVives = smesh.Mesh(aretesVivesC) - algo1d = meshAretesVives.Segment() - hypo1d = algo1d.LocalLength(dmoyen,[],1e-07) - putName(algo1d.GetSubMesh(), "aretesVives") - putName(algo1d, "algo1d_aretesVives") - putName(hypo1d, "hypo1d_aretesVives") - isDone = meshAretesVives.Compute() - logging.info("aretesVives fini") - grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' ) - nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() ) + (internalBoundary, bordsLibres, grpAretesVives) = mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, dmoyen) - # ----------------------------------------------------------------------- # --- maillage faces de fissure - logging.debug("---------------------------- maillage faces de fissure externes au pipe :%s --------------", len(facesFissExt)) - - meshFaceFiss = smesh.Mesh(faceFissureExterne) - algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( areteFaceFissure ) - hypo2d.SetSecondOrder( 0 ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) - hypo2d.SetQuadAllowed( 0 ) - putName(algo2d.GetSubMesh(), "faceFiss") - putName(algo2d, "algo2d_faceFiss") - putName(hypo2d, "hypo2d_faceFiss") - - algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) - hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0) - putName(algo1d.GetSubMesh(), "edgeFissPeau") - putName(algo1d, "algo1d_edgeFissPeau") - putName(hypo1d, "hypo1d_edgeFissPeau") - - isDone = meshFaceFiss.Compute() - logging.info("meshFaceFiss fini") - - grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE) - grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE) - grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) + (meshFaceFiss, grpFaceFissureExterne, + grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne) = mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC, + meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad) # --- maillage faces de peau - - boutFromIfil = [None for i in range(nbFacesFilling)] - if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes - boutFromIfil[idFillingFromBout[0]] = 0 - boutFromIfil[idFillingFromBout[1]] = 1 - logging.debug("---------------------------- maillage faces de peau --------------") - meshesFacesPeau = [] - for ifil in range(nbFacesFilling): - meshFacePeau = None - if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte - - # --- edges de bord de la face de filling - filling = facesDefaut[ifil] - edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) - groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) - geompy.UnionList(groupEdgesBordPeau, edgesFilling) - geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords") - - meshFacePeau = smesh.Mesh(facesDefaut[ifil]) - - algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) - hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) - putName(algo1d.GetSubMesh(), "bordsLibres", ifil) - putName(algo1d, "algo1d_bordsLibres", ifil) - putName(hypo1d, "hypo1d_bordsLibres", ifil) - - else: - - facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) - edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] - verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] - groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine - bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives - edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] - - meshFacePeau = smesh.Mesh(facePeau) - - algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) - hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) - putName(algo1d.GetSubMesh(), "bordsLibres", ifil) - putName(algo1d, "algo1d_bordsLibres", ifil) - putName(hypo1d, "hypo1d_bordsLibres", ifil) - - algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau)) - hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) - putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil) - putName(algo1d, "algo1d_edgePeauFiss", ifil) - putName(hypo1d, "hypo1d_edgePeauFiss", ifil) - - if bordsVifs is not None: - algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) - hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) - putName(algo1d.GetSubMesh(), "bordsVifs", ifil) - putName(algo1d, "algo1d_bordsVifs", ifil) - putName(hypo1d, "hypo1d_bordsVifs", ifil) - - for i, edgeCirc in enumerate(edgesCircPeau): - if edgeCirc is not None: - algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) - if boutFromIfil[ifil] is None: - hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i] ],0,0) - else: - hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) - name = "cercle%d"%i - putName(algo1d.GetSubMesh(), name, ifil) - putName(algo1d, "algo1d_" + name, ifil) - putName(hypo1d, "hypo1d_" + name, ifil) - - algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( dmoyen ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) - hypo2d.SetQuadAllowed( 0 ) - putName(algo2d.GetSubMesh(), "facePeau", ifil) - putName(algo2d, "algo2d_facePeau", ifil) - putName(hypo2d, "hypo2d_facePeau", ifil) - - isDone = meshFacePeau.Compute() - logging.info("meshFacePeau %d fini", ifil) - GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) - nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) - meshesFacesPeau.append(meshFacePeau) + meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, + facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, + bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, + edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad) # --- regroupement des maillages du défaut @@ -878,8 +267,6 @@ def construitFissureGenerale(maillagesSains, groups = meshBoiteDefaut.GetGroups() for grp in groups: if grp.GetType() == SMESH.FACE: - #if "internalBoundary" in grp.GetName(): - # grp.SetName("skinFaces") if grp.GetName() == "fisOutPi": group_faceFissOutPipe = grp elif grp.GetName() == "fisInPi": diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe.py b/src/Tools/blocFissure/gmu/construitMaillagePipe.py new file mode 100644 index 000000000..d5f395db3 --- /dev/null +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe.py @@ -0,0 +1,168 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from geomsmesh import smesh + +def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad): + """ + maillage effectif du pipe + """ + logging.info('start') + meshPipe = smesh.Mesh(None, "meshPipe") + fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS") + nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis") + faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi") + edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss") + edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0") + edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1") + faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0") + faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1") + + mptsdisks = [] # vertices maillage de tous les disques + mEdges = [] # identifiants edges maillage fond de fissure + mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe + mFaces = [] # identifiants faces maillage fissure + mVols = [] # identifiants volumes maillage pipe + + mptdsk = None + for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes + + # ----------------------------------------------------------------------- + # --- points + + gptdsk = gptsdisks[idisk] + if idisk > idisklim[0]: + oldmpts = mptdsk + mptdsk = [] # vertices maillage d'un disque + for k in range(nbsegCercle): + points = gptdsk[k] + mptids = [] + for j, pt in enumerate(points): + if j == 0 and k > 0: + id = mptdsk[0][0] + else: + coords = geompy.PointCoordinates(pt) + id = meshPipe.AddNode(coords[0], coords[1], coords[2]) + mptids.append(id) + mptdsk.append(mptids) + mptsdisks.append(mptdsk) + + # ----------------------------------------------------------------------- + # --- groupes edges cercles debouchants + + if idisk == idisklim[0]: + pts = [] + for k in range(nbsegCercle): + pts.append(mptdsk[k][-1]) + edges = [] + for k in range(len(pts)): + k1 = (k+1)%len(pts) + idEdge = meshPipe.AddEdge([pts[k], pts[k1]]) + edges.append(idEdge) + edgeCircPipe0Group.Add(edges) + + if idisk == idisklim[1]: + pts = [] + for k in range(nbsegCercle): + pts.append(mptdsk[k][-1]) + edges = [] + for k in range(len(pts)): + k1 = (k+1)%len(pts) + idEdge = meshPipe.AddEdge([pts[k], pts[k1]]) + edges.append(idEdge) + edgeCircPipe1Group.Add(edges) + + # ----------------------------------------------------------------------- + # --- groupes faces debouchantes + + if idisk == idisklim[0]: + faces = [] + for j in range(nbsegRad): + for k in range(nbsegCercle): + k1 = k+1 + if k == nbsegCercle-1: + k1 = 0 + if j == 0: + idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle + else: + idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle + faces.append(idf) + faceCircPipe0Group.Add(faces) + + if idisk == idisklim[1]: + faces = [] + for j in range(nbsegRad): + for k in range(nbsegCercle): + k1 = k+1 + if k == nbsegCercle-1: + k1 = 0 + if j == 0: + idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle + else: + idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle + faces.append(idf) + faceCircPipe1Group.Add(faces) + + # ----------------------------------------------------------------------- + # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure + + if idisk == idisklim[0]: + mEdges.append(0) + mEdgeFaces.append(0) + mFaces.append([0]) + mVols.append([[0]]) + nodesFondFissGroup.Add([mptdsk[0][0]]) + else: + ide = meshPipe.AddEdge([oldmpts[0][0], mptdsk[0][0]]) + mEdges.append(ide) + fondFissGroup.Add([ide]) + nodesFondFissGroup.Add([mptdsk[0][0]]) + ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]]) + mEdgeFaces.append(ide2) + edgeFaceFissGroup.Add([ide2]) + idFaces = [] + idVols = [] + + for j in range(nbsegRad): + idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]]) + faceFissGroup.Add([idf]) + idFaces.append(idf) + + idVolCercle = [] + for k in range(nbsegCercle): + k1 = k+1 + if k == nbsegCercle-1: + k1 = 0 + if j == 0: + idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], + oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1]]) + else: + idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j], + oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1], oldmpts[k1][j]]) + idVolCercle.append(idv) + idVols.append(idVolCercle) + + mFaces.append(idFaces) + mVols.append(idVols) + + pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' ) + nbAdd = pipeFissGroup.AddFrom( meshPipe.GetMesh() ) + + nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries") + edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group] + + meshPipeGroups = dict(fondFissGroup = fondFissGroup, + nodesFondFissGroup = nodesFondFissGroup, + faceFissGroup = faceFissGroup, + edgeFaceFissGroup = edgeFaceFissGroup, + edgeCircPipe0Group = edgeCircPipe0Group, + edgeCircPipe1Group = edgeCircPipe1Group, + faceCircPipe0Group = faceCircPipe0Group, + faceCircPipe1Group = faceCircPipe1Group, + pipeFissGroup = pipeFissGroup, + edgesCircPipeGroup = edgesCircPipeGroup + ) + + return (meshPipe, meshPipeGroups, edgesCircPipeGroup) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/creePointsPipePeau.py b/src/Tools/blocFissure/gmu/creePointsPipePeau.py new file mode 100644 index 000000000..30836c723 --- /dev/null +++ b/src/Tools/blocFissure/gmu/creePointsPipePeau.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from projettePointSurCourbe import projettePointSurCourbe + +def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, + ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad): + """ + création des points du maillage du pipe sur la face de peau + """ + logging.info('start') + + for i, edges in enumerate(listEdges): + idf = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) + if idf >= 0: + gptdsk = [] + if idf > 0: # idf vaut 0 ou 1 + idf = -1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) + centre = ptEdgeFond[idFillingFromBout[i]][idf] + name = "centre%d"%idf + geompy.addToStudy(centre, name) + vertPipePeau = ptFisExtPi[idFillingFromBout[i]][idf] + geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau") + grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes + edgesCirc = [] + for grpEdgesCirc in grpsEdgesCirc: + edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False) + for k, edge in enumerate(edges): + extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True) + if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]): + bout = extrems[1] + else: + bout = extrems[0] + # ajustement du point extrémité (bout) sur l'edge circulaire en face de peau + logging.debug("edgesCirc: %s", edgesCirc) + distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)] + distEdgeCirc.sort() + logging.debug("distEdgeCirc: %s", distEdgeCirc) + u = projettePointSurCourbe(bout, distEdgeCirc[0][2]) + if (abs(u) < 0.02) or (abs(1-u) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément. + extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True) + if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]): + bout = extrCircs[0] + else: + bout = extrCircs[1] + else: + bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u) + name ="bout%d"%k + geompy.addToStudyInFather(centre, bout, name) + # enregistrement des points dans la structure + points = [] + for j in range(nbsegRad +1): + u = j/float(nbsegRad) + points.append(geompy.MakeVertexOnCurve(edge, u)) + if geompy.MinDistance(bout, points[0]) < geompy.MinDistance(centre, points[0]): + points.reverse() + points[0] = centre + points[-1] = bout + gptdsk.append(points) + if i == 0: + gptsdisks[idisklim[0] -1] = gptdsk + idisklim[0] = idisklim[0] -1 + else: + gptsdisks[idisklim[1] +1] = gptdsk + idisklim[1] = idisklim[1] +1 + + return (gptsdisks, idisklim) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/elimineExtremitesPipe.py b/src/Tools/blocFissure/gmu/elimineExtremitesPipe.py new file mode 100644 index 000000000..edfb5ed60 --- /dev/null +++ b/src/Tools/blocFissure/gmu/elimineExtremitesPipe.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from whichSideVertex import whichSideVertex + +def elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle): + """ + recherche des points en trop (externes au volume à remailler) + - on associe chaque extrémité du pipe à une face filling + - on part des disques aux extrémités du pipe + - pour chaque disque, on prend les vertices de géométrie, + on marque leur position relative à la face. + - on s'arrete quand tous les noeuds sont dedans + """ + + logging.info('start') + + pt0 = centres[0] + pt1 = centres[-1] + idFillingFromBout = [None, None] # contiendra l'index du filling pour les extrémités 0 et 1 + nbFacesFilling = len(ptEdgeFond) + for ifil in range(nbFacesFilling): + for ipt, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face + if geompy.MinDistance(pt,pt0) < geompy.MinDistance(pt,pt1): # TODO: trouver plus fiable pour les cas tordus... + idFillingFromBout[0] = ifil + else: + idFillingFromBout[1] = ifil + logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout) + + logging.debug("recherche des disques de noeuds complètement internes") + idisklim = [] # indices des premier et dernier disques internes + idiskout = [] # indices des premier et dernier disques externes + for bout in range(2): + if bout == 0: + idisk = -1 + inc = 1 + numout = -1 + else: + idisk = len(gptsdisks) + inc = -1 + numout = len(gptsdisks) + inside = False + outside = True + while not inside: + idisk = idisk + inc + logging.debug("examen disque %s", idisk) + gptdsk = gptsdisks[idisk] + inside = True + for k in range(nbsegCercle): + points = gptdsk[k] + for j, pt in enumerate(points): + side = whichSideVertex(facesDefaut[idFillingFromBout[bout]], pt) + if side < 0: + if outside: # premier point detecté dedans + outside = False + numout = idisk -inc # le disque précédent était dehors + else: + inside = False # ce point est dehors + if not inside and not outside: + break + idisklim.append(idisk) # premier et dernier disques internes + idiskout.append(numout) # premier et dernier disques externes + + return (idFillingFromBout, idisklim, idiskout) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py index ff138f329..0d74241a0 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py @@ -134,4 +134,4 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, - bordsVifs, edgesFissurePeau) + bordsVifs, edgesFissurePeau, aretesVivesCoupees) diff --git a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py index 397bf18f9..a2a19001c 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py @@ -1,17 +1,7 @@ # -*- coding: utf-8 -*- import logging -import math -from geomsmesh import geompy - -from extractionOrientee import extractionOrientee -from extractionOrienteeMulti import extractionOrienteeMulti -from orderEdgesFromWire import orderEdgesFromWire -from produitMixte import produitMixte -from whichSide import whichSide -from sortFaces import sortFaces -from substractSubShapes import substractSubShapes from identifieElementsFissure import identifieElementsFissure from identifieElementsDebouchants import identifieElementsDebouchants from trouveEdgesFissPeau import trouveEdgesFissPeau @@ -60,8 +50,8 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, - bordsVifs, edgesFissurePeau) = identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, - edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees) + bordsVifs, edgesFissurePeau, aretesVivesCoupees) = identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, + edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees) dataPPFF = dict(endsEdgeFond = endsEdgeFond, # pour chaque face [points edge fond de fissure aux débouchés du pipe] facesPipePeau = facesPipePeau, # pour chaque face [face diff --git a/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py new file mode 100644 index 000000000..0b4c780b1 --- /dev/null +++ b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy + +def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss): + """ + identification des faces et edges de fissure externe pour maillage + """ + logging.info('start') + + facesFissExt = [] + edgesFissExtPeau = [] + edgesFissExtPipe = [] + for ifil in len(fsFissuExt): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?) + facesFissExt += fsFissuExt[ifil] + edgesFissExtPeau += edFisExtPe[ifil] + edgesFissExtPipe += edFisExtPi[ifil] + logging.debug("---------------------------- identification faces de fissure externes au pipe :%s ", len(facesFissExt)) + # regroupement des faces de fissure externes au pipe. + + if len(facesFissExt) > 1: + faceFissureExterne = geompy.MakePartition(facesFissExt, [], [], [], geompy.ShapeType["FACE"], 0, [], 0) + edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss)) # edgesFissExtPipe peut ne pas couvrir toute la longueur + # edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau)) + # il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau + (isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne) + edgesBordFFE = [] + for bound in closedFreeBoundaries: + edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False) + edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE] + logging.debug("edgesBordFFEid %s", edgesBordFFEid) + edgesPPE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False) + edgesPPEid = [ geompy.GetSubShapeID(faceFissureExterne, ed) for ed in edgesPPE] + logging.debug("edgesPPEid %s", edgesPPEid) + edgesPFE = [ edid[0] for edid in edgesBordFFEid if edid[1] not in edgesPPEid] # on garde toutes les edges de bord non en contact avec le pipe + logging.debug("edgesPFE %s", edgesPFE) + edgesPeauFissureExterneC = geompy.MakeCompound(edgesPFE) + else: + faceFissureExterne = facesFissExt[0] + edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau) + edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe) + wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)) + geompy.addToStudy(faceFissureExterne, "faceFissureExterne") + geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") + geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") + + return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py new file mode 100644 index 000000000..bd070af8e --- /dev/null +++ b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from geomsmesh import smesh + +from putName import putName + +def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, dmoyen): + """ + edges de bord, faces défaut à respecter + """ + logging.info('start') + + aFilterManager = smesh.CreateFilterManager() + nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ]) + criteres = [] + unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0) + criteres.append(unCritere) + filtre = smesh.GetFilterFromCriteria(criteres) + bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre ) + smesh.SetName(bordsLibres, 'bordsLibres') + + # --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes + # on désigne les faces de peau en quadrangles par le groupe "skinFaces" + + skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' ) + nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() ) + + # --- maillage des éventuelles arêtes vives entre faces reconstruites + + if len(aretesVivesCoupees) > 0: + aretesVivesC = geompy.MakeCompound(aretesVivesCoupees) + meshAretesVives = smesh.Mesh(aretesVivesC) + algo1d = meshAretesVives.Segment() + hypo1d = algo1d.LocalLength(dmoyen,[],1e-07) + putName(algo1d.GetSubMesh(), "aretesVives") + putName(algo1d, "algo1d_aretesVives") + putName(hypo1d, "hypo1d_aretesVives") + isDone = meshAretesVives.Compute() + logging.info("aretesVives fini") + grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' ) + nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() ) + + return (internalBoundary, bordsLibres, grpAretesVives) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py new file mode 100644 index 000000000..94bf8c5a5 --- /dev/null +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from geomsmesh import smesh +from salome.smesh import smeshBuilder + +from putName import putName + +def mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC, + meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad): + """ + maillage faces de fissure + """ + logging.info('start') + + meshFaceFiss = smesh.Mesh(faceFissureExterne) + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( areteFaceFissure ) + hypo2d.SetSecondOrder( 0 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) + putName(algo2d.GetSubMesh(), "faceFiss") + putName(algo2d, "algo2d_faceFiss") + putName(hypo2d, "hypo2d_faceFiss") + + algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) + hypo1d = algo1d.SourceEdges([ meshPipeGroups['edgeFaceFissGroup'] ],0,0) + putName(algo1d.GetSubMesh(), "edgeFissPeau") + putName(algo1d, "algo1d_edgeFissPeau") + putName(hypo1d, "hypo1d_edgeFissPeau") + + isDone = meshFaceFiss.Compute() + logging.info("meshFaceFiss fini") + + grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE) + grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE) + grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) + + return (meshFaceFiss, grpFaceFissureExterne, grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py new file mode 100644 index 000000000..7b25c43ac --- /dev/null +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- + +import logging + +from geomsmesh import geompy +from geomsmesh import smesh +from salome.smesh import smeshBuilder + +from putName import putName + +def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, + facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, + bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, + edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad): + """ + maillage faces de peau + """ + logging.info('start') + nbFacesFilling = len(partitionsPeauFissFond) + boutFromIfil = [None for i in range(nbFacesFilling)] + if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes + boutFromIfil[idFillingFromBout[0]] = 0 + boutFromIfil[idFillingFromBout[1]] = 1 + + logging.debug("---------------------------- maillage faces de peau --------------") + meshesFacesPeau = [] + for ifil in range(nbFacesFilling): + meshFacePeau = None + if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte + + # --- edges de bord de la face de filling + filling = facesDefaut[ifil] + edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) + groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) + geompy.UnionList(groupEdgesBordPeau, edgesFilling) + geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords") + + meshFacePeau = smesh.Mesh(facesDefaut[ifil]) + + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(algo1d.GetSubMesh(), "bordsLibres", ifil) + putName(algo1d, "algo1d_bordsLibres", ifil) + putName(hypo1d, "hypo1d_bordsLibres", ifil) + + else: + + facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) + edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] + verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] + groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine + bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives + edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] + + meshFacePeau = smesh.Mesh(facePeau) + + algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(algo1d.GetSubMesh(), "bordsLibres", ifil) + putName(algo1d, "algo1d_bordsLibres", ifil) + putName(hypo1d, "hypo1d_bordsLibres", ifil) + + algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau)) + hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) + putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil) + putName(algo1d, "algo1d_edgePeauFiss", ifil) + putName(hypo1d, "hypo1d_edgePeauFiss", ifil) + + if bordsVifs is not None: + algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) + hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) + putName(algo1d.GetSubMesh(), "bordsVifs", ifil) + putName(algo1d, "algo1d_bordsVifs", ifil) + putName(hypo1d, "hypo1d_bordsVifs", ifil) + + for i, edgeCirc in enumerate(edgesCircPeau): + if edgeCirc is not None: + algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) + if boutFromIfil[ifil] is None: + hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i] ],0,0) + else: + hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) + name = "cercle%d"%i + putName(algo1d.GetSubMesh(), name, ifil) + putName(algo1d, "algo1d_" + name, ifil) + putName(hypo1d, "hypo1d_" + name, ifil) + + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( dmoyen ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) + putName(algo2d.GetSubMesh(), "facePeau", ifil) + putName(algo2d, "algo2d_facePeau", ifil) + putName(hypo2d, "hypo2d_facePeau", ifil) + + isDone = meshFacePeau.Compute() + logging.info("meshFacePeau %d fini", ifil) + GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) + nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) + meshesFacesPeau.append(meshFacePeau) + + return meshesFacesPeau \ No newline at end of file From 249a5808d82222ae3f9cde764ed8387a5d7ea72e Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 21 Sep 2014 21:49:53 +0200 Subject: [PATCH 013/147] debug --- src/Tools/blocFissure/CasTests/execution_Cas.py | 2 +- .../gmu/construitEdgesRadialesDebouchantes.py | 4 ++++ .../blocFissure/gmu/construitFissureGenerale.py | 13 +++++++++---- src/Tools/blocFissure/gmu/construitMaillagePipe.py | 1 + .../gmu/identifieElementsGeometriquesPeau.py | 2 +- .../gmu/identifieFacesEdgesFissureExterne.py | 2 +- src/Tools/blocFissure/gmu/mailleAretesEtJonction.py | 2 ++ src/Tools/blocFissure/gmu/mailleFacesFissure.py | 1 + src/Tools/blocFissure/gmu/mailleFacesPeau.py | 1 + 9 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 9936248f3..580861961 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -131,7 +131,7 @@ runall = True if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 - torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,] + torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,] for i in range(len(problemes)): if torun[i]: diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py index 294309177..91b1b725c 100644 --- a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py +++ b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py @@ -3,6 +3,7 @@ import logging from geomsmesh import geompy +import GEOM from sortEdges import sortEdges def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, @@ -48,6 +49,9 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, for i, nappes in enumerate(listNappes): if facesDebouchantes[i]: for k, face in enumerate(facesPipePeau): + #logging.debug('i, k, face, nappes[0] %s %s %s %s', i, k, face, nappes[0]) + #geompy.addToStudy(nappes[0], 'lanappe') + #geompy.addToStudy(face, 'laface') edge = geompy.MakeSection(face, nappes[0]) if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0: idFacesDebouchantes[i] = k diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index f6858132f..d4936d0ae 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -154,8 +154,8 @@ def construitFissureGenerale(maillagesSains, nbFacesFilling = len(partitionsPeauFissFond) ptEdgeFond = [ [] for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe] - facesPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] - edgeRadFacePipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] + fsPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes] + edRadFPiPo = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ] fsFissuExt = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe] edFisExtPe = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)] edFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes] @@ -174,8 +174,8 @@ def construitFissureGenerale(maillagesSains, facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees) ptEdgeFond[ifil] = dataPPFF['endsEdgeFond'] - facesPipePeau[ifil] = dataPPFF['facesPipePeau'] - edgeRadFacePipePeau[ifil] = dataPPFF['edgeRadFacePipePeau'] + fsPipePeau[ifil] = dataPPFF['facesPipePeau'] + edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau'] fsFissuExt[ifil] = dataPPFF['facesFissExt'] edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau'] edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe'] @@ -187,6 +187,11 @@ def construitFissureGenerale(maillagesSains, edFissPeau[ifil] = dataPPFF['edgesFissurePeau'] ptFisExtPi[ifil] = dataPPFF['verticesPipePeau'] + facesPipePeau = [] + edgeRadFacePipePeau = [] + for ifil in range(nbFacesFilling): + facesPipePeau += fsPipePeau[ifil] + edgeRadFacePipePeau += edRadFPiPo[ifil] for i, avc in enumerate(aretesVivesCoupees): name = "areteViveCoupee%d"%i diff --git a/src/Tools/blocFissure/gmu/construitMaillagePipe.py b/src/Tools/blocFissure/gmu/construitMaillagePipe.py index d5f395db3..e08ba47c3 100644 --- a/src/Tools/blocFissure/gmu/construitMaillagePipe.py +++ b/src/Tools/blocFissure/gmu/construitMaillagePipe.py @@ -4,6 +4,7 @@ import logging from geomsmesh import geompy from geomsmesh import smesh +import SMESH def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad): """ diff --git a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py index a2a19001c..c60682c51 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py @@ -54,7 +54,7 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees) dataPPFF = dict(endsEdgeFond = endsEdgeFond, # pour chaque face [points edge fond de fissure aux débouchés du pipe] - facesPipePeau = facesPipePeau, # pour chaque face [face + facesPipePeau = facesPipePeau, # pour chaque face [faces du pipe débouchantes] edgeRadFacePipePeau = edgeRadFacePipePeau, # pour chaque face [edge radiale des faces du pipe débouchantes ] facesFissExt = facesFissExt, # pour chaque face [faces de fissure externes au pipe] edgesFissExtPeau = edgesFissExtPeau, # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)] diff --git a/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py index 0b4c780b1..856cfae48 100644 --- a/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py +++ b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py @@ -13,7 +13,7 @@ def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesP facesFissExt = [] edgesFissExtPeau = [] edgesFissExtPipe = [] - for ifil in len(fsFissuExt): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?) + for ifil in range(len(fsFissuExt)): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?) facesFissExt += fsFissuExt[ifil] edgesFissExtPeau += edFisExtPe[ifil] edgesFissExtPipe += edFisExtPi[ifil] diff --git a/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py index bd070af8e..179124308 100644 --- a/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py +++ b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py @@ -4,6 +4,7 @@ import logging from geomsmesh import geompy from geomsmesh import smesh +import SMESH from putName import putName @@ -30,6 +31,7 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, dmoyen): # --- maillage des éventuelles arêtes vives entre faces reconstruites + grpAretesVives = None if len(aretesVivesCoupees) > 0: aretesVivesC = geompy.MakeCompound(aretesVivesCoupees) meshAretesVives = smesh.Mesh(aretesVivesC) diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py index 94bf8c5a5..90bd87012 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesFissure.py +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -5,6 +5,7 @@ import logging from geomsmesh import geompy from geomsmesh import smesh from salome.smesh import smeshBuilder +import SMESH from putName import putName diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index 7b25c43ac..5ff5170be 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -5,6 +5,7 @@ import logging from geomsmesh import geompy from geomsmesh import smesh from salome.smesh import smeshBuilder +import SMESH from putName import putName From 77b224bfc97465d694c206f026d02fc5ea70a0a3 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 21 Sep 2014 23:21:50 +0200 Subject: [PATCH 014/147] un premier test de publication conditionnelle --- .../blocFissure/CasTests/execution_Cas.py | 2 +- src/Tools/blocFissure/gmu/geomsmesh.py | 10 ++++++++ .../blocFissure/gmu/identifieEdgesPeau.py | 23 ++++++++++-------- src/Tools/blocFissure/gmu/initLog.py | 24 +++++++++++++++---- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 580861961..487ac69bc 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -127,7 +127,7 @@ problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.reference # ---tous les cas en sequence, ou les cas selectionnés ... -runall = True +runall = False if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 diff --git a/src/Tools/blocFissure/gmu/geomsmesh.py b/src/Tools/blocFissure/gmu/geomsmesh.py index 889d35ba3..baa874ee7 100644 --- a/src/Tools/blocFissure/gmu/geomsmesh.py +++ b/src/Tools/blocFissure/gmu/geomsmesh.py @@ -2,6 +2,7 @@ import logging logging.info('start') +from initLog import getLogLevel import salome salome.salome_init() @@ -13,3 +14,12 @@ from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) logging.debug("initialisation de geompy et smesh OK") + +def geomPublishDebug(aShape, aName): + if getLogLevel() <= 1: + geompy.addToStudy(aShape, aName) + +def geomPublishDebugInFather(aFather, aShape, aName): + if getLogLevel() <= 1: + geompy.addToStudyInFather(aFather, aShape, aName) + \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py index 0d74241a0..efb7df915 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublishDebug +from geomsmesh import geomPublishDebugInFather + from substractSubShapes import substractSubShapes def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSorted, @@ -36,13 +39,13 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor nameEdge = "edgeRadFacePipePeau%d"%i facesPipePeau[i] = face endsEdgeFond[i] = sharedVertices[0] - geompy.addToStudy(face, nameFace) - geompy.addToStudy(sharedVertices[0], nameVert) + geomPublishDebug(face, nameFace) + geomPublishDebug(sharedVertices[0], nameVert) edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True) for edge in edgesFace: if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3: edgeRadFacePipePeau[i] = edge - geompy.addToStudy(edge, nameEdge) + geomPublishDebug(edge, nameEdge) break pass pass @@ -59,14 +62,14 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor geompy.UnionList(grpEdgesCirc, edges) edgesCircPeau[i] = grpEdgesCirc name = "edgeCirc%d"%i - geompy.addToStudyInFather(facePeau, grpEdgesCirc, name) + geomPublishDebugInFather(facePeau, grpEdgesCirc, name) edgesListees = edgesListees + edges vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"]) grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"]) geompy.UnionList(grpVertCircPeau, vertices) verticesCircPeau[i] = grpVertCircPeau name = "pointEdgeCirc%d"%i - geompy.addToStudyInFather(facePeau, grpVertCircPeau, name) + geomPublishDebugInFather(facePeau, grpVertCircPeau, name) pass pass # --- au moins une extrémité du pipe sur cette face de peau @@ -77,7 +80,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor for i, edge in enumerate(edgesFilling): edgepeau = geompy.GetInPlace(facePeau, edge) name = "edgepeau%d"%i - geompy.addToStudyInFather(facePeau,edgepeau, name) + geomPublishDebugInFather(facePeau,edgepeau, name) logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau)) if geompy.ShapeInfo(edgepeau)['EDGE'] > 1: logging.debug(" EDGES multiples") @@ -94,7 +97,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor if aretesVivesC is not None: bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC) if bordsVifs is not None: - geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs") + geomPublishDebugInFather(facePeau, bordsVifs, "bordsVifs") groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs) grptmp = None if len(aretesVivesCoupees) > 0: @@ -108,7 +111,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False) aretesVivesCoupees += edv logging.debug("aretesVivesCoupees %s",aretesVivesCoupees) - geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords") + geomPublishDebugInFather(facePeau, groupEdgesBordPeau , "EdgesBords") # --- edges de la face de peau partagées avec la face de fissure @@ -122,7 +125,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau): edgesFissurePeau[i] = edge name = "edgeFissurePeau%d"%i - geompy.addToStudyInFather(facePeau, edge, name) + geomPublishDebugInFather(facePeau, edge, name) for edge in edges: # on ajoute après les edges manquantes if edge not in edgesFissurePeau: edgesFissurePeau.append(edge) @@ -130,7 +133,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor for i, edge in enumerate(edges): edgesFissurePeau.append(edge) name = "edgeFissurePeau%d"%i - geompy.addToStudyInFather(facePeau, edge, name) + geomPublishDebugInFather(facePeau, edge, name) return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, diff --git a/src/Tools/blocFissure/gmu/initLog.py b/src/Tools/blocFissure/gmu/initLog.py index 696a26ebe..adbdda00b 100644 --- a/src/Tools/blocFissure/gmu/initLog.py +++ b/src/Tools/blocFissure/gmu/initLog.py @@ -1,31 +1,45 @@ # -*- coding: utf-8 -*- import logging +loglevel = 3 def setDebug(): + global loglevel logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', level=logging.DEBUG) - logging.info('start Debug') + loglevel = 1 + logging.info('start Debug %s', loglevel) def setVerbose(): + global loglevel logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', level=logging.INFO) - logging.info('start Verbose') + loglevel = 2 + logging.info('start Verbose %s', loglevel) def setRelease(): + global loglevel logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', level=logging.WARNING) - logging.warning('start Release') + loglevel = 3 + logging.warning('start Release %s', loglevel) def setUnitTests(): + global loglevel logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', level=logging.CRITICAL) - logging.critical('start UnitTests') + loglevel = 4 + logging.critical('start UnitTests %s', loglevel) def setPerfTests(): + global loglevel logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', level=logging.CRITICAL) - logging.info('start PerfTests') + loglevel = 5 + logging.info('start PerfTests %s', loglevel) + +def getLogLevel(): + return loglevel #logging.basicConfig(filename='myapp.log', # format='%(asctime)s %(message)s', From b016dcf830950ab0b627ce9610ab05f10cf4a679 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 28 Nov 2014 14:35:10 +0100 Subject: [PATCH 015/147] essai formalisation niveaux de debug --- src/Tools/blocFissure/gmu/geomsmesh.py | 10 ++++---- .../blocFissure/gmu/identifieEdgesPeau.py | 25 ++++++++++--------- src/Tools/blocFissure/gmu/initLog.py | 19 +++++++++----- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/Tools/blocFissure/gmu/geomsmesh.py b/src/Tools/blocFissure/gmu/geomsmesh.py index baa874ee7..aa8f02c93 100644 --- a/src/Tools/blocFissure/gmu/geomsmesh.py +++ b/src/Tools/blocFissure/gmu/geomsmesh.py @@ -2,7 +2,7 @@ import logging logging.info('start') -from initLog import getLogLevel +import initLog import salome salome.salome_init() @@ -15,11 +15,11 @@ smesh = smeshBuilder.New(salome.myStudy) logging.debug("initialisation de geompy et smesh OK") -def geomPublishDebug(aShape, aName): - if getLogLevel() <= 1: +def geomPublish(level,aShape, aName): + if initLog.getLogLevel() <= level: geompy.addToStudy(aShape, aName) -def geomPublishDebugInFather(aFather, aShape, aName): - if getLogLevel() <= 1: +def geomPublishInFather(level, aFather, aShape, aName): + if initLog.getLogLevel() <= level: geompy.addToStudyInFather(aFather, aShape, aName) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py index efb7df915..19335d7fa 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py @@ -3,8 +3,9 @@ import logging from geomsmesh import geompy -from geomsmesh import geomPublishDebug -from geomsmesh import geomPublishDebugInFather +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from substractSubShapes import substractSubShapes @@ -39,13 +40,13 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor nameEdge = "edgeRadFacePipePeau%d"%i facesPipePeau[i] = face endsEdgeFond[i] = sharedVertices[0] - geomPublishDebug(face, nameFace) - geomPublishDebug(sharedVertices[0], nameVert) + geomPublish(initLog.debug, face, nameFace) + geomPublish(initLog.debug, sharedVertices[0], nameVert) edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True) for edge in edgesFace: if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3: edgeRadFacePipePeau[i] = edge - geomPublishDebug(edge, nameEdge) + geomPublish(initLog.debug, edge, nameEdge) break pass pass @@ -62,14 +63,14 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor geompy.UnionList(grpEdgesCirc, edges) edgesCircPeau[i] = grpEdgesCirc name = "edgeCirc%d"%i - geomPublishDebugInFather(facePeau, grpEdgesCirc, name) + geomPublishInFather(initLog.debug, facePeau, grpEdgesCirc, name) edgesListees = edgesListees + edges vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"]) grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"]) geompy.UnionList(grpVertCircPeau, vertices) verticesCircPeau[i] = grpVertCircPeau name = "pointEdgeCirc%d"%i - geomPublishDebugInFather(facePeau, grpVertCircPeau, name) + geomPublishInFather(initLog.debug, facePeau, grpVertCircPeau, name) pass pass # --- au moins une extrémité du pipe sur cette face de peau @@ -80,7 +81,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor for i, edge in enumerate(edgesFilling): edgepeau = geompy.GetInPlace(facePeau, edge) name = "edgepeau%d"%i - geomPublishDebugInFather(facePeau,edgepeau, name) + geomPublishInFather(initLog.debug, facePeau,edgepeau, name) logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau)) if geompy.ShapeInfo(edgepeau)['EDGE'] > 1: logging.debug(" EDGES multiples") @@ -97,7 +98,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor if aretesVivesC is not None: bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC) if bordsVifs is not None: - geomPublishDebugInFather(facePeau, bordsVifs, "bordsVifs") + geomPublishInFather(initLog.debug, facePeau, bordsVifs, "bordsVifs") groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs) grptmp = None if len(aretesVivesCoupees) > 0: @@ -111,7 +112,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False) aretesVivesCoupees += edv logging.debug("aretesVivesCoupees %s",aretesVivesCoupees) - geomPublishDebugInFather(facePeau, groupEdgesBordPeau , "EdgesBords") + geomPublishInFather(initLog.debug, facePeau, groupEdgesBordPeau , "EdgesBords") # --- edges de la face de peau partagées avec la face de fissure @@ -125,7 +126,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau): edgesFissurePeau[i] = edge name = "edgeFissurePeau%d"%i - geomPublishDebugInFather(facePeau, edge, name) + geomPublishInFather(initLog.debug, facePeau, edge, name) for edge in edges: # on ajoute après les edges manquantes if edge not in edgesFissurePeau: edgesFissurePeau.append(edge) @@ -133,7 +134,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor for i, edge in enumerate(edges): edgesFissurePeau.append(edge) name = "edgeFissurePeau%d"%i - geomPublishDebugInFather(facePeau, edge, name) + geomPublishInFather(initLog.debug, facePeau, edge, name) return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, diff --git a/src/Tools/blocFissure/gmu/initLog.py b/src/Tools/blocFissure/gmu/initLog.py index adbdda00b..07c0c3640 100644 --- a/src/Tools/blocFissure/gmu/initLog.py +++ b/src/Tools/blocFissure/gmu/initLog.py @@ -1,41 +1,48 @@ # -*- coding: utf-8 -*- import logging -loglevel = 3 + +debug = 10 +info = 20 +warning = 30 +error = 40 +critical = 50 + +loglevel = warning def setDebug(): global loglevel logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', level=logging.DEBUG) - loglevel = 1 + loglevel = debug logging.info('start Debug %s', loglevel) def setVerbose(): global loglevel logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', level=logging.INFO) - loglevel = 2 + loglevel = info logging.info('start Verbose %s', loglevel) def setRelease(): global loglevel logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', level=logging.WARNING) - loglevel = 3 + loglevel = warning logging.warning('start Release %s', loglevel) def setUnitTests(): global loglevel logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', level=logging.CRITICAL) - loglevel = 4 + loglevel = critical logging.critical('start UnitTests %s', loglevel) def setPerfTests(): global loglevel logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', level=logging.CRITICAL) - loglevel = 5 + loglevel = critical logging.info('start PerfTests %s', loglevel) def getLogLevel(): From 1d4f9483235612bf596e283bae860809cb0dec04 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 4 Dec 2014 17:18:07 +0100 Subject: [PATCH 016/147] missing python files in install --- src/Tools/blocFissure/CMakeLists.txt | 1 - src/Tools/blocFissure/CasTests/CMakeLists.txt | 3 +++ src/Tools/blocFissure/gmu/CMakeLists.txt | 26 +++++++++++++++++++ .../materielCasTests/CMakeLists.txt | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/CMakeLists.txt b/src/Tools/blocFissure/CMakeLists.txt index 462017460..4dab87093 100644 --- a/src/Tools/blocFissure/CMakeLists.txt +++ b/src/Tools/blocFissure/CMakeLists.txt @@ -30,7 +30,6 @@ ENDIF(SALOME_BUILD_GUI) # scripts / static SET(plugin_SCRIPTS __init__.py - casStandard.py exemple.py exemple2.py ) diff --git a/src/Tools/blocFissure/CasTests/CMakeLists.txt b/src/Tools/blocFissure/CasTests/CMakeLists.txt index 3cf970add..0f6f09f98 100644 --- a/src/Tools/blocFissure/CasTests/CMakeLists.txt +++ b/src/Tools/blocFissure/CasTests/CMakeLists.txt @@ -24,6 +24,9 @@ SET(plugin_SCRIPTS __init__.py cubeAngle2.py cubeAngle.py + cubeCoin.py + cubeMilieu.py + cubeTransverse.py cylindre_2.py cylindre.py disquePerce.py diff --git a/src/Tools/blocFissure/gmu/CMakeLists.txt b/src/Tools/blocFissure/gmu/CMakeLists.txt index 8bd0ceb57..d7d2d9e5c 100644 --- a/src/Tools/blocFissure/gmu/CMakeLists.txt +++ b/src/Tools/blocFissure/gmu/CMakeLists.txt @@ -22,15 +22,25 @@ # scripts / static SET(plugin_SCRIPTS __init__.py + ajustePointsEdgePipeFissure.py blocDefaut.py + calculePointsAxiauxPipe.py + casStandard.py checkDecoupePartition.py commonSubShapes.py + compoundFromList.py + construitEdgesRadialesDebouchantes.py + construitFissureGenerale.py + construitMaillagePipe.py + construitPartitionsPeauFissure.py + creePointsPipePeau.py creeZoneDefautDansObjetSain.py creeZoneDefautFilling.py creeZoneDefautGeom.py creeZoneDefautMaillage.py distance2.py eliminateDoubles.py + elimineExtremitesPipe.py ellipsoideDefaut.py enleveDefaut.py extractionOrienteeMulti.py @@ -43,20 +53,32 @@ SET(plugin_SCRIPTS findWireIntermediateVertices.py fissureCoude.py fissureGenerique.py + fusionMaillageAttributionDefaut.py genereElemsFissureElliptique.py genereMeshCalculZoneDefaut.py geomsmesh.py getCentreFondFiss.py getStatsMaillageFissure.py getSubshapeIds.py + identifieEdgesPeau.py + identifieElementsDebouchants.py + identifieElementsFissure.py + identifieElementsGeometriquesPeau.py + identifieFacesEdgesFissureExterne.py + identifieFacesPeau.py initEtude.py initLog.py insereFissureElliptique.py insereFissureGenerale.py insereFissureLongue.py + listOfExtraFunctions.py + mailleAretesEtJonction.py + mailleFacesFissure.py + mailleFacesPeau.py meshBlocPart.py orderEdgesFromWire.py partitionBlocDefaut.py + partitionneFissureParPipe.py partitionVolumeSain.py peauInterne.py produitMixte.py @@ -65,8 +87,11 @@ SET(plugin_SCRIPTS prolongeWire.py propagateTore.py putName.py + quadranglesToShapeNoCorner.py quadranglesToShape.py + quadranglesToShapeWithCorner.py regroupeSainEtDefaut.py + restreintFaceFissure.py rotTrans.py shapesSurFissure.py shapeSurFissure.py @@ -78,6 +103,7 @@ SET(plugin_SCRIPTS testgmu.py toreFissure.py triedreBase.py + trouveEdgesFissPeau.py whichSideMulti.py whichSide.py whichSideVertex.py diff --git a/src/Tools/blocFissure/materielCasTests/CMakeLists.txt b/src/Tools/blocFissure/materielCasTests/CMakeLists.txt index 094f30ab9..958211354 100644 --- a/src/Tools/blocFissure/materielCasTests/CMakeLists.txt +++ b/src/Tools/blocFissure/materielCasTests/CMakeLists.txt @@ -23,6 +23,7 @@ SET(plugin_SCRIPTS __init__.py cubeAngle.py + cubeFin.py decoupeCylindre.py disque_perce.py ellipse_disque.py From 39fc24644213cfc399476488c96bcb20c208f780 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 8 Dec 2014 16:08:40 +0100 Subject: [PATCH 017/147] modifications for OCC 6.8.0 --- src/Tools/blocFissure/CasTests/execution_Cas.py | 2 +- src/Tools/blocFissure/materielCasTests/fissureGauche.py | 8 ++++---- src/Tools/blocFissure/materielCasTests/fissureGauche2.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 487ac69bc..580861961 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -127,7 +127,7 @@ problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.reference # ---tous les cas en sequence, ou les cas selectionnés ... -runall = False +runall = True if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche.py b/src/Tools/blocFissure/materielCasTests/fissureGauche.py index b378fa587..6efe23942 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -42,7 +42,9 @@ Partition_1 = geompy.MakePartition([Box_1], [Fillet_1], [], [], geompy.ShapeType geomObj_3 = geompy.MakeCylinderRH(1450, 8000) Cylinder_3 = geompy.MakeRotation(geomObj_3, OZ, 180*math.pi/180.0) Cut_1 = geompy.MakeCut(Partition_1, Cylinder_3) -[faceFiss1] = geompy.SubShapes(Cut_1, [61]) +geompy.addToStudy( Cut_1, 'Cut_1' ) +[faceFiss1] = geompy.SubShapes(Cut_1, [63]) +geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' ) [Vertex_3,geomObj_4] = geompy.SubShapes(faceFiss1, [4, 5]) Cylinder_4 = geompy.MakeCylinderRH(2000, 4000) Cylinder_5 = geompy.MakeCylinderRH(1500, 4000) @@ -72,8 +74,6 @@ geompy.addToStudy( Vertex_2, 'Vertex_2' ) geompy.addToStudy( Box_1, 'Box_1' ) geompy.addToStudy( Partition_1, 'Partition_1' ) geompy.addToStudy( Cylinder_3, 'Cylinder_3' ) -geompy.addToStudy( Cut_1, 'Cut_1' ) -geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' ) geompy.addToStudyInFather( faceFiss1, Vertex_3, 'Vertex_3' ) geompy.addToStudy( Cylinder_4, 'Cylinder_4' ) geompy.addToStudy( Cylinder_5, 'Cylinder_5' ) diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py index 431668130..420118628 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -42,7 +42,9 @@ Vertex_3 = geompy.MakeVertex(400, 500, 800) objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, 180*math.pi/180.0) Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0) -[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13]) +geompy.addToStudy( Partition_2, 'Partition_2' ) +[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [17]) +geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) Plane_1 = geompy.MakePlaneLCS(None, 2000, 3) FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0) geompy.Export(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP") @@ -63,8 +65,6 @@ geompy.addToStudy( Vertex_2, 'Vertex_2' ) geompy.addToStudy( Vertex_3, 'Vertex_3' ) geompy.addToStudy( objetSain, 'objetSain' ) geompy.addToStudy( Rotation_1, 'Rotation_1' ) -geompy.addToStudy( Partition_2, 'Partition_2' ) -geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) geompy.addToStudy( Plane_1, 'Plane_1' ) geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' ) From 41f1b7bad25a245eea4746bab1fb2817dd7dd1c6 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 10 Dec 2014 11:36:59 +0100 Subject: [PATCH 018/147] adaptations cas pour OCC 6.8.0 --- src/Tools/blocFissure/CasTests/faceGauche_2.py | 2 +- src/Tools/blocFissure/CasTests/fissureCoude_5.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index c9e0e0fbc..c2bcf776d 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -60,7 +60,7 @@ class faceGauche_2(fissureGenerique): shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP") fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"]) - geompy.UnionIDs(fondFiss, [12, 4]) + geompy.UnionIDs(fondFiss, [14, 7]) geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_5.py b/src/Tools/blocFissure/CasTests/fissureCoude_5.py index 320947b0c..aab86cd78 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_5.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_5.py @@ -75,7 +75,7 @@ class fissureCoude_5(fissureCoude): nomFicSain = self.nomCas, nomFicFissure = 'fissure_' + self.nomCas, nbsegRad = 5, - nbsegCercle = 6, + nbsegCercle = 8, areteFaceFissure = 5) # --------------------------------------------------------------------------- From 2475437e5dfa27df324e347ce7e9bf519daf026f Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 10 Dec 2014 16:37:01 +0100 Subject: [PATCH 019/147] adaptation patch OCC 6.8.0 et probleme prolongation wire --- .../blocFissure/CasTests/faceGauche_2.py | 2 +- src/Tools/blocFissure/gmu/prolongeWire.py | 33 +++++++++++++++++-- .../materielCasTests/fissureGauche.py | 2 +- .../materielCasTests/fissureGauche2.py | 2 +- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index c2bcf776d..2feaec3a8 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -60,7 +60,7 @@ class faceGauche_2(fissureGenerique): shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP") fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"]) - geompy.UnionIDs(fondFiss, [14, 7]) + geompy.UnionIDs(fondFiss, [14, 9]) geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) diff --git a/src/Tools/blocFissure/gmu/prolongeWire.py b/src/Tools/blocFissure/gmu/prolongeWire.py index 72e766dff..916a8433c 100644 --- a/src/Tools/blocFissure/gmu/prolongeWire.py +++ b/src/Tools/blocFissure/gmu/prolongeWire.py @@ -2,6 +2,7 @@ import logging from geomsmesh import geompy +from orderEdgesFromWire import orderEdgesFromWire # ----------------------------------------------------------------------------- # --- prolongation d'un wire par deux segments tangents @@ -12,8 +13,11 @@ def prolongeWire(aWire, extrem, norms, long): logging.info("start") if geompy.NumberOfEdges(aWire) > 1: edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"]) + uneSeuleEdge = False else: edges = [aWire] + uneSeuleEdge = True + edgesBout = [] for i, v1 in enumerate(extrem): exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-long, long)] dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)] @@ -22,8 +26,31 @@ def prolongeWire(aWire, extrem, norms, long): #v2 = geompy.MakeTranslationVectorDistance(v1, norms[i], long) edge = geompy.MakeEdge(v1, v2) edges.append(edge) + edgesBout.append(edge) name = "extrem%d"%i - #geompy.addToStudy(edge,name) - wireProlonge = geompy.MakeWire(edges) - geompy.addToStudy(wireProlonge, "wireProlonge") + geompy.addToStudy(edge,name) + try: + wireProlonge = geompy.MakeWire(edges) + geompy.addToStudy(wireProlonge, "wireProlonge") + except: + logging.warning("probleme MakeWire, approche pas a pas") + if uneSeuleEdge: + edgelist = [aWire] + accessList = [0] + else: + edgelist, accessList = orderEdgesFromWire(aWire) + edge1 = edgelist[accessList[0]] + if geompy.MinDistance(edgesBout[0], edge1) < 1.e-4 : + i0 = 0 + i1 = 1 + else: + i0 = 1 + i1 = 0 + wireProlonge = edgesBout[i0] + for i in range(len(edgelist)): + wireProlonge = geompy.MakeWire([wireProlonge, edgelist[accessList[i]]]) + geompy.addToStudy(wireProlonge, "wireProlonge_%d"%i) + wireProlonge = geompy.MakeWire([wireProlonge,edgesBout[i1]]) + geompy.addToStudy(wireProlonge, "wireNonProlonge") + logging.warning("prolongation wire pas a pas OK") return wireProlonge diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche.py b/src/Tools/blocFissure/materielCasTests/fissureGauche.py index 6efe23942..2660e04de 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche.py @@ -43,7 +43,7 @@ geomObj_3 = geompy.MakeCylinderRH(1450, 8000) Cylinder_3 = geompy.MakeRotation(geomObj_3, OZ, 180*math.pi/180.0) Cut_1 = geompy.MakeCut(Partition_1, Cylinder_3) geompy.addToStudy( Cut_1, 'Cut_1' ) -[faceFiss1] = geompy.SubShapes(Cut_1, [63]) +[faceFiss1] = geompy.SubShapes(Cut_1, [61]) geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' ) [Vertex_3,geomObj_4] = geompy.SubShapes(faceFiss1, [4, 5]) Cylinder_4 = geompy.MakeCylinderRH(2000, 4000) diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py index 420118628..289102c69 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py @@ -43,7 +43,7 @@ objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, 180*math.pi/180.0) Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0) geompy.addToStudy( Partition_2, 'Partition_2' ) -[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [17]) +[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13]) geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) Plane_1 = geompy.MakePlaneLCS(None, 2000, 3) FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0) From fd5ea4103869e7f849c55c341bbff77e6c1013c8 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 10 Dec 2014 17:37:21 +0100 Subject: [PATCH 020/147] test traces conditionnelles --- .../blocFissure/CasTests/execution_Cas.py | 18 +++++++++++------- src/Tools/blocFissure/gmu/prolongeWire.py | 12 +++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 580861961..3fa7f7f06 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -4,10 +4,21 @@ import sys, traceback import logging from blocFissure import gmu from blocFissure.gmu import initLog + +# ----------------------------------------------------------------------------------------------- #initLog.setDebug() initLog.setVerbose() +#initLog.setRelease() #initLog.setPerfTests() +# ---tous les cas en sequence, ou les cas selectionnés ... +runall = True +if runall: + torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] +else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 + torun = [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,] +# ----------------------------------------------------------------------------------------------- + from blocFissure.gmu import geomsmesh from blocFissure.gmu.casStandard import casStandard @@ -125,13 +136,6 @@ cas=27 from blocFissure.CasTests import cubeTransverse problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, cas)) - -# ---tous les cas en sequence, ou les cas selectionnés ... -runall = True -if runall: - torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] -else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 - torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,] for i in range(len(problemes)): if torun[i]: diff --git a/src/Tools/blocFissure/gmu/prolongeWire.py b/src/Tools/blocFissure/gmu/prolongeWire.py index 916a8433c..52b3991b4 100644 --- a/src/Tools/blocFissure/gmu/prolongeWire.py +++ b/src/Tools/blocFissure/gmu/prolongeWire.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from orderEdgesFromWire import orderEdgesFromWire # ----------------------------------------------------------------------------- @@ -23,15 +26,14 @@ def prolongeWire(aWire, extrem, norms, long): dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)] dists.sort() v2 = dists[-1][-1] - #v2 = geompy.MakeTranslationVectorDistance(v1, norms[i], long) edge = geompy.MakeEdge(v1, v2) edges.append(edge) edgesBout.append(edge) name = "extrem%d"%i - geompy.addToStudy(edge,name) + geomPublish(initLog.debug, edge, name) try: wireProlonge = geompy.MakeWire(edges) - geompy.addToStudy(wireProlonge, "wireProlonge") + geomPublish(initLog.debug, wireProlonge, "wireProlonge") except: logging.warning("probleme MakeWire, approche pas a pas") if uneSeuleEdge: @@ -49,8 +51,8 @@ def prolongeWire(aWire, extrem, norms, long): wireProlonge = edgesBout[i0] for i in range(len(edgelist)): wireProlonge = geompy.MakeWire([wireProlonge, edgelist[accessList[i]]]) - geompy.addToStudy(wireProlonge, "wireProlonge_%d"%i) + geomPublish(initLog.debug, wireProlonge, "wireProlonge_%d"%i) wireProlonge = geompy.MakeWire([wireProlonge,edgesBout[i1]]) - geompy.addToStudy(wireProlonge, "wireNonProlonge") + geomPublish(initLog.debug, wireProlonge, "wireProlonge") logging.warning("prolongation wire pas a pas OK") return wireProlonge From a8380feec5b500ecfb5d0254e9126103539f4a78 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 11 Dec 2014 15:45:06 +0100 Subject: [PATCH 021/147] generalisation publication conditionnelle --- .../blocFissure/CasTests/execution_Cas.py | 2 +- src/Tools/blocFissure/gmu/casStandard.py | 22 +-- src/Tools/blocFissure/gmu/compoundFromList.py | 5 +- .../gmu/construitEdgesRadialesDebouchantes.py | 17 ++- .../gmu/construitFissureGenerale.py | 7 +- .../gmu/construitPartitionsPeauFissure.py | 5 +- .../blocFissure/gmu/creePointsPipePeau.py | 9 +- .../blocFissure/gmu/creeZoneDefautFilling.py | 11 +- .../blocFissure/gmu/creeZoneDefautGeom.py | 37 ++--- .../blocFissure/gmu/extractionOrientee.py | 9 +- .../gmu/extractionOrienteeMulti.py | 9 +- src/Tools/blocFissure/gmu/facesCirculaires.py | 21 +-- src/Tools/blocFissure/gmu/facesFissure.py | 11 +- src/Tools/blocFissure/gmu/facesToreInBloc.py | 9 +- .../blocFissure/gmu/facesVolumesToriques.py | 11 +- .../blocFissure/gmu/findWireEndVertices.py | 7 +- .../gmu/findWireIntermediateVertices.py | 7 +- src/Tools/blocFissure/gmu/fissureCoude.py | 93 ++++++------- .../gmu/fusionMaillageAttributionDefaut.py | 9 +- .../gmu/genereElemsFissureElliptique.py | 15 ++- .../blocFissure/gmu/getCentreFondFiss.py | 9 +- .../gmu/identifieElementsDebouchants.py | 27 ++-- .../gmu/identifieElementsFissure.py | 12 +- .../gmu/identifieFacesEdgesFissureExterne.py | 9 +- .../blocFissure/gmu/identifieFacesPeau.py | 7 +- .../gmu/insereFissureElliptique.py | 15 ++- .../blocFissure/gmu/insereFissureGenerale.py | 127 +++++++++--------- .../blocFissure/gmu/insereFissureLongue.py | 81 +++++------ src/Tools/blocFissure/gmu/mailleFacesPeau.py | 5 +- .../blocFissure/gmu/partitionBlocDefaut.py | 33 ++--- .../blocFissure/gmu/partitionVolumeSain.py | 11 +- .../gmu/partitionneFissureParPipe.py | 25 ++-- src/Tools/blocFissure/gmu/propagateTore.py | 15 ++- .../blocFissure/gmu/quadranglesToShape.py | 21 +-- .../gmu/quadranglesToShapeNoCorner.py | 22 +-- .../gmu/quadranglesToShapeWithCorner.py | 17 ++- .../blocFissure/gmu/restreintFaceFissure.py | 7 +- src/Tools/blocFissure/gmu/rotTrans.py | 9 +- src/Tools/blocFissure/gmu/shapeSurFissure.py | 5 +- src/Tools/blocFissure/gmu/sortGeneratrices.py | 9 +- src/Tools/blocFissure/gmu/toreFissure.py | 29 ++-- src/Tools/blocFissure/gmu/triedreBase.py | 11 +- .../blocFissure/gmu/trouveEdgesFissPeau.py | 5 +- 43 files changed, 477 insertions(+), 350 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 3fa7f7f06..8d8524f73 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -16,7 +16,7 @@ runall = True if runall: torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,] else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 - torun = [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,] + torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,] # ----------------------------------------------------------------------------------------------- from blocFissure.gmu import geomsmesh diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index 4bfedef33..b0bca4ec1 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- import os -from blocFissure import gmu -from blocFissure.gmu.geomsmesh import geompy, smesh +from geomsmesh import geompy, smesh +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import math import GEOM @@ -13,13 +15,13 @@ import SMESH #import NETGENPlugin import logging -from blocFissure.gmu.fissureGenerique import fissureGenerique +from fissureGenerique import fissureGenerique -from blocFissure.gmu.initEtude import initEtude -from blocFissure.gmu.triedreBase import triedreBase -from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut -from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale +from initEtude import initEtude +from triedreBase import triedreBase +from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut +from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain +from construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -97,8 +99,8 @@ class casStandard(fissureGenerique): shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP") fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"]) geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] ) - geompy.addToStudy( shellFiss, 'shellFiss' ) - geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) + geomPublish(initLog.debug, shellFiss, 'shellFiss' ) + geomPublishInFather(initLog.debug, shellFiss, fondFiss, 'fondFiss' ) coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1]) diff --git a/src/Tools/blocFissure/gmu/compoundFromList.py b/src/Tools/blocFissure/gmu/compoundFromList.py index 6787b2520..8f1ed1962 100644 --- a/src/Tools/blocFissure/gmu/compoundFromList.py +++ b/src/Tools/blocFissure/gmu/compoundFromList.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog def compoundFromList(elements, nom=None): """ @@ -21,7 +24,7 @@ def compoundFromList(elements, nom=None): for i,a in enumerate(shapeList): nom = nom +"%d"%i logging.debug('nom: %s',nom) - geompy.addToStudy(a, nom) + geomPublish(initLog.debug, a, nom) shapeCompound = None if len(shapeList) > 0: diff --git a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py index 91b1b725c..d77ccafd6 100644 --- a/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py +++ b/src/Tools/blocFissure/gmu/construitEdgesRadialesDebouchantes.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM from sortEdges import sortEdges @@ -30,18 +33,18 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) name='compoundRay%d'%k - geompy.addToStudy(comp, name) + geomPublish(initLog.debug, comp, name) else: idfin = min(len(gptsdisks), numout+1) iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) name='compoundRay%d'%k - geompy.addToStudy(comp, name) + geomPublish(initLog.debug, comp, name) nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default) nappes.append(nappe) name='nappe%d'%k - geompy.addToStudy(nappe, name) + geomPublish(initLog.debug, nappe, name) facesDebouchantes[i] = True listNappes.append(nappes) @@ -50,8 +53,8 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, if facesDebouchantes[i]: for k, face in enumerate(facesPipePeau): #logging.debug('i, k, face, nappes[0] %s %s %s %s', i, k, face, nappes[0]) - #geompy.addToStudy(nappes[0], 'lanappe') - #geompy.addToStudy(face, 'laface') + #geomPublish(initLog.debug, nappes[0], 'lanappe') + #geomPublish(initLog.debug, face, 'laface') edge = geompy.MakeSection(face, nappes[0]) if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0: idFacesDebouchantes[i] = k @@ -93,13 +96,13 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, ednouv.append(ed) logging.debug(" edges issues de la partition: %s", ednouv) for ii, ed in enumerate(ednouv): - geompy.addToStudy(ed, "ednouv%d"%ii) + geomPublish(initLog.debug, ed, "ednouv%d"%ii) [edsorted, minl,maxl] = sortEdges(ednouv) logging.debug(" longueur edge trouvée: %s", maxl) edge = edsorted[-1] edges.append(edge) name = 'edgeEndPipe%d'%k - geompy.addToStudy(edge, name) + geomPublish(initLog.debug, edge, name) listEdges.append(edges) return (listEdges, idFacesDebouchantes) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index d4936d0ae..ddffac389 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -3,6 +3,9 @@ import logging import salome from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM from geomsmesh import smesh from salome.smesh import smeshBuilder @@ -130,7 +133,7 @@ def construitFissureGenerale(maillagesSains, (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe) edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss) for i,edge in enumerate(edgesFondFiss): - geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i) + geomPublishInFather(initLog.debug, wireFondFiss, edge, "edgeFondFiss%d"%i) # --- peau et face de fissure # @@ -195,7 +198,7 @@ def construitFissureGenerale(maillagesSains, for i, avc in enumerate(aretesVivesCoupees): name = "areteViveCoupee%d"%i - geompy.addToStudy(avc, name) + geomPublish(initLog.debug, avc, name) # --- identification des faces et edges de fissure externe pour maillage diff --git a/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py index 05430c750..20ba23bf5 100644 --- a/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py +++ b/src/Tools/blocFissure/gmu/construitPartitionsPeauFissure.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from checkDecoupePartition import checkDecoupePartition # ----------------------------------------------------------------------------- @@ -35,7 +38,7 @@ def construitPartitionsPeauFissure(facesDefaut, fissPipe): fissPipePart = fissPipe part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) partitionsPeauFissFond.append(part) - geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart ) + geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart ) else: partitionsPeauFissFond.append(None) ipart = ipart +1 diff --git a/src/Tools/blocFissure/gmu/creePointsPipePeau.py b/src/Tools/blocFissure/gmu/creePointsPipePeau.py index 30836c723..0f3bb71a3 100644 --- a/src/Tools/blocFissure/gmu/creePointsPipePeau.py +++ b/src/Tools/blocFissure/gmu/creePointsPipePeau.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from projettePointSurCourbe import projettePointSurCourbe def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, @@ -20,9 +23,9 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, idf = -1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) centre = ptEdgeFond[idFillingFromBout[i]][idf] name = "centre%d"%idf - geompy.addToStudy(centre, name) + geomPublish(initLog.debug, centre, name) vertPipePeau = ptFisExtPi[idFillingFromBout[i]][idf] - geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau") + geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau") grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes edgesCirc = [] for grpEdgesCirc in grpsEdgesCirc: @@ -48,7 +51,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, else: bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u) name ="bout%d"%k - geompy.addToStudyInFather(centre, bout, name) + geomPublishInFather(initLog.debug, centre, bout, name) # enregistrement des points dans la structure points = [] for j in range(nbsegRad +1): diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py b/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py index fd98acab2..c83f2aa02 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautFilling.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- crée zone géométrique défaut a partir d'un filling @@ -21,15 +24,15 @@ def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50): trace = True facesDefaut = filling centreSphere = geompy.MakeCDG(shapeDefaut) - geompy.addToStudy(centreSphere, "cdg_defaut") + geomPublish(initLog.debug, centreSphere, "cdg_defaut") centreDefaut = geompy.MakeProjection(centreSphere, filling) if trace: - geompy.addToStudy(centreDefaut, "centreDefaut") + geomPublish(initLog.debug, centreDefaut, "centreDefaut") normalDefaut = geompy.GetNormal(filling, centreDefaut) if trace: - geompy.addToStudy(normalDefaut, "normalDefaut") + geomPublish(initLog.debug, normalDefaut, "normalDefaut") extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion) if trace: - geompy.addToStudy(extrusionDefaut, "extrusionDefaut") + geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut") return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautGeom.py b/src/Tools/blocFissure/gmu/creeZoneDefautGeom.py index 9969c8d8c..4c622ebea 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautGeom.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautGeom.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from prolongeVertices import prolongeVertices # ----------------------------------------------------------------------------- @@ -42,57 +45,57 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye curves.append(curve) if trace: name="poly_%d"%aShape - geompy.addToStudy(curve, name) + geomPublish(initLog.debug, curve, name) # cdg = geompy.MakeCDG(curve) cdgs.append(cdg) if trace: name="cdgpoly_%d"%aShape - geompy.addToStudy(cdg, name) + geomPublish(initLog.debug, cdg, name) # projCdg = geompy.MakeProjection(cdg, face) projs.append(projCdg) if trace: name="projCdg_%d"%aShape - geompy.addToStudy(projCdg, name) + geomPublish(initLog.debug, projCdg, name) # normal = geompy.GetNormal(face, projCdg) normals.append(normal) if trace: name="normal_%d"%aShape - geompy.addToStudy(normal, name) + geomPublish(initLog.debug, normal, name) # extrusion = geompy.MakePrismVecH2Ways(curve, normal, 10) extrusions.append(extrusion) if trace: name="extrusion_%d"%aShape - geompy.addToStudy(extrusion, name) + geomPublish(initLog.debug, extrusion, name) # verticesProlongees = prolongeVertices(vertices) # curveprol = geompy.MakePolyline(verticesProlongees, False) if trace: name="polyProl_%d"%aShape - geompy.addToStudy(curveprol, name) + geomPublish(initLog.debug, curveprol, name) # extruprol = geompy.MakePrismVecH2Ways(curveprol, normal, 10) if trace: name="extruProl_%d"%aShape - geompy.addToStudy(extruprol, name) + geomPublish(initLog.debug, extruprol, name) # partition = geompy.MakePartition([face], [extruprol], [], [], geompy.ShapeType["FACE"], 0, [], 0) partitions.append(partition) if trace: name="partition_%d"%aShape - geompy.addToStudy(partition, name) + geomPublish(initLog.debug, partition, name) pass # centreSphere = geompy.MakeCDG(shapeDefaut) - geompy.addToStudy(centreSphere, "cdg_defaut") + geomPublish(initLog.debug, centreSphere, "cdg_defaut") ccurves = geompy.MakeCompound(curves) gravCenter = geompy.MakeCDG(ccurves) - geompy.addToStudy(gravCenter, "cdg_curves") + geomPublish(initLog.debug, gravCenter, "cdg_curves") for i in range(len(partitions)): if trace: logging.debug(" --- original shape %s", origShapes[i]) @@ -114,7 +117,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye if d == minDist: aFace = facesToSort[j] name="decoupe_%d"%origShapes[i] - geompy.addToStudy(aFace, name) + geomPublish(initLog.debug, aFace, name) decoupes.append(aFace) break pass @@ -123,7 +126,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye facesDefaut = decoupes[0] if len(decoupes) > 1: facesDefaut = geompy.MakePartition(decoupes, [], [], [], geompy.ShapeType["FACE"], 0, [], 0) - geompy.addToStudy(facesDefaut, "facesDefaut") + geomPublish(initLog.debug, facesDefaut, "facesDefaut") shells=[] if len(decoupes) > 1: # plusieurs faces de defaut @@ -159,7 +162,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye theFaces[k:k+1] = [] theShell = geompy.MakeShell(aShell) name = "theShell%d"%len(shells) - geompy.addToStudy(theShell,name) + geomPublish(initLog.debug, theShell,name) shells.append(theShell) # distances = [] @@ -175,7 +178,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye subFaces = [facesDefaut] theShellDefaut = geompy.MakeShell(subFaces) if trace: - geompy.addToStudy(theShellDefaut,"theShellDefaut") + geomPublish(initLog.debug, theShellDefaut,"theShellDefaut") theFaces = geompy.ExtractShapes(theShellDefaut, geompy.ShapeType["FACE"], True) distances = [] @@ -188,10 +191,10 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye centreDefaut = geompy.MakeProjection(centreSphere, theFaces[index]) if trace: - geompy.addToStudy(centreDefaut, "centreDefaut") + geomPublish(initLog.debug, centreDefaut, "centreDefaut") normalDefaut = geompy.GetNormal(subFaces[index], centreDefaut) if trace: - geompy.addToStudy(normalDefaut, "normalDefaut") + geomPublish(initLog.debug, normalDefaut, "normalDefaut") extrusionDefaut = geompy.MakePrismVecH(theShellDefaut, normalDefaut, -lgExtrusion) info = geompy.ShapeInfo(extrusionDefaut) logging.debug("shape info %s", info) @@ -202,6 +205,6 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye solid0 = geompy.MakeFuse(solid0, solids[i]) extrusionDefaut = solid0 if trace: - geompy.addToStudy(extrusionDefaut, "extrusionDefaut") + geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut") return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut diff --git a/src/Tools/blocFissure/gmu/extractionOrientee.py b/src/Tools/blocFissure/gmu/extractionOrientee.py index 2ea9e52f9..ec95646de 100644 --- a/src/Tools/blocFissure/gmu/extractionOrientee.py +++ b/src/Tools/blocFissure/gmu/extractionOrientee.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from whichSide import whichSide @@ -32,19 +35,19 @@ def extractionOrientee(face, obj, ref, shapeType, tol, prefix=""): shapesInside.append(shape) if trace: name = prefix + "_Inside%d"%i - geompy.addToStudyInFather(obj, shape, name) + geomPublishInFather(initLog.debug, obj, shape, name) i+=1 elif side == -sideRef: shapesOutside.append(shape) if trace: name = prefix + "_Outside%d"%j - geompy.addToStudyInFather(obj, shape, name) + geomPublishInFather(initLog.debug, obj, shape, name) j+=1 elif side == 0: shapesOnside.append(shape) if trace: name = prefix + "_Onside%d"%k - geompy.addToStudyInFather(obj, shape, name) + geomPublishInFather(initLog.debug, obj, shape, name) k+=1 logging.debug("--- shape was %s", name) return [shapesInside, shapesOutside, shapesOnside] diff --git a/src/Tools/blocFissure/gmu/extractionOrienteeMulti.py b/src/Tools/blocFissure/gmu/extractionOrienteeMulti.py index 86faec83d..0c6457ad3 100644 --- a/src/Tools/blocFissure/gmu/extractionOrienteeMulti.py +++ b/src/Tools/blocFissure/gmu/extractionOrienteeMulti.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from whichSideMulti import whichSideMulti @@ -30,19 +33,19 @@ def extractionOrienteeMulti(faces, ifil, obj, centre, shapeType, tol, prefix="") shapesInside.append(shape) if trace: name = prefix + "_Inside%d"%i - geompy.addToStudyInFather(obj, shape, name) + geomPublishInFather(initLog.debug, obj, shape, name) i+=1 elif side == -1: shapesOutside.append(shape) if trace: name = prefix + "_Outside%d"%j - geompy.addToStudyInFather(obj, shape, name) + geomPublishInFather(initLog.debug, obj, shape, name) j+=1 elif side == 0: shapesOnside.append(shape) if trace: name = prefix + "_Onside%d"%k - geompy.addToStudyInFather(obj, shape, name) + geomPublishInFather(initLog.debug, obj, shape, name) k+=1 logging.debug("--- shape was %s", name) return [shapesInside, shapesOutside, shapesOnside] diff --git a/src/Tools/blocFissure/gmu/facesCirculaires.py b/src/Tools/blocFissure/gmu/facesCirculaires.py index daca717f2..71df8eeb0 100644 --- a/src/Tools/blocFissure/gmu/facesCirculaires.py +++ b/src/Tools/blocFissure/gmu/facesCirculaires.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- TORE @@ -20,10 +23,10 @@ def facesCirculaires(bloc, tore): faces = geompy.GetShapesOnShape(bloc, tore, geompy.ShapeType["FACE"], GEOM.ST_ON) - geompy.addToStudyInFather( tore, faces[0], 'face0' ) - geompy.addToStudyInFather( tore, faces[1], 'face1' ) - geompy.addToStudyInFather( tore, faces[2], 'face2' ) - geompy.addToStudyInFather( tore, faces[3], 'face3' ) + geomPublishInFather(initLog.debug, tore, faces[0], 'face0' ) + geomPublishInFather(initLog.debug, tore, faces[1], 'face1' ) + geomPublishInFather(initLog.debug, tore, faces[2], 'face2' ) + geomPublishInFather(initLog.debug, tore, faces[3], 'face3' ) centres = [None, None, None, None] [v1,centres[0],v3] = geompy.ExtractShapes(faces[0], geompy.ShapeType["VERTEX"], True) @@ -31,10 +34,10 @@ def facesCirculaires(bloc, tore): [v1,centres[2],v3] = geompy.ExtractShapes(faces[2], geompy.ShapeType["VERTEX"], True) [v1,centres[3],v3] = geompy.ExtractShapes(faces[3], geompy.ShapeType["VERTEX"], True) - geompy.addToStudyInFather( faces[0], centres[0], 'centre0' ) - geompy.addToStudyInFather( faces[1], centres[1], 'centre1' ) - geompy.addToStudyInFather( faces[2], centres[2], 'centre2' ) - geompy.addToStudyInFather( faces[3], centres[3], 'centre3' ) + geomPublishInFather(initLog.debug, faces[0], centres[0], 'centre0' ) + geomPublishInFather(initLog.debug, faces[1], centres[1], 'centre1' ) + geomPublishInFather(initLog.debug, faces[2], centres[2], 'centre2' ) + geomPublishInFather(initLog.debug, faces[3], centres[3], 'centre3' ) alledges = [None, None, None, None] alledges[0] = geompy.ExtractShapes(faces[0], geompy.ShapeType["EDGE"], True) @@ -60,7 +63,7 @@ def facesCirculaires(bloc, tore): dicoedge[edgid] = edgesface[j] edges.append(edgesface[j]) named = 'edge_' + str(i) + '_' +str(j) - geompy.addToStudyInFather( faces[i], edgesface[j], named) + geomPublishInFather(initLog.debug, faces[i], edgesface[j], named) vertices = geompy.ExtractShapes(edgesface[j], geompy.ShapeType["VERTEX"], False) #firstVertex = geompy.GetFirstVertex(edgesface[j]) if geompy.GetSubShapeID(tore, vertices[0]) != geompy.GetSubShapeID(tore, centres[i]): diff --git a/src/Tools/blocFissure/gmu/facesFissure.py b/src/Tools/blocFissure/gmu/facesFissure.py index 1cbf8cea4..f1b8dbe40 100644 --- a/src/Tools/blocFissure/gmu/facesFissure.py +++ b/src/Tools/blocFissure/gmu/facesFissure.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- faces fissure dans et hors tore, et edges face hors tore @@ -24,18 +27,18 @@ def facesFissure(blocp, faceFissure, extrusionDefaut, genint): facefissintore = f1 facefissoutore = f0 - geompy.addToStudyInFather(faceFissure, facefissintore,'facefissintore') - geompy.addToStudyInFather(faceFissure, facefissoutore,'facefissoutore') + geomPublishInFather(initLog.debug, faceFissure, facefissintore,'facefissintore') + geomPublishInFather(initLog.debug, faceFissure, facefissoutore,'facefissoutore') edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN) edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON) for i in range(len(edgeint)): name = "edgeint_%d"%i - geompy.addToStudyInFather(facefissoutore, edgeint[i],name) + geomPublishInFather(initLog.debug, facefissoutore, edgeint[i],name) for i in range(len(edgeext)): name = "edgeext_%d"%i - geompy.addToStudyInFather(facefissoutore, edgeext[i],name) + geomPublishInFather(initLog.debug, facefissoutore, edgeext[i],name) reverext = [] if len(edgeext) > 1: diff --git a/src/Tools/blocFissure/gmu/facesToreInBloc.py b/src/Tools/blocFissure/gmu/facesToreInBloc.py index 043155426..529216958 100644 --- a/src/Tools/blocFissure/gmu/facesToreInBloc.py +++ b/src/Tools/blocFissure/gmu/facesToreInBloc.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- identification des faces tore et fissure dans le solide hors tore du bloc partitionné @@ -21,9 +24,9 @@ def facesToreInBloc(blocp, facefissoutore, facetore1, facetore2): blocFaceTore1 = geompy.GetInPlaceByHistory(blocp, facetore1) blocFaceTore2 = geompy.GetInPlaceByHistory(blocp, facetore2) - geompy.addToStudyInFather(blocp, blocFaceFiss,'blocFaceFiss') - geompy.addToStudyInFather(blocp, blocFaceTore1,'blocFaceTore1') - geompy.addToStudyInFather(blocp, blocFaceTore2,'blocFaceTore2') + geomPublishInFather(initLog.debug, blocp, blocFaceFiss,'blocFaceFiss') + geomPublishInFather(initLog.debug, blocp, blocFaceTore1,'blocFaceTore1') + geomPublishInFather(initLog.debug, blocp, blocFaceTore2,'blocFaceTore2') return blocFaceFiss, blocFaceTore1, blocFaceTore2 diff --git a/src/Tools/blocFissure/gmu/facesVolumesToriques.py b/src/Tools/blocFissure/gmu/facesVolumesToriques.py index 2ad4dc6e7..6d3434ba1 100644 --- a/src/Tools/blocFissure/gmu/facesVolumesToriques.py +++ b/src/Tools/blocFissure/gmu/facesVolumesToriques.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from extractionOrientee import extractionOrientee from getSubshapeIds import getSubshapeIds @@ -43,11 +46,11 @@ def facesVolumesToriques(tore, plan, facesDefaut): #[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON) - geompy.addToStudyInFather( tore, facetore1, 'facetore1' ) - geompy.addToStudyInFather( tore, facetore2, 'facetore2' ) + geomPublishInFather(initLog.debug, tore, facetore1, 'facetore1' ) + geomPublishInFather(initLog.debug, tore, facetore2, 'facetore2' ) [volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True) - geompy.addToStudyInFather( tore, volumeTore1, 'volumeTore1' ) - geompy.addToStudyInFather( tore, volumeTore2, 'volumeTore2' ) + geomPublishInFather(initLog.debug, tore, volumeTore1, 'volumeTore1' ) + geomPublishInFather(initLog.debug, tore, volumeTore2, 'volumeTore2' ) return facetore1, facetore2, volumeTore1, volumeTore2 diff --git a/src/Tools/blocFissure/gmu/findWireEndVertices.py b/src/Tools/blocFissure/gmu/findWireEndVertices.py index 1196e28bd..22f4ff014 100644 --- a/src/Tools/blocFissure/gmu/findWireEndVertices.py +++ b/src/Tools/blocFissure/gmu/findWireEndVertices.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- trouver les vertices extremites d'un wire @@ -44,11 +47,11 @@ def findWireEndVertices(aWire, getNormals=False): else: idsubs[subid] = [sub] name='vertex%d'%i - geompy.addToStudyInFather(aWire, sub, name) + geomPublishInFather(initLog.debug, aWire, sub, name) if getNormals: idnorm[subid] = normals[i] name='norm%d'%i - geompy.addToStudyInFather(aWire, normals[i], name) + geomPublishInFather(initLog.debug, aWire, normals[i], name) logging.debug("idsubs: %s", idsubs) for k, v in idsubs.iteritems(): if len(v) == 1: diff --git a/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py b/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py index 3b8b40591..63c884458 100644 --- a/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py +++ b/src/Tools/blocFissure/gmu/findWireIntermediateVertices.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- trouver les vertices intermediaires d'un wire @@ -41,11 +44,11 @@ def findWireIntermediateVertices(aWire, getNormals=False): else: idsubs[subid] = [sub] name='vertex%d'%i - geompy.addToStudyInFather(aWire, sub, name) + geomPublishInFather(initLog.debug, aWire, sub, name) if getNormals: idnorm[subid] = normals[i] name='norm%d'%i - geompy.addToStudyInFather(aWire, normals[i], name) + geomPublishInFather(initLog.debug, aWire, normals[i], name) for k, v in idsubs.iteritems(): if len(v) > 1: shortList.append(v[0]) diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index fdeb69ab2..bf8e0e639 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- from geomsmesh import geompy, smesh +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import math import GEOM @@ -69,22 +72,22 @@ class fissureCoude(fissureGenerique): Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0) tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2) plan_y = geompy.MakePlaneLCS(None, 100000, 3) - geompy.addToStudy( plan_y, "plan_y" ) - geompy.addToStudy( tube_1, "tube_1" ) - geompy.addToStudy( coude, "coude" ) - geompy.addToStudy( tube_2, "tube_2" ) + geomPublish(initLog.debug, plan_y, "plan_y" ) + geomPublish(initLog.debug, tube_1, "tube_1" ) + geomPublish(initLog.debug, coude, "coude" ) + geomPublish(initLog.debug, tube_2, "tube_2" ) P1 = O - geompy.addToStudy( P1, "P1" ) + geompy.addToStudy(P1, "P1" ) op2 = geompy.MakeVertex(0, 0, -l_tube_p1) P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0) P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2) - geompy.addToStudy( P2, "P2" ) + geompy.addToStudy(P2, "P2" ) # --- tube coude sain geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1) - geompy.addToStudy( geometrieSaine, self.nomCas ) + geomPublish(initLog.debug, geometrieSaine, self.nomCas ) [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True) xmin = -de -r_cintr -l_tube_p2 @@ -123,19 +126,19 @@ class fissureCoude(fissureGenerique): grped = geompy.CutGroups(grpedy0, long_p1) grped = geompy.CutGroups(grped, long_p2) ep = geompy.CutGroups(grped, long_coude) - geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' ) - geompy.addToStudyInFather( geometrieSaine, ep, 'ep' ) - geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' ) - geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' ) - geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' ) - geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' ) + geomPublishInFather(initLog.debug, geometrieSaine, long_p1, 'long_p1' ) + geomPublishInFather(initLog.debug, geometrieSaine, ep, 'ep' ) + geomPublishInFather(initLog.debug, geometrieSaine, long_coude, 'long_coude' ) + geomPublishInFather(initLog.debug, geometrieSaine, circ_g, 'circ_g' ) + geomPublishInFather(initLog.debug, geometrieSaine, circ_d, 'circ_d' ) + geomPublishInFather(initLog.debug, geometrieSaine, long_p2, 'long_p2' ) # --- face extremite tube (EXTUBE) facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON) EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(EXTUBE, facesIds) - geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' ) + geomPublishInFather(initLog.debug, geometrieSaine, EXTUBE, 'EXTUBE' ) # --- edge bord extremite tube (BORDTU) @@ -147,17 +150,17 @@ class fissureCoude(fissureGenerique): edgesIds.append(edge) BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"]) geompy.UnionIDs(BORDTU, edgesIds) - geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' ) + geomPublishInFather(initLog.debug, geometrieSaine, BORDTU, 'BORDTU' ) # --- face origine tube (CLGV) pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10) vec2 = geompy.MakeVector(P2, pp2) - #geompy.addToStudy(vec2, 'vec2') + #geomPublish(initLog.debug, vec2, 'vec2') facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON) CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(CLGV, facesIds) - geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' ) + geomPublishInFather(initLog.debug, geometrieSaine, CLGV, 'CLGV' ) # --- peau tube interieur (PEAUINT) @@ -167,11 +170,11 @@ class fissureCoude(fissureGenerique): extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2) interne = geompy.MakeFuse(extru1, revol1) interne = geompy.MakeFuse(extru2, interne) - geompy.addToStudy(interne, 'interne') + geomPublish(initLog.debug, interne, 'interne') facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN) PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(PEAUINT, facesIds) - geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' ) + geomPublishInFather(initLog.debug, geometrieSaine, PEAUINT, 'PEAUINT' ) # --- peau tube exterieur (PEAUEXT) @@ -182,18 +185,18 @@ class fissureCoude(fissureGenerique): extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2) externe = geompy.MakeFuse(extru1, revol1) externe = geompy.MakeFuse(extru2, externe) - geompy.addToStudy(externe, 'externe') + geomPublish(initLog.debug, externe, 'externe') facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON) PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(PEAUEXT, facesIds) - geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' ) + geomPublishInFather(initLog.debug, geometrieSaine, PEAUEXT, 'PEAUEXT' ) # --- solide sain volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"]) COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"]) geompy.UnionIDs(COUDE, volIds) - geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' ) + geomPublishInFather(initLog.debug, geometrieSaine, COUDE, 'COUDSAIN' ) geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE] @@ -340,7 +343,7 @@ class fissureCoude(fissureGenerique): azimut = -azimut # axe inverse / ASCOUF axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1) - geompy.addToStudy(axe,"axe") + geomPublish(initLog.debug, axe,"axe") if not lgInfluence: lgInfluence = profondeur @@ -377,8 +380,8 @@ class fissureCoude(fissureGenerique): pi = geompy.MakeVertex(rayint, 0, 0) pbl = geompy.MakeRotation(pb, OZ, angle) pbr = geompy.MakeRotation(pb, OZ, -angle) - geompy.addToStudy(pbl,"pbl") - geompy.addToStudy(pbr,"pbr") + geomPublish(initLog.debug, pbl,"pbl") + geomPublish(initLog.debug, pbr,"pbr") pal = geompy.MakeTranslationVector(pbl, OZ) par = geompy.MakeTranslationVector(pbr, OZ) axl = geompy.MakeVector(pbl,pal) @@ -409,7 +412,7 @@ class fissureCoude(fissureGenerique): wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1]) #wiretube = geompy.MakeInterpol(points) wiretube=geompy.MakeWire([wire0,wire1,wire2]) - geompy.addToStudy(wiretube,"wiretube") + geomPublish(initLog.debug, wiretube,"wiretube") pe = geompy.MakeVertex(rayext, 0, 0) pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.) @@ -417,22 +420,22 @@ class fissureCoude(fissureGenerique): pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.) arce = geompy.MakeArc(points[0], pe, points[-1]) - geompy.addToStudy(arce,"arce") + geomPublish(initLog.debug, arce,"arce") facefiss = geompy.MakeFaceWires([arce, wiretube], 1) - geompy.addToStudy( facefiss, 'facefissPlace' ) + geomPublish(initLog.debug, facefiss, 'facefissPlace' ) pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0) centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.) centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1) centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.) - geompy.addToStudy( centre, 'centrefissPlace' ) + geomPublish(initLog.debug, centre, 'centrefissPlace' ) wiretube = geompy.GetInPlace(facefiss, wiretube) - geompy.addToStudy(wiretube, 'wiretubePlace' ) + geomPublish(initLog.debug, wiretube, 'wiretubePlace' ) try: edgetube = geompy.MakeEdgeWire(wiretube) - geompy.addToStudy(edgetube,"edgetube") + geomPublish(initLog.debug, edgetube,"edgetube") except: logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans") edgetube = None @@ -485,10 +488,10 @@ class fissureCoude(fissureGenerique): points.append(pt) curves.append(geompy.MakeInterpol(points)) point0 = points[0] - geompy.addToStudy(curves[-1],"curve0") + geomPublish(initLog.debug, curves[-1],"curve0") # for i, pt in enumerate(points): # name = "point%d"%i -# geompy.addToStudyInFather(curves[-1], pt, name) +# geomPublishInFather(initLog.debug,curves[-1], pt, name) points = [] nbp = 3*nbp1 @@ -506,10 +509,10 @@ class fissureCoude(fissureGenerique): pt = geompy.MakeRotation(pi, axe, angi) points.append(pt) curves.append(geompy.MakeInterpol(points)) - geompy.addToStudy(curves[-1],"curve1") + geomPublish(initLog.debug, curves[-1],"curve1") # for i, pt in enumerate(points): # name = "point%d"%i -# geompy.addToStudyInFather(curves[-1], pt, name) +# geomPublishInFather(initLog.debug,curves[-1], pt, name) points = [] nbp = 3*nbp1 @@ -529,16 +532,16 @@ class fissureCoude(fissureGenerique): points.append(pt) curves.append(geompy.MakeInterpol(points)) point1 = points[-1] - geompy.addToStudy(curves[-1],"curve2") + geomPublish(initLog.debug, curves[-1],"curve2") # for i, pt in enumerate(points): # name = "point%d"%i -# geompy.addToStudyInFather(curves[-1], pt, name) +# geomPublishInFather(initLog.debug,curves[-1], pt, name) wiretube = geompy.MakeWire(curves) - geompy.addToStudy(wiretube,"wiretube") + geomPublish(initLog.debug, wiretube,"wiretube") try: edgetube = geompy.MakeEdgeWire(wiretube) - geompy.addToStudy(edgetube,"edgetube") + geomPublish(initLog.debug, edgetube,"edgetube") except: logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans") edgetube = None @@ -553,21 +556,21 @@ class fissureCoude(fissureGenerique): pts.append(pt) pts.append(point1) arce = geompy.MakeInterpol(pts) - geompy.addToStudy(arce,"arce") + geomPublish(initLog.debug, arce,"arce") facefiss = geompy.MakeFaceWires([arce, wiretube], 0) - geompy.addToStudy( facefiss, 'facefissPlace' ) + geomPublish(initLog.debug, facefiss, 'facefissPlace' ) pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.) centre = geompy.MakeRotation(pc, axe, alfrd) - geompy.addToStudy( centre, 'centrefissPlace' ) + geomPublish(initLog.debug, centre, 'centrefissPlace' ) edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True) edgesTriees, minl, maxl = sortEdges(edges) edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine wiretube = geompy.MakeWire(edges) #wiretube = edgesTriees[-1] - geompy.addToStudy(wiretube, 'wiretubePlace' ) + geomPublish(initLog.debug, wiretube, 'wiretubePlace' ) # --------------------------------------------------------- @@ -612,7 +615,7 @@ class fissureCoude(fissureGenerique): arci = geompy.MakePosition(arco, originLCS, localLCS, "arci") arce = geompy.MakePosition(lino, originLCS, localLCS, "arce") facefiss = geompy.MakeFaceWires([arce, arci], 0) - geompy.addToStudy( facefiss, 'facefissPlace' ) + geomPublish(initLog.debug, facefiss, 'facefissPlace' ) edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True) edgesTriees, minl, maxl = sortEdges(edges) edgetube = edgesTriees[-1] # la plus grande correspond à arci @@ -620,7 +623,7 @@ class fissureCoude(fissureGenerique): pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.) centre = geompy.MakeRotation(pc, axe, alfrd) - geompy.addToStudy( centre, 'centrefissPlace' ) + geomPublish(initLog.debug, centre, 'centrefissPlace' ) coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur) diff --git a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py index 89fef3ae5..703c02447 100644 --- a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py +++ b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py @@ -8,6 +8,9 @@ Created on Tue Jun 24 09:14:13 2014 import logging from geomsmesh import geompy from geomsmesh import smesh +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM import SMESH @@ -49,19 +52,19 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible # on recrée un objet GEOM temporaire par filling. filling = geompy.MakeFilling(geompy.MakeCompound(setOfLines), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) #logging.debug("face de filling") - #geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) + #geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1)) tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0) tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True) tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) if len(tmpExplodeRef) == len(tmpExplodeNum): logging.debug("face de filling non coupee") - geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1)) + geompy.addToStudy( filling, "faceNonCoupee_{0}".format(i + 1)) # doit etre publie pour critere OK plus bas facesNonCoupees.append(filling) maillagesNonCoupes.append(listOfNewMeshes[i]) else: logging.debug("face de filling coupee") - geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1)) + geompy.addToStudy( filling, "faceCoupee_{0}".format(i + 1)) facesCoupees.append(filling) maillagesCoupes.append(listOfNewMeshes[i]) diff --git a/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py b/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py index bbf939417..62be40c77 100644 --- a/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py +++ b/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from toreFissure import toreFissure from ellipsoideDefaut import ellipsoideDefaut @@ -40,12 +43,12 @@ def genereElemsFissureElliptique(shapeFissureParams): plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut) ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut) - geompy.addToStudy( pipe0, 'pipe0' ) - geompy.addToStudy( gener1, 'gener1' ) - geompy.addToStudy( pipe1, 'pipe1' ) - geompy.addToStudy( facefis1, 'facefis1' ) - geompy.addToStudy( plane1, 'plane1' ) - geompy.addToStudy( ellipsoide1, 'ellipsoide1' ) + geomPublish(initLog.debug, pipe0, 'pipe0' ) + geomPublish(initLog.debug, gener1, 'gener1' ) + geomPublish(initLog.debug, pipe1, 'pipe1' ) + geomPublish(initLog.debug, facefis1, 'facefis1' ) + geomPublish(initLog.debug, plane1, 'plane1' ) + geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' ) shapeDefaut = facefis1 xyz_defaut = geompy.PointCoordinates(centreDefaut) diff --git a/src/Tools/blocFissure/gmu/getCentreFondFiss.py b/src/Tools/blocFissure/gmu/getCentreFondFiss.py index f8f53d7ba..52f1f3bd9 100644 --- a/src/Tools/blocFissure/gmu/getCentreFondFiss.py +++ b/src/Tools/blocFissure/gmu/getCentreFondFiss.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import bisect publie = False @@ -35,7 +38,7 @@ def getCentreFondFiss(shapesFissure): edgeFondExt = fondFiss aWire = geompy.MakeWire([fondFiss], 1e-07) if not publie: - geompy.addToStudy(aWire, "wireFondFissExt") + geomPublish(initLog.debug, aWire, "wireFondFissExt") lgWire = geompy.BasicProperties(aWire)[0] edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True) @@ -61,7 +64,7 @@ def getCentreFondFiss(shapesFissure): centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr]) else: # on ne sait pas comment est orientée l'edge unique, mais ça n'a pas d'importance centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr]) - geompy.addToStudyInFather(aWire, centreFondFiss, "centreFondFiss") + geomPublishInFather(initLog.debug,aWire, centreFondFiss, "centreFondFiss") tgtCentre = geompy.MakeTangentOnCurve(edges[iedr], lgOnEdge/ lgEdges[iedr]) if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge @@ -71,7 +74,7 @@ def getCentreFondFiss(shapesFissure): logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans") edgeFondExt = None if not publie and edgeFondExt is not None: - geompy.addToStudy(edgeFondExt, "edgeFondExt") + geomPublish(initLog.debug, edgeFondExt, "edgeFondExt") publie = True return edgeFondExt, centreFondFiss, tgtCentre diff --git a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py index 4f6de333c..af485444e 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py +++ b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py @@ -4,6 +4,9 @@ import logging import math from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from produitMixte import produitMixte from whichSide import whichSide @@ -29,7 +32,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, #logging.debug("edgesFondIn %s", edgesFondIn) for iedf, edge in enumerate(edgesFondIn): name = "edgeFondIn%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, edge, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name) dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau] ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge [u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss) @@ -37,14 +40,14 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex] centre = PointOnEdge centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u) - geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf) + geomPublishInFather(initLog.debug, partitionPeauFissFond, centre2, "centre2_%d"%iedf) verticesEdgesFondIn.append(centre) name = "verticeEdgesFondIn%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, centre, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, name) norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u) - geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf) + geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, "norm%d"%iedf) cercle = geompy.MakeCircle(centre, norm, rayonPipe) - geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf) + geomPublishInFather(initLog.debug, partitionPeauFissFond, cercle, "cerclorig%d"%iedf) [vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False) vec1 = geompy.MakeVector(centre, vertex) vec2 = geompy.MakeVector(centre, ptPeau) @@ -66,7 +69,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, else: cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi) name = "cercle%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, cercle, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name) cercles.append(cercle) # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie @@ -95,8 +98,8 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, logging.debug("distance curviligne centre extremite0: %s", ofp) p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0) p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0) - geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf) - geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf) + geomPublishInFather(initLog.debug, wireFondFiss, p1, "p1_%d"%iedf) + geomPublishInFather(initLog.debug, wireFondFiss, p2, "p2_%d"%iedf) edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0) edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True) @@ -104,7 +107,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, if geompy.MinDistance(centre, edp) < 1.e-3: pipext = geompy.MakePipe(cercle, edp) name = "pipeExt%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, pipext, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, pipext, name) pipexts.append(pipext) for ifa, face in enumerate(facesInside): @@ -129,7 +132,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, logging.debug(" face %s inside ajoutée", ifa) facesFissExt.append(face) name="faceFissExt%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, face, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, face, name) dist = 1. for ipe, edpe in enumerate(edgesPeauFis): for ipi, edpi in enumerate(edgesPipeFis): @@ -137,10 +140,10 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, if dist < 1.e-3: edgesFissExtPeau.append(edpe) name="edgesFissExtPeau%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, edpe, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, edpe, name) edgesFissExtPipe.append(edpi) name="edgesFissExtPipe%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, edpi, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, edpi, name) break if dist < 1.e-3: break diff --git a/src/Tools/blocFissure/gmu/identifieElementsFissure.py b/src/Tools/blocFissure/gmu/identifieElementsFissure.py index e88624034..fcad8c519 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsFissure.py +++ b/src/Tools/blocFissure/gmu/identifieElementsFissure.py @@ -3,6 +3,10 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog + from extractionOrientee import extractionOrientee from extractionOrienteeMulti import extractionOrienteeMulti @@ -19,9 +23,9 @@ def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond, logging.info('start') edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) - geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss") + geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesPipeC, "edgesPipeFiss") edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) - geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss") + geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesFondC, "edgesFondFiss") if aretesVivesC is None: [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) @@ -38,9 +42,9 @@ def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond, vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"]) verticesPipePeau.append(vertices[0]) name = "edgePipeIn%d"%i - geompy.addToStudyInFather(partitionPeauFissFond, edge, name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name) name = "verticePipePeau%d"%i - geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name) + geomPublishInFather(initLog.debug, partitionPeauFissFond, vertices[0], name) logging.debug("edgePipeIn%s coupe les faces OnSide", i) except: logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i) diff --git a/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py index 856cfae48..12efab46c 100644 --- a/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py +++ b/src/Tools/blocFissure/gmu/identifieFacesEdgesFissureExterne.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss): """ @@ -42,8 +45,8 @@ def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesP edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau) edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe) wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)) - geompy.addToStudy(faceFissureExterne, "faceFissureExterne") - geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") - geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") + geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne") + geomPublishInFather(initLog.debug, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") + geomPublishInFather(initLog.debug, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/identifieFacesPeau.py b/src/Tools/blocFissure/gmu/identifieFacesPeau.py index 693586b8f..a8917ad78 100644 --- a/src/Tools/blocFissure/gmu/identifieFacesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieFacesPeau.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from sortFaces import sortFaces from extractionOrientee import extractionOrientee @@ -62,7 +65,7 @@ def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss, pass name="partitionPeauByPipe%d"%ifil - geompy.addToStudy(partitionPeauByPipe, name) + geomPublish(initLog.debug, partitionPeauByPipe, name) [edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3) [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3) @@ -73,6 +76,6 @@ def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss, facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1) facesPeauSorted = [facePeau] name="facePeau%d"%ifil - geompy.addToStudy(facePeau, name) + geomPublish(initLog.debug, facePeau, name) return (facePeau, facesPeauSorted, edgesPeauFondIn) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/insereFissureElliptique.py b/src/Tools/blocFissure/gmu/insereFissureElliptique.py index 95d4a6279..ede20b48c 100644 --- a/src/Tools/blocFissure/gmu/insereFissureElliptique.py +++ b/src/Tools/blocFissure/gmu/insereFissureElliptique.py @@ -3,6 +3,9 @@ import logging import salome from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from geomsmesh import smesh import SMESH import math @@ -98,12 +101,12 @@ def insereFissureElliptique(geometriesSaines, maillagesSains, #plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut) #ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut) - #geompy.addToStudy( pipe0, 'pipe0' ) - #geompy.addToStudy( gener1, 'gener1' ) - #geompy.addToStudy( pipe1, 'pipe1' ) - #geompy.addToStudy( facefis1, 'facefis1' ) - #geompy.addToStudy( plane1, 'plane1' ) - #geompy.addToStudy( ellipsoide1, 'ellipsoide1' ) + #geomPublish(initLog.debug, pipe0, 'pipe0' ) + #geomPublish(initLog.debug, gener1, 'gener1' ) + #geomPublish(initLog.debug, pipe1, 'pipe1' ) + #geomPublish(initLog.debug, facefis1, 'facefis1' ) + #geomPublish(initLog.debug, plane1, 'plane1' ) + #geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' ) # --- partition du bloc défaut par génératrice, tore et plan fissure if step == 7: diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index e3816ab85..96c733e1e 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -3,6 +3,9 @@ import logging import salome from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM from geomsmesh import smesh from salome.smesh import smeshBuilder @@ -105,7 +108,7 @@ def insereFissureGenerale(maillagesSains, # partition face fissure étendue par fillings, on garde la plus grande face partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0) - geompy.addToStudy(partShapeDefaut, 'partShapeDefaut') + geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut') facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False) if isPointInterne: distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)] @@ -117,7 +120,7 @@ def insereFissureGenerale(maillagesSains, logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf) facesPortFissure = facesPartShapeDefautSorted[-1] #= global - geompy.addToStudy(facesPortFissure, "facesPortFissure") + geomPublish(initLog.debug, facesPortFissure, "facesPortFissure") O, OX, OY, OZ = triedreBase() @@ -129,42 +132,42 @@ def insereFissureGenerale(maillagesSains, plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000) shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #= local #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile - geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe') - #geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe') + geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe') + #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe') extrem, norms = findWireEndVertices(fondFiss, True) logging.debug("extrem: %s, norm: %s",extrem, norms) cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe) cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure - geompy.addToStudy(cercle, 'cercle') + geomPublish(initLog.debug, cercle, 'cercle') fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe) pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) - geompy.addToStudy(pipeFiss, 'pipeFiss') + geomPublish(initLog.debug, pipeFiss, 'pipeFiss') partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) - geompy.addToStudy(partFissPipe, 'partFissPipe') + geomPublish(initLog.debug, partFissPipe, 'partFissPipe') fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) #= global - geompy.addToStudy(fissPipe, 'fissPipe') + geomPublish(initLog.debug, fissPipe, 'fissPipe') partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) #= local - geompy.addToStudy(partPipe, 'partPipe') + geomPublish(initLog.debug, partPipe, 'partPipe') edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) #= global for i, edge in enumerate(edgesPipeFiss): name = "edgePipe%d"%i - geompy.addToStudyInFather(fissPipe, edge, name) + geomPublishInFather(initLog.debug,fissPipe, edge, name) try: wirePipeFiss = geompy.MakeWire(edgesPipeFiss) #= global except: wirePipeFiss = geompy.MakeCompound(edgesPipeFiss) logging.debug("wirePipeFiss construit sous forme de compound") - geompy.addToStudy(wirePipeFiss, "wirePipeFiss") + geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss") wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss) edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"]) for i, edge in enumerate(edgesFondFiss): name = "edgeFondFiss%d"%i - geompy.addToStudyInFather(fissPipe, edge, name) + geomPublishInFather(initLog.debug,fissPipe, edge, name) wireFondFiss = geompy.MakeWire(edgesFondFiss) #= global - geompy.addToStudy(wireFondFiss,"wireFondFiss") + geomPublish(initLog.debug, wireFondFiss,"wireFondFiss") # ----------------------------------------------------------------------------- # --- peau et face de fissure @@ -187,7 +190,7 @@ def insereFissureGenerale(maillagesSains, fissPipePart = fissPipe part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) partitionsPeauFissFond.append(part) - geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart ) + geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart ) else: partitionsPeauFissFond.append(None) ipart = ipart +1 @@ -203,13 +206,13 @@ def insereFissureGenerale(maillagesSains, if not isinstance(a, list): aretesVives.append(a) name = "areteVive%d"%ia - geompy.addToStudy(a, name) + geomPublish(initLog.debug, a, name) ia += 1 else: if a[0] is not None: aretesVives.append(a[0]) name = "areteVive%d"%ia - geompy.addToStudy(a[0], name) + geomPublish(initLog.debug, a[0], name) ia += 1 aretesVivesC = None #= global @@ -246,9 +249,9 @@ def insereFissureGenerale(maillagesSains, # edges prolongées edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) #= local - geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss") + geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPipeC, "edgesPipeFiss") edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) #= local - geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss") + geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesFondC, "edgesFondFiss") if aretesVivesC is None: #= global facesInside facesOnside [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) @@ -265,9 +268,9 @@ def insereFissureGenerale(maillagesSains, vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"]) verticesPipePeau.append(vertices[0]) name = "edgePipeIn%d"%i - geompy.addToStudyInFather(partitionPeauFissFond, edge, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name) name = "verticePipePeau%d"%i - geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, vertices[0], name) logging.debug("edgePipeIn%s coupe les faces OnSide", i) except: logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i) @@ -289,11 +292,11 @@ def insereFissureGenerale(maillagesSains, edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss) for i,edge in enumerate(edgesFondFiss): - geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i) + geomPublishInFather(initLog.debug,wireFondFiss, edge, "edgeFondFiss%d"%i) for iedf, edge in enumerate(edgesFondIn): name = "edgeFondIn%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, edge, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name) dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau] ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge [u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss) @@ -301,14 +304,14 @@ def insereFissureGenerale(maillagesSains, localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex] centre = PointOnEdge centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u) - geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf) + geomPublishInFather(initLog.debug,partitionPeauFissFond, centre2, "centre2_%d"%iedf) verticesEdgesFondIn.append(centre) name = "verticeEdgesFondIn%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, centre, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, name) norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u) - geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf) + geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, "norm%d"%iedf) cercle = geompy.MakeCircle(centre, norm, rayonPipe) - geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf) + geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, "cerclorig%d"%iedf) [vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False) vec1 = geompy.MakeVector(centre, vertex) vec2 = geompy.MakeVector(centre, ptPeau) @@ -330,7 +333,7 @@ def insereFissureGenerale(maillagesSains, else: cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi) name = "cercle%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, cercle, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name) cercles.append(cercle) # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie @@ -359,8 +362,8 @@ def insereFissureGenerale(maillagesSains, logging.debug("distance curviligne centre extremite0: %s", ofp) p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0) p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0) - geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf) - geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf) + geomPublishInFather(initLog.debug,wireFondFiss, p1, "p1_%d"%iedf) + geomPublishInFather(initLog.debug,wireFondFiss, p2, "p2_%d"%iedf) edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0) edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True) @@ -368,7 +371,7 @@ def insereFissureGenerale(maillagesSains, if geompy.MinDistance(centre, edp) < 1.e-3: pipext = geompy.MakePipe(cercle, edp) name = "pipeExt%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, pipext, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, pipext, name) pipexts.append(pipext) for face in facesInside: @@ -393,7 +396,7 @@ def insereFissureGenerale(maillagesSains, logging.debug(" face %s inside ajoutée", i) facesFissExt.append(face) name="faceFissExt%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, face, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, face, name) dist = 1. for ipe, edpe in enumerate(edgesPeauFis): for ipi, edpi in enumerate(edgesPipeFis): @@ -401,10 +404,10 @@ def insereFissureGenerale(maillagesSains, if dist < 1.e-3: edgesFissExtPeau.append(edpe) name="edgesFissExtPeau%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, edpe, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, edpe, name) edgesFissExtPipe.append(edpi) name="edgesFissExtPipe%d"%iedf - geompy.addToStudyInFather(partitionPeauFissFond, edpi, name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, edpi, name) break if dist < 1.e-3: break @@ -425,7 +428,7 @@ def insereFissureGenerale(maillagesSains, if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0): edgesFissExtPeau.append(edgesPeauFis[0]) name="edgesFissExtPeau%d"%j - geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name) j += 1 # ----------------------------------------------------------------------- @@ -478,7 +481,7 @@ def insereFissureGenerale(maillagesSains, pass name="partitionPeauByPipe%d"%ifil - geompy.addToStudy(partitionPeauByPipe, name) + geomPublish(initLog.debug, partitionPeauByPipe, name) [edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3) [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3) @@ -488,7 +491,7 @@ def insereFissureGenerale(maillagesSains, else: facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1) name="facePeau%d"%ifil - geompy.addToStudy(facePeau, name) + geomPublish(initLog.debug, facePeau, name) facesPipePeau = [None for i in range(len(edgesFissExtPipe))] endsEdgeFond = [None for i in range(len(edgesFissExtPipe))] @@ -514,13 +517,13 @@ def insereFissureGenerale(maillagesSains, nameEdge = "edgeRadFacePipePeau%d"%i facesPipePeau[i] = face endsEdgeFond[i] = sharedVertices[0] - geompy.addToStudy(face, nameFace) - geompy.addToStudy(sharedVertices[0], nameVert) + geomPublish(initLog.debug, face, nameFace) + geomPublish(initLog.debug, sharedVertices[0], nameVert) edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True) for edge in edgesFace: if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3: edgeRadFacePipePeau[i] = edge - geompy.addToStudy(edge, nameEdge) + geomPublish(initLog.debug, edge, nameEdge) break pass pass @@ -537,14 +540,14 @@ def insereFissureGenerale(maillagesSains, geompy.UnionList(grpEdgesCirc, edges) edgesCircPeau[i] = grpEdgesCirc name = "edgeCirc%d"%i - geompy.addToStudyInFather(facePeau, grpEdgesCirc, name) + geomPublishInFather(initLog.debug,facePeau, grpEdgesCirc, name) edgesListees = edgesListees + edges vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"]) grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"]) geompy.UnionList(grpVertCircPeau, vertices) verticesCircPeau[i] = grpVertCircPeau name = "pointEdgeCirc%d"%i - geompy.addToStudyInFather(facePeau, grpVertCircPeau, name) + geomPublishInFather(initLog.debug,facePeau, grpVertCircPeau, name) pass pass # --- au moins une extrémité du pipe sur cette face de peau @@ -555,7 +558,7 @@ def insereFissureGenerale(maillagesSains, for i, edge in enumerate(edgesFilling): edgepeau = geompy.GetInPlace(facePeau, edge) name = "edgepeau%d"%i - geompy.addToStudyInFather(facePeau,edgepeau, name) + geomPublishInFather(initLog.debug,facePeau,edgepeau, name) logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau)) if geompy.ShapeInfo(edgepeau)['EDGE'] > 1: logging.debug(" EDGES multiples") @@ -572,7 +575,7 @@ def insereFissureGenerale(maillagesSains, if aretesVivesC is not None: bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC) if bordsVifs is not None: - geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs") + geomPublishInFather(initLog.debug,facePeau, bordsVifs, "bordsVifs") groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs) grptmp = None if len(aretesVivesCoupees) > 0: @@ -586,7 +589,7 @@ def insereFissureGenerale(maillagesSains, edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False) aretesVivesCoupees += edv logging.debug("aretesVivesCoupees %s",aretesVivesCoupees) - geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords") + geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords") # --- edges de la face de peau partagées avec la face de fissure @@ -600,7 +603,7 @@ def insereFissureGenerale(maillagesSains, if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau): edgesFissurePeau[i] = edge name = "edgeFissurePeau%d"%i - geompy.addToStudyInFather(facePeau, edge, name) + geomPublishInFather(initLog.debug,facePeau, edge, name) for edge in edges: # on ajoute après les edges manquantes if edge not in edgesFissurePeau: edgesFissurePeau.append(edge) @@ -608,7 +611,7 @@ def insereFissureGenerale(maillagesSains, for i, edge in enumerate(edges): edgesFissurePeau.append(edge) name = "edgeFissurePeau%d"%i - geompy.addToStudyInFather(facePeau, edge, name) + geomPublishInFather(initLog.debug,facePeau, edge, name) ptEdgeFond[ifil] = endsEdgeFond # pour chaque face [points edge fond de fissure aux débouchés du pipe] @@ -631,7 +634,7 @@ def insereFissureGenerale(maillagesSains, for i, avc in enumerate(aretesVivesCoupees): name = "areteViveCoupee%d"%i - geompy.addToStudy(avc, name) + geomPublish(initLog.debug, avc, name) # --- identification des faces et edges de fissure externe pour maillage @@ -667,9 +670,9 @@ def insereFissureGenerale(maillagesSains, edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau) edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe) wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)) - geompy.addToStudy(faceFissureExterne, "faceFissureExterne") - geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") - geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") + geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne") + geomPublishInFather(initLog.debug,faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne") + geomPublishInFather(initLog.debug,faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne") logging.debug("---------------------------- Preparation Maillage du Pipe --------------") # ----------------------------------------------------------------------- @@ -734,11 +737,11 @@ def insereFissureGenerale(maillagesSains, origins.append(vertpx) normals.append(norm) # name = "vertcx%d"%i -# geompy.addToStudyInFather(wireFondFiss, vertcx, name) +# geomPublishInFather(initLog.debug,wireFondFiss, vertcx, name) # name = "vertpx%d"%i -# geompy.addToStudyInFather(wireFondFiss, vertpx, name) +# geomPublishInFather(initLog.debug,wireFondFiss, vertpx, name) # name = "plan%d"%i -# geompy.addToStudyInFather(wireFondFiss, plan, name) +# geomPublishInFather(initLog.debug,wireFondFiss, plan, name) # --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau @@ -854,18 +857,18 @@ def insereFissureGenerale(maillagesSains, #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) name='compoundRay%d'%k - geompy.addToStudy(comp, name) + geomPublish(initLog.debug, comp, name) else: idfin = min(len(gptsdisks), numout+1) iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb) comp = geompy.MakeCompound(raydisks[k][iddeb:idfin]) name='compoundRay%d'%k - geompy.addToStudy(comp, name) + geomPublish(initLog.debug, comp, name) nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default) nappes.append(nappe) name='nappe%d'%k - geompy.addToStudy(nappe, name) + geomPublish(initLog.debug, nappe, name) facesDebouchantes[i] = True listNappes.append(nappes) @@ -914,13 +917,13 @@ def insereFissureGenerale(maillagesSains, ednouv.append(ed) logging.debug(" edges issues de la partition: %s", ednouv) for ii, ed in enumerate(ednouv): - geompy.addToStudy(ed, "ednouv%d"%ii) + geomPublish(initLog.debug, ed, "ednouv%d"%ii) [edsorted, minl,maxl] = sortEdges(ednouv) logging.debug(" longueur edge trouvée: %s", maxl) edge = edsorted[-1] edges.append(edge) name = 'edgeEndPipe%d'%k - geompy.addToStudy(edge, name) + geomPublish(initLog.debug, edge, name) listEdges.append(edges) # --- création des points du maillage du pipe sur la face de peau @@ -932,9 +935,9 @@ def insereFissureGenerale(maillagesSains, id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) centre = ptEdgeFond[idFillingFromBout[i]][id] name = "centre%d"%id - geompy.addToStudy(centre, name) + geomPublish(initLog.debug, centre, name) vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id] - geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau") + geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau") grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes edgesCirc = [] for grpEdgesCirc in grpsEdgesCirc: @@ -961,7 +964,7 @@ def insereFissureGenerale(maillagesSains, else: bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u) name ="bout%d"%k - geompy.addToStudyInFather(centre, bout, name) + geomPublishInFather(initLog.debug,centre, bout, name) # enregistrement des points dans la structure points = [] for j in range(nbsegRad +1): @@ -1238,7 +1241,7 @@ def insereFissureGenerale(maillagesSains, edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) geompy.UnionList(groupEdgesBordPeau, edgesFilling) - geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords") + geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords") meshFacePeau = smesh.Mesh(facesDefaut[ifil]) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue.py b/src/Tools/blocFissure/gmu/insereFissureLongue.py index 8f9515846..bc33172ee 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue.py @@ -3,6 +3,9 @@ import logging import salome from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from geomsmesh import smesh from salome.smesh import smeshBuilder import SMESH @@ -80,7 +83,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, WirePorteFondFissure = wiretube fillingFaceExterne = facesDefaut[0] logging.debug("fillingFaceExterne %s", fillingFaceExterne) - geompy.addToStudy(fillingFaceExterne, "fillingFaceExterne") + geomPublish(initLog.debug, fillingFaceExterne, "fillingFaceExterne") edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False) O, OX, OY, OZ = triedreBase() @@ -90,7 +93,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, # --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée partitionPeauFissFond = geompy.MakePartition([facePorteFissure, WirePorteFondFissure, fillingFaceExterne], [], [], [], geompy.ShapeType["FACE"], 0, [], 0) - geompy.addToStudy( partitionPeauFissFond, 'partitionPeauFissFond' ) + geomPublish(initLog.debug, partitionPeauFissFond, 'partitionPeauFissFond' ) edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False) @@ -103,39 +106,39 @@ def insereFissureLongue(geometriesSaines, maillagesSains, lgmax = lg imax = i edgemax = edges[imax] - geompy.addToStudy(edgemax, 'edgemax') + geomPublish(initLog.debug, edgemax, 'edgemax') centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5) - geompy.addToStudy(centreFondFiss, 'centreFondFiss') + geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss') tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5) - geompy.addToStudy(tangentFondFiss, 'tangentFondFiss') + geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss') bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0) - geompy.addToStudy(bord1FondFiss, 'bord1FondFiss') + geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss') tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0) - geompy.addToStudy(tangentBord1FondFiss, 'tangentBord1FondFiss') + geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss') bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0) - geompy.addToStudy(bord2FondFiss, 'bord2FondFiss') + geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss') tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0) - geompy.addToStudy(tangentBord2FondFiss, 'tangentBord2FondFiss') + geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss') planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe) planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe) - geompy.addToStudy(planBord1, 'planBord1') - geompy.addToStudy(planBord2, 'planBord2') + geomPublish(initLog.debug, planBord1, 'planBord1') + geomPublish(initLog.debug, planBord2, 'planBord2') [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) # --- partition peau -face fissure - pipe fond de fissure prolongé partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], [], [], geompy.ShapeType["FACE"], 0, [], 0) - geompy.addToStudy( partitionPeauFissByPipe, 'partitionPeauFissByPipe' ) + geomPublish(initLog.debug, partitionPeauFissByPipe, 'partitionPeauFissByPipe' ) # --- identification face de peau [facesPeauFissInside, facesPeauFissOutside, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_") facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face facePeau = facesPeauSorted[-1] # la plus grande face - geompy.addToStudyInFather(partitionPeauFissByPipe, facePeau, "facePeau") + geomPublishInFather(initLog.debug,partitionPeauFissByPipe, facePeau, "facePeau") # --- identification edges de bord face peau edgesBords = [] @@ -144,7 +147,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, edgesBords.append(edgepeau) groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"]) geompy.UnionList(groupEdgesBordPeau, edgesBords) - geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords") + geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords") # --- identification face fissure externe au pipe et edge commune peau fissure for face in facesPeauFissInside: @@ -153,9 +156,9 @@ def insereFissureLongue(geometriesSaines, maillagesSains, if sharedEdges is not None: faceFiss = face edgePeauFiss = sharedEdges[0] - geompy.addToStudyInFather(partitionPeauFissByPipe, faceFiss, "faceFiss") - geompy.addToStudyInFather(faceFiss, edgePeauFiss, "edgePeauFiss") - geompy.addToStudyInFather(facePeau, edgePeauFiss, "edgePeauFiss") + geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss") + geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss") + geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss") break except: pass @@ -168,16 +171,16 @@ def insereFissureLongue(geometriesSaines, maillagesSains, verticesDemiCerclesPeau = [] for i, edge in enumerate(demiCerclesPeau): name = "demiCerclePeau_%d"%i - geompy.addToStudyInFather(facePeau, edge, name) + geomPublishInFather(initLog.debug,facePeau, edge, name) verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False) verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau) for i, vertex in enumerate(verticesDemiCerclesPeau): name = "verticesDemiCerclesPeau_%d"%i - geompy.addToStudyInFather(facePeau, vertex, name) + geomPublishInFather(initLog.debug,facePeau, vertex, name) verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss) for i, vertex in enumerate(verticesOutCercles): name = "verticesOutCercles_%d"%i - geompy.addToStudyInFather(facePeau, vertex, name) + geomPublishInFather(initLog.debug,facePeau, vertex, name) # --- demi cercles regroupés groupsDemiCerclesPeau = [] @@ -189,7 +192,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"]) geompy.UnionList(group, demis) name = "Cercle%d"%i - geompy.addToStudyInFather(facePeau, group , name) + geomPublishInFather(initLog.debug,facePeau, group , name) groupsDemiCerclesPeau.append(group) # --- identification edges commune pipe face fissure externe au pipe @@ -200,10 +203,10 @@ def insereFissureLongue(geometriesSaines, maillagesSains, if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId: edgesFaceFissPipe.append(edge) name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe) - geompy.addToStudyInFather(faceFiss, edge, name) + geomPublishInFather(initLog.debug,faceFiss, edge, name) groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"]) geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe) - geompy.addToStudyInFather(faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe") + geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe") # ----------------------------------------------------------------------------- # --- pipe de fond de fissure @@ -240,29 +243,29 @@ def insereFissureLongue(geometriesSaines, maillagesSains, #pipeFondFiss = pipesSorted[-1] #pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0) - geompy.addToStudy( disque, 'disque') - geompy.addToStudy( wireFondFiss, 'wireFondFiss') - geompy.addToStudy( pipeFondFiss, 'pipeFondFiss') + geomPublish(initLog.debug, disque, 'disque') + geomPublish(initLog.debug, wireFondFiss, 'wireFondFiss') + geomPublish(initLog.debug, pipeFondFiss, 'pipeFondFiss') VerticesEndFondFiss = findWireEndVertices(wireFondFiss) for i, v in enumerate(VerticesEndFondFiss): name = "vertexEndFondFiss_%d"%i - geompy.addToStudyInFather(wireFondFiss, v, name) + geomPublishInFather(initLog.debug,wireFondFiss, v, name) VerticesEndPipeFiss = [] for v in VerticesEndFondFiss: VerticesEndPipeFiss.append(geompy.GetInPlace(pipeFondFiss, v)) for i, v in enumerate(VerticesEndPipeFiss): name = "vertexEndPipeFiss_%d"%i - geompy.addToStudyInFather(pipeFondFiss, v, name) + geomPublishInFather(initLog.debug,pipeFondFiss, v, name) - geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[0], "PFOR") - geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[1], "PFEX") + geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[0], "PFOR") + geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[1], "PFEX") if geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[0]) > geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[1]): a = verticesOutCercles[0] verticesOutCercles[0] = verticesOutCercles[1] verticesOutCercles[1] = a - geompy.addToStudyInFather(facePeau, verticesOutCercles[0], "THOR") - geompy.addToStudyInFather(facePeau, verticesOutCercles[1], "THEX") + geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[0], "THOR") + geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[1], "THEX") [facesPipeInside, facesPipeOutside, facesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "FACE", 0.1, "pipe_bord_") [edgesPipeInside, edgesPipeOutside, edgesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "EDGE", 0.1, "pipe_bord_") @@ -275,7 +278,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, centre = geompy.MakeVertexOnSurface(planfiss, 0.5, 0.5) refpoint = geompy.MakeTranslationVector(centre, geompy.GetNormal(planfiss,centre)) - geompy.addToStudy(refpoint, 'refpoint') + geomPublish(initLog.debug, refpoint, 'refpoint') [facesPipeInplan, facesPipeOutplan, facesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "FACE", 0.1, "pipe_plan_") [edgesPipeInplan, edgesPipeOutplan, edgesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "EDGE", 0.1, "pipe_plan_") @@ -315,7 +318,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, generFiss.append(edge) groupGenerFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"]) geompy.UnionList(groupGenerFiss, generFiss) - geompy.addToStudyInFather(pipeFondFiss, groupGenerFiss, "GenFiss") + geomPublishInFather(initLog.debug,pipeFondFiss, groupGenerFiss, "GenFiss") # --- demi cercles externes regroupés groupsDemiCerclesPipe = [] @@ -327,7 +330,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains, group = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"]) geompy.UnionList(group, demis) name = "Cercle%d"%i - geompy.addToStudyInFather(pipeFondFiss, group , name) + geomPublishInFather(initLog.debug,pipeFondFiss, group , name) groupsDemiCerclesPipe.append(group) # --- faces fissure dans le pipe @@ -344,12 +347,12 @@ def insereFissureLongue(geometriesSaines, maillagesSains, logging.debug("face found") facesFissinPipe.append(face) name = "faceFissInPipe_%d"%i - geompy.addToStudyInFather(pipeFondFiss, face, name) + geomPublishInFather(initLog.debug,pipeFondFiss, face, name) break groupFaceFissInPipe = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["FACE"]) geompy.UnionList(groupFaceFissInPipe, facesFissinPipe) name = "FaceFissInPipe" - geompy.addToStudyInFather(pipeFondFiss, groupFaceFissInPipe , name) + geomPublishInFather(initLog.debug,pipeFondFiss, groupFaceFissInPipe , name) # --- edges de fond de fissure @@ -359,11 +362,11 @@ def insereFissureLongue(geometriesSaines, maillagesSains, logging.debug(" edge %s ", anEdge) edgesFondFiss.append(anEdge) name ="edgeFondFissure_%d"%i - geompy.addToStudyInFather(pipeFondFiss, anEdge, name) + geomPublishInFather(initLog.debug,pipeFondFiss, anEdge, name) groupEdgeFondFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"]) geompy.UnionList(groupEdgeFondFiss, edgesFondFiss) name = "FONDFISS" - geompy.addToStudyInFather(pipeFondFiss, groupEdgeFondFiss , name) + geomPublishInFather(initLog.debug,pipeFondFiss, groupEdgeFondFiss , name) # ------------------------------------------------------------------------- # --- maillage diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index 5ff5170be..c73cf1d59 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from geomsmesh import smesh from salome.smesh import smeshBuilder import SMESH @@ -34,7 +37,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"]) geompy.UnionList(groupEdgesBordPeau, edgesFilling) - geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords") + geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords") meshFacePeau = smesh.Mesh(facesDefaut[ifil]) diff --git a/src/Tools/blocFissure/gmu/partitionBlocDefaut.py b/src/Tools/blocFissure/gmu/partitionBlocDefaut.py index 4016c9a5b..be3a3481d 100644 --- a/src/Tools/blocFissure/gmu/partitionBlocDefaut.py +++ b/src/Tools/blocFissure/gmu/partitionBlocDefaut.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- partition du bloc defaut par generatrice, tore et plan fissure @@ -29,10 +32,10 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, faceFissure = geompy.GetInPlaceByHistory(volDefautPart, facefis) #ellipsoidep =geompy.GetInPlaceByHistory(volDefautPart, ellipsoide) - geompy.addToStudy( volDefautPart, 'volDefautPart' ) - geompy.addToStudyInFather( volDefautPart, tore, 'tore' ) - geompy.addToStudyInFather( volDefautPart, faceFissure, 'FACE1' ) - #geompy.addToStudyInFather( volDefautPart, gencnt, 'generatrice' ) + geomPublish(initLog.debug, volDefautPart, 'volDefautPart' ) + geomPublishInFather(initLog.debug, volDefautPart, tore, 'tore' ) + geomPublishInFather(initLog.debug, volDefautPart, faceFissure, 'FACE1' ) + #geomPublishInFather(initLog.debug, volDefautPart, gencnt, 'generatrice' ) solids = geompy.ExtractShapes(blocp, geompy.ShapeType["SOLID"], True) vols = [] @@ -47,13 +50,13 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, imaxvol = vols.index(maxvol) ellipsoidep = solids[imaxvol] - geompy.addToStudyInFather( volDefautPart, blocp, 'bloc' ) - geompy.addToStudyInFather( volDefautPart, ellipsoidep, 'ellipsoide' ) + geomPublishInFather(initLog.debug, volDefautPart, blocp, 'bloc' ) + geomPublishInFather(initLog.debug, volDefautPart, ellipsoidep, 'ellipsoide' ) sharedFaces = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["FACE"]) for i in range(len(sharedFaces)): name = "faceCommuneEllipsoideBloc_%d"%i - geompy.addToStudyInFather(blocp, sharedFaces[i], name) + geomPublishInFather(initLog.debug,blocp, sharedFaces[i], name) #sharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"]) allSharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"]) @@ -63,7 +66,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, sharedEdges.append(allSharedEdges[i]) for i in range(len(sharedEdges)): name = "edgeCommuneEllipsoideBloc_%d"%i - geompy.addToStudyInFather(blocp, sharedEdges[i], name) + geomPublishInFather(initLog.debug,blocp, sharedEdges[i], name) facesExternes = [] facesExtBloc = [] @@ -75,14 +78,14 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, faceExt = geompy.GetInPlace(ellipsoidep, faces[i]) if faceExt is not None: name = "faceExterne_e%d"%i - geompy.addToStudyInFather(ellipsoidep, faceExt, name) + geomPublishInFather(initLog.debug,ellipsoidep, faceExt, name) facesExternes.append(faceExt) facesExtElli.append(faceExt) faceExt = geompy.GetInPlace(blocp, faces[i]) if faceExt is not None: name = "faceExterne_b%d"%i - geompy.addToStudyInFather(blocp, faceExt, name) + geomPublishInFather(initLog.debug,blocp, faceExt, name) facesExternes.append(faceExt) facesExtBloc.append(faceExt) else: @@ -93,12 +96,12 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, #extrusionFace = geompy.MakePrismVecH2Ways(faces[i], normal, 0.1) #extrusionFace = geompy.MakeScaleTransform(extrusionFace, vertex, 1.01) name = "extrusionFace_b%d"%i - geompy.addToStudyInFather(blocp, extrusionFace, name) + geomPublishInFather(initLog.debug,blocp, extrusionFace, name) #facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ONIN) facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ON) for j in range(len(facesExt)): name = "faceExterne_b%d_%d"%(i,j) - geompy.addToStudyInFather(blocp, facesExt[j], name) + geomPublishInFather(initLog.debug,blocp, facesExt[j], name) facesExternes.append(facesExt[j]) facesExtBloc.append(facesExt[j]) @@ -120,7 +123,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, pass if len(allSharedEdges) > 0: name = "faceExterne_b%d_%d"%(i,j) - geompy.addToStudyInFather(blocp, facesBloc[i], name) + geomPublishInFather(initLog.debug,blocp, facesBloc[i], name) facesExternes.append(facesBloc[i]) facesExtBloc.append(facesBloc[i]) @@ -136,7 +139,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, aretesInternes += shared for i in range(len(aretesInternes)): name = "aretesInternes_%d"%i - geompy.addToStudyInFather(blocp, aretesInternes[i], name) + geomPublishInFather(initLog.debug,blocp, aretesInternes[i], name) edgesBords = [] for faceExtB in facesExtBloc: @@ -150,7 +153,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe, if not isInterne: edgesBords.append(edges[i]) name = "edgeBord%d"%i - geompy.addToStudyInFather(blocp,edges[i] , name) + geomPublishInFather(initLog.debug,blocp,edges[i] , name) group = None if len(edgesBords) > 0: group = geompy.CreateGroup(blocp, geompy.ShapeType["EDGE"]) diff --git a/src/Tools/blocFissure/gmu/partitionVolumeSain.py b/src/Tools/blocFissure/gmu/partitionVolumeSain.py index a23fa591a..e7ce51a11 100644 --- a/src/Tools/blocFissure/gmu/partitionVolumeSain.py +++ b/src/Tools/blocFissure/gmu/partitionVolumeSain.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- partition volume sain et bloc, face du bloc recevant la fissure @@ -26,8 +29,8 @@ def partitionVolumeSain(volumeSain,boiteDefaut): partieSaine = b faceBloc = geompy.GetShapesOnShapeAsCompound(volumeSain, volDefaut, geompy.ShapeType["FACE"], GEOM.ST_ON) - geompy.addToStudy( volumeSainPart, 'volumeSainPart' ) - geompy.addToStudyInFather( volumeSainPart, partieSaine, 'partieSaine' ) - geompy.addToStudyInFather( volumeSainPart, volDefaut, 'volDefaut' ) - geompy.addToStudyInFather( volDefaut, faceBloc, 'faceBloc' ) + geomPublish(initLog.debug, volumeSainPart, 'volumeSainPart' ) + geomPublishInFather(initLog.debug, volumeSainPart, partieSaine, 'partieSaine' ) + geomPublishInFather(initLog.debug, volumeSainPart, volDefaut, 'volDefaut' ) + geomPublishInFather(initLog.debug, volDefaut, faceBloc, 'faceBloc' ) return volumeSainPart, partieSaine, volDefaut, faceBloc diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py index 8f770fa51..7d6289797 100644 --- a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py +++ b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py @@ -3,6 +3,9 @@ import math import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from findWireEndVertices import findWireEndVertices from prolongeWire import prolongeWire @@ -21,41 +24,41 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000) shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile - geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe') - #geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe') + geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe') + #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe') extrem, norms = findWireEndVertices(fondFiss, True) logging.debug("extrem: %s, norm: %s",extrem, norms) cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe) cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure - geompy.addToStudy(cercle, 'cercle') + geomPublish(initLog.debug, cercle, 'cercle') fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe) pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) - geompy.addToStudy(pipeFiss, 'pipeFiss') + geomPublish(initLog.debug, pipeFiss, 'pipeFiss') partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) - geompy.addToStudy(partFissPipe, 'partFissPipe') + geomPublish(initLog.debug, partFissPipe, 'partFissPipe') fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) - geompy.addToStudy(fissPipe, 'fissPipe') + geomPublish(initLog.debug, fissPipe, 'fissPipe') partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) - geompy.addToStudy(partPipe, 'partPipe') + geomPublish(initLog.debug, partPipe, 'partPipe') edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) for i, edge in enumerate(edgesPipeFiss): name = "edgePipe%d"%i - geompy.addToStudyInFather(fissPipe, edge, name) + geomPublishInFather(initLog.debug,fissPipe, edge, name) try: wirePipeFiss = geompy.MakeWire(edgesPipeFiss) except: wirePipeFiss = geompy.MakeCompound(edgesPipeFiss) logging.debug("wirePipeFiss construit sous forme de compound") - geompy.addToStudy(wirePipeFiss, "wirePipeFiss") + geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss") wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss) edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"]) for i, edge in enumerate(edgesFondFiss): name = "edgeFondFiss%d"%i - geompy.addToStudyInFather(fissPipe, edge, name) + geomPublishInFather(initLog.debug,fissPipe, edge, name) wireFondFiss = geompy.MakeWire(edgesFondFiss) - geompy.addToStudy(wireFondFiss,"wireFondFiss") + geomPublish(initLog.debug, wireFondFiss,"wireFondFiss") return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) \ No newline at end of file diff --git a/src/Tools/blocFissure/gmu/propagateTore.py b/src/Tools/blocFissure/gmu/propagateTore.py index 70678a420..23200e1f7 100644 --- a/src/Tools/blocFissure/gmu/propagateTore.py +++ b/src/Tools/blocFissure/gmu/propagateTore.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- recherche et classement des edges du tore par propagate @@ -18,7 +21,7 @@ def propagateTore(tore): lencomp = [] compounds = geompy.Propagate(tore) for i in range(len(compounds)): - #geompy.addToStudyInFather( tore, compounds[i], 'edges' ) + #geomPublishInFather(initLog.debug, tore, compounds[i], 'edges' ) props = geompy.BasicProperties(compounds[i]) lencomp.append(props[0]) pass @@ -35,10 +38,10 @@ def propagateTore(tore): else: circles.append(compounds[i]) - geompy.addToStudyInFather( tore, diams[0], 'diams0' ) - geompy.addToStudyInFather( tore, diams[1], 'diams1' ) - geompy.addToStudyInFather( tore, circles[0], 'circles0' ) - geompy.addToStudyInFather( tore, circles[1], 'circles1' ) - geompy.addToStudyInFather( tore, geners[0], 'geners' ) + geomPublishInFather(initLog.debug, tore, diams[0], 'diams0' ) + geomPublishInFather(initLog.debug, tore, diams[1], 'diams1' ) + geomPublishInFather(initLog.debug, tore, circles[0], 'circles0' ) + geomPublishInFather(initLog.debug, tore, circles[1], 'circles1' ) + geomPublishInFather(initLog.debug, tore, geners[0], 'geners' ) return diams, circles, geners diff --git a/src/Tools/blocFissure/gmu/quadranglesToShape.py b/src/Tools/blocFissure/gmu/quadranglesToShape.py index faa9478f7..b9facb652 100644 --- a/src/Tools/blocFissure/gmu/quadranglesToShape.py +++ b/src/Tools/blocFissure/gmu/quadranglesToShape.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM import math import numpy as np @@ -225,23 +228,23 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss): if i == 0: noeudsBords[0].append(node) #name = "bord0_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) if i == (nbLignes -1): noeudsBords[2].append(node) #name = "bord2_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) if j == 0: noeudsBords[1].append(node) #name = "bord1_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) if j == (nbCols -1): noeudsBords[3].append(node) #name = "bord3_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) k += 1 curve = geompy.MakeInterpol(nodeList, False, False) #name = "curve_%d"%i - #geompy.addToStudy( curve, name ) + #geomPublish(initLog.debug, curve, name ) if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe curvconts.append(nodeList) curves.append(curve) @@ -291,11 +294,11 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss): vecteurDefaut = geompy.MakeVector(vertex, cdg) if vecteurDefaut is not None: - geompy.addToStudy(normal, "normFillOrig%d"%iface) - geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface) + geomPublish(initLog.debug, normal, "normFillOrig%d"%iface) + geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface) if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0: filling = geompy.ChangeOrientation(filling) - geompy.addToStudy( filling, "filling%d"%iface ) + geomPublish(initLog.debug, filling, "filling%d"%iface ) #geompy.ExportBREP(filling, "filling.brep") iface = iface+1 fillings.append(filling) @@ -315,7 +318,7 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss): curve = geompy.MakeInterpol(nodes, False, False) curves.append(curve) fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) - geompy.addToStudy( fillcont, "filcont%d"%icont ) + geomPublish(initLog.debug, fillcont, "filcont%d"%icont ) fillconts.append(fillcont) icont = icont+1 pass # --- loop while there are remaining nodes diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py index a305a05d9..d3c52ab59 100644 --- a/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py +++ b/src/Tools/blocFissure/gmu/quadranglesToShapeNoCorner.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM import math import numpy as np @@ -40,6 +43,7 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): allNodeIds = meshQuad.GetNodesId() while len(allNodeIds): + logging.debug("len(allNodeIds): %s ", len(allNodeIds)) nodeIds = allNodeIds for idNode in nodeIds: # rechercher un coin elems = meshQuad.GetNodeInverseElements(idNode) @@ -227,23 +231,23 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): if i == 0: noeudsBords[0].append(node) #name = "bord0_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) if i == (nbLignes -1): noeudsBords[2].append(node) #name = "bord2_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) if j == 0: noeudsBords[1].append(node) #name = "bord1_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) if j == (nbCols -1): noeudsBords[3].append(node) #name = "bord3_%d"%k - #geompy.addToStudy( node, name ) + #geomPublish(initLog.debug, node, name ) k += 1 curve = geompy.MakeInterpol(nodeList, False, False) #name = "curve_%d"%i - #geompy.addToStudy( curve, name ) + #geomPublish(initLog.debug, curve, name ) if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe curvconts.append(nodeList) curves.append(curve) @@ -293,11 +297,11 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): vecteurDefaut = geompy.MakeVector(vertex, cdg) if vecteurDefaut is not None: - geompy.addToStudy(normal, "normFillOrig%d"%iface) - geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface) + geomPublish(initLog.debug, normal, "normFillOrig%d"%iface) + geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface) if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0: filling = geompy.ChangeOrientation(filling) - geompy.addToStudy( filling, "filling%d"%iface ) + geomPublish(initLog.debug, filling, "filling%d"%iface ) #geompy.ExportBREP(filling, "filling.brep") iface = iface+1 fillings.append(filling) @@ -318,7 +322,7 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss): curve = geompy.MakeInterpol(nodes, False, False) curves.append(curve) fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) - geompy.addToStudy( fillcont, "filcont%d"%icont ) + geomPublish(initLog.debug, fillcont, "filcont%d"%icont ) fillconts.append(fillcont) icont = icont+1 pass # --- loop while there are remaining nodes diff --git a/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py b/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py index 83fba6078..66963300f 100644 --- a/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py +++ b/src/Tools/blocFissure/gmu/quadranglesToShapeWithCorner.py @@ -7,6 +7,9 @@ Created on Tue Jun 24 09:14:13 2014 import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import GEOM from listOfExtraFunctions import createNewMeshesFromCorner @@ -62,7 +65,7 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent # A partir des lignes de chaque face, # on recrée un objet GEOM temporaire par filling. filling = geompy.MakeFilling(geompy.MakeCompound(face), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True) - geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) + geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1)) tmpFillings.append(filling) for face in setOfNodes: @@ -81,10 +84,10 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True) tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) if len(tmpExplodeRef) == len(tmpExplodeNum): - geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1)) + geomPublish(initLog.debug, filling, "faceNonCoupee_{0}".format(i + 1)) facesNonCoupees.append(filling) else: - geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1)) + geomPublish(initLog.debug, filling, "faceCoupee_{0}".format(i + 1)) facesCoupees.append(filling) fillings = facesCoupees, facesNonCoupees @@ -93,21 +96,21 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True) tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True) if len(tmpExplodeRef) == len(tmpExplodeNum): - geompy.addToStudy(filling, "areteNonCoupee_{0}".format(i + 1)) + geomPublish(initLog.debug, filling, "areteNonCoupee_{0}".format(i + 1)) aretesNonCoupees.append(filling) else: - geompy.addToStudy(filling, "areteCoupee_{0}".format(i + 1)) + geomPublish(initLog.debug, filling, "areteCoupee_{0}".format(i + 1)) aretesCoupees.append(filling) bords_Partages = aretesCoupees, aretesNonCoupees # TODO: A enlever # for i, face in enumerate(setOfLines): # for j, line in enumerate(face): -# geompy.addToStudy(line, 'face{0}_ligne{1}'.format(i + 1, j + 1)) +# geomPublish(initLog.debug, line, 'face{0}_ligne{1}'.format(i + 1, j + 1)) #TODO: A enlever # for i, filling in enumerate(fillings[0]): -# geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) +# geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1)) # for j, line in enumerate(setOfLines[i]): # geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1)) diff --git a/src/Tools/blocFissure/gmu/restreintFaceFissure.py b/src/Tools/blocFissure/gmu/restreintFaceFissure.py index 4cadb4984..50e867e0c 100644 --- a/src/Tools/blocFissure/gmu/restreintFaceFissure.py +++ b/src/Tools/blocFissure/gmu/restreintFaceFissure.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog from sortFaces import sortFaces def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): @@ -11,7 +14,7 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): """ logging.info('start') partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0) - geompy.addToStudy(partShapeDefaut, 'partShapeDefaut') + geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut') facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False) if pointInterne is not None: distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)] @@ -23,5 +26,5 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf) facesPortFissure = facesPartShapeDefautSorted[-1] - geompy.addToStudy(facesPortFissure, "facesPortFissure") + geomPublish(initLog.debug, facesPortFissure, "facesPortFissure") return facesPortFissure diff --git a/src/Tools/blocFissure/gmu/rotTrans.py b/src/Tools/blocFissure/gmu/rotTrans.py index 7b8ff6e47..05e3dcbe1 100644 --- a/src/Tools/blocFissure/gmu/rotTrans.py +++ b/src/Tools/blocFissure/gmu/rotTrans.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import math from triedreBase import triedreBase O, OX, OY, OZ = triedreBase() @@ -48,9 +51,9 @@ def rotTrans(objet, orientation, point, normal, trace = False): logging.debug("alpha",alpha) logging.debug("beta",beta) if trace: - geompy.addToStudy( rot1, 'rot1' ) - geompy.addToStudy( axe2, 'axe2' ) - geompy.addToStudy( rot2, 'rot2' ) + geomPublish(initLog.debug, rot1, 'rot1' ) + geomPublish(initLog.debug, axe2, 'axe2' ) + geomPublish(initLog.debug, rot2, 'rot2' ) xyz = geompy.PointCoordinates(point) trans = geompy.MakeTranslation(rot2, xyz[0], xyz[1], xyz[2]) diff --git a/src/Tools/blocFissure/gmu/shapeSurFissure.py b/src/Tools/blocFissure/gmu/shapeSurFissure.py index 10b125ff7..f9e36ac19 100644 --- a/src/Tools/blocFissure/gmu/shapeSurFissure.py +++ b/src/Tools/blocFissure/gmu/shapeSurFissure.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- construction d'une shape de dectection des éléments à modifier suite à la la duplication des noeuds de la face fissure (d'un coté de la face) @@ -30,6 +33,6 @@ def shapeSurFissure(facesFissure): normal = geompy.GetNormal(face, vertex) extrusionFaceFissure = geompy.MakePrismVecH(facesFissure, normal, 100) - geompy.addToStudy(extrusionFaceFissure, "extrusionFaceFissure") + geomPublish(initLog.debug, extrusionFaceFissure, "extrusionFaceFissure") return extrusionFaceFissure, normal diff --git a/src/Tools/blocFissure/gmu/sortGeneratrices.py b/src/Tools/blocFissure/gmu/sortGeneratrices.py index 956a8bcb8..f61dc2838 100644 --- a/src/Tools/blocFissure/gmu/sortGeneratrices.py +++ b/src/Tools/blocFissure/gmu/sortGeneratrices.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # ----------------------------------------------------------------------------- # --- tri par longueur des 3 generatrices @@ -36,8 +39,8 @@ def sortGeneratrices(tore, geners): gencnt= genx[i] pass - geompy.addToStudyInFather( tore, genext, 'genext' ) - geompy.addToStudyInFather( tore, genint, 'genint' ) - geompy.addToStudyInFather( tore, gencnt, 'gencnt' ) + geomPublishInFather(initLog.debug, tore, genext, 'genext' ) + geomPublishInFather(initLog.debug, tore, genint, 'genint' ) + geomPublishInFather(initLog.debug, tore, gencnt, 'gencnt' ) return genext, genint, gencnt diff --git a/src/Tools/blocFissure/gmu/toreFissure.py b/src/Tools/blocFissure/gmu/toreFissure.py index 899ef5e0c..12464f65d 100644 --- a/src/Tools/blocFissure/gmu/toreFissure.py +++ b/src/Tools/blocFissure/gmu/toreFissure.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog import math from triedreBase import triedreBase @@ -28,11 +31,11 @@ def toreFissure(minRad,allonge,rayTore): Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3) generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1) - #geompy.addToStudy( Vertex_1, 'Vertex_1' ) - #geompy.addToStudy( Vertex_2, 'Vertex_2' ) - #geompy.addToStudy( Vertex_3, 'Vertex_3' ) - #geompy.addToStudy( Arc_1, 'Arc_1' ) - #geompy.addToStudy( generatrice, 'generatrice' ) + #geomPublish(initLog.debug, Vertex_1, 'Vertex_1' ) + #geomPublish(initLog.debug, Vertex_2, 'Vertex_2' ) + #geomPublish(initLog.debug, Vertex_3, 'Vertex_3' ) + #geomPublish(initLog.debug, Arc_1, 'Arc_1' ) + #geomPublish(initLog.debug, generatrice, 'generatrice' ) # --- face circulaire sur la generatrice, pour extrusion @@ -41,10 +44,10 @@ def toreFissure(minRad,allonge,rayTore): Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0) FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1) - #geompy.addToStudy( Circle_1, 'Circle_1' ) - #geompy.addToStudy( Rotation_1, 'Rotation_1' ) - #geompy.addToStudy( Translation_1, 'Translation_1' ) - #geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' ) + #geomPublish(initLog.debug, Circle_1, 'Circle_1' ) + #geomPublish(initLog.debug, Rotation_1, 'Rotation_1' ) + #geomPublish(initLog.debug, Translation_1, 'Translation_1' ) + #geomPublish(initLog.debug, FaceGenFiss, 'FaceGenFiss' ) # --- tore extrude @@ -56,14 +59,14 @@ def toreFissure(minRad,allonge,rayTore): Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3) FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1) - #geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' ) - #geompy.addToStudy( Line_1, 'Line_1' ) - #geompy.addToStudy( FaceFissure, 'FaceFissure' ) + #geomPublishInFather(initLog.debug, generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' ) + #geomPublish(initLog.debug, Line_1, 'Line_1' ) + #geomPublish(initLog.debug, FaceFissure, 'FaceFissure' ) # --- tore coupe en 2 demi tore de section 1/2 disque Plane_1 = geompy.MakePlane(O, OZ, 2000) Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1) - geompy.addToStudy(Pipe1Part , 'Pipe1Part' ) + geomPublish(initLog.debug, Pipe1Part , 'Pipe1Part' ) return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part diff --git a/src/Tools/blocFissure/gmu/triedreBase.py b/src/Tools/blocFissure/gmu/triedreBase.py index 53135633e..068ca40b7 100644 --- a/src/Tools/blocFissure/gmu/triedreBase.py +++ b/src/Tools/blocFissure/gmu/triedreBase.py @@ -2,6 +2,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog # --- origine et vecteurs de base @@ -24,9 +27,9 @@ def triedreBase(): OY = geompy.MakeVectorDXDYDZ(0, 1, 0) OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) - geompy.addToStudy( O, 'O' ) - geompy.addToStudy( OX, 'OX' ) - geompy.addToStudy( OY, 'OY' ) - geompy.addToStudy( OZ, 'OZ' ) + geomPublish(initLog.debug, O, 'O' ) + geomPublish(initLog.debug, OX, 'OX' ) + geomPublish(initLog.debug, OY, 'OY' ) + geomPublish(initLog.debug, OZ, 'OZ' ) return O, OX, OY, OZ diff --git a/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py b/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py index 13289ac2c..49205e688 100644 --- a/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py +++ b/src/Tools/blocFissure/gmu/trouveEdgesFissPeau.py @@ -3,6 +3,9 @@ import logging from geomsmesh import geompy +from geomsmesh import geomPublish +from geomsmesh import geomPublishInFather +import initLog def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau): """ @@ -24,6 +27,6 @@ def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, part if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0): edgesFissExtPeau.append(edgesPeauFis[0]) name="edgesFissExtPeau%d"%j - geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name) + geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name) j += 1 return edgesFissExtPeau \ No newline at end of file From 204ce83e987b9b048ea7da1fa166068f853289b8 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 19 Oct 2015 11:25:16 +0300 Subject: [PATCH 022/147] Set development flag to 1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a92546766..03e0f5357 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 7) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 0) +SET(${PROJECT_NAME_UC}_VERSION_DEV 1) # Find KERNEL # =========== From 3369d458eaf2f08db6e32b75609679f06771a5cb Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 27 Oct 2015 20:47:31 +0300 Subject: [PATCH 023/147] IPAL52935: "Apply and Close" button is not available in "Make 0D Elements on Element Nodes" dialog box (SMESHGUI_Add0DElemsOnAllNodesDlg.cxx) Eliminate compilation warnings (all the rest files) --- src/DriverCGNS/DriverCGNS_Read.cxx | 10 +- src/DriverMED/DriverMED_W_Field.cxx | 6 +- src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx | 2 +- src/DriverUNV/UNV_Utilities.hxx | 12 +- src/SMDS/SMDS_FaceOfNodes.cxx | 5 +- src/SMDS/SMDS_Mesh.cxx | 209 +++++++++--------- src/SMDS/SMDS_Mesh.hxx | 7 +- src/SMDS/SMDS_MeshElementIDFactory.cxx | 6 +- src/SMDS/SMDS_MeshInfo.hxx | 8 +- src/SMDS/SMDS_PolygonalFaceOfNodes.cxx | 2 +- src/SMDS/SMDS_QuadraticFaceOfNodes.cxx | 8 +- src/SMDS/SMDS_UnstructuredGrid.cxx | 24 +- src/SMDS/SMDS_VolumeOfNodes.cxx | 2 +- src/SMDS/SMDS_VtkVolume.cxx | 2 +- src/SMESH/SMESH_Algo.cxx | 4 +- src/SMESH/SMESH_Gen.hxx | 2 +- src/SMESH/SMESH_HypoFilter.cxx | 9 +- src/SMESH/SMESH_Hypothesis.cxx | 3 +- src/SMESH/SMESH_Mesh.cxx | 2 +- src/SMESH/SMESH_ProxyMesh.cxx | 4 +- src/SMESH/SMESH_subMesh.cxx | 6 +- src/SMESHDS/SMESHDS_TSubMeshHolder.hxx | 4 +- .../SMESHGUI_Add0DElemsOnAllNodesDlg.cxx | 3 + src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx | 4 +- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 4 +- src/SMESHGUI/SMESHGUI_MergeDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 8 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 5 +- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_PreviewDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_Selection.cxx | 2 +- src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 42 +--- src/SMESHGUI/SMESHGUI_Utils.h | 2 +- src/StdMeshers/StdMeshers_Adaptive1D.cxx | 4 +- src/StdMeshers/StdMeshers_Arithmetic1D.cxx | 4 +- .../StdMeshers_CompositeHexa_3D.cxx | 6 +- src/StdMeshers/StdMeshers_Deflection1D.cxx | 2 +- src/StdMeshers/StdMeshers_FixedPoints1D.cxx | 6 +- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 4 +- src/StdMeshers/StdMeshers_Import_1D.cxx | 12 +- src/StdMeshers/StdMeshers_Import_1D2D.cxx | 2 +- src/StdMeshers/StdMeshers_LocalLength.cxx | 2 +- src/StdMeshers/StdMeshers_MEFISTO_2D.cxx | 6 +- src/StdMeshers/StdMeshers_MaxLength.cxx | 2 +- src/StdMeshers/StdMeshers_Penta_3D.cxx | 6 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 9 +- src/StdMeshers/StdMeshers_Projection_3D.cxx | 8 +- src/StdMeshers/StdMeshers_Propagation.cxx | 12 +- .../StdMeshers_QuadFromMedialAxis_1D2D.cxx | 14 +- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 7 +- src/StdMeshers/StdMeshers_Regular_1D.cxx | 13 +- src/StdMeshers/StdMeshers_StartEndLength.cxx | 6 +- src/StdMeshers/StdMeshers_ViscousLayers2D.cxx | 16 +- .../StdMeshersGUI_NbSegmentsCreator.cxx | 2 +- .../StdMeshersGUI_PropagationHelperWdg.cxx | 2 +- .../StdMeshersGUI_QuadrangleParamWdg.cxx | 4 +- .../StdMeshersGUI_SubShapeSelectorWdg.cxx | 4 +- .../StdMeshers_Arithmetic1D_i.cxx | 2 +- .../StdMeshers_LayerDistribution2D_i.cxx | 4 +- .../StdMeshers_NumberOfLayers2D_i.cxx | 4 +- .../StdMeshers_NumberOfSegments_i.cxx | 3 +- .../StdMeshers_Reversible1D_i.cxx | 2 +- .../StdMeshers_StartEndLength_i.cxx | 2 +- 72 files changed, 289 insertions(+), 324 deletions(-) diff --git a/src/DriverCGNS/DriverCGNS_Read.cxx b/src/DriverCGNS/DriverCGNS_Read.cxx index cf4709edb..4393e471c 100644 --- a/src/DriverCGNS/DriverCGNS_Read.cxx +++ b/src/DriverCGNS/DriverCGNS_Read.cxx @@ -234,7 +234,7 @@ namespace dist2 = ( nn1[1] - nn2[1] ).Modulus(); tol = 1e-5 * ( nn1[0] - nn1[1] ).Modulus(); } - return ( dist1 < tol & dist2 < tol ); + return ( dist1 < tol && dist2 < tol ); } return false; } @@ -451,7 +451,7 @@ namespace if ( !_nodeReplacementMap.empty() ) { map< int, int >::const_iterator it, end = _nodeReplacementMap.end(); - for ( size_t i = 0; i < nbIds; ++i ) + for ( int i = 0; i < nbIds; ++i ) if (( it = _nodeReplacementMap.find( ids[i] + idShift)) != end ) ids[i] = it->second; else @@ -459,7 +459,7 @@ namespace } else if ( idShift ) { - for ( size_t i = 0; i < nbIds; ++i ) + for ( int i = 0; i < nbIds; ++i ) ids[i] += idShift; } } @@ -1022,7 +1022,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform() if ( zone.IsStructured() ) { int axis = 0; // axis perpendiculaire to which boundary elements are oriented - if ( ids.size() >= meshDim * 2 ) + if ( (int) ids.size() >= meshDim * 2 ) { for ( ; axis < meshDim; ++axis ) if ( ids[axis] - ids[axis+meshDim] == 0 ) @@ -1127,7 +1127,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform() if ( psType == CGNS_ENUMV( PointRange ) && ids.size() == 2 ) { - for ( size_t i = ids[0]; i <= ids[1]; ++i ) + for ( cgsize_t i = ids[0]; i <= ids[1]; ++i ) if ( const SMDS_MeshElement* e = myMesh->FindElement( i )) groupDS.Add( e ); } diff --git a/src/DriverMED/DriverMED_W_Field.cxx b/src/DriverMED/DriverMED_W_Field.cxx index 71082464c..e40aac434 100644 --- a/src/DriverMED/DriverMED_W_Field.cxx +++ b/src/DriverMED/DriverMED_W_Field.cxx @@ -168,7 +168,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh, void DriverMED_W_Field::SetCompName(const int iComp, const char* name) { - if ( _compNames.size() <= iComp ) + if ( (int)_compNames.size() <= iComp ) _compNames.resize( iComp + 1 ); _compNames[ iComp ] = name; } @@ -327,7 +327,7 @@ Driver_Mesh::Status DriverMED_W_Field::Perform() MED::PIntTimeStampValue timeStampIntVal = timeStampVal; // set values - int iVal = 0, i, nbE; + int iVal = 0; MED::TFloat* ptrDbl = 0; MED::TInt* ptrInt = 0; for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG ) @@ -354,6 +354,8 @@ Driver_Mesh::Status DriverMED_W_Field::Perform() _dblValues.clear(); _intValues.clear(); + + return DRS_OK; } namespace DriverMED // Implemetation of fuctions declared in DriverMED.hxx diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index 243d9f350..5aa64330a 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -183,7 +183,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() aRec.fe_descriptor_id = anId; aRec.node_labels.reserve(aNbNodes); SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV(); - while ( aNodesIter->more() && aRec.node_labels.size() < aNbNodes ) + while ( aNodesIter->more() && (int)aRec.node_labels.size() < aNbNodes ) { const SMDS_MeshElement* aNode = aNodesIter->next(); aRec.node_labels.push_back(aNode->GetID()); diff --git a/src/DriverUNV/UNV_Utilities.hxx b/src/DriverUNV/UNV_Utilities.hxx index 413ccfa5a..28ebcd17f 100644 --- a/src/DriverUNV/UNV_Utilities.hxx +++ b/src/DriverUNV/UNV_Utilities.hxx @@ -93,17 +93,17 @@ namespace UNV{ */ inline double D_to_e(std::string& number) { - /* find "D" in string, start looking at + /* find "D" in string, start looking at * 6th element, to improve speed. * We dont expect a "D" earlier */ - const int position = number.find("D",6); - if(position != std::string::npos){ - number.replace(position, 1, "e"); - } + const size_t position = number.find("D",6); + if ( position != std::string::npos ) + number.replace(position, 1, "e"); + return atof (number.c_str()); } - + /** * @returns \p false when file is incorrect, \p true otherwise. * Check file with name \p theFileName for correct terminate diff --git a/src/SMDS/SMDS_FaceOfNodes.cxx b/src/SMDS/SMDS_FaceOfNodes.cxx index da8e96d69..42859c88a 100644 --- a/src/SMDS/SMDS_FaceOfNodes.cxx +++ b/src/SMDS/SMDS_FaceOfNodes.cxx @@ -90,7 +90,7 @@ class SMDS_FaceOfNodes_MyIterator:public SMDS_NodeArrayElemIterator class _MyEdgeIterator : public SMDS_ElemIterator { vector< const SMDS_MeshElement* > myElems; - int myIndex; + size_t myIndex; public: _MyEdgeIterator(const SMDS_FaceOfNodes* face):myIndex(0) { myElems.reserve( face->NbNodes() ); @@ -108,8 +108,7 @@ public: virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; } }; -SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator - (SMDSAbs_ElementType type) const +SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator( SMDSAbs_ElementType type ) const { switch(type) { diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 87a2f1558..c4cadf10f 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -124,16 +124,16 @@ int SMDS_Mesh::CheckMemory(const bool doNotRaise) throw (std::bad_alloc) /////////////////////////////////////////////////////////////////////////////// /// Create a new mesh object /////////////////////////////////////////////////////////////////////////////// -SMDS_Mesh::SMDS_Mesh() - :myParent(NULL), - myNodeIDFactory(new SMDS_MeshNodeIDFactory()), - myElementIDFactory(new SMDS_MeshElementIDFactory()), - myHasConstructionEdges(false), myHasConstructionFaces(false), - myHasInverseElements(true), - myNodeMin(0), myNodeMax(0), - myNodePool(0), myEdgePool(0), myFacePool(0), myVolumePool(0),myBallPool(0), - myModified(false), myModifTime(0), myCompactTime(0), - xmin(0), xmax(0), ymin(0), ymax(0), zmin(0), zmax(0) +SMDS_Mesh::SMDS_Mesh(): + myNodePool(0), myVolumePool(0), myFacePool(0), myEdgePool(0), myBallPool(0), + myParent(NULL), + myNodeIDFactory(new SMDS_MeshNodeIDFactory()), + myElementIDFactory(new SMDS_MeshElementIDFactory()), + myModified(false), myModifTime(0), myCompactTime(0), + myNodeMin(0), myNodeMax(0), + myHasConstructionEdges(false), myHasConstructionFaces(false), + myHasInverseElements(true), + xmin(0), xmax(0), ymin(0), ymax(0), zmin(0), zmax(0) { myMeshId = _meshList.size(); // --- index of the mesh to push back in the vector myNodeIDFactory->SetMesh(this); @@ -169,16 +169,16 @@ SMDS_Mesh::SMDS_Mesh() /// Note that the tree structure of SMDS_Mesh seems to be unused in this version /// (2003-09-08) of SMESH /////////////////////////////////////////////////////////////////////////////// -SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent) - :myParent(parent), myNodeIDFactory(parent->myNodeIDFactory), - myElementIDFactory(parent->myElementIDFactory), - myHasConstructionEdges(false), myHasConstructionFaces(false), - myHasInverseElements(true), - myNodePool(parent->myNodePool), - myEdgePool(parent->myEdgePool), - myFacePool(parent->myFacePool), - myVolumePool(parent->myVolumePool), - myBallPool(parent->myBallPool) +SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent): + myNodePool(parent->myNodePool), + myVolumePool(parent->myVolumePool), + myFacePool(parent->myFacePool), + myEdgePool(parent->myEdgePool), + myBallPool(parent->myBallPool), + myParent(parent), myNodeIDFactory(parent->myNodeIDFactory), + myElementIDFactory(parent->myElementIDFactory), + myHasConstructionEdges(false), myHasConstructionFaces(false), + myHasInverseElements(true) { } @@ -188,9 +188,9 @@ SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent) SMDS_Mesh *SMDS_Mesh::AddSubMesh() { - SMDS_Mesh *submesh = new SMDS_Mesh(this); - myChildren.insert(myChildren.end(), submesh); - return submesh; + SMDS_Mesh *submesh = new SMDS_Mesh(this); + myChildren.insert(myChildren.end(), submesh); + return submesh; } /////////////////////////////////////////////////////////////////////////////// @@ -223,7 +223,7 @@ SMDS_MeshNode * SMDS_Mesh::AddNodeWithID(double x, double y, double z, int ID) SMDS_MeshNode * node = myNodePool->getNew(); node->init(ID, myMeshId, 0, x, y, z); - if (ID >= myNodes.size()) + if (ID >= (int)myNodes.size()) { myNodes.resize(ID+SMDS_Mesh::chunkSize, 0); // MESSAGE(" ------------------ myNodes resize " << ID << " --> " << ID+SMDS_Mesh::chunkSize); @@ -1649,7 +1649,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceFromVtkIdsWithID(const std::vector& bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element) { //MESSAGE("registerElement " << ID); - if ((ID >=0) && (ID < myCells.size()) && myCells[ID]) // --- already bound + if ((ID >=0) && (ID < (int)myCells.size()) && myCells[ID]) // --- already bound { MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId()); return false; @@ -1664,7 +1664,7 @@ bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element) if (vtkId == -1) vtkId = myElementIDFactory->SetInVtkGrid(element); - if (vtkId >= myCellIdVtkToSmds.size()) // --- resize local vector + if (vtkId >= (int)myCellIdVtkToSmds.size()) // --- resize local vector { // MESSAGE(" --------------------- resize myCellIdVtkToSmds " << vtkId << " --> " << vtkId + SMDS_Mesh::chunkSize); myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1); @@ -1691,7 +1691,7 @@ void SMDS_Mesh::MoveNode(const SMDS_MeshNode *n, double x, double y, double z) /////////////////////////////////////////////////////////////////////////////// const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const { - if (ID < 1 || ID >= myNodes.size()) + if (ID < 1 || ID >= (int)myNodes.size()) { // MESSAGE("------------------------------------------------------------------------- "); // MESSAGE("----------------------------------- bad ID " << ID << " " << myNodes.size()); @@ -1707,7 +1707,7 @@ const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const { // TODO if needed use mesh->nodeIdFromVtkToSmds - if (vtkId < 0 || vtkId >= (myNodes.size() -1)) + if ( vtkId < 0 || vtkId+1 >= (int) myNodes.size() ) { MESSAGE("------------------------------------------------------------------------- "); MESSAGE("---------------------------- bad VTK ID " << vtkId << " " << myNodes.size()); @@ -2426,7 +2426,7 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1, const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const { - if ((IDelem <= 0) || IDelem >= myCells.size()) + if ( IDelem <= 0 || IDelem >= (int)myCells.size() ) { MESSAGE("--------------------------------------------------------------------------------- "); MESSAGE("----------------------------------- bad IDelem " << IDelem << " " << myCells.size()); @@ -2482,7 +2482,7 @@ const SMDS_MeshElement* SMDS_Mesh::FindElement (const vectornext(); int nbNodesToCheck = noMedium ? e->NbCornerNodes() : e->NbNodes(); - if ( nbNodesToCheck == nodes.size() ) + if ( nbNodesToCheck == (int)nodes.size() ) { for ( size_t i = 1; e && i < nodes.size(); ++i ) { @@ -3110,28 +3110,27 @@ static set * getFinitElements(const SMDS_MeshElement * /////////////////////////////////////////////////////////////////////////////// /// Return the list of nodes used only by the given elements /////////////////////////////////////////////////////////////////////////////// -static set * getExclusiveNodes( - set& elements) +static set * getExclusiveNodes(set& elements) { - set * toReturn=new set(); - set::iterator itElements=elements.begin(); + set * toReturn=new set(); + set::iterator itElements=elements.begin(); - while(itElements!=elements.end()) - { - SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator(); - itElements++; + while(itElements!=elements.end()) + { + SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator(); + itElements++; - while(itNodes->more()) - { - const SMDS_MeshNode * n=static_cast(itNodes->next()); - SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator(); - set s; - while(itFe->more()) - s.insert(itFe->next()); - if(s==elements) toReturn->insert(n); - } - } - return toReturn; + while(itNodes->more()) + { + const SMDS_MeshNode * n=static_cast(itNodes->next()); + SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator(); + set s; + while(itFe->more()) + s.insert(itFe->next()); + if(s==elements) toReturn->insert(n); + } + } + return toReturn; } /////////////////////////////////////////////////////////////////////////////// @@ -3145,62 +3144,63 @@ void SMDS_Mesh::addChildrenWithNodes(set& setOfChildren set& nodes) { switch(element->GetType()) + { + case SMDSAbs_Node: + MESSAGE("Internal Error: This should not happen"); + break; + case SMDSAbs_0DElement: + { + } + break; + case SMDSAbs_Edge: + { + SMDS_ElemIteratorPtr itn=element->nodesIterator(); + while(itn->more()) { - case SMDSAbs_Node: - MESSAGE("Internal Error: This should not happen"); - break; - case SMDSAbs_0DElement: + const SMDS_MeshElement * e=itn->next(); + if(nodes.find(e)!=nodes.end()) { + setOfChildren.insert(element); + break; } - break; - case SMDSAbs_Edge: - { - SMDS_ElemIteratorPtr itn=element->nodesIterator(); - while(itn->more()) - { - const SMDS_MeshElement * e=itn->next(); - if(nodes.find(e)!=nodes.end()) - { - setOfChildren.insert(element); - break; - } - } - } break; - case SMDSAbs_Face: - { - SMDS_ElemIteratorPtr itn=element->nodesIterator(); - while(itn->more()) - { - const SMDS_MeshElement * e=itn->next(); - if(nodes.find(e)!=nodes.end()) - { - setOfChildren.insert(element); - break; - } - } - if(hasConstructionEdges()) - { - SMDS_ElemIteratorPtr ite=element->edgesIterator(); - while(ite->more()) - addChildrenWithNodes(setOfChildren, ite->next(), nodes); - } - } break; - case SMDSAbs_Volume: - { - if(hasConstructionFaces()) - { - SMDS_ElemIteratorPtr ite=element->facesIterator(); - while(ite->more()) - addChildrenWithNodes(setOfChildren, ite->next(), nodes); - } - else if(hasConstructionEdges()) - { - SMDS_ElemIteratorPtr ite=element->edgesIterator(); - while(ite->more()) - addChildrenWithNodes(setOfChildren, ite->next(), nodes); - } - } } + } break; + case SMDSAbs_Face: + { + SMDS_ElemIteratorPtr itn=element->nodesIterator(); + while(itn->more()) + { + const SMDS_MeshElement * e=itn->next(); + if(nodes.find(e)!=nodes.end()) + { + setOfChildren.insert(element); + break; + } + } + if(hasConstructionEdges()) + { + SMDS_ElemIteratorPtr ite=element->edgesIterator(); + while(ite->more()) + addChildrenWithNodes(setOfChildren, ite->next(), nodes); + } + } break; + case SMDSAbs_Volume: + { + if(hasConstructionFaces()) + { + SMDS_ElemIteratorPtr ite=element->facesIterator(); + while(ite->more()) + addChildrenWithNodes(setOfChildren, ite->next(), nodes); + } + else if(hasConstructionEdges()) + { + SMDS_ElemIteratorPtr ite=element->edgesIterator(); + while(ite->more()) + addChildrenWithNodes(setOfChildren, ite->next(), nodes); + } + } + case SMDSAbs_All: break; + } } /////////////////////////////////////////////////////////////////////////////// @@ -3347,6 +3347,9 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, else delete (*it); break; + + case SMDSAbs_All: + case SMDSAbs_NbElementTypes: break; } if (vtkid >= 0) { @@ -4685,7 +4688,7 @@ void SMDS_Mesh::updateNodeMinMax() myNodeMax=0; return; } - while (!myNodes[myNodeMin] && (myNodeMin=0)) @@ -4775,7 +4778,7 @@ void SMDS_Mesh::compactMesh() int SMDS_Mesh::fromVtkToSmds(int vtkid) { - if (vtkid >= 0 && vtkid < myCellIdVtkToSmds.size()) + if (vtkid >= 0 && vtkid < (int)myCellIdVtkToSmds.size()) return myCellIdVtkToSmds[vtkid]; throw SALOME_Exception(LOCALIZED ("vtk id out of bounds")); } diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 7c728d6f9..b561d7571 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -789,7 +789,7 @@ protected: { assert(ID >= 0); myElementIDFactory->adjustMaxId(ID); - if (ID >= myCells.size()) + if (ID >= (int)myCells.size()) myCells.resize(ID+SMDS_Mesh::chunkSize,0); } @@ -838,6 +838,8 @@ protected: SMDS_MeshElementIDFactory *myElementIDFactory; SMDS_MeshInfo myInfo; + //! any add, remove or change of node or cell + bool myModified; //! use a counter to keep track of modifications unsigned long myModifTime, myCompactTime; @@ -848,9 +850,6 @@ protected: bool myHasConstructionFaces; bool myHasInverseElements; - //! any add, remove or change of node or cell - bool myModified; - double xmin; double xmax; double ymin; diff --git a/src/SMDS/SMDS_MeshElementIDFactory.cxx b/src/SMDS/SMDS_MeshElementIDFactory.cxx index f8eb2ddef..5bf7398ca 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.cxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.cxx @@ -95,7 +95,7 @@ bool SMDS_MeshElementIDFactory::BindID(int ID, SMDS_MeshElement * elem) //======================================================================= SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID) { - if ((ID<1) || (ID>=myMesh->myCells.size())) + if ( ID<1 || ID >= (int) myMesh->myCells.size() ) return NULL; const SMDS_MeshElement* elem = GetMesh()->FindElement(ID); return (SMDS_MeshElement*)(elem); @@ -129,7 +129,7 @@ void SMDS_MeshElementIDFactory::ReleaseID(int ID, int vtkId) //MESSAGE("~~~~~~~~~~~~~~ SMDS_MeshElementIDFactory::ReleaseID smdsId vtkId " << ID << " " << vtkId); if (vtkId >= 0) { - assert(vtkId < myMesh->myCellIdVtkToSmds.size()); + assert(vtkId < (int)myMesh->myCellIdVtkToSmds.size()); myMesh->myCellIdVtkToSmds[vtkId] = -1; myMesh->setMyModified(); } @@ -149,7 +149,7 @@ void SMDS_MeshElementIDFactory::updateMinMax() const { myMin = INT_MAX; myMax = 0; - for (int i = 0; i < myMesh->myCells.size(); i++) + for (size_t i = 0; i < myMesh->myCells.size(); i++) { if (myMesh->myCells[i]) { diff --git a/src/SMDS/SMDS_MeshInfo.hxx b/src/SMDS/SMDS_MeshInfo.hxx index 5c22d7f9b..4c6dba726 100644 --- a/src/SMDS/SMDS_MeshInfo.hxx +++ b/src/SMDS/SMDS_MeshInfo.hxx @@ -192,7 +192,7 @@ inline SMDS_MeshInfo::SMDS_MeshInfo(): inline SMDS_MeshInfo& // operator= SMDS_MeshInfo::operator=(const SMDS_MeshInfo& other) -{ for ( int i=0; i myElems; - int myIndex; + size_t myIndex; public: _MyEdgeIterator(const SMDS_MeshFace* face):myIndex(0) { myElems.reserve( face->NbNodes() ); diff --git a/src/SMDS/SMDS_QuadraticFaceOfNodes.cxx b/src/SMDS/SMDS_QuadraticFaceOfNodes.cxx index f427dac96..a308239eb 100644 --- a/src/SMDS/SMDS_QuadraticFaceOfNodes.cxx +++ b/src/SMDS/SMDS_QuadraticFaceOfNodes.cxx @@ -168,14 +168,14 @@ namespace { //======================================================================= //class : _MyInterlacedNodeIterator - //purpose : + //purpose : //======================================================================= class _MyInterlacedNodeIterator:public SMDS_NodeIterator { const vector& mySet; - int myIndex; - const int * myInterlace; + size_t myIndex; + const int * myInterlace; public: _MyInterlacedNodeIterator(const vector& s, const int * interlace): @@ -228,7 +228,7 @@ SMDS_NodeIteratorPtr SMDS_QuadraticFaceOfNodes::interlacedNodesIterator() const class _MyEdgeIterator : public SMDS_ElemIterator { vector< const SMDS_MeshElement* > myElems; - int myIndex; + size_t myIndex; public: _MyEdgeIterator(const SMDS_QuadraticFaceOfNodes* face):myIndex(0) { myElems.reserve( face->NbNodes() ); diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 5fe82a432..52916ec72 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -354,12 +354,12 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes, int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId) { - if((vtkCellId < 0) || (vtkCellId >= _cellIdToDownId.size())) - { - //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId=" - // << vtkCellId << " max="<< _cellIdToDownId.size()); - return -1; - } + if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size())) + { + //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId=" + // << vtkCellId << " max="<< _cellIdToDownId.size()); + return -1; + } return _cellIdToDownId[vtkCellId]; } @@ -371,12 +371,12 @@ void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId) void SMDS_UnstructuredGrid::CleanDownwardConnectivity() { - for (int i = 0; i < _downArray.size(); i++) - { - if (_downArray[i]) - delete _downArray[i]; - _downArray[i] = 0; - } + for (size_t i = 0; i < _downArray.size(); i++) + { + if (_downArray[i]) + delete _downArray[i]; + _downArray[i] = 0; + } _cellIdToDownId.clear(); } diff --git a/src/SMDS/SMDS_VolumeOfNodes.cxx b/src/SMDS/SMDS_VolumeOfNodes.cxx index 80d41a263..612e6e7f4 100644 --- a/src/SMDS/SMDS_VolumeOfNodes.cxx +++ b/src/SMDS/SMDS_VolumeOfNodes.cxx @@ -191,7 +191,7 @@ class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator class _MySubIterator : public SMDS_ElemIterator { vector< const SMDS_MeshElement* > myElems; - int myIndex; + size_t myIndex; public: _MySubIterator(const SMDS_VolumeOfNodes* vol, SMDSAbs_ElementType type):myIndex(0) { SMDS_VolumeTool vTool(vol); diff --git a/src/SMDS/SMDS_VtkVolume.cxx b/src/SMDS/SMDS_VtkVolume.cxx index 015edf75f..d6da43579 100644 --- a/src/SMDS/SMDS_VtkVolume.cxx +++ b/src/SMDS/SMDS_VtkVolume.cxx @@ -165,7 +165,7 @@ bool SMDS_VtkVolume::vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes) const std::vector& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( aVtkType )); if ( !interlace.empty() ) { - ASSERT( interlace.size() == nbNodes ); + ASSERT( (int)interlace.size() == nbNodes ); std::vector initNodes( nodes, nodes+nbNodes ); for ( size_t i = 0; i < interlace.size(); ++i ) nodes[i] = initNodes[ interlace[i] ]; diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index b7992de2f..56d41720d 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -449,7 +449,7 @@ bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh* theM if ( n2 && ++nbNodes ) theNodes.insert( make_pair( l, n2 )); - return theNodes.size() == nbNodes; + return (int)theNodes.size() == nbNodes; } //================================================================================ @@ -469,7 +469,7 @@ SMESH_Algo::GetCompatibleHypoFilter(const bool ignoreAuxiliary) const { SMESH_HypoFilter* filter = new SMESH_HypoFilter(); filter->Init( filter->HasName( _compatibleHypothesis[0] )); - for ( int i = 1; i < _compatibleHypothesis.size(); ++i ) + for ( size_t i = 1; i < _compatibleHypothesis.size(); ++i ) filter->Or( filter->HasName( _compatibleHypothesis[ i ] )); SMESH_HypoFilter* filterNoAux = new SMESH_HypoFilter( filter ); diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx index eb09db52b..94a28a279 100644 --- a/src/SMESH/SMESH_Gen.hxx +++ b/src/SMESH/SMESH_Gen.hxx @@ -125,7 +125,7 @@ public: int _algoDim; bool _isGlobalAlgo; - TAlgoStateError(): _algoDim(0),_algo(0),_name(SMESH_Hypothesis::HYP_OK) {} + TAlgoStateError(): _name(SMESH_Hypothesis::HYP_OK), _algo(0), _algoDim(0) {} void Set(TAlgoStateErrorName name, const SMESH_Algo* algo, bool isGlobal) { _name = name; _algo = algo; _algoDim = algo->GetDim(); _isGlobalAlgo = isGlobal; } void Set(TAlgoStateErrorName name, const int algoDim, bool isGlobal) diff --git a/src/SMESH/SMESH_HypoFilter.cxx b/src/SMESH/SMESH_HypoFilter.cxx index fcebe63d3..a5fd2f457 100644 --- a/src/SMESH/SMESH_HypoFilter.cxx +++ b/src/SMESH/SMESH_HypoFilter.cxx @@ -131,19 +131,22 @@ void SMESH_HypoFilter::IsMoreLocalThanPredicate::findPreferable() { const int shapeID = _mesh.GetMeshDS()->ShapeToIndex( _shape ); const TListOfListOfInt& listOfShapeIDList = _mesh.GetMeshOrder(); - TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin(); + TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin(); for ( ; listsIt != listOfShapeIDList.end(); ++listsIt ) { - const TListOfInt& idList = *listsIt; + const TListOfInt& idList = *listsIt; TListOfInt::const_iterator idIt = std::find( idList.begin(), idList.end(), shapeID ); if ( idIt != idList.end() && *idIt != idList.front() ) { - for ( ; idIt != idList.end(); --idIt ) + for ( --idIt; true; --idIt ) { const TopoDS_Shape& shape = _mesh.GetMeshDS()->IndexToShape( *idIt ); if ( !shape.IsNull()) _preferableShapes.Add( shape ); + + if ( idIt == idList.begin() ) + break; } } } diff --git a/src/SMESH/SMESH_Hypothesis.cxx b/src/SMESH/SMESH_Hypothesis.cxx index 0c08a7cee..3a21a0a31 100644 --- a/src/SMESH/SMESH_Hypothesis.cxx +++ b/src/SMESH/SMESH_Hypothesis.cxx @@ -78,6 +78,7 @@ int SMESH_Hypothesis::GetDim() const case ALGO_1D: dim = 1; break; case ALGO_2D: dim = 2; break; case ALGO_3D: dim = 3; break; + case ALGO_0D: dim = 0; break; case PARAM_ALGO: dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break; } @@ -159,7 +160,7 @@ void SMESH_Hypothesis::SetLibName(const char* theLibName) SMESH_Mesh* SMESH_Hypothesis::GetMeshByPersistentID(int id) { StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId); - map::iterator itm = itm = myStudyContext->mapMesh.begin(); + map::iterator itm = myStudyContext->mapMesh.begin(); for ( ; itm != myStudyContext->mapMesh.end(); itm++) { SMESH_Mesh* mesh = (*itm).second; diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 9e613c121..ca3674ef8 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -2010,7 +2010,7 @@ SMESH_Group* SMESH_Mesh::AddGroup (SMESHDS_GroupBase* groupDS) throw(SALOME_Exce bool SMESH_Mesh::SynchronizeGroups() { - int nbGroups = _mapGroup.size(); + size_t nbGroups = _mapGroup.size(); const set& groups = _myMeshDS->GetGroups(); set::const_iterator gIt = groups.begin(); for ( ; gIt != groups.end(); ++gIt ) diff --git a/src/SMESH/SMESH_ProxyMesh.cxx b/src/SMESH/SMESH_ProxyMesh.cxx index 9e4ebe913..962ba92a5 100644 --- a/src/SMESH/SMESH_ProxyMesh.cxx +++ b/src/SMESH/SMESH_ProxyMesh.cxx @@ -130,7 +130,7 @@ const SMESHDS_SubMesh* SMESH_ProxyMesh::GetSubMesh(const TopoDS_Shape& shape) co { const SMESHDS_SubMesh* sm = 0; - int i = shapeIndex(shape); + size_t i = shapeIndex(shape); if ( i < _subMeshes.size() ) sm = _subMeshes[i]; if ( !sm ) @@ -148,7 +148,7 @@ const SMESHDS_SubMesh* SMESH_ProxyMesh::GetSubMesh(const TopoDS_Shape& shape) co const SMESH_ProxyMesh::SubMesh* SMESH_ProxyMesh::GetProxySubMesh(const TopoDS_Shape& shape) const { - int i = shapeIndex(shape); + size_t i = shapeIndex(shape); return i < _subMeshes.size() ? _subMeshes[i] : 0; } diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index be6345c93..5bb65b5b3 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1093,8 +1093,6 @@ bool SMESH_subMesh::IsConform(const SMESH_Algo* theAlgo) !theAlgo->OnlyUnaryInput() ) // all adjacent shapes will be meshed by this algo? return true; - SMESH_Gen* gen =_father->GetGen(); - // only local algo is to be checked //if ( gen->IsGlobalHypothesis( theAlgo, *_father )) if ( _subShape.ShapeType() == _father->GetMeshDS()->ShapeToMesh().ShapeType() ) @@ -2465,7 +2463,7 @@ namespace { { _Iterator(SMDS_Iterator* subIt, SMESH_subMesh* prepend, - SMESH_subMesh* append): myIt(subIt),myAppend(append) + SMESH_subMesh* append): myAppend(append), myIt(subIt) { myCur = prepend ? prepend : myIt->more() ? myIt->next() : append; if ( myCur == append ) append = 0; @@ -2570,7 +2568,7 @@ void SMESH_subMesh::ClearAncestors() bool SMESH_subMesh::FindIntersection(const SMESH_subMesh* theOther, std::set& theSetOfCommon ) const { - int oldNb = theSetOfCommon.size(); + size_t oldNb = theSetOfCommon.size(); // check main submeshes const map ::const_iterator otherEnd = theOther->_mapDepend.end(); diff --git a/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx b/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx index eebb42470..289bde732 100644 --- a/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx +++ b/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx @@ -54,7 +54,7 @@ public: } else { - if ( myVec.size() <= id ) + if ( (int)myVec.size() <= id ) myVec.resize( id+1, (SUBMESH*) NULL ); myVec[ id ] = sm; } @@ -68,7 +68,7 @@ public: } else { - return (SUBMESH*) ( id >= myVec.size() ? NULL : myVec[ id ]); + return (SUBMESH*) ( id >= (int)myVec.size() ? NULL : myVec[ id ]); } } void DeleteAll() diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx index 96fca0d9f..8578dbf34 100644 --- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx @@ -497,6 +497,9 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::onSelTypeChange(int selType) disconnect( myDlg, SIGNAL( objectChanged( int, const QStringList& )), this, SLOT ( onTextChanged( int, const QStringList& ))); + connect( myDlg->myGroupListCmBox, SIGNAL( editTextChanged(const QString & )), + this, SLOT( updateButtons() )); + selectionDone(); } diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index 5da5ff109..9f85f5c27 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -109,8 +109,8 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myFilterDlg(0), mySelectedObject(SMESH::SMESH_IDSource::_nil()), + myFilterDlg(0), myIsApplyAndClose( false ) { QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH"))); diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index 5af9a3789..dd1f1e684 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -73,8 +73,8 @@ //================================================================================= SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule): QDialog(SMESH::GetDesktop(theModule)), - mySelectionMgr(SMESH::GetSelectionMgr(theModule)), - mySMESHGUI(theModule) + mySMESHGUI(theModule), + mySelectionMgr(SMESH::GetSelectionMgr(theModule)) { setModal(false); setWindowTitle(tr("CAPTION")); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 5a62c1de6..38b36d060 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -397,7 +397,7 @@ void SMESHGUI_3TypesSelector::addTmpIdSource( SMESH::long_array_var& ids, int iT SMESH::SMESH_IDSource_var idSrc = aMeshEditor->MakeIDSource( ids, SMESH::ElementType( iType+1 )); - if ( myIDSource[ iType ]->length() <= index ) + if ( (int) myIDSource[ iType ]->length() <= index ) myIDSource[ iType ]->length( index + 1 ); myIDSource[ iType ][ index ] = idSrc; diff --git a/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx b/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx index ff6cd8707..9b72ae2f4 100644 --- a/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx +++ b/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx @@ -170,7 +170,7 @@ bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds() { int nbSelected = 0; if ( myTree->isEnabled() ) - for ( size_t i = 0; i < myTree->topLevelItemCount(); ++i ) + for ( int i = 0; i < myTree->topLevelItemCount(); ++i ) { QTreeWidgetItem* meshItem = myTree->topLevelItem( i ); int iM = meshItem->data( 0, Qt::UserRole ).toInt(); @@ -202,7 +202,7 @@ bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds() } else { - for ( size_t iF = 0; iF < myFields->count(); ++iF ) + for ( int iF = 0; iF < myFields->count(); ++iF ) { GEOM::ListOfFields& fields = (*myFields)[ iF ].first.inout(); fields.length( 0 ); diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx index fc4304500..5b3f1ef27 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx @@ -101,7 +101,7 @@ void SMESHGUI_FindElemByPointDlg::setTypes(SMESH::array_of_ElementType_var & typ myElemTypeCombo->blockSignals(true); myElemTypeCombo->clear(); int nbTypes = 0, hasNodes = 0; - for ( int i = 0; i < types->length(); ++i ) + for ( int i = 0; i < (int) types->length(); ++i ) { switch ( types[i] ) { case SMESH::NODE: @@ -449,7 +449,7 @@ void SMESHGUI_FindElemByPointOp::onFind() myDlg->myZ->GetValue(), SMESH::ElementType( myDlg->myElemTypeCombo->currentId())); myDlg->myFoundList->clear(); - for ( int i = 0; i < foundIds->length(); ++i ) + for ( int i = 0; i < (int) foundIds->length(); ++i ) myDlg->myFoundList->addItem( QString::number( foundIds[i] )); if ( foundIds->length() > 0 ) diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index ad2e6f3f3..62fbba011 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -629,7 +629,7 @@ namespace SMESH { SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) ); SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo ); - for( int i = 0; i < meshList.size(); i++ ) + for( size_t i = 0; i < meshList.size(); i++ ) RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo ); } } @@ -729,7 +729,7 @@ namespace SMESH QString GetMessageOnAlgoStateErrors(const algo_error_array& errors) { QString resMsg; // PAL14861 = QObject::tr("SMESH_WRN_MISSING_PARAMETERS") + ":\n"; - for ( int i = 0; i < errors.length(); ++i ) { + for ( size_t i = 0; i < errors.length(); ++i ) { const SMESH::AlgoStateError & error = errors[ i ]; const bool hasAlgo = ( strlen( error.algoName ) != 0 ); QString msg; diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index f594f650d..46e68d346 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -797,11 +797,11 @@ void SMESHGUI_MergeDlg::onDetect() break; } - for (int i = 0; i < aGroupsArray->length(); i++) { + for (int i = 0; i < (int)aGroupsArray->length(); i++) { SMESH::long_array& aGroup = aGroupsArray[i]; QStringList anIDs; - for (int j = 0; j < aGroup.length(); j++) + for (int j = 0; j < (int)aGroup.length(); j++) anIDs.append(QString::number(aGroup[j])); ListCoincident->addItem(anIDs.join(" ")); diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx index 38314468f..50fe4e592 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx @@ -173,7 +173,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewD vtkPoints* aPoints = vtkPoints::New(); aPoints->SetNumberOfPoints(aNodesXYZ.length()); - for ( int i = 0; i < aNodesXYZ.length(); i++ ) { + for ( size_t i = 0; i < aNodesXYZ.length(); i++ ) { aPoints->SetPoint( i, aNodesXYZ[i].x, aNodesXYZ[i].y, aNodesXYZ[i].z ); } myGrid->SetPoints(aPoints); @@ -197,7 +197,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewD vtkIdList *anIdList = vtkIdList::New(); int aNodePos = 0; - for ( int i = 0; i < anElemTypes.length(); i++ ) { + for ( size_t i = 0; i < anElemTypes.length(); i++ ) { const SMESH::ElementSubType& anElementSubType = anElemTypes[i]; SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType); vtkIdType aNbNodes = anElementSubType.nbNodesInElement; @@ -299,7 +299,7 @@ void SMESHGUI_MeshEditPreview::SetArrowShapeAndNb( int nbArrows, myLabelActors.resize( nbArrows, ( vtkTextActor*) NULL ); char label[] = "X"; if ( labels ) - for ( int iP = 0, iA = 0; iA < nbArrows; ++iA ) + for ( int iA = 0; iA < nbArrows; ++iA ) { label[0] = labels[iA]; vtkTextMapper* text = vtkTextMapper::New(); @@ -333,7 +333,7 @@ void SMESHGUI_MeshEditPreview::SetArrows( const gp_Ax1* axes, { vtkPoints* aPoints = myGrid->GetPoints(); - for ( int iP = 0, iA = 0; iA < myLabelActors.size(); ++iA ) + for ( int iP = 0, iA = 0; iA < (int) myLabelActors.size(); ++iA ) { gp_Trsf trsf; trsf.SetTransformation( gp_Ax3( axes[iA].Location(), axes[iA].Direction() ), gp::XOY() ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index f123ea17e..d598d95e9 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -112,8 +112,8 @@ SMESHGUI_MultiEditDlg const bool the3d2d, bool theDoInit): SMESHGUI_PreviewDlg(theModule), - mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), + mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySMESHGUI(theModule) { setModal(false); @@ -1572,7 +1572,6 @@ SMESHGUI_SplitVolumesDlg::SMESHGUI_SplitVolumesDlg(SMESHGUI* theModule) QLabel* dXLbl = new QLabel( tr("SMESH_DX"), myFacetSelGrp); QLabel* dYLbl = new QLabel( tr("SMESH_DY"), myFacetSelGrp); QLabel* dZLbl = new QLabel( tr("SMESH_DZ"), myFacetSelGrp); - QPushButton* axisBtn[3]; for ( int i = 0; i < 3; ++i ) { myPointSpin[i] = new SMESHGUI_SpinBox( myFacetSelGrp ); @@ -1983,7 +1982,7 @@ void SMESHGUI_SplitVolumesDlg::onSetDir() if ( sender() == myAxisBtn[i] ) break; if ( i == 3 ) - i == 0; + i = 0; myDirSpin[i]->SetValue(1.); if ( myActor && !myMesh->_is_nil() && myMesh->NbNodes() > 0 ) diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index e163699d4..5a2cf87b8 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -230,8 +230,8 @@ namespace SMESH //================================================================================= SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): QDialog( SMESH::GetDesktop( theModule ) ), - mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), + mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ), mySMESHGUI( theModule ) { setModal( false ); diff --git a/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx b/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx index d466dedf3..8dc5f52c9 100644 --- a/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_PreviewDlg.cxx @@ -45,8 +45,8 @@ // purpose : //================================================================================= SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) : - mySMESHGUI(theModule), QDialog(SMESH::GetDesktop( theModule )), + mySMESHGUI(theModule), myIsApplyAndClose( false ) { mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI )); @@ -151,8 +151,8 @@ void SMESHGUI_PreviewDlg::onOpenView() // purpose : //================================================================================= SMESHGUI_MultiPreviewDlg::SMESHGUI_MultiPreviewDlg( SMESHGUI* theModule ) : - mySMESHGUI( theModule ), QDialog( SMESH::GetDesktop( theModule ) ), + mySMESHGUI( theModule ), myIsApplyAndClose( false ) { mySimulationList.clear(); diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 1decdeff6..a8cdcb1ea 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -80,8 +80,8 @@ SMESHGUI_RemoveElementsDlg ::SMESHGUI_RemoveElementsDlg(SMESHGUI* theModule) : QDialog(SMESH::GetDesktop(theModule)), - mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), + mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySMESHGUI(theModule), myBusy(false), myFilterDlg(0) diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index 5baaf4dc2..8b9ab2e55 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -81,8 +81,8 @@ SMESHGUI_RemoveNodesDlg ::SMESHGUI_RemoveNodesDlg(SMESHGUI* theModule) : QDialog(SMESH::GetDesktop(theModule)), - mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), + mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySMESHGUI(theModule), myBusy(false), myFilterDlg(0) diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index a91586798..82a7a0451 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -612,9 +612,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() if ( !aMesh ) return; - int aNbUnits = 0; - - bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X || + bool isNodeSelected = ((myEditCurrentArgument == (QWidget*)SpinBox_X ) || (myEditCurrentArgument == (QWidget*)SpinBox_DX && myVectorDefinition==POINT_SELECT)); diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 3661fa853..fa6f4c386 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -474,7 +474,7 @@ int SMESHGUI_Selection::dim( int ind ) const if ( !CORBA::is_nil( idSrc ) ) { SMESH::array_of_ElementType_var types = idSrc->GetTypes(); - for ( int i = 0; i < types->length(); ++ i) { + for ( size_t i = 0; i < types->length(); ++ i) { switch ( types[i] ) { case SMESH::EDGE : dim = std::max( dim, 1 ); break; case SMESH::FACE : dim = std::max( dim, 2 ); break; diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index 2ed7c0271..e40b5b4d1 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -93,8 +93,8 @@ private: SMESHGUI_SingleEditDlg ::SMESHGUI_SingleEditDlg(SMESHGUI* theModule) : QDialog(SMESH::GetDesktop(theModule)), - mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), + mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySMESHGUI(theModule) { setModal(false); diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index d752a128a..30c98a6aa 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -111,8 +111,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myFilterDlg(0), - mySelectedObject(SMESH::SMESH_IDSource::_nil()) + mySelectedObject(SMESH::SMESH_IDSource::_nil()), + myFilterDlg(0) { QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING"))); QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 7cc3006b8..1b484b5b3 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -815,46 +815,8 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument() if ( myObjects.isEmpty() ) return; // get IDs from mesh - /* - SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh(); - if (!aSMDSMesh) - return; - - for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) { - const SMDS_MeshElement * e = aSMDSMesh->FindElement(i); - if (e) { - myElementsId += QString(" %1").arg(i); - aNbUnits++; - } - } - } else if (!SMESH::IObjectToInterface(IO)->_is_nil()) { //SUBMESH - // get submesh - SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(IO); - - // get IDs from submesh - /* - SMESH::long_array_var anElementsIds = new SMESH::long_array; - anElementsIds = aSubMesh->GetElementsId(); - for (int i = 0; i < anElementsIds->length(); i++) { - myElementsId += QString(" %1").arg(anElementsIds[i]); - } - aNbUnits = anElementsIds->length(); - } else { // GROUP - // get smesh group - SMESH::SMESH_GroupBase_var aGroup = - SMESH::IObjectToInterface(IO); - if (aGroup->_is_nil()) - return; - - // get IDs from smesh group - SMESH::long_array_var anElementsIds = new SMESH::long_array; - anElementsIds = aGroup->GetListOfID(); - for (int i = 0; i < anElementsIds->length(); i++) { - myElementsId += QString(" %1").arg(anElementsIds[i]); - } - aNbUnits = anElementsIds->length(); - } - */ + // get IDs from submesh + // get IDs from smesh group } else { aNbUnits = SMESH::GetNameOfSelectedElements( mySelector, aList.First(), aString); myElementsId = aString; diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h index 51d763492..6f024242f 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.h +++ b/src/SMESHGUI/SMESHGUI_Utils.h @@ -195,7 +195,7 @@ SMESHGUI_EXPORT class toStrT : public _STRING { CORBA::String_var myStr; public: - toStrT( char* s ): myStr(s), _STRING( s ) + toStrT( char* s ): _STRING( s ), myStr(s) {} operator const char*() const { return myStr.in(); } diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 946c200df..24c054636 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -535,7 +535,7 @@ namespace // internal utils for ( int i = 0; i < 3; ++i ) { const gp_Pnt& pn = myNodes->Value(n[i]); - if ( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 )) + if (( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 ))) break; if ( !projectedOnly ) minD2 = Min( minD2, pn.SquareDistance( p )); @@ -1505,7 +1505,7 @@ bool AdaptiveAlgo::Evaluate(SMESH_Mesh & theMesh, for ( ; edExp.More(); edExp.Next() ) { - const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() ); + //const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() ); StdMeshers_Regular_1D::Evaluate( theMesh, theShape, theResMap ); } return true; diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx index 3bf1f1be5..2642dd1af 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx @@ -155,7 +155,7 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load) isOK = (load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { isOK = (load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } @@ -167,7 +167,7 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load) //============================================================================= /*! - * + * */ //============================================================================= diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 7c9dca548..cc27b86d7 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -62,9 +62,7 @@ #ifdef _DEBUG_ // #define DEB_FACES // #define DEB_GRID -// #define DUMP_VERT(msg,V) \ -// { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); \ -// cout << msg << "( "<< p.X()<<", "< 0) { _params.clear(); _params.reserve( intVal ); - for (int i = 0; i < _params.capacity() && isOK; i++) { + for ( size_t i = 0; i < _params.capacity() && isOK; i++) { isOK = (load >> dblVal); if ( isOK ) _params.push_back( dblVal ); } @@ -164,7 +164,7 @@ istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load) if (isOK && intVal > 0) { _nbsegs.clear(); _nbsegs.reserve( intVal ); - for (int i = 0; i < _nbsegs.capacity() && isOK; i++) { + for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) { isOK = (load >> intVal); if ( isOK ) _nbsegs.push_back( intVal ); } @@ -174,7 +174,7 @@ istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load) if (isOK && intVal > 0) { _edgeIDs.clear(); _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { isOK = (load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 1ad459448..87f1aa8d7 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -444,8 +444,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, { aCubeSide[i]._columns.resize( aCubeSide[i]._u2nodesMap.size() ); - int iFwd = 0, iRev = aCubeSide[i]._columns.size()-1; - int* pi = isReverse[i] ? &iRev : &iFwd; + size_t iFwd = 0, iRev = aCubeSide[i]._columns.size()-1; + size_t* pi = isReverse[i] ? &iRev : &iFwd; TParam2ColumnMap::iterator u2nn = aCubeSide[i]._u2nodesMap.begin(); for ( ; iFwd < aCubeSide[i]._columns.size(); --iRev, ++iFwd, ++u2nn ) aCubeSide[i]._columns[ *pi ].swap( u2nn->second ); diff --git a/src/StdMeshers/StdMeshers_Import_1D.cxx b/src/StdMeshers/StdMeshers_Import_1D.cxx index 083f055f2..f53b60ede 100644 --- a/src/StdMeshers/StdMeshers_Import_1D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D.cxx @@ -685,7 +685,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th // import edges from groups TNodeNodeMap* n2n; TElemElemMap* e2e; - for ( int iG = 0; iG < srcGroups.size(); ++iG ) + for ( size_t iG = 0; iG < srcGroups.size(); ++iG ) { const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS(); @@ -711,7 +711,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th double mytol = a.Distance(edge->GetNode(edge->NbNodes()-1))/25; //mytol = max(1.E-5, 10*edgeTol); // too strict and not necessary //MESSAGE("mytol = " << mytol); - for ( unsigned i = 0; i < newNodes.size(); ++i, ++node ) + for ( size_t i = 0; i < newNodes.size(); ++i, ++node ) { TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first; if ( n2nIt->second ) @@ -810,7 +810,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th // copy meshes vector srcMeshes = _sourceHyp->GetSourceMeshes(); - for ( unsigned i = 0; i < srcMeshes.size(); ++i ) + for ( size_t i = 0; i < srcMeshes.size(); ++i ) importMesh( srcMeshes[i], theMesh, _sourceHyp, theShape ); return true; @@ -873,7 +873,7 @@ void StdMeshers_Import_1D::importMesh(const SMESH_Mesh* srcMesh, (*e2eIt).second = newElem; } // copy free nodes - if ( srcMeshDS->NbNodes() > n2n->size() ) + if ( srcMeshDS->NbNodes() > (int) n2n->size() ) { SMDS_NodeIteratorPtr nIt = srcMeshDS->nodesIterator(); while( nIt->more() ) @@ -1028,7 +1028,7 @@ bool StdMeshers_Import_1D::Evaluate(SMESH_Mesh & theMesh, // count edges imported from groups int nbEdges = 0, nbQuadEdges = 0; - for ( int iG = 0; iG < srcGroups.size(); ++iG ) + for ( size_t iG = 0; iG < srcGroups.size(); ++iG ) { const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS(); SMDS_ElemIteratorPtr srcElems = srcGroup->GetElements(); @@ -1057,7 +1057,7 @@ bool StdMeshers_Import_1D::Evaluate(SMESH_Mesh & theMesh, } SMESH_subMesh * sm = theMesh.GetSubMesh(theShape); - aResMap.insert(make_pair(sm,aVec)); + aResMap.insert( make_pair( sm, aVec )); return true; } diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.cxx b/src/StdMeshers/StdMeshers_Import_1D2D.cxx index 60b776254..df7f8c065 100644 --- a/src/StdMeshers/StdMeshers_Import_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D2D.cxx @@ -824,7 +824,7 @@ bool StdMeshers_Import_1D2D::Evaluate(SMESH_Mesh & theMesh, set allNodes; gp_XY uv; double minGroupTol = 1e100; - for ( int iG = 0; iG < srcGroups.size(); ++iG ) + for ( size_t iG = 0; iG < srcGroups.size(); ++iG ) { const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS(); const double groupTol = 0.5 * sqrt( getMinElemSize2( srcGroup )); diff --git a/src/StdMeshers/StdMeshers_LocalLength.cxx b/src/StdMeshers/StdMeshers_LocalLength.cxx index c5c824e18..ea14e8126 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.cxx +++ b/src/StdMeshers/StdMeshers_LocalLength.cxx @@ -224,7 +224,7 @@ bool StdMeshers_LocalLength::SetParametersByMesh(const SMESH_Mesh* theMesh, SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params )) { - for ( int i = 1; i < params.size(); ++i ) + for ( size_t i = 1; i < params.size(); ++i ) _length += GCPnts_AbscissaPoint::Length( AdaptCurve, params[ i-1 ], params[ i ]); nbEdges += params.size() - 1; } diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx index 264189170..e7daf5ace 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx @@ -587,7 +587,7 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(TWireVector & wires, F = TopoDS::Face( _helper->GetSubShape() ); TopExp::MapShapesAndAncestors( F, TopAbs_VERTEX, TopAbs_WIRE, VWMap ); int nbVertices = 0; - for ( int iW = 0; iW < wires.size(); ++iW ) + for ( size_t iW = 0; iW < wires.size(); ++iW ) nbVertices += wires[ iW ]->NbEdges(); if ( nbVertices == VWMap.Extent() ) VWMap.Clear(); // wires have no common vertices @@ -595,10 +595,10 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(TWireVector & wires, int m = 0; - for ( int iW = 0; iW < wires.size(); ++iW ) + for ( size_t iW = 0; iW < wires.size(); ++iW ) { const vector& uvPtVec = wires[ iW ]->GetUVPtStruct(); - if ( uvPtVec.size() != wires[ iW ]->NbPoints() ) { + if ((int) uvPtVec.size() != wires[ iW ]->NbPoints() ) { return error(COMPERR_BAD_INPUT_MESH,SMESH_Comment("Unexpected nb of points on wire ") << iW << ": " << uvPtVec.size()<<" != "<NbPoints() << ", probably because of invalid node parameters on geom edges"); diff --git a/src/StdMeshers/StdMeshers_MaxLength.cxx b/src/StdMeshers/StdMeshers_MaxLength.cxx index 0e7e9f617..3d5529940 100644 --- a/src/StdMeshers/StdMeshers_MaxLength.cxx +++ b/src/StdMeshers/StdMeshers_MaxLength.cxx @@ -213,7 +213,7 @@ bool StdMeshers_MaxLength::SetParametersByMesh(const SMESH_Mesh* theMesh, SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS(); if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params )) { - for ( int i = 1; i < params.size(); ++i ) + for ( size_t i = 1; i < params.size(); ++i ) _length += GCPnts_AbscissaPoint::Length( AdaptCurve, params[ i-1 ], params[ i ]); nbEdges += params.size() - 1; } diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index 6d99a44de..bb4f491b1 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -674,7 +674,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() int nbFaceNodes = pE0->NbNodes(); if(myCreateQuadratic) nbFaceNodes = nbFaceNodes/2; - if ( aN.size() < nbFaceNodes * 2 ) + if ( (int) aN.size() < nbFaceNodes * 2 ) aN.resize( nbFaceNodes * 2 ); // for ( k=0; kNbNodes(); if(myCreateQuadratic) aNbNodes = aNbNodes/2; - if ( aNodes1.size() < aNbNodes ) + if ( (int) aNodes1.size() < aNbNodes ) aNodes1.resize( aNbNodes ); // k = aNbNodes-1; // reverse a face @@ -1476,7 +1476,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, nVec.resize( vsize, nullNode ); loadedNodes.insert( nVec[ 0 ] = node ); } - if ( theIJNodes.size() != hsize ) { + if ( (int) theIJNodes.size() != hsize ) { MESSAGE( "Wrong node positions on theBaseEdge" ); return false; } diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 6e58555e1..e2330e95e 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -71,8 +71,7 @@ using namespace std; #ifdef _DEBUG_ #define DBGOUT(msg) //cout << msg << endl; #define SHOWYXZ(msg, xyz) \ - // { gp_Pnt p (xyz); \ - // cout << msg << " ("<< p.X() << "; " <X(),n->Y(),n->Z()) -#define SHOWYXZ(msg, xyz) // {\ -// gp_Pnt p (xyz); \ -// cout << msg << " ("<< p.X() << "; " < edgeIdVec; SMESH_Block::GetFaceEdgesIDs( fId, edgeIdVec ); - for ( int i = 0; i < edgeIdVec.size(); ++i ) { + for ( size_t i = 0; i < edgeIdVec.size(); ++i ) { int eID = edgeIdVec[ i ]; shape2ShapeMap.Bind( scrShapes( eID ), tgtShapes( eID )); if ( i < 2 ) { diff --git a/src/StdMeshers/StdMeshers_Propagation.cxx b/src/StdMeshers/StdMeshers_Propagation.cxx index 5a6c9ade0..bf67b7a0a 100644 --- a/src/StdMeshers/StdMeshers_Propagation.cxx +++ b/src/StdMeshers/StdMeshers_Propagation.cxx @@ -304,7 +304,7 @@ namespace { // Get ordered edges and find index of anE in a sequence edges.clear(); BRepTools_WireExplorer aWE (TopoDS::Wire(itA.Value())); - int edgeIndex = 0; + size_t edgeIndex = 0; for (; aWE.More(); aWE.Next()) { TopoDS_Edge edge = aWE.Current(); edge.Orientation( aWE.Orientation() ); @@ -325,8 +325,8 @@ namespace { else { // count nb sides TopoDS_Edge prevEdge = anE; - int nbSide = 0, eIndex = edgeIndex + 1; - for ( int i = 0; i < edges.size(); ++i, ++eIndex ) + size_t nbSide = 0, eIndex = edgeIndex + 1; + for ( size_t i = 0; i < edges.size(); ++i, ++eIndex ) { if ( eIndex == edges.size() ) eIndex = 0; @@ -633,7 +633,11 @@ namespace { } return; } + case MEANINGLESS_LAST: { + break; + } } // switch by SubMeshState - } + + } // ProcessEvent() } // namespace diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index a9b924724..8bf7d6ac2 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -949,7 +949,7 @@ namespace { const SMDS_MeshNode* _node; double _u; - int _edgeInd; // index in theSinuEdges vector + size_t _edgeInd; // index in theSinuEdges vector NodePoint(): _node(0), _u(0), _edgeInd(-1) {} NodePoint(const SMDS_MeshNode* n, double u, size_t iEdge ): _node(n), _u(u), _edgeInd(iEdge) {} @@ -1251,8 +1251,8 @@ namespace const vector& theSinuEdges = theSinuFace._sinuEdges; const vector< Handle(Geom_Curve) >& curves = theSinuFace._sinuCurves; - SMESH_MAT2d::BoundaryPoint bp[2]; - const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0); + //SMESH_MAT2d::BoundaryPoint bp[2]; + //const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0); typedef TMAPar2NPoints::iterator TIterator; @@ -1292,7 +1292,7 @@ namespace { // find an existing node on VERTEX among sameU2NP and get underlying EDGEs const SMDS_MeshNode* existingNode = 0; - set< int > edgeInds; + set< size_t > edgeInds; NodePoint* np; for ( size_t i = 0; i < sameU2NP.size(); ++i ) { @@ -1309,7 +1309,7 @@ namespace if ( u2NPprev->first < 0. ) ++u2NPprev; if ( u2NPnext->first > 1. ) --u2NPnext; - set< int >::iterator edgeID = edgeInds.begin(); + set< size_t >::iterator edgeID = edgeInds.begin(); for ( ; edgeID != edgeInds.end(); ++edgeID ) { // get U range on iEdge within which the equal points will be distributed @@ -1844,12 +1844,12 @@ namespace const double dksi = 0.5, deta = 0.5; const double dksi2 = dksi*dksi, deta2 = deta*deta; double err = 0., g11, g22, g12; - int nbErr = 0; + //int nbErr = 0; FaceQuadStruct& q = *quad; UVPtStruct pNew; - double refArea = area( q.UVPt(0,0), q.UVPt(1,0), q.UVPt(1,1) ); + //double refArea = area( q.UVPt(0,0), q.UVPt(1,0), q.UVPt(1,1) ); for ( int iLoop = 0; iLoop < nbLoops; ++iLoop ) { diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index f7ac411d9..a3bf670cb 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -132,8 +132,7 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis myParams = NULL; myQuadList.clear(); - bool isOk = true; - aStatus = SMESH_Hypothesis::HYP_OK; + aStatus = SMESH_Hypothesis::HYP_OK; const list & hyps = GetUsedHypothesis(aMesh, aShape, false); @@ -4219,7 +4218,7 @@ bool StdMeshers_Quadrangle_2D::check() return isOK; } -/*//================================================================================ +//================================================================================ /*! * \brief Finds vertices at the most sharp face corners * \param [in] theFace - the FACE @@ -4604,7 +4603,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, //================================================================================ FaceQuadStruct::Side::Side(StdMeshers_FaceSidePtr theGrid) - : grid(theGrid), nbNodeOut(0), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1) + : grid(theGrid), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1), nbNodeOut(0) { } diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 73f11aff5..c414e51f4 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -713,7 +713,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, size_t iSeg = theReverse ? segLen.size()-1 : 0; size_t dSeg = theReverse ? -1 : +1; double param = theFirstU; - int nbParams = 0; + size_t nbParams = 0; for ( int i = 0, nb = segLen.size()-1; i < nb; ++i, iSeg += dSeg ) { GCPnts_AbscissaPoint Discret( theC3d, segLen[ iSeg ], param ); @@ -988,9 +988,9 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, case FIXED_POINTS_1D: { const std::vector& aPnts = _fpHyp->GetPoints(); const std::vector& nbsegs = _fpHyp->GetNbSegments(); - int i = 0; TColStd_SequenceOfReal Params; - for(; i0.9999 ) continue; int j=1; bool IsExist = false; @@ -1014,8 +1014,9 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, } double eltSize, segmentSize = 0.; double currAbscissa = 0; - for(i=0; i nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i]; + for ( int i = 0; i < Params.Length(); i++ ) + { + int nbseg = ( i > (int)nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i]; segmentSize = Params.Value(i+1)*theLength - currAbscissa; currAbscissa += segmentSize; GCPnts_AbscissaPoint APnt(theC3d, sign*segmentSize, par1); @@ -1052,7 +1053,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, par1 = par2; } // add for last - int nbseg = ( nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0]; + int nbseg = ( (int)nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0]; segmentSize = theLength - currAbscissa; eltSize = segmentSize/nbseg; GCPnts_UniformAbscissa Discret; diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index c667ce38a..dffe92e9a 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -153,11 +153,11 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load) if (!isOK) load.clear(ios::badbit | load.rdstate()); - + isOK = (load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { isOK = (load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } @@ -169,7 +169,7 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load) //============================================================================= /*! - * + * */ //============================================================================= diff --git a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx index 3c1841e7b..56613b351 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx @@ -817,7 +817,7 @@ bool _ViscousBuilder2D::findEdgesWithLayers() { hasVL = false; for ( hyp = allHyps.begin(); hyp != allHyps.end() && !hasVL; ++hyp ) - if ( viscHyp = dynamic_cast( *hyp )) + if (( viscHyp = dynamic_cast( *hyp ))) hasVL = viscHyp->IsShapeWithLayers( neighbourID ); } if ( !hasVL ) @@ -1438,7 +1438,7 @@ bool _ViscousBuilder2D::inflate() _PolyLine::TEdgeIterator eIt = isR ? L._lEdges.end()-1 : L._lEdges.begin(); if ( eIt->_length2D == 0 ) continue; _Segment seg1( eIt->_uvOut, eIt->_uvIn ); - for ( eIt += deltaIt; nbRemove < L._lEdges.size()-1; eIt += deltaIt ) + for ( eIt += deltaIt; nbRemove < (int)L._lEdges.size()-1; eIt += deltaIt ) { _Segment seg2( eIt->_uvOut, eIt->_uvIn ); if ( !intersection.Compute( seg1, seg2 )) @@ -1446,7 +1446,7 @@ bool _ViscousBuilder2D::inflate() ++nbRemove; } if ( nbRemove > 0 ) { - if ( nbRemove == L._lEdges.size()-1 ) // 1st and last _LayerEdge's intersect + if ( nbRemove == (int)L._lEdges.size()-1 ) // 1st and last _LayerEdge's intersect { --nbRemove; _LayerEdge& L0 = L._lEdges.front(); @@ -2131,7 +2131,7 @@ bool _ViscousBuilder2D::refine() // store a proxyMesh in a sub-mesh // make faces on each _PolyLine vector< double > layersHeight; - double prevLen2D = -1; + //double prevLen2D = -1; for ( size_t iL = 0; iL < _polyLineVec.size(); ++iL ) { _PolyLine& L = _polyLineVec[ iL ]; @@ -2669,7 +2669,7 @@ _SegmentTree::box_type* _SegmentTree::buildRootBox() void _SegmentTree::buildChildrenData() { - for ( int i = 0; i < _segments.size(); ++i ) + for ( size_t i = 0; i < _segments.size(); ++i ) for (int j = 0; j < nbChildren(); j++) if ( !myChildren[j]->getBox()->IsOut( *_segments[i]._seg->_uv[0], *_segments[i]._seg->_uv[1] )) @@ -2680,7 +2680,7 @@ void _SegmentTree::buildChildrenData() for (int j = 0; j < nbChildren(); j++) { _SegmentTree* child = static_cast<_SegmentTree*>( myChildren[j]); - child->myIsLeaf = ( child->_segments.size() <= maxNbSegInLeaf() ); + child->myIsLeaf = ((int) child->_segments.size() <= maxNbSegInLeaf() ); } } @@ -2698,7 +2698,7 @@ void _SegmentTree::GetSegmentsNear( const _Segment& seg, if ( isLeaf() ) { - for ( int i = 0; i < _segments.size(); ++i ) + for ( size_t i = 0; i < _segments.size(); ++i ) if ( !_segments[i].IsOut( seg )) found.push_back( _segments[i]._seg ); } @@ -2724,7 +2724,7 @@ void _SegmentTree::GetSegmentsNear( const gp_Ax2d& ray, if ( isLeaf() ) { - for ( int i = 0; i < _segments.size(); ++i ) + for ( size_t i = 0; i < _segments.size(); ++i ) if ( !_segments[i].IsOut( ray )) found.push_back( _segments[i]._seg ); } diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index fa4eb1dcc..4450986fd 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -300,7 +300,7 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const case TabFunc : { //valStr += tr("SMESH_TAB_FUNC"); bool param = true; - for( int i=0; i < data.myTable.length(); i++, param = !param ) { + for( size_t i=0; i < data.myTable.length(); i++, param = !param ) { if ( param ) valStr += "["; valStr += QString::number( data.myTable[ i ]); diff --git a/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx index c84b40be9..617f5cbfa 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_PropagationHelperWdg.cxx @@ -379,7 +379,7 @@ std::vector< int > * StdMeshersGUI_PropagationHelperWdg::getSelectedChain() std::vector< int > * chain = 0; if ( QListWidgetItem * item = myListWidget->currentItem() ) { - int i = item->data( Qt::UserRole ).toInt(); + size_t i = (size_t) item->data( Qt::UserRole ).toInt(); if ( 0 <= i && i < myChains.size() ) chain = & myChains[i]; } diff --git a/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx index c52f3602a..b1112e786 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx @@ -215,7 +215,7 @@ void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const GEOM::ListOfGO_var shapes; SMESH::nodes_array_var points; h->GetEnforcedNodes( shapes, points ); - for ( int i = 0; i < shapes->length(); ++i ) + for ( size_t i = 0; i < shapes->length(); ++i ) { CORBA::String_var name = shapes[i]->GetName(); CORBA::String_var entry = shapes[i]->GetStudyEntry(); @@ -223,7 +223,7 @@ void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const item->setData( Qt::UserRole, entry.in() ); myShapesList->addItem( item ); } - for ( int i = 0; i < points->length(); ++i ) + for ( size_t i = 0; i < points->length(); ++i ) { QTreeWidgetItem* item = new QTreeWidgetItem ( QStringList() diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx index 66da7722e..b5d7629f7 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx @@ -72,8 +72,8 @@ StdMeshersGUI_SubShapeSelectorWdg ::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent, TopAbs_ShapeEnum aSubShType ): QWidget( parent ), - myPreviewActor( 0 ), - myMaxSize( -1 ) + myMaxSize( -1 ), + myPreviewActor( 0 ) { QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) ); diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx index e5bc43681..96f16c5e4 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx @@ -225,7 +225,7 @@ SMESH::long_array* StdMeshers_Arithmetic1D_i::GetReversedEdges() SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); anArray->length( ids.size() ); - for ( CORBA::Long i = 0; i < ids.size(); i++) + for ( CORBA::ULong i = 0; i < ids.size(); i++) anArray [ i ] = ids [ i ]; return anArray._retn(); diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx index bedb2277e..48530d600 100644 --- a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx @@ -38,8 +38,8 @@ StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i (PortableServer::POA_ptr thePOA, int theStudyId, ::SMESH_Gen* theGenImpl ) -: StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl), - SMESH_Hypothesis_i( thePOA ) +:SMESH_Hypothesis_i( thePOA ), + StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl) { MESSAGE( "StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i" ); myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(), diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx index 6e1f2e974..286396297 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx @@ -38,8 +38,8 @@ StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i (PortableServer::POA_ptr thePOA, int theStudyId, ::SMESH_Gen* theGenImpl) -: StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl), - SMESH_Hypothesis_i( thePOA ) + :SMESH_Hypothesis_i( thePOA ), + StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl) { MESSAGE("StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i"); myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(), diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index c9047fb7a..0033badf7 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -397,8 +397,7 @@ void StdMeshers_NumberOfSegments_i::SetExpressionFunction(const char* expr) SMESH::TPythonDump() << _this() << ".SetExpressionFunction( '" << expr << "' )"; } catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); } } diff --git a/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx b/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx index 9a71ba6ca..13e86c06a 100644 --- a/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx @@ -123,7 +123,7 @@ SMESH::long_array* StdMeshers_Reversible1D_i::GetReversedEdges() SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); anArray->length( ids.size() ); - for ( CORBA::Long i = 0; i < ids.size(); i++) + for ( CORBA::ULong i = 0; i < ids.size(); i++) anArray [ i ] = ids [ i ]; return anArray._retn(); diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx index 7586394d3..b73eab39b 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx @@ -223,7 +223,7 @@ SMESH::long_array* StdMeshers_StartEndLength_i::GetReversedEdges() SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); anArray->length( ids.size() ); - for ( CORBA::Long i = 0; i < ids.size(); i++) + for ( CORBA::ULong i = 0; i < ids.size(); i++) anArray [ i ] = ids [ i ]; return anArray._retn(); From d4c58513204d48121786c215b09b0517da90c08e Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 27 Oct 2015 20:57:08 +0300 Subject: [PATCH 024/147] IPAL52924: Edit Group Standalone: Filters with Source: Mesh, Initial selection does not work + Enable "New Mesh" option in Create Boundary Elements dialog independently of type of selected object (SMESHGUI_Make2DFrom3DOp.cxx) --- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 47 ++++++++-- src/SMESHGUI/SMESHGUI_FilterDlg.h | 8 +- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 108 ++++++++++++----------- src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx | 18 ++-- 4 files changed, 109 insertions(+), 72 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 97f1df847..04732d8f6 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -870,8 +870,8 @@ SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule, QWidget* parent, const int type ) : QWidget( parent ), - myIsLocked( false ), - mySMESHGUI( theModule ) + mySMESHGUI( theModule ), + myIsLocked( false ) { myEntityType = -1; @@ -888,8 +888,8 @@ SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule, QWidget* parent, const QList& types ) : QWidget( parent ), - myIsLocked( false ), - mySMESHGUI( theModule ) + mySMESHGUI( theModule ), + myIsLocked( false ) { myEntityType = -1; Init(types); @@ -1155,7 +1155,7 @@ bool SMESHGUI_FilterTable::IsValid (const bool theMess, const int theEntityType) bool aRes = false; bool isSignalsBlocked = aTable->signalsBlocked(); aTable->blockSignals(true); - double aThreshold = (int)aTable->text(i, 2).toDouble(&aRes); + /*double aThreshold =*/ aTable->text(i, 2).toDouble( &aRes ); aTable->blockSignals(isSignalsBlocked); if (!aRes && aTable->isEditable(i, 2)) @@ -3365,7 +3365,7 @@ bool SMESHGUI_FilterDlg::onApply() if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) { // - bool toFilter = (( SMESH::FindActorByObject( myMesh )) || + bool toFilter = (( getActor() ) || ( myInitSourceWgOnApply && mySourceWg ) || ( mySourceGrp->checkedId() == Dialog && mySourceWg )); if ( toFilter ) { @@ -3416,7 +3416,7 @@ bool SMESHGUI_FilterDlg::createFilter (const int theType) if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) aPrecision = mgr->integerValue( "SMESH", "controls_precision", aPrecision ); - for (CORBA::ULong i = 0; i < n; i++) { + for ( int i = 0; i < n; i++) { SMESH::Filter::Criterion aCriterion = createCriterion(); myTable->GetCriterion(i, aCriterion); aCriterion.Precision = aPrecision; @@ -3622,6 +3622,35 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, theResIds.append(aResIter.Key()); } +//======================================================================= +//function : getActor +//purpose : Returns an actor to show filtered entities +//======================================================================= + +SMESH_Actor* SMESHGUI_FilterDlg::getActor() +{ + SMESH_Actor* meshActor = SMESH::FindActorByObject( myMesh ); + if ( meshActor && meshActor->GetVisibility() ) + return meshActor; + + SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects); + for ( ; anIter.More(); anIter.Next()) + { + Handle(SALOME_InteractiveObject) io = anIter.Key(); + if ( io->hasEntry() ) + { + SMESH_Actor* actor = SMESH::FindActorByEntry( io->getEntry() ); + if ( !actor ) + continue; + if ( actor->GetVisibility() ) + return actor; + if ( !meshActor ) + meshActor = actor; + } + } + return meshActor; +} + //======================================================================= // name : SMESHGUI_FilterDlg::selectInViewer // Purpose : Select given entities in viewer @@ -3644,8 +3673,8 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList& th } // Clear selection - SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh); - if (!anActor || !anActor->hasIO()) + SMESH_Actor* anActor = getActor(); + if ( !anActor || !anActor->hasIO() ) return; Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index 50dabdaa1..2bff4ba6f 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -45,17 +45,18 @@ #include CORBA_SERVER_HEADER(SMESH_Filter) #include CORBA_SERVER_HEADER(SMESH_Mesh) -class QFrame; +class LightApp_SelectionMgr; class QButtonGroup; class QCheckBox; +class QFrame; class QGroupBox; class QPushButton; +class QStackedWidget; class QTableWidget; class QTableWidgetItem; -class QStackedWidget; -class LightApp_SelectionMgr; class SMESHGUI; class SMESHGUI_FilterLibraryDlg; +class SMESH_Actor; class SVTK_Selector; /*! @@ -282,6 +283,7 @@ private: void setIdsToWg( QWidget*, const QList& ); Selection_Mode getSelMode( const int ) const; void updateSelection(); + SMESH_Actor* getActor(); private: // widgets diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 7b1ad6ec9..c2575f14e 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -128,8 +128,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ), myIsBusy( false ), myNameChanged( false ), - myIsApplyAndClose( false ), - myNbChangesOfContents(0) + myNbChangesOfContents(0), + myIsApplyAndClose( false ) { initDialog( true ); if ( !theMesh->_is_nil() ) @@ -612,6 +612,8 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, case SMESH::EDGE: aType = grpEdgeSelection; break; case SMESH::FACE: aType = grpFaceSelection; break; case SMESH::VOLUME: aType = grpVolumeSelection; break; + case SMESH::ALL: + case SMESH::NB_ELEMENT_TYPES: break; } myTypeGroup->button(aType)->setChecked(true); @@ -1075,7 +1077,7 @@ bool SMESHGUI_GroupDlg::onApply() // check and add all selected GEOM objects: they must be // a sub-shapes of the main GEOM and must be of one type TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; - for ( int i =0; i < myGeomObjects->length(); i++) { + for ( int i =0; i < (int)myGeomObjects->length(); i++) { TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType(); if (i == 0) aGroupType = aSubShapeType; @@ -1809,6 +1811,10 @@ void SMESHGUI_GroupDlg::onFilterAccepted() mesh = myGroupOnFilter->GetMesh(); } myFilter->SetMesh( mesh ); + + // highlight ids if selection changed in the Viewer (IPAL52924) + myCurrentLineEdit = 0; + onObjectSelectionChanged(); } updateButtons(); @@ -2139,15 +2145,13 @@ void SMESHGUI_GroupDlg::onRemove() } } else if (myCurrentLineEdit == myGroupLine) { - Standard_Boolean aRes; - //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); SALOME_ListIO aList; mySelectionMgr->selectedObjects( aList ); SALOME_ListIteratorOfListIO anIt (aList); for ( ; anIt.More(); anIt.Next()) { SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface(anIt.Value()); - if (aRes && !aGroup->_is_nil()) { + if (!aGroup->_is_nil()) { // check if mesh is the same if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { SMESH::long_array_var anElements = aGroup->GetListOfID(); @@ -2285,18 +2289,20 @@ void SMESHGUI_GroupDlg::onHelp() { LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); if (app) - app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString( "" ), myHelpFileName); - else { - QString platform; + { + app->onHelpContextModule + ( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : QString(""), myHelpFileName ); + } + else + { #ifdef WIN32 - platform = "winapplication"; + QString platform = "winapplication"; #else - platform = "application"; + QString platform = "application"; #endif SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ), tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg(app->resourceMgr()->stringValue( "ExternalBrowser", - platform)). + arg(app->resourceMgr()->stringValue( "ExternalBrowser", platform)). arg(myHelpFileName)); } } @@ -2343,16 +2349,16 @@ void SMESHGUI_GroupDlg::keyPressEvent( QKeyEvent* e ) return; if ( e->key() == Qt::Key_F1 ) - { - e->accept(); - onHelp(); - } + { + e->accept(); + onHelp(); + } } //================================================================================ /*! * \brief Enable showing of the popup when Geometry selection btn is clicked - * \param enable - true to enable + * \param enable - true to enable */ //================================================================================ @@ -2388,17 +2394,17 @@ void SMESHGUI_GroupDlg::updateGeomPopup() void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn) { if ( myGeomPopup && isBtnOn ) - { - myCurrentLineEdit = myGeomGroupLine; - QAction* a = myGeomPopup->exec( QCursor::pos() ); - if (!a || myActions[a] == DIRECT_GEOM_INDEX) - setSelectionMode(grpGeomSelection); - } + { + myCurrentLineEdit = myGeomGroupLine; + QAction* a = myGeomPopup->exec( QCursor::pos() ); + if (!a || myActions[a] == DIRECT_GEOM_INDEX) + setSelectionMode(grpGeomSelection); + } else if (!isBtnOn) - { - myCurrentLineEdit = 0; - setSelectionMode(grpAllSelection); - } + { + myCurrentLineEdit = 0; + setSelectionMode(grpAllSelection); + } } //================================================================================= @@ -2409,26 +2415,26 @@ void SMESHGUI_GroupDlg::onGeomPopup( QAction* a ) { int index = myActions[a]; if ( index == GEOM_BY_MESH_INDEX ) - { - mySelectionMode = grpNoSelection; - if ( !myShapeByMeshOp ) { - myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); - connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), - SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); - connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), - SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); - } - // set mesh object to SMESHGUI_ShapeByMeshOp and start it - if ( !myMesh->_is_nil() ) { - myIsBusy = true; - hide(); // stop processing selection - myIsBusy = false; - myShapeByMeshOp->setModule( mySMESHGUI ); - myShapeByMeshOp->setStudy( 0 ); // it's really necessary - myShapeByMeshOp->SetMesh( myMesh ); - myShapeByMeshOp->start(); - } + { + mySelectionMode = grpNoSelection; + if ( !myShapeByMeshOp ) { + myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); + connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), + SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); + connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), + SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); } + // set mesh object to SMESHGUI_ShapeByMeshOp and start it + if ( !myMesh->_is_nil() ) { + myIsBusy = true; + hide(); // stop processing selection + myIsBusy = false; + myShapeByMeshOp->setModule( mySMESHGUI ); + myShapeByMeshOp->setStudy( 0 ); // it's really necessary + myShapeByMeshOp->SetMesh( myMesh ); + myShapeByMeshOp->start(); + } + } } //================================================================================ @@ -2469,10 +2475,10 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op) void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op) { if ( myShapeByMeshOp == op ) - { - show(); - setSelectionMode(grpGeomSelection); - } + { + show(); + setSelectionMode(grpGeomSelection); + } } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index f8ab1da2a..199bdf420 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -299,14 +299,14 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() myDlg->selectObject( names, types, ids ); // enable/desable "new mesh" button - bool isMesh = true; - for ( int i = 0; i < ids.count() && isMesh; ++i ) - { - _PTR(SObject) sobj = - SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); - mySrcMesh = SMESH::SObjectToInterface( sobj ); - isMesh = !mySrcMesh->_is_nil(); - } + bool isMesh = true; // EAP - it's sometimes necessary to copy to a new mesh + // for ( int i = 0; i < ids.count() && isMesh; ++i ) + // { + // _PTR(SObject) sobj = + // SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); + // mySrcMesh = SMESH::SObjectToInterface( sobj ); + // isMesh = !mySrcMesh->_is_nil(); + // } myDlg->setNewMeshEnabled( isMesh ); } catch ( const SALOME::SALOME_Exception& S_ex ) { @@ -374,7 +374,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const idSource = SMESH::SObjectToInterface( sobj ); if ( !idSource->_is_nil() ) { SMESH::array_of_ElementType_var types = idSource->GetTypes(); - for ( int j = 0; j < types->length(); ++j ) + for ( int j = 0; j < (int) types->length(); ++j ) if ( types[j] == SMESH::VOLUME ) hasVolumes = true; else if ( types[j] == SMESH::FACE ) From 8301b1e71a0a9833c5bcf7951b426949f647ae9f Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 27 Oct 2015 21:21:05 +0300 Subject: [PATCH 025/147] 23189: EDF 11603 - Dyssymetry in meshing (fix StdMeshers_CompositeHexa_3D.cxx, StdMeshers_Hexa_3D.cxx) + Doc update + Optimize dump of NumberOfSegments --- doc/salome/examples/filters_ex01.py | 7 ++ .../gui/SMESH/input/1d_meshing_hypo.doc | 28 +++-- .../SMESH/input/selection_filter_library.doc | 7 +- doc/salome/gui/SMESH/input/tui_filters.doc | 2 +- .../StdMeshers_CompositeHexa_3D.cxx | 109 ++++++++++++++--- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 110 +++++++++++++++--- .../StdMeshers_NumberOfSegments.cxx | 45 ++++--- .../StdMeshersGUI_NbSegmentsCreator.cxx | 10 +- .../StdMeshers_NumberOfSegments_i.cxx | 8 +- 9 files changed, 256 insertions(+), 70 deletions(-) diff --git a/doc/salome/examples/filters_ex01.py b/doc/salome/examples/filters_ex01.py index 233b699a9..88305c97f 100644 --- a/doc/salome/examples/filters_ex01.py +++ b/doc/salome/examples/filters_ex01.py @@ -25,3 +25,10 @@ crit = [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_AspectRatio, '<', 1.5, BinaryO triaGroup = mesh.MakeGroupByCriteria( "Tria AR < 1.5", crit ) print "Number of triangles with aspect ratio < 1.5:", triaGroup.Size() +# get range of values of Aspect Ratio of all faces in the mesh +aspects = mesh.GetMinMax( SMESH.FT_AspectRatio ) +print "MESH: Min aspect = %s, Max aspect = %s" % ( aspects[0], aspects[1] ) + +# get max value of Aspect Ratio of faces in triaGroup +grAspects = mesh.GetMinMax( SMESH.FT_AspectRatio, triaGroup ) +print "GROUP: Max aspect = %s" % grAspects[1] diff --git a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc index a5b54c82c..0995673b3 100644 --- a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc +++ b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc @@ -241,7 +241,7 @@ in the plot the density function curve in red and the node distribution as blue crosses. The node distribution is computed in the same way as for \ref analyticdensity_anchor "Distribution with Analytic Density". You -can select the Conversion mode from\b Exponent and Cut +can select the Conversion mode from \b Exponent and Cut negative. \image html distributionwithtabledensity.png @@ -344,16 +344,24 @@ geometrical model in the 3D Viewer, which can help to understand the location of a set of edges within the model. Propagation chains group allows defining Reversed Edges -for splitting opposite edges of quadrilateral faces -in a logically uniform direction. When this group is -activated, the list is filled with propagation chains found within the -model. When a chain is selected in the list its edges are -shown in the Viewer with arrows, which enables choosing a common -direction for all chain edges. \b Reverse button inverts the common -direction of chain edges. If \b Add button is active, some -edges of a chain have a different direction, so you can click \b Add -button to add them to Reversed Edges list. +for splitting opposite edges of quadrilateral faces in a logically +uniform direction. When this group is activated, the list is filled +with propagation chains found within the shape on which a hypothesis +is assigned. When a chain is selected in the list its edges are shown +in the Viewer with arrows, which enables choosing a common direction +for all chain edges. \b Reverse button inverts the common direction of +chain edges. \b Add button is active if some edges of a chain have a +different direction, so you can click \b Add button to add them +to Reversed Edges list. \image html propagation_chain.png "The whole geometry and a propagation chain" +\note Alternatively, uniform direction of edges of one propagation +chain can be achieved by +\ref constructing_submeshes_page "definition of a sub-mesh" on one +edge of the chain and assigning a +\ref propagation_anchor "Propagation" additional hypothesis. +Orientation of this edge (and hence of all the rest edges of the chain) can be +controlled by using Reversed Edges field. + */ diff --git a/doc/salome/gui/SMESH/input/selection_filter_library.doc b/doc/salome/gui/SMESH/input/selection_filter_library.doc index 308706075..c73c1e42e 100644 --- a/doc/salome/gui/SMESH/input/selection_filter_library.doc +++ b/doc/salome/gui/SMESH/input/selection_filter_library.doc @@ -20,7 +20,7 @@ filter. By default it is prefixed with the corresponding entity type. \anchor filtering_elements -When we use filters during a group creation or another operation (by +When we use filters during group creation or another operation (by clicking Set Filter button in the corresponding dialog), the dialog for setting filters looks as shown below. @@ -29,7 +29,10 @@ dialog for setting filters looks as shown below. The \b Add button creates a new criterion at the end of the list of criteria. The \b Insert button creates a new criterion before the selected criterion. The \b Remove button deletes the selected -criterion. The \b Clear button deletes all criteria. +criterion. The \b Clear button deletes all criteria.\n +If there is a choice of Entity type in the dialog, only +criteria of currently selected type are used to create or change a +filter, and criteria of hidden types (if were specified) are ignored. \n Each Entity type has its specific list of criteria, however all filters have common syntax. The Threshold Value should be specified for most criteria. For numerical criteria it is necessary to indicate if diff --git a/doc/salome/gui/SMESH/input/tui_filters.doc b/doc/salome/gui/SMESH/input/tui_filters.doc index bf3a1f72e..66cd3135d 100755 --- a/doc/salome/gui/SMESH/input/tui_filters.doc +++ b/doc/salome/gui/SMESH/input/tui_filters.doc @@ -13,7 +13,7 @@ Several filtering criteria can be combined together by using logical operators \a AND and \a OR. In addition, applied filter criterion can be reverted using logical operator \a NOT. -Mesh filters use the functionality of mesh quality controls to filter +Mesh filters can use the functionality of mesh quality controls to filter mesh nodes / elements by a specific characteristic (Area, Length, etc). This page provides a short description of the existing mesh filters, diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index cc27b86d7..07919e0ff 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -62,7 +62,9 @@ #ifdef _DEBUG_ // #define DEB_FACES // #define DEB_GRID -// #define DUMP_VERT(msg,V) { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); cout << msg << "( "<< p.X()<<", "<& faces, EBoxSides id) const; //!< Reverse edges in order to have the bottom edge going along axes of the unit box - void ReverseEdges(/*int e1, int e2*/); + void ReverseEdges(); bool IsComplex() const { return !myChildren.empty(); } @@ -177,6 +181,9 @@ public: //** Loading and access to mesh **// //!< Load nodes of a mesh bool LoadGrid( SMESH_Mesh& mesh ); + //!< Computes normalized parameters of nodes of myGrid + void ComputeIJK( int i1, int i2, double v3 ); + //!< Return number of segments on the hirizontal sides int GetNbHoriSegments(SMESH_Mesh& mesh, bool withBrothers=false) const; @@ -192,6 +199,9 @@ public: //** Loading and access to mesh **// //!< Return node coordinates by its position gp_XYZ GetXYZ(int iHori, int iVert) const; + //!< Return normalized parameters of nodes within the unitary cube + gp_XYZ& GetIJK(int iCol, int iRow) { return myIJK[ myIndexer( iCol, iRow )]; } + public: //** Access to member fields **// //!< Return i-th face side (0 myGrid; + vector myIJK; // normalized parameters of nodes SMESH_ComputeErrorPtr myError; @@ -590,6 +601,14 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh& theMesh, if ( !fRight ->LoadGrid( theMesh )) return error( fRight ->GetError() ); if ( !fTop ->LoadGrid( theMesh )) return error( fTop ->GetError() ); + // compute normalized parameters of nodes on sides (PAL23189) + fBottom->ComputeIJK( COO_X, COO_Y, /*z=*/0. ); + fBack ->ComputeIJK( COO_X, COO_Z, /*y=*/1. ); + fLeft ->ComputeIJK( COO_Y, COO_Z, /*x=*/0. ); + fFront ->ComputeIJK( COO_X, COO_Z, /*y=*/0. ); + fRight ->ComputeIJK( COO_Y, COO_Z, /*x=*/1. ); + fTop ->ComputeIJK( COO_X, COO_Y, /*z=*/1. ); + int x, xSize = fBottom->GetNbHoriSegments(theMesh) + 1, X = xSize - 1; int y, ySize = fBottom->GetNbVertSegments(theMesh) + 1, Y = ySize - 1; int z, zSize = fFront ->GetNbVertSegments(theMesh) + 1, Z = zSize - 1; @@ -645,13 +664,14 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh& theMesh, pointsOnShapes[ SMESH_Block::ID_V011 ] = fTop->GetXYZ( 0, Y ); pointsOnShapes[ SMESH_Block::ID_V111 ] = fTop->GetXYZ( X, Y ); + gp_XYZ params; // normalized parameters of an internal node within the unit box + for ( x = 1; x < xSize-1; ++x ) { - gp_XYZ params; // normalized parameters of internal node within a unit box - params.SetCoord( 1, x / double(X) ); + const double rX = x / double(X); for ( y = 1; y < ySize-1; ++y ) { - params.SetCoord( 2, y / double(Y) ); + const double rY = y / double(Y); // column to fill during z loop vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )]; // points projections on horizontal edges @@ -668,14 +688,28 @@ bool StdMeshers_CompositeHexa_3D::Compute(SMESH_Mesh& theMesh, pointsOnShapes[ SMESH_Block::ID_Fxy1 ] = fTop ->GetXYZ( x, y ); for ( z = 1; z < zSize-1; ++z ) // z loop { - params.SetCoord( 3, z / double(Z) ); + // compute normalized parameters of an internal node within the unit box + const double rZ = z / double(Z); + const gp_XYZ& pBo = fBottom->GetIJK( x, y ); + const gp_XYZ& pTo = fTop ->GetIJK( x, y ); + const gp_XYZ& pFr = fFront ->GetIJK( x, z ); + const gp_XYZ& pBa = fBack ->GetIJK( x, z ); + const gp_XYZ& pLe = fLeft ->GetIJK( y, z ); + const gp_XYZ& pRi = fRight ->GetIJK( y, z ); + params.SetCoord( 1, 0.5 * ( pBo.X() * ( 1. - rZ ) + pTo.X() * rZ + + pFr.X() * ( 1. - rY ) + pBa.X() * rY )); + params.SetCoord( 2, 0.5 * ( pBo.Y() * ( 1. - rZ ) + pTo.Y() * rZ + + pLe.Y() * ( 1. - rX ) + pRi.Y() * rX )); + params.SetCoord( 3, 0.5 * ( pFr.Z() * ( 1. - rY ) + pBa.Z() * rY + + pLe.Z() * ( 1. - rX ) + pRi.Z() * rX )); + // point projections on vertical edges - pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z ); - pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z ); - pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z ); + pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z ); + pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z ); + pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z ); pointsOnShapes[ SMESH_Block::ID_E11z ] = fBack->GetXYZ( X, z ); // point projections on vertical faces - pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z ); + pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z ); pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z ); pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z ); pointsOnShapes[ SMESH_Block::ID_F1yz ] = fRight->GetXYZ( y, z ); @@ -1117,7 +1151,7 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh ) const SMDS_MeshElement* firstQuad = 0; // most left face above the last row of found nodes int nbFoundNodes = myIndexer._xSize; - while ( nbFoundNodes != (int) myGrid.size() ) + while ( nbFoundNodes != myGrid.size() ) { // first and last nodes of the last filled row of nodes const SMDS_MeshNode* n1down = myGrid[ nbFoundNodes - myIndexer._xSize ]; @@ -1185,6 +1219,53 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh ) return true; } +//================================================================================ +/*! + * \brief Fill myIJK with normalized parameters of nodes in myGrid + * \param [in] i1 - coordinate index along rows of myGrid + * \param [in] i2 - coordinate index along columns of myGrid + * \param [in] v3 - value of the constant parameter + */ +//================================================================================ + +void _QuadFaceGrid::ComputeIJK( int i1, int i2, double v3 ) +{ + gp_XYZ ijk( v3, v3, v3 ); + myIJK.resize( myIndexer.size(), ijk ); + + const size_t nbCol = myIndexer._xSize; + const size_t nbRow = myIndexer._ySize; + + vector< double > len( nbRow ); + len[0] = 0; + for ( size_t i = 0; i < nbCol; ++i ) + { + gp_Pnt pPrev = GetXYZ( i, 0 ); + for ( size_t j = 1; j < nbRow; ++j ) + { + gp_Pnt p = GetXYZ( i, j ); + len[ j ] = len[ j-1 ] + p.Distance( pPrev ); + pPrev = p; + } + for ( size_t j = 0; j < nbRow; ++j ) + GetIJK( i, j ).SetCoord( i2, len[ j ]/len.back() ); + } + + len.resize( nbCol ); + for ( size_t j = 0; j < nbRow; ++j ) + { + gp_Pnt pPrev = GetXYZ( 0, j ); + for ( size_t i = 1; i < nbCol; ++i ) + { + gp_Pnt p = GetXYZ( i, j ); + len[ i ] = len[ i-1 ] + p.Distance( pPrev ); + pPrev = p; + } + for ( size_t i = 0; i < nbCol; ++i ) + GetIJK( i, j ).SetCoord( i1, len[ i ]/len.back() ); + } +} + //================================================================================ /*! * \brief Find out mutual location of children: find their right and up brothers @@ -1441,8 +1522,8 @@ const SMDS_MeshNode* _QuadFaceGrid::GetNode(int iHori, int iVert) const gp_XYZ _QuadFaceGrid::GetXYZ(int iHori, int iVert) const { - const SMDS_MeshNode* n = myGrid[ myIndexer( iHori, iVert )]; - return gp_XYZ( n->X(), n->Y(), n->Z() ); + SMESH_TNodeXYZ xyz = myGrid[ myIndexer( iHori, iVert )]; + return xyz; } //================================================================================ diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 87f1aa8d7..c8d4c7a72 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -144,6 +144,7 @@ namespace //============================================================================= typedef boost::shared_ptr< FaceQuadStruct > FaceQuadStructPtr; + typedef std::vector TXYZColumn; // symbolic names of box sides enum EBoxSides{ B_BOTTOM=0, B_RIGHT, B_TOP, B_LEFT, B_FRONT, B_BACK, B_NB_SIDES }; @@ -151,6 +152,8 @@ namespace // symbolic names of sides of quadrangle enum EQuadSides{ Q_BOTTOM=0, Q_RIGHT, Q_TOP, Q_LEFT, Q_NB_SIDES }; + enum EAxes{ COO_X=1, COO_Y, COO_Z }; + //============================================================================= /*! * \brief Container of nodes of structured mesh on a qudrangular geom FACE @@ -166,6 +169,9 @@ namespace // node column's taken form _u2nodesMap taking into account sub-shape orientation vector _columns; + // columns of normalized parameters of nodes within the unitary cube + vector _ijkColumns; + // geometry of a cube side TopoDS_Face _sideF; @@ -177,6 +183,10 @@ namespace { return SMESH_TNodeXYZ( GetNode( iCol, iRow )); } + gp_XYZ& GetIJK(int iCol, int iRow) + { + return _ijkColumns[iCol][iRow]; + } }; //================================================================================ @@ -276,6 +286,56 @@ namespace } return ( n == n00 || n == n01 || n == n10 || n == n11 ); } + + //================================================================================ + /*! + * \brief Fill in _FaceGrid::_ijkColumns + * \param [in,out] fg - a _FaceGrid + * \param [in] i1 - coordinate index along _columns + * \param [in] i2 - coordinate index along _columns[i] + * \param [in] v3 - value of the constant parameter + */ + //================================================================================ + + void computeIJK( _FaceGrid& fg, int i1, int i2, double v3 ) + { + gp_XYZ ijk( v3, v3, v3 ); + const size_t nbCol = fg._columns.size(); + const size_t nbRow = fg._columns[0].size(); + + fg._ijkColumns.resize( nbCol ); + for ( size_t i = 0; i < nbCol; ++i ) + fg._ijkColumns[ i ].resize( nbRow, ijk ); + + vector< double > len( nbRow ); + len[0] = 0; + for ( size_t i = 0; i < nbCol; ++i ) + { + gp_Pnt pPrev = fg.GetXYZ( i, 0 ); + for ( size_t j = 1; j < nbRow; ++j ) + { + gp_Pnt p = fg.GetXYZ( i, j ); + len[ j ] = len[ j-1 ] + p.Distance( pPrev ); + pPrev = p; + } + for ( size_t j = 0; j < nbRow; ++j ) + fg.GetIJK( i, j ).SetCoord( i2, len[ j ]/len.back() ); + } + + len.resize( nbCol ); + for ( size_t j = 0; j < nbRow; ++j ) + { + gp_Pnt pPrev = fg.GetXYZ( 0, j ); + for ( size_t i = 1; i < nbCol; ++i ) + { + gp_Pnt p = fg.GetXYZ( i, j ); + len[ i ] = len[ i-1 ] + p.Distance( pPrev ); + pPrev = p; + } + for ( size_t i = 0; i < nbCol; ++i ) + fg.GetIJK( i, j ).SetCoord( i1, len[ i ]/len.back() ); + } + } } //============================================================================= @@ -444,15 +504,15 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, { aCubeSide[i]._columns.resize( aCubeSide[i]._u2nodesMap.size() ); - size_t iFwd = 0, iRev = aCubeSide[i]._columns.size()-1; - size_t* pi = isReverse[i] ? &iRev : &iFwd; + int iFwd = 0, iRev = aCubeSide[i]._columns.size()-1; + int* pi = isReverse[i] ? &iRev : &iFwd; TParam2ColumnMap::iterator u2nn = aCubeSide[i]._u2nodesMap.begin(); for ( ; iFwd < aCubeSide[i]._columns.size(); --iRev, ++iFwd, ++u2nn ) aCubeSide[i]._columns[ *pi ].swap( u2nn->second ); aCubeSide[i]._u2nodesMap.clear(); } - + if ( proxymesh ) for ( int i = 0; i < 6; ++i ) for ( unsigned j = 0; j < aCubeSide[i]._columns.size(); ++j) @@ -476,6 +536,14 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, _FaceGrid* fFront = & aCubeSide[ B_FRONT ]; _FaceGrid* fBack = & aCubeSide[ B_BACK ]; + // compute normalized parameters of nodes on sides (PAL23189) + computeIJK( *fBottom, COO_X, COO_Y, /*z=*/0. ); + computeIJK( *fRight, COO_Y, COO_Z, /*x=*/1. ); + computeIJK( *fTop, COO_X, COO_Y, /*z=*/1. ); + computeIJK( *fLeft, COO_Y, COO_Z, /*x=*/0. ); + computeIJK( *fFront, COO_X, COO_Z, /*y=*/0. ); + computeIJK( *fBack, COO_X, COO_Z, /*y=*/1. ); + // cube size measured in nb of nodes int x, xSize = fBottom->_columns.size() , X = xSize - 1; int y, ySize = fLeft->_columns.size() , Y = ySize - 1; @@ -531,13 +599,14 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, pointsOnShapes[ SMESH_Block::ID_V011 ] = fTop->GetXYZ( 0, Y ); pointsOnShapes[ SMESH_Block::ID_V111 ] = fTop->GetXYZ( X, Y ); + gp_XYZ params; // normalized parameters of an internal node within the unit box for ( x = 1; x < xSize-1; ++x ) { - gp_XYZ params; // normalized parameters of internal node within a unit box - params.SetCoord( 1, x / double(X) ); + const double rX = x / double(X); for ( y = 1; y < ySize-1; ++y ) { - params.SetCoord( 2, y / double(Y) ); + const double rY = y / double(Y); + // a column to fill in during z loop vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )]; // projection points on horizontal edges @@ -554,23 +623,36 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, pointsOnShapes[ SMESH_Block::ID_Fxy1 ] = fTop ->GetXYZ( x, y ); for ( z = 1; z < zSize-1; ++z ) // z loop { - params.SetCoord( 3, z / double(Z) ); + const double rZ = z / double(Z); + + const gp_XYZ& pBo = fBottom->GetIJK( x, y ); + const gp_XYZ& pTo = fTop ->GetIJK( x, y ); + const gp_XYZ& pFr = fFront ->GetIJK( x, z ); + const gp_XYZ& pBa = fBack ->GetIJK( x, z ); + const gp_XYZ& pLe = fLeft ->GetIJK( y, z ); + const gp_XYZ& pRi = fRight ->GetIJK( y, z ); + params.SetCoord( 1, 0.5 * ( pBo.X() * ( 1. - rZ ) + pTo.X() * rZ + + pFr.X() * ( 1. - rY ) + pBa.X() * rY )); + params.SetCoord( 2, 0.5 * ( pBo.Y() * ( 1. - rZ ) + pTo.Y() * rZ + + pLe.Y() * ( 1. - rX ) + pRi.Y() * rX )); + params.SetCoord( 3, 0.5 * ( pFr.Z() * ( 1. - rY ) + pBa.Z() * rY + + pLe.Z() * ( 1. - rX ) + pRi.Z() * rX )); + // projection points on vertical edges - pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z ); - pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z ); - pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z ); + pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z ); + pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z ); + pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z ); pointsOnShapes[ SMESH_Block::ID_E11z ] = fBack->GetXYZ( X, z ); // projection points on vertical faces - pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z ); - pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z ); - pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z ); + pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z ); + pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z ); + pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z ); pointsOnShapes[ SMESH_Block::ID_F1yz ] = fRight->GetXYZ( y, z ); // compute internal node coordinates gp_XYZ coords; SMESH_Block::ShellPoint( params, pointsOnShapes, coords ); column[ z ] = helper.AddNode( coords.X(), coords.Y(), coords.Z() ); - } } } diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 2f0d05b9d..29e55e4a5 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -180,15 +180,16 @@ StdMeshers_NumberOfSegments::DistrType StdMeshers_NumberOfSegments::GetDistrType void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor) throw(SALOME_Exception) { - if (_distrType != DT_Scale) - _distrType = DT_Scale; - //throw SALOME_Exception(LOCALIZED("not a scale distribution")); if (scaleFactor < PRECISION) throw SALOME_Exception(LOCALIZED("scale factor must be positive")); - if (fabs(scaleFactor - 1.0) < PRECISION) + + if (_distrType != DT_Scale) + _distrType = DT_Scale; + + if ( fabs(scaleFactor - 1.0) < PRECISION ) _distrType = DT_Regular; - if (fabs(_scaleFactor - scaleFactor) > PRECISION) + if ( fabs(_scaleFactor - scaleFactor) > PRECISION ) { _scaleFactor = scaleFactor; NotifySubMeshesHypothesisModification(); @@ -197,7 +198,7 @@ void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor) //================================================================================ /*! - * + * */ //================================================================================ @@ -211,7 +212,7 @@ double StdMeshers_NumberOfSegments::GetScaleFactor() const //================================================================================ /*! - * + * */ //================================================================================ @@ -224,12 +225,12 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) if ( (table.size() % 2) != 0 ) throw SALOME_Exception(LOCALIZED("odd size of vector of table function")); - int i; double prev = -PRECISION; bool isSame = table.size() == _table.size(); bool pos = false; - for (i=0; i < table.size()/2; i++) { + for ( size_t i = 0; i < table.size() / 2; i++ ) + { double par = table[i*2]; double val = table[i*2+1]; if( _convMode==0 ) @@ -239,7 +240,8 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) OCC_CATCH_SIGNALS; #endif val = pow( 10.0, val ); - } catch(Standard_Failure) { + } + catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); throw SALOME_Exception( LOCALIZED( "invalid value")); return; @@ -248,19 +250,19 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) else if( _convMode==1 && val<0.0 ) val = 0.0; - if ( par<0 || par > 1) + if ( par < 0 || par > 1) throw SALOME_Exception(LOCALIZED("parameter of table function is out of range [0,1]")); - if ( fabs(par-prev)PRECISION ) + if( val > PRECISION ) pos = true; if (isSame) { double oldpar = _table[i*2]; double oldval = _table[i*2+1]; - if (fabs(par - oldpar) > PRECISION || fabs(val - oldval) > PRECISION) + if ( fabs(par - oldpar) > PRECISION || fabs(val - oldval) > PRECISION ) isSame = false; } prev = par; @@ -269,7 +271,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) if( !pos ) throw SALOME_Exception(LOCALIZED("value of table function is not positive")); - if( pos && !isSame ) + if ( pos && !isSame ) { _table = table; NotifySubMeshesHypothesisModification(); @@ -278,7 +280,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) //================================================================================ /*! - * + * */ //================================================================================ @@ -394,7 +396,6 @@ void StdMeshers_NumberOfSegments::SetExpressionFunction(const char* expr) { if (_distrType != DT_ExprFunc) _distrType = DT_ExprFunc; - //throw SALOME_Exception(LOCALIZED("not an expression function distribution")); string func = CheckExpressionFunction( expr, _convMode ); if( _func != func ) @@ -509,9 +510,8 @@ ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save) save << " " << _scaleFactor; break; case DT_TabFunc: - int i; save << " " << _table.size(); - for (i=0; i < _table.size(); i++) + for ( size_t i = 0; i < _table.size(); i++ ) save << " " << _table[i]; break; case DT_ExprFunc: @@ -599,8 +599,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) if (isOK) { _table.resize(a, 0.); - int i; - for (i=0; i < _table.size(); i++) + for ( size_t i=0; i < _table.size(); i++ ) { isOK = (load >> b); if (isOK) @@ -652,7 +651,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) isOK = (load >> intVal); if ( isOK && _distrType != DT_Regular && intVal > 0 ) { _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { isOK = (load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } @@ -664,7 +663,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) //============================================================================= /*! - * + * */ //============================================================================= diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index 4450986fd..6749e0b9c 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -94,9 +94,10 @@ bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg ) const readParamsFromHypo( data_old ); readParamsFromWidgets( data_new ); bool res = storeParamsToHypo( data_new ); - storeParamsToHypo( data_old ); res = myNbSeg->isValid( msg, true ) && res; res = myScale->isValid( msg, true ) && res; + if ( !res ) + storeParamsToHypo( data_old ); return res; } @@ -300,7 +301,7 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const case TabFunc : { //valStr += tr("SMESH_TAB_FUNC"); bool param = true; - for( size_t i=0; i < data.myTable.length(); i++, param = !param ) { + for( int i=0; i < data.myTable.length(); i++, param = !param ) { if ( param ) valStr += "["; valStr += QString::number( data.myTable[ i ]); @@ -382,9 +383,10 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe h->SetVarParameter( h_data.myNbSegVarName.toLatin1().constData(), "SetNumberOfSegments" ); h->SetNumberOfSegments( h_data.myNbSeg ); - int distr = h_data.myDistrType; - h->SetDistrType( distr ); + int distr = h_data.myDistrType; + if ( distr == 0 ) + h->SetDistrType( distr ); // this is actually needed at non-uniform -> uniform switch if( distr==1 ) { h->SetVarParameter( h_data.myScaleVarName.toLatin1().constData(), "SetScaleFactor" ); h->SetScaleFactor( h_data.myScale ); diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index 0033badf7..4e6ef16ae 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -267,10 +267,13 @@ void StdMeshers_NumberOfSegments_i::SetDistrType(CORBA::Long typ) { ASSERT( myBaseImpl ); try { + CORBA::Long oldType = (CORBA::Long) this->GetImpl()->GetDistrType(); + this->GetImpl()->SetDistrType( (::StdMeshers_NumberOfSegments::DistrType) typ ); // Update Python script - SMESH::TPythonDump() << _this() << ".SetDistrType( " << typ << " )"; + if ( oldType != typ ) + SMESH::TPythonDump() << _this() << ".SetDistrType( " << typ << " )"; } catch ( SALOME_Exception& S_ex ) { THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), @@ -397,7 +400,8 @@ void StdMeshers_NumberOfSegments_i::SetExpressionFunction(const char* expr) SMESH::TPythonDump() << _this() << ".SetExpressionFunction( '" << expr << "' )"; } catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), + SALOME::BAD_PARAM ); } } From 219f1c3410ef3fab8f5a5abe3539a12d6170079d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 28 Oct 2015 19:04:54 +0300 Subject: [PATCH 026/147] IPAL52933: Selection disappears in the "Move node" dialog Fix SMESHGUI_MakeNodeAtPointDlg.cxx Eliminate compilation warnings from SMESHGUI.cxx --- src/SMESHGUI/SMESHGUI.cxx | 89 +++++++++++--------- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 20 +++-- 2 files changed, 66 insertions(+), 43 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 4de86fc5d..a465cd3be 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1176,7 +1176,7 @@ namespace out << "# Control: " << functorToString( aFunctor ) << endl; out << "#" << endl; out.setFieldWidth( 10 ); - for ( int i = 0; i < qMin( nbEvents.size(), funValues.size()-1 ); i++ ) + for ( int i = 0; i < (int)qMin( nbEvents.size(), funValues.size()-1 ); i++ ) out << funValues[i] << "\t" << funValues[i+1] << "\t" << nbEvents[i] << endl; f.close(); } @@ -4901,7 +4901,7 @@ void SMESHGUI::ProcessEvents( vtkObject* theObject, void* theCallData ) { if( SMESHGUI* aSMESHGUI = reinterpret_cast( theClientData ) ) { - if( theObject && theEvent == SMESH::DeleteActorEvent ) { + if( theObject && (int) theEvent == SMESH::DeleteActorEvent ) { if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( theObject ) ) { SMESHGUI_ClippingPlaneInfoMap& aClippingPlaneInfoMap = aSMESHGUI->getClippingPlaneInfoMap(); SMESHGUI_ClippingPlaneInfoMap::iterator anIter1 = aClippingPlaneInfoMap.begin(); @@ -5305,79 +5305,92 @@ void SMESHGUI::createPreferences() void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) { - if( sect=="SMESH" ) { - float sbX1,sbY1,sbW,sbH; + if ( sect=="SMESH" ) { + float sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08; float aTol = 1.00000009999999; std::string aWarning; SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this); - if( name=="selection_object_color" || name=="selection_element_color" || - name=="highlight_color" || - name=="selection_precision_node" || name=="selection_precision_element" || - name=="selection_precision_object") + + if ( name== "selection_object_color" || + name=="selection_element_color" || + name== "highlight_color" || + name=="selection_precision_node" || + name=="selection_precision_element" || + name=="selection_precision_object" ) + { SMESH::UpdateSelectionProp( this ); - else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){ - sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1); - sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW); - if(sbX1+sbW > aTol){ + } + else if (name == "scalar_bar_vertical_x" || name == "scalar_bar_vertical_width") + { + sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1); + sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW); + if ( sbX1+sbW > aTol ) { aWarning = "Origin and Size Vertical: X+Width > 1\n"; - sbX1=0.01; - sbW=0.08; - aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1); + sbX1 = 0.01; + sbW = 0.08; + aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1); aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW); } } - else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){ - sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1); - sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH); - if(sbY1+sbH > aTol){ + else if (name == "scalar_bar_vertical_y" || name == "scalar_bar_vertical_height" ) + { + sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1); + sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH); + if ( sbY1 + sbH > aTol ) { aWarning = "Origin and Size Vertical: Y+Height > 1\n"; - aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1); + aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1); aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH); } } - else if(name == QString("scalar_bar_horizontal_x") || name == QString("scalar_bar_horizontal_width")){ - sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1); - sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW); - if(sbX1+sbW > aTol){ + else if (name == "scalar_bar_horizontal_x" || name == "scalar_bar_horizontal_width") + { + sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1); + sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW); + if ( sbX1 + sbW > aTol ) { aWarning = "Origin and Size Horizontal: X+Width > 1\n"; sbX1=0.1; - sbW=0.08; + sbW =0.08; aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1); aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW); } } - else if(name == QString("scalar_bar_horizontal_y") || name == QString("scalar_bar_horizontal_height")){ - sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1); - sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH); - if(sbY1+sbH > aTol){ + else if (name == "scalar_bar_horizontal_y" || name == "scalar_bar_horizontal_height") + { + sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1); + sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH); + if ( sbY1 + sbH > aTol ) { aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; sbY1=0.01; - sbH=0.08; + sbH =0.08; aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1); aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH); } } - else if ( name == "segmentation" ) { + else if ( name == "segmentation" ) + { int nbSeg = aResourceMgr->integerValue( "SMESH", "segmentation", 10 ); myComponentSMESH->SetBoundaryBoxSegmentation( nbSeg ); } - else if ( name == "nb_segments_per_edge" ) { + else if ( name == "nb_segments_per_edge" ) + { int nbSeg = aResourceMgr->integerValue( "SMESH", "nb_segments_per_edge", 15 ); myComponentSMESH->SetDefaultNbSegments( nbSeg ); } - else if ( name == "historical_python_dump" || - name == "forget_mesh_on_hyp_modif") { + else if ( name == "historical_python_dump" || name == "forget_mesh_on_hyp_modif") + { QString val = aResourceMgr->stringValue( "SMESH", name ); myComponentSMESH->SetOption( name.toLatin1().constData(), val.toLatin1().constData() ); } - else if ( name == QString( "numbering_node_color" ) || name == QString( "numbering_node_font" ) ) { - SMESH::UpdateFontProp( this ); + else if ( name == "numbering_node_color" || name == "numbering_node_font" ) + { + SMESH::UpdateFontProp( this ); } - else if ( name == QString( "numbering_elem_color" ) || name == QString( "numbering_elem_font" ) ) { + else if ( name == "numbering_elem_color" || name == "numbering_elem_font" ) + { SMESH::UpdateFontProp( this ); } - if(aWarning.size() != 0){ + if ( aWarning.size() != 0 ) { aWarning += "The default values are applied instead."; SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"), diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index 89034c8a6..f578c1c2f 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -84,6 +84,11 @@ #define SPACING 6 #define MARGIN 11 +namespace +{ + enum { MANUAL_MODE = 0, SEARCH_MODE }; // how a node to move is specified +} + /*! * \brief Dialog to publish a sub-shape of the mesh main shape * by selecting mesh elements @@ -437,7 +442,7 @@ void SMESHGUI_MakeNodeAtPointOp::startOperation() myDlg->myDestDZ->setReadOnly(true); myDlg->myRButNodeToMove->setChecked(true); - myDlg->ConstructorsClicked(GetConstructorId()); + myDlg->ConstructorsClicked( GetConstructorId() ); myDlg->show(); @@ -469,12 +474,13 @@ void SMESHGUI_MakeNodeAtPointOp::stopOperation() mySimulation = 0; } if ( myMeshActor ) { - myMeshActor->SetPointRepresentation(false); - SMESH::RepaintCurrentView(); myMeshActor = 0; } + SMESH::SetPointRepresentation( false ); + SMESH::RepaintCurrentView(); + disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView())); - disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView())); + disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView())); selectionMgr()->removeFilter( myFilter ); SMESHGUI_SelectionOp::stopOperation(); } @@ -685,6 +691,9 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview() return; myNoPreview = true; + if ( !myMeshActor && GetConstructorId() == SEARCH_MODE ) + onSelectionDone(); + SMESH::MeshPreviewStruct_var aMeshPreviewStruct; bool moveShown = false; @@ -776,7 +785,8 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview() } } } - }catch (...) { + } + catch (...) { } } } From 387ee093834ff8105e02cf017f0823d09c0412f9 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 28 Oct 2015 19:11:56 +0300 Subject: [PATCH 027/147] IPAL52934: Elements are't not highlighted in vtk viewer after set id in measurements dialog box Fix SMESHGUI_Measurements.cxx In "Build Compound Mesh", set "Merge coincident nodes and elements" ON by default after reflection about a question on the Forum http://www.salome-platform.org/forum/forum_11/866636535 Change SMESHGUI_BuildCompoundDlg.cxx --- src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_Measurements.cxx | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 90f42ee45..ae1f5ad3f 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -228,7 +228,7 @@ void SMESHGUI_BuildCompoundDlg::Init() ComboBoxUnion->addItem(tr("RENAME")); ComboBoxUnion->setCurrentIndex(0); - CheckBoxMerge->setChecked(false); + CheckBoxMerge->setChecked(true); TextLabelTol->setEnabled(CheckBoxMerge->isChecked()); SpinBoxTol->SetValue(1e-05); diff --git a/src/SMESHGUI/SMESHGUI_Measurements.cxx b/src/SMESHGUI/SMESHGUI_Measurements.cxx index e2d3b5b01..4b30659eb 100644 --- a/src/SMESHGUI/SMESHGUI_Measurements.cxx +++ b/src/SMESHGUI/SMESHGUI_Measurements.cxx @@ -198,6 +198,7 @@ SMESHGUI_MinDistance::SMESHGUI_MinDistance( QWidget* parent ) clear(); //setTarget( FirstTgt ); + selectionChanged(); } /*! @@ -500,13 +501,21 @@ void SMESHGUI_MinDistance::secondEdited() setTarget( SecondTgt ); if ( sender() == mySecondTgt ) clear(); + QString text = mySecondTgt->text(); + if ( !mySecondActor ) + { + selectionChanged(); + mySecondTgt->setText( text ); + } SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector(); if ( mySecondActor && selector ) { Handle(SALOME_InteractiveObject) IO = mySecondActor->getIO(); if ( mySecond->checkedId() == NodeTgt || mySecond->checkedId() == ElementTgt ) { - TColStd_MapOfInteger ID; - ID.Add( mySecondTgt->text().toLong() ); - selector->AddOrRemoveIndex( IO, ID, false ); + if ( !text.isEmpty() ) { + TColStd_MapOfInteger ID; + ID.Add( text.toLong() ); + selector->AddOrRemoveIndex( IO, ID, false ); + } } if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) aViewWindow->highlight( IO, true, true ); From abe9bd6dff6149ea8e2236360c0186e9c0dd2ad1 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 28 Oct 2015 19:15:20 +0300 Subject: [PATCH 028/147] IPAL52871: Mesh Information dialog shows different number of nodes for group of elements Implement final solution (note 0506775) --- src/SMESH_I/SMESH_Group_i.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index d51714ae7..9d3b3ee02 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -55,11 +55,11 @@ SMESH_GroupBase_i::SMESH_GroupBase_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID ) : SALOME::GenericObj_i( thePOA ), - myMeshServant( theMeshServant ), - myLocalID( theLocalID ), + myPreMeshInfo(NULL), myNbNodes(-1), myGroupDSTic(0), - myPreMeshInfo(NULL) + myMeshServant( theMeshServant ), + myLocalID( theLocalID ) { // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i, // servant activation is performed by SMESH_Mesh_i::createGroup() @@ -69,8 +69,8 @@ SMESH_GroupBase_i::SMESH_GroupBase_i( PortableServer::POA_ptr thePOA, SMESH_Group_i::SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID ) - : SALOME::GenericObj_i( thePOA ), - SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID ) + : SALOME::GenericObj_i( thePOA ), + SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID ) { //MESSAGE("SMESH_Group_i; this = "<SetName(aNewGroupName.c_str()); } char aGroupNum[128]; sprintf(aGroupNum, "%u", aNewGroups.size()+1); - aNewGroupName = string(aGroupName) + "_" + string(aGroupNum); + aNewGroupName = aName + "_" + string(aGroupNum); aNewGroup->SetName(aNewGroupName.c_str()); aNewGroups.push_back(aNewGroup); } diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 139257213..52ac9f8f3 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -3135,7 +3135,7 @@ namespace if ( !_vIntNodes.empty() ) return false; - const int ijk[3] = { _i, _j, _k }; + const size_t ijk[3] = { _i, _j, _k }; F_IntersectPoint curIntPnt; // consider a cell to be in a hole if all links in any direction From ffd0606a85a3124f8143b44d76ba21c4d114fa26 Mon Sep 17 00:00:00 2001 From: ysn Date: Mon, 19 Oct 2015 11:10:14 +0300 Subject: [PATCH 031/147] Documentation update --- .../gui/SMESH/input/1d_meshing_hypo.doc | 2 +- doc/salome/gui/SMESH/input/about_meshes.doc | 2 +- doc/salome/gui/SMESH/input/extrusion.doc | 6 ++-- doc/salome/gui/SMESH/input/mesh_infos.doc | 6 ++-- .../gui/SMESH/input/quad_from_ma_algo.doc | 14 ++++---- doc/salome/gui/SMESH/input/revolution.doc | 2 +- .../SMESH/input/selection_filter_library.doc | 8 ++--- doc/salome/gui/SMESH/input/sewing_meshes.doc | 36 +++++++++---------- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc index 0995673b3..01deffbcd 100644 --- a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc +++ b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc @@ -250,7 +250,7 @@ negative. \ref tui_deflection_1d "Defining Number of Segments" hypothesis operation. -\note The plot functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module). +\note The plot functionality is available only if GUI module is built with Plot 2D Viewer (option SALOME_USE_PLOT2DVIEWER is ON when building GUI module).
\anchor start_and_end_length_anchor diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc index 7550e8934..80266cada 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.doc +++ b/doc/salome/gui/SMESH/input/about_meshes.doc @@ -98,7 +98,7 @@ surface in addition stores its position in parametric space of the associated geometrical entity. Mesh entities are identified by integer IDs starting from 1. -Nodes and elements are countered separately, i.e. there can be a node +Nodes and elements are counted separately, i.e. there can be a node and element with the same ID. SALOME supports elements of second order, without a central node diff --git a/doc/salome/gui/SMESH/input/extrusion.doc b/doc/salome/gui/SMESH/input/extrusion.doc index 56cb32f4c..5a603b229 100644 --- a/doc/salome/gui/SMESH/input/extrusion.doc +++ b/doc/salome/gui/SMESH/input/extrusion.doc @@ -23,10 +23,10 @@ elements is extruded into a corresponding type of result elements: When 2D elements are extruded, in addition to 3D elements segments are -created on ribs of the result 3D mesh. Free edges of input 2D elements +created on the ribs of the resulting 3D mesh. Free edges of input 2D elements generate logically horizontal rib segments. Logically vertical rib -segments are generated from nodes belonging to a sole input 2D element -(a figure below illustrates this rule). +segments are generated from the nodes belonging to a sole input 2D element +(the figure below illustrates this rule). \image html extru_rib_segs.png "Two triangles extruded: no vertical rib segments generated from nodes #2 and #3 as they are shared by both triangles" diff --git a/doc/salome/gui/SMESH/input/mesh_infos.doc b/doc/salome/gui/SMESH/input/mesh_infos.doc index 2013cd426..929deb8f3 100644 --- a/doc/salome/gui/SMESH/input/mesh_infos.doc +++ b/doc/salome/gui/SMESH/input/mesh_infos.doc @@ -46,7 +46,7 @@ information about the selected mesh node(s) or element(s), namely: - Node ID; - Coordinates (X, Y, Z); - Connectivity information (connected elements); double click in - this line makes the dialog show information of these elements; + this line reveals information about these elements; - Position on a shape (for meshes built on a geometry); - Groups information (names of groups the node belongs to). @@ -59,7 +59,7 @@ information about the selected mesh node(s) or element(s), namely: - Type (triangle, quadrangle, etc.); - Gravity center (X, Y, Z coordinates); - Connectivity information (connected nodes); double click in - a line of a node makes the dialog show information of this node; + a line of a node reveals the information about this node; - Quality controls (area, aspect ration, volume, etc.); - Position on a shape (for meshes built on a geometry); - Groups information (names of groups the element belongs to). @@ -156,7 +156,7 @@ button. Also, values are automatically computed if the number of nodes / elements does not exceed the "Automatic controls compute limit" set via the "Mesh information" preferences (zero value means that there is no limit). -\note The plot functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module). +\note The plot functionality is available only if the GUI module is built with Plot 2D Viewer (option SALOME_USE_PLOT2DVIEWER is ON when building GUI module). The button \b "Dump" allows printing the information displayed in the dialog box to a .txt file. diff --git a/doc/salome/gui/SMESH/input/quad_from_ma_algo.doc b/doc/salome/gui/SMESH/input/quad_from_ma_algo.doc index 6a90f376e..e3df9e4a5 100644 --- a/doc/salome/gui/SMESH/input/quad_from_ma_algo.doc +++ b/doc/salome/gui/SMESH/input/quad_from_ma_algo.doc @@ -3,9 +3,9 @@ \page quad_from_ma_algo_page Medial Axis Projection Quadrangle meshing algorithm Medial Axis Projection algorithm can be used for meshing faces with -sinuous borders and having channel-like shape, for which is it -difficult to define 1D hypotheses so that generated quadrangles to be -of good shape. The algorithm can be also applied to faces with ring +sinuous borders and a channel-like shape, for which it can be +difficult to define 1D hypotheses such that to obtain a good shape of +resulting quadrangles. The algorithm can be also applied to faces with ring topology, which can be viewed as a closed 'channel'. In the latter case radial discretization of a ring can be specified by using Number of Layers or Distribution of Layers @@ -13,7 +13,7 @@ hypothesis. \image html quad_from_ma_mesh.png "A mesh of a river model to the left and of a ring-face to the right" -The algorithm assures good shape of quadrangles by constructing Medial +The algorithm provides proper shape of quadrangles by constructing Medial Axis between sinuous borders of the face and using it to discretize the borders. (Shape of quadrangles can be not perfect at locations where opposite sides of a 'channel' are far from being parallel.) @@ -22,13 +22,13 @@ locations where opposite sides of a 'channel' are far from being parallel.) The Medial Axis is used in two ways:
    -
  1. If there is a sub-mesh on either sinuous border, then the nodes of +
  2. If there is a sub-mesh on a sinuous border, then the nodes of this border are mapped to the opposite border via the Medial Axis.
  3. -
  4. If there is no sub-meshes on the sinuous borders, then a part of +
  5. If there are no sub-meshes on sinuous borders, then the part of the Medial Axis that can be mapped to both borders is discretized using a 1D hypothesis assigned to the face or its ancestor shapes, - and the division points are mapped from the Medial Axis to the both + and the division points are mapped from the Medial Axis to both borders to find positions of nodes.
diff --git a/doc/salome/gui/SMESH/input/revolution.doc b/doc/salome/gui/SMESH/input/revolution.doc index f0d4194df..4b1d81240 100644 --- a/doc/salome/gui/SMESH/input/revolution.doc +++ b/doc/salome/gui/SMESH/input/revolution.doc @@ -7,7 +7,7 @@ dimension than the input ones. Boundary elements around generated mesh of plus one dimension are additionally created. All created elements can be automatically grouped. Revolution can be used to create a \ref extrusion_struct "structured mesh from scratch". -See \ref extrusion_page page for general information on Revolution +See \ref extrusion_page page for general information on Revolution, which can be viewed as extrusion along a circular path. To apply revolution: diff --git a/doc/salome/gui/SMESH/input/selection_filter_library.doc b/doc/salome/gui/SMESH/input/selection_filter_library.doc index c73c1e42e..7189ccc43 100644 --- a/doc/salome/gui/SMESH/input/selection_filter_library.doc +++ b/doc/salome/gui/SMESH/input/selection_filter_library.doc @@ -3,8 +3,8 @@ \page selection_filter_library_page Selection filter library \n Selection filter library allows creating and storing in files -filters that can be later loaded and used for operations on meshes. You can -access to it from the Main Menu via Tools / Selection filter library. +the filters that can be later reused for operations on meshes. You can +access it from the Main Menu via Tools / Selection filter library. It is also possible to save any filter by invoking the filter library from \a Filter dialog launched from any mesh operation. @@ -182,8 +182,8 @@ The following criteria allow selecting mesh Faces: \ref area_page "Area quality control"), which is more, less or equal (within a given Tolerance) to the predefined Threshold Value.
  • -Free edges selects 2D mesh elements having at least one of its -edges not shared with other faces. See also a +Free edges selects 2D mesh elements having at least one +edge, which is not shared with other faces. See also a \ref free_edges_page "Free Edges quality control".
  • Free faces selects 2D mesh elements, which belong to less than two volumes. diff --git a/doc/salome/gui/SMESH/input/sewing_meshes.doc b/doc/salome/gui/SMESH/input/sewing_meshes.doc index 8697b36f4..cfb6206dd 100644 --- a/doc/salome/gui/SMESH/input/sewing_meshes.doc +++ b/doc/salome/gui/SMESH/input/sewing_meshes.doc @@ -32,9 +32,9 @@ the type of sewing operation you would like to perform.
  • This functionality allows you to unite free borders of a 2D mesh. There are two working modes: \a Automatic and \a Manual. In the \b -Automatic mode, the program finds free borders coincident within a +Automatic mode, the program finds free borders coincident within the specified tolerance and sews them. Optionally it is possible to -visually check and correct is necessary the found free borders before +visually check and correct if necessary the found free borders before sewing.
    In the \b Manual mode you are to define borders to sew by picking three nodes of each of two borders. @@ -44,14 +44,14 @@ three nodes of each of two borders. To use \b Automatic sewing:
      -
    • Specify a mesh you want to sew by selecting it or any its part +
    • Specify the mesh you want to sew by selecting it or any its part (group or sub-mesh) in the Object Browser or in the VTK Viewer.
    • -
    • Specify the \b Tolerance within which free borders are considered +
    • Specify the \b Tolerance, within which free borders are considered coincident. At the default zero \b Tolerance, the tolerance used by the search algorithm is defined as one tenth of an average size of - elements adjacent to free borders being compared.
    • + elements adjacent to compared free borders.
    • To visually check the coincident free borders found by the - algorithm, switch off Auto Sewing check-box. Then controls + algorithm, switch off Auto Sewing check-box. The controls to adjust groups of coincident free borders will become available in the dialog.
    • @@ -60,13 +60,13 @@ To use \b Automatic sewing:
    • \b Detect button launches the algorithm of search of coincident free borders.
    • -
    • The found groups of Coincident Free Borders are shown in a - list, a group per a line. Each group has its own color which is used - to display the borders of the group in the VTK Viewer. A free border - within a group is designated by IDs of its first, second and last - nodes within parenthesis. All borders present in the list will be - sewn upon \b Apply.
    • -
    • \b Remove button removes selected groups from the list.
    • +
    • The found groups of Coincident Free Borders are shown in the + list, one group per line. Each group has its own color, which is used + to display the group borders in the VTK Viewer. A free border + within a group is designated by the IDs of its first, second and + last nodes within parenthesis. All borders present in the list will + be sewn upon \b Apply.
    • +
    • \b Remove button removes the selected groups from the list.
    • Select All check-box selects all groups in the list.
    • When a group is selected, its borders appear in Edit Selected Group list that allows you to change this group.
    • @@ -77,12 +77,12 @@ To use \b Automatic sewing: to this border during sewing.
    • \image html remove.png -Remove Border button removes selected borders from the +Remove Border button removes the selected borders from the group. It is active if there are more than two borders in the group.
    • -
    • Selection of a border in the list allows to change its first and +
    • Selection of a border in the list allows changing its first and last nodes whose IDs appear in two fields below the list. \a Arrow - buttons near each field move the corresponding end node by + buttons near each field move the corresponding end node by the number of nodes defined by \b Step field.
    • \image html swap.png @@ -92,7 +92,7 @@ To use \b Automatic sewing:
    For sewing free borders manually you should switch the \b Mode to \b -Manual and define three points on each border: first, second and the +Manual and define three points on each border: the first, the second and the last node: \image html sewing_manual.png @@ -119,7 +119,7 @@ they coincide with the first and the last nodes of the other border. To cope with this, \ref merging_nodes_page "merge" coincident nodes into one beforehand. Two figures below illustrate this approach. -\image html sew_using_merge.png "Merge coincident nodes which are difficult to distinguish" +\image html sew_using_merge.png "Merge coincident nodes, which are difficult to distinguish"
    \image html sew_after_merge.png "After merging nodes it is easy to specify border nodes" From a5a9b778aaaab382d357dc107c161190a13f7b5c Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 29 Oct 2015 19:18:36 +0300 Subject: [PATCH 032/147] IPAL10786: "Edit" is unnecessary functionality for some Mesh hypotheses + Eliminate compilation warnings --- idl/SMESH_Hypothesis.idl | 7 +++ src/SMESHGUI/SMESHGUI.cxx | 2 +- src/SMESHGUI/SMESHGUI_Selection.cxx | 47 ++++++++++++++----- src/SMESHGUI/SMESHGUI_Selection.h | 9 ++-- src/SMESH_I/SMESH_2smeshpy.cxx | 10 ++-- src/SMESH_I/SMESH_2smeshpy.hxx | 2 +- src/SMESH_I/SMESH_Filter_i.cxx | 38 +++++++-------- src/SMESH_I/SMESH_Hypothesis_i.cxx | 13 +++++ src/SMESH_I/SMESH_Hypothesis_i.hxx | 17 ++++--- src/SMESH_I/SMESH_Measurements_i.cxx | 5 +- src/SMESH_I/SMESH_Pattern_i.cxx | 4 +- src/SMESH_I/SMESH_PreMeshInfo.cxx | 4 +- src/SMESH_I/SMESH_subMesh_i.cxx | 2 +- .../StdMeshers_QuadFromMedialAxis_1D2D.cxx | 2 +- .../StdMeshers_FixedPoints1D_i.cxx | 6 +-- .../StdMeshers_ImportSource1D_i.cxx | 8 ++-- .../StdMeshers_ImportSource2D_i.cxx | 8 ++-- .../StdMeshers_LengthFromEdges_i.cxx | 10 ++++ .../StdMeshers_LengthFromEdges_i.hxx | 3 ++ 19 files changed, 128 insertions(+), 69 deletions(-) diff --git a/idl/SMESH_Hypothesis.idl b/idl/SMESH_Hypothesis.idl index 6157618d6..ab6e7dd43 100644 --- a/idl/SMESH_Hypothesis.idl +++ b/idl/SMESH_Hypothesis.idl @@ -87,6 +87,13 @@ module SMESH * Verify whether hypothesis supports given entity type */ boolean IsDimSupported( in Dimension type ); + + /*! + * Return true if a hypothesis has parameters. + * + * This method is intended for GUI to know if "Edit" menu item sould be available + */ + boolean HasParameters(); }; typedef sequence ListOfHypothesisName; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index a465cd3be..b3d61a763 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4353,7 +4353,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& hasGeomReference" ); createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo); + createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp"); createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh + " " + subMesh ); // convert to quadratic diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index fa6f4c386..3d446d96d 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -129,6 +129,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) ); else if ( p=="isPreComputable" ) val = QVariant( isPreComputable( ind ) ); else if ( p=="hasGeomReference" ) val = QVariant( hasGeomReference( ind ) ); + else if ( p=="isEditableHyp" ) val = QVariant( isEditableHyp( ind ) ); else if ( p=="isImported" ) val = QVariant( isImported( ind ) ); else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) ); else if ( p=="groupType" ) val = QVariant( groupType( ind ) ); @@ -495,16 +496,16 @@ int SMESHGUI_Selection::dim( int ind ) const //purpose : return true for a ready-to-compute mesh //======================================================================= -QVariant SMESHGUI_Selection::isComputable( int ind ) const +bool SMESHGUI_Selection::isComputable( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" ) { QMap modeMap; _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); SMESHGUI_PrecomputeOp::getAssignedAlgos( so, modeMap ); - return QVariant( modeMap.size() > 0 ); + return modeMap.size() > 0; } - return QVariant( false ); + return false; } //======================================================================= @@ -512,7 +513,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const //purpose : returns true for a mesh with algorithms //======================================================================= -QVariant SMESHGUI_Selection::isPreComputable( int ind ) const +bool SMESHGUI_Selection::isPreComputable( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" ) { @@ -523,11 +524,11 @@ QVariant SMESHGUI_Selection::isPreComputable( int ind ) const _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap ); if ( modeMap.size() > 1 ) - return QVariant( ( modeMap.contains( SMESH::DIM_3D )) || - ( modeMap.contains( SMESH::DIM_2D ) && maxDim < 1 )); + return (( modeMap.contains( SMESH::DIM_3D )) || + ( modeMap.contains( SMESH::DIM_2D ) && maxDim < 1 )); } } - return QVariant( false ); + return false; } //======================================================================= @@ -535,15 +536,35 @@ QVariant SMESHGUI_Selection::isPreComputable( int ind ) const //purpose : returns true for a mesh or sub-mesh on geometry //======================================================================= -QVariant SMESHGUI_Selection::hasGeomReference( int ind ) const +bool SMESHGUI_Selection::hasGeomReference( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) { _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so ); - return QVariant( !shape->_is_nil() ); + return !shape->_is_nil(); } - return QVariant( false ); + return false; +} + +//======================================================================= +//function : isEditableHyp +//purpose : +//======================================================================= + +bool SMESHGUI_Selection::isEditableHyp( int ind ) const +{ + bool isEditable = true; + if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" ) + { + _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); + SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface( so ); + if ( !hyp->_is_nil() ) + { + isEditable = hyp->HasParameters(); + } + } + return isEditable; } //======================================================================= @@ -551,17 +572,17 @@ QVariant SMESHGUI_Selection::hasGeomReference( int ind ) const //purpose : //======================================================================= -QVariant SMESHGUI_Selection::isVisible( int ind ) const +bool SMESHGUI_Selection::isVisible( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) { SMESH_Actor* actor = SMESH::FindActorByEntry( entry( ind ).toLatin1().data() ); if ( actor && actor->hasIO() ) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() ) - return QVariant( aViewWindow->isVisible( actor->getIO() ) ); + return aViewWindow->isVisible( actor->getIO() ); } } - return QVariant( false ); + return false; } //======================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index de0d0d12f..e3146cad3 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -56,10 +56,11 @@ public: virtual bool isAutoColor( int ) const; virtual int numberOfNodes( int ) const; virtual int dim( int ) const; - virtual QVariant isComputable( int ) const; - virtual QVariant isPreComputable( int ) const; - virtual QVariant hasGeomReference( int ) const; - virtual QVariant isVisible( int ) const; + virtual bool isComputable( int ) const; + virtual bool isPreComputable( int ) const; + virtual bool hasGeomReference( int ) const; + virtual bool isEditableHyp( int ) const; + virtual bool isVisible( int ) const; virtual QString quadratic2DMode( int ) const; diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 3ea0f6acd..2669db47b 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -919,7 +919,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Threshold = SMESH + types[ iGeom ]; #ifdef _DEBUG_ // is types complete? (compilation failure mains that enum GeometryType changed) - int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; + int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1; #endif } if (Type == "SMESH.FT_EntityType") @@ -939,7 +939,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Threshold = SMESH + types[ iGeom ]; #ifdef _DEBUG_ // is types complete? (compilation failure mains that enum EntityType changed) - int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; + int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1; #endif } } @@ -1930,7 +1930,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) TCollection_AsciiString grIDs = theCommand->GetResultValue(); list< _pyID > idList = theCommand->GetStudyEntries( grIDs ); list< _pyID >::iterator grID = idList.begin(); - const int nbGroupsBefore = myGroups.size(); + const size_t nbGroupsBefore = myGroups.size(); Handle(_pyObject) obj; for ( ; grID != idList.end(); ++grID ) { @@ -3133,7 +3133,7 @@ void _pyHypothesis::setCreationArg( const int argNb, const _AString& arg ) { if ( myCurCrMethod ) { - while ( myCurCrMethod->myArgs.size() < argNb ) + while ( (int) myCurCrMethod->myArgs.size() < argNb ) myCurCrMethod->myArgs.push_back( "None" ); if ( arg.IsEmpty() ) myCurCrMethod->myArgs[ argNb-1 ] = "None"; @@ -3200,7 +3200,7 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand) for ( ; type2meth != myAlgoType2CreationMethod.end(); ++type2meth ) { CreationMethod& crMethod = type2meth->second; - while ( crMethod.myArgs.size() < i+1 ) + while ( (int) crMethod.myArgs.size() < i+1 ) crMethod.myArgs.push_back( "[]" ); crMethod.myArgs[ i ] = theCommand->GetArg( 1 ); // arg value } diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index a67e3cbca..ca1f78337 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -115,7 +115,7 @@ class _pyCommand: public Standard_Transient public: _pyCommand() {}; _pyCommand( const _AString& theString, int theNb=-1 ) - : myString( theString ), myOrderNb( theNb ) {}; + : myOrderNb( theNb ), myString( theString ) {}; _AString & GetString() { return myString; } int GetOrderNb() const { return myOrderNb; } void SetOrderNb( int theNb ) { myOrderNb = theNb; } diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 7ceeb904f..36808eed4 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -170,21 +170,21 @@ static TopoDS_Shape getShapeByID (const char* theID) return TopoDS_Shape(); } -static std::string getShapeNameByID (const char* theID) -{ - if ( theID && strlen( theID ) > 0 ) { - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy(); - if ( !aStudy->_is_nil() ) { - SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID); - if ( !aSObj->_is_nil() ) { - CORBA::String_var name = aSObj->GetName(); - return name.in(); - } - } - } - return ""; -} +// static std::string getShapeNameByID (const char* theID) +// { +// if ( theID && strlen( theID ) > 0 ) { +// SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); +// SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy(); +// if ( !aStudy->_is_nil() ) { +// SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID); +// if ( !aSObj->_is_nil() ) { +// CORBA::String_var name = aSObj->GetName(); +// return name.in(); +// } +// } +// } +// return ""; +// } /* FUNCTORS @@ -1830,9 +1830,9 @@ FunctorType EqualTo_i::GetFunctorType() Class : LogicalNOT_i Description : Logical NOT predicate */ -LogicalNOT_i::LogicalNOT_i() -: myPredicate( NULL ), - myLogicalNOTPtr( new Controls::LogicalNOT() ) +LogicalNOT_i::LogicalNOT_i(): + myLogicalNOTPtr( new Controls::LogicalNOT() ), + myPredicate( NULL ) { myFunctorPtr = myPredicatePtr = myLogicalNOTPtr; } @@ -4068,7 +4068,7 @@ static const char** getFunctNames() #ifdef _DEBUG_ // check if functName is complete, compilation failure means that enum FunctorType changed const int nbFunctors = sizeof(functName) / sizeof(const char*); - int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ]; + int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ]; _assert[0]=1; #endif return functName; diff --git a/src/SMESH_I/SMESH_Hypothesis_i.cxx b/src/SMESH_I/SMESH_Hypothesis_i.cxx index 04667edaa..1f0517f3a 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.cxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.cxx @@ -237,6 +237,19 @@ void SMESH_Hypothesis_i::setOldParameters (const char* theParameters) return myBaseImpl; } +//================================================================================ +/*! + * \brief Return true if a hypothesis has parameters + */ +//================================================================================ + +CORBA::Boolean SMESH_Hypothesis_i::HasParameters() +{ + std::ostringstream os; + myBaseImpl->SaveTo( os ); + return ( !os.str().empty() ); +} + //============================================================================= /*! * SMESH_Hypothesis_i::SaveTo diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx index b589fd319..55c1e2779 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx @@ -59,31 +59,34 @@ public: virtual ~SMESH_Hypothesis_i(); // Get type name of hypothesis - char* GetName(); + virtual char* GetName(); // Get plugin library name of hypothesis - char* GetLibName(); + virtual char* GetLibName(); // Set plugin library name of hypothesis void SetLibName( const char* theLibName ); // Get unique id of hypothesis - CORBA::Long GetId(); - + virtual CORBA::Long GetId(); + + // Return true if a hypothesis has parameters + virtual CORBA::Boolean HasParameters(); + // Set the variable parameter (a variable name or a parameter value); \a method is a name // of method setting this parameter. // This method must be called by the hypothesis creator just before calling hyp->method() - void SetVarParameter (const char* parameter, const char* method); + virtual void SetVarParameter (const char* parameter, const char* method); // Return the variable parameter used at Hypothesis Creation by the name of method // setting this parameter. The returned variable name is used at Hypothesis Edition. - char* GetVarParameter (const char* methodName); + virtual char* GetVarParameter (const char* methodName); // Store a hypothesis wrapping this not published one. This hyp, which has // no own parameters but is published, is used to store variables defining parameters // of this hypothesis. This method is to be called before setting parameters // of this hypothesis. - void SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp); + virtual void SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp); //Return true if hypothesis was published in study bool IsPublished(); diff --git a/src/SMESH_I/SMESH_Measurements_i.cxx b/src/SMESH_I/SMESH_Measurements_i.cxx index f078bdc10..b17fc6c4a 100644 --- a/src/SMESH_I/SMESH_Measurements_i.cxx +++ b/src/SMESH_I/SMESH_Measurements_i.cxx @@ -132,7 +132,8 @@ static bool isNodeType (SMESH::array_of_ElementType_var theTypes) return theTypes->length() > 0 && theTypes[0] == SMESH::NODE; } -static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Controls::NumericalFunctorPtr theFunctor) +static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, + SMESH::Controls::NumericalFunctorPtr theFunctor) { double value = 0; @@ -142,7 +143,7 @@ static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Cont theFunctor->SetMesh( aMesh ); SMESH::long_array_var anElementsId = theSource->GetIDs(); - for (int i = 0; i < anElementsId->length(); i++) { + for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) { value += theFunctor->GetValue( anElementsId[i] ); } } diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index f7fcbb493..511433f6f 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -284,7 +284,7 @@ SMESH::point_array* list xyzList; set fset; - for (int i = 0; i < theFacesIDs.length(); i++) + for ( CORBA::ULong i = 0; i < theFacesIDs.length(); i++) { CORBA::Long index = theFacesIDs[i]; const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index); @@ -345,7 +345,7 @@ SMESH::point_array* list xyzList; set vset; - for (int i = 0; i < theVolumesIDs.length(); i++) + for ( CORBA::ULong i = 0; i < theVolumesIDs.length(); i++) { CORBA::Long index = theVolumesIDs[i]; const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index); diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 130330c1c..21fe1513e 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -899,7 +899,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const HDFdataset* aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup ); aDataset->OpenOnDisk(); // read submesh IDs for all elements sorted by ID - int nbElems = aDataset->GetSize(); + size_t nbElems = aDataset->GetSize(); int* smIDs = new int [ nbElems ]; aDataset->ReadFromDisk( smIDs ); aDataset->CloseOnDisk(); @@ -921,7 +921,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const } // add elements to submeshes TIDSortedElemSet::iterator iE = elemSet.begin(); - for ( int i = 0; i < nbElems; ++i, ++iE ) + for ( size_t i = 0; i < nbElems; ++i, ++iE ) { int smID = smIDs[ i ]; if ( smID == 0 ) continue; diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 02c2664f0..ee9117e2c 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -95,7 +95,7 @@ typedef list TListOfSubMeshes; bool getSubMeshes(::SMESH_subMesh* theSubMesh, TListOfSubMeshes& theSubMeshList) { - int size = theSubMeshList.size(); + size_t size = theSubMeshList.size(); SMESH_Mesh* aMesh = theSubMesh->GetFather(); SMESHDS_Mesh* aMeshDS = aMesh->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index 8bf7d6ac2..55e0d19ab 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -551,7 +551,7 @@ namespace allEdges, theShortEdges[ nbBranchPoints > 0 ] )) return false; - for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints ].size(); ++iS ) + for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints > 0 ].size(); ++iS ) shortMap.Add( theShortEdges[ nbBranchPoints ][ iS ]); ++nbBranchPoints; diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx index 2db85387e..580331db5 100644 --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx @@ -137,7 +137,7 @@ SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints() SMESH::double_array_var anArray = new SMESH::double_array; std::vector params = this->GetImpl()->GetPoints(); anArray->length( params.size() ); - for ( CORBA::Long i = 0; i < params.size(); i++) + for ( CORBA::ULong i = 0; i < params.size(); i++) anArray [ i ] = params [ i ]; return anArray._retn(); @@ -158,7 +158,7 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments() SMESH::long_array_var anArray = new SMESH::long_array; std::vector nbsegs = this->GetImpl()->GetNbSegments(); anArray->length( nbsegs.size() ); - for ( CORBA::Long i = 0; i < nbsegs.size(); i++) + for ( CORBA::ULong i = 0; i < nbsegs.size(); i++) anArray [ i ] = nbsegs [ i ]; return anArray._retn(); @@ -252,7 +252,7 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges() SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); anArray->length( ids.size() ); - for ( CORBA::Long i = 0; i < ids.size(); i++) + for ( CORBA::ULong i = 0; i < ids.size(); i++) anArray [ i ] = ids [ i ]; return anArray._retn(); diff --git a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx index 681092fc2..9b6f41db1 100644 --- a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx @@ -91,7 +91,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou std::vector smesh_groups; std::vector entries; SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < groups.length(); ++i ) + for ( CORBA::ULong i = 0; i < groups.length(); ++i ) if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast( groups[i] )) { if ( gp_i->GetType() != SMESH::EDGE ) @@ -109,7 +109,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou _groupEntries = new SMESH::string_array; _groupEntries->length( entries.size ()); - for ( int i = 0; i < entries.size(); ++i ) + for ( size_t i = 0; i < entries.size(); ++i ) _groupEntries[i] = entries[i].c_str(); } catch ( SALOME_Exception& S_ex ) @@ -173,7 +173,7 @@ char* StdMeshers_ImportSource1D_i::SaveTo() os << " " << _groupEntries->length(); SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( size_t i = 0; i < _groupEntries->length(); ++i ) { // entry os << " " << _groupEntries[i]; @@ -208,7 +208,7 @@ void StdMeshers_ImportSource1D_i::LoadFrom( const char* theStream ) _groupEntries = new SMESH::string_array; _groupEntries->length( nbGroups ); std::string id, entry; - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( size_t i = 0; i < _groupEntries->length(); ++i ) { if ( is >> entry ) _groupEntries[i] = entry.c_str(); diff --git a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx index f8305e9c7..051ae469c 100644 --- a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx @@ -90,7 +90,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou std::vector smesh_groups; std::vector entries; SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < groups.length(); ++i ) + for ( CORBA::ULong i = 0; i < groups.length(); ++i ) if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast( groups[i] )) { if ( gp_i->GetType() != SMESH::FACE ) @@ -109,7 +109,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou _groupEntries = new SMESH::string_array; _groupEntries->length( entries.size ()); - for ( int i = 0; i < entries.size(); ++i ) + for ( size_t i = 0; i < entries.size(); ++i ) _groupEntries[i] = entries[i].c_str(); } catch ( SALOME_Exception& S_ex ) @@ -173,7 +173,7 @@ char* StdMeshers_ImportSource2D_i::SaveTo() os << " " << _groupEntries->length(); SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i ) { // entry os << " " << _groupEntries[i]; @@ -210,7 +210,7 @@ void StdMeshers_ImportSource2D_i::LoadFrom( const char* theStream ) _groupEntries = new SMESH::string_array; _groupEntries->length( nbGroups ); std::string id, entry; - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i ) { if ( is >> entry ) _groupEntries[i] = entry.c_str(); diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx index 59e6d7713..da92224e8 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx @@ -105,6 +105,16 @@ CORBA::Long StdMeshers_LengthFromEdges_i::GetMode() return this->GetImpl()->GetMode(); } +//================================================================================ +/*! + * \brief Return false as in SALOME the mode is not used + */ +//================================================================================ + +CORBA::Boolean StdMeshers_LengthFromEdges_i::HasParameters() +{ + return false; +} //============================================================================= /*! diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx index 06f98664f..6e121afc7 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx @@ -59,6 +59,9 @@ public: // Get mode CORBA::Long GetMode(); + // Return false as in SALOME the mode is not used + CORBA::Boolean HasParameters(); + // Get implementation ::StdMeshers_LengthFromEdges* GetImpl(); From c149fe29639b700a4e6708d3f2c4360dcea28e67 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 29 Oct 2015 19:27:29 +0300 Subject: [PATCH 033/147] IPAL52939: SIGSEGV when Compute a mesh with closed VTK Viewer --- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_Utils.cxx | 7 ++++--- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 18 ++++++++++++------ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 6fb07fb4f..23b24c5fe 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -2917,7 +2917,7 @@ void SMESHGUI_MeshInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO myCtrlInfo->showInfo( obj ); myActor = SMESH::FindActorByEntry( IO->getEntry() ); - SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector(); + SVTK_Selector* selector = SMESH::GetSelector(); QString ID; int nb = 0; if ( myActor && selector ) { @@ -3081,7 +3081,7 @@ void SMESHGUI_MeshInfoDlg::modeChanged() */ void SMESHGUI_MeshInfoDlg::idChanged() { - SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector(); + SVTK_Selector* selector = SMESH::GetSelector(); if ( myActor && selector ) { Handle(SALOME_InteractiveObject) IO = myActor->getIO(); TColStd_MapOfInteger ID; diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index f4912f423..351639e89 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -2666,7 +2666,7 @@ void SMESHGUI_MeshOp::onAlgoSetByMeshType( const int theTabIndex, const int theI * \param theIndex - Index of current type of mesh */ //================================================================================ -void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theIndex) +void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theIndex ) { QStringList anAvailableAlgs; QString anCompareType = currentMeshTypeName( theIndex ); @@ -2684,7 +2684,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI anCurrentAvailableAlgo = -1; isNone = currentHyp( dim, Algo ) < 0; //return current algo in current tab and set new algorithm list - HypothesisData* algoCur; + HypothesisData* algoCur = 0; if ( !isNone && !myAvailableHypData[dim][Algo].empty() ) { algoCur = myAvailableHypData[dim][Algo].at( currentHyp( dim, Algo ) ); } diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index 30ddc010b..c8f226708 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -298,9 +298,10 @@ namespace SMESH aPixmap->SetPixMap( pmName ); _PTR(ChildIterator) anIter = aStudy->NewChildIterator(theSObject); - for (int i = 1; anIter->More(); anIter->Next(), i++) { + for ( ; anIter->More(); anIter->Next() ) { _PTR(SObject) aSObj = anIter->Value(); - /*if (i >= 1)*/ { + if ( aSObj->Tag() >= SMESH::Tag_FirstSubMesh ) + { _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj); for ( ; anIter1->More(); anIter1->Next()) { @@ -339,7 +340,7 @@ namespace SMESH else aPixmap->SetPixMap( "ICON_SMESH_TREE_GROUP" ); } - else + else // is it necessary? { if ( !theIsNotModif ) aPixmap->SetPixMap( pmName ); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index ca100fce9..031335ee5 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -773,6 +773,7 @@ namespace SMESH anActor->SetVisibility(false); aStudy->setVisibilityState(theEntry, Qtx::HiddenState); break; + default:; } } else { switch (theAction) { @@ -799,6 +800,7 @@ namespace SMESH } break; } + default:; } } } @@ -808,16 +810,20 @@ namespace SMESH } - bool UpdateView(EDisplaing theAction, const char* theEntry){ + bool UpdateView(EDisplaing theAction, const char* theEntry) { //MESSAGE("UpdateView"); SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() ); SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() ); - SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView(); - return UpdateView(aWnd,theAction,theEntry); + if ( SUIT_ViewManager* vm = app->activeViewManager() ) + { + SUIT_ViewWindow *aWnd = vm->getActiveView(); + return UpdateView(aWnd,theAction,theEntry); + } + return false; } void UpdateView(){ - if(SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()){ + if ( SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()) { LightApp_SelectionMgr* mgr = SMESHGUI::selectionMgr(); SALOME_ListIO selected; mgr->selectedObjects( selected ); @@ -848,7 +854,7 @@ namespace SMESH bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay) { - MESSAGE("Update"); + MESSAGE("Update"); _PTR(Study) aStudy = GetActiveStudyDocument(); CORBA::Long anId = aStudy->StudyId(); if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) { @@ -861,7 +867,7 @@ namespace SMESH bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay) { - MESSAGE("UpdateNulData"); + MESSAGE("UpdateNulData"); _PTR(Study) aStudy = GetActiveStudyDocument(); CORBA::Long anId = aStudy->StudyId(); if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) { From a0487332cf60c3e891943309937167616cff644d Mon Sep 17 00:00:00 2001 From: mkr Date: Mon, 17 Aug 2015 12:12:33 +0300 Subject: [PATCH 034/147] Run tests on Windows platform. --- doc/salome/examples/testme.py | 12 +++++++++++- src/SMESHUtils/SMESH_MeshAlgos.cxx | 2 +- src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/salome/examples/testme.py b/doc/salome/examples/testme.py index 510a408f8..cd74c4495 100755 --- a/doc/salome/examples/testme.py +++ b/doc/salome/examples/testme.py @@ -24,11 +24,21 @@ import unittest, sys, os class SalomeSession(object): def __init__(self, script): import runSalome - sys.argv = ["runSalome.py"] + run_script = "runSalome.py" + if sys.platform == 'win32': + module_dir = os.getenv("KERNEL_ROOT_DIR") + if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script) + pass + sys.argv = [run_script] sys.argv += ["--terminal"] sys.argv += ["--modules=GEOM,MED,SMESH"] sys.argv += ["%s" % script] + if sys.platform == 'win32': + main_module_path = sys.modules['__main__'].__file__ + sys.modules['__main__'].__file__ = '' clt, d = runSalome.main() + if sys.platform == 'win32': + sys.modules['__main__'].__file__ = main_module_path return def __del__(self): diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index a5171703b..e589289e8 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1537,7 +1537,7 @@ SMESH_MeshAlgos::FindFaceInSet(const SMDS_MeshNode* n1, int* n2ind) { - int i1, i2; + int i1 = 0, i2 = 0; const SMDS_MeshElement* face = 0; SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face); diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index 03395bd10..e9aab2b29 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -930,7 +930,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, //cout<<"Angles.Length() = "<= 0 && - groupIndex < myBorders->coincidentGroups.length() ) + groupIndex < (int)myBorders->coincidentGroups.length() ) { const SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ groupIndex ]; @@ -934,7 +935,7 @@ void SMESHGUI_SewingDlg::onRemoveGroupClicked() delete item; if ( myBorderDisplayers[ groupIndex ]) myBorderDisplayers[ groupIndex ]->Hide(); - SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ myCurGroupIndex ]; + SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ groupIndex ]; aGRP.length( 0 ); } myBusy = false; @@ -958,7 +959,7 @@ void SMESHGUI_SewingDlg::showGroup( QListWidgetItem* item ) int groupIndex = item->data( GROUP_INDEX ).toInt(); QColor groupColor = item->data( GROUP_COLOR ).value(); if ( groupIndex >= 0 && - groupIndex < myBorders->coincidentGroups.length() ) + groupIndex < (int)myBorders->coincidentGroups.length() ) { if ( !myBorderDisplayers[ groupIndex ] && SMESH::GetCurrentVtkView()) myBorderDisplayers[ groupIndex ] = new BorderGroupDisplayer( myBorders, groupIndex, groupColor, myMesh ); @@ -984,7 +985,7 @@ bool SMESHGUI_SewingDlg::setCurrentGroup() myCurGroupIndex = selItems[0]->data( GROUP_INDEX ).toInt(); - return ( myCurGroupIndex >= 0 && myCurGroupIndex < myBorders->coincidentGroups.length() ); + return ( myCurGroupIndex >= 0 && myCurGroupIndex < (int)myBorders->coincidentGroups.length() ); } //======================================================================= @@ -1003,7 +1004,7 @@ bool SMESHGUI_SewingDlg::setCurrentPart() myCurPartIndex = ListEdit->currentRow(); const SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ myCurGroupIndex ]; - return ( myCurPartIndex >= 0 && myCurPartIndex < aGRP.length() ); + return ( myCurPartIndex >= 0 && myCurPartIndex < (int)aGRP.length() ); } //======================================================================= @@ -1192,15 +1193,18 @@ void SMESHGUI_SewingDlg::onRemoveElemClicked() SMESH::FreeBordersGroup& aGRP = myBorders->coincidentGroups[ myCurGroupIndex ]; + myBusy = true; QList selItems = ListEdit->selectedItems(); for ( int i = 0; i < selItems.count(); ++i ) { int part = ListEdit->row( selItems[i] ); - for ( ; part + 1 < aGRP.length(); ++part ) + for ( ; part + 1 < (int)aGRP.length(); ++part ) aGRP[ part ] = aGRP[ part + 1 ]; - aGRP.length( aGRP.length() - 1 ); + if ( aGRP.length() > 0 ) + aGRP.length( aGRP.length() - 1 ); delete selItems[i]; } + myBusy = false; if ( aGRP.length() == 0 ) onRemoveGroupClicked(); @@ -1944,6 +1948,7 @@ void SMESHGUI_SewingDlg::BorderGroupDisplayer::getPartEnds( int p std::vector & ids, std::list& coords) { + if ( partIndex >= (int)myGroup.length() ) return; const SMESH::FreeBorderPart& aPART = myGroup [ partIndex ]; const SMESH::FreeBorder& aBRD = myBorders[ aPART.border ]; From 7b33b10e89859b5599e5d4819b87a183b64ea42c Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 11 Nov 2015 16:13:01 +0300 Subject: [PATCH 036/147] 52943: "Apply and Close" button does not active on symmetry dialog box Fix same pb in all similar dlg --- src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx | 12 ++++++++ src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx | 16 +++++------ src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 10 +++++++ src/SMESHGUI/SMESHGUI_ScaleDlg.cxx | 11 ++++++++ src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 4 ++- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 31 +++++++++++++++------ src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 18 ++++++++++-- 8 files changed, 83 insertions(+), 21 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index 9f85f5c27..35611dfe5 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -494,6 +494,9 @@ void SMESHGUI_CopyMeshDlg::onTextChange (const QString& theNewText) void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active + if (!GroupButtons->isEnabled()) return; // inactive + BusyLocker lock( myBusy ); // clear @@ -677,6 +680,15 @@ void SMESHGUI_CopyMeshDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMesh->NbEdges() ) types << SMESH::EDGE; + if ( myMesh->NbFaces() ) types << SMESH::FACE; + if ( myMesh->NbVolumes() ) types << SMESH::VOLUME; + if ( myMesh->NbBalls() ) types << SMESH::BALL; + if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMesh ); myFilterDlg->SetSourceWg( myLineEditElements ); diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index 199bdf420..1767a2805 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -299,14 +299,14 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() myDlg->selectObject( names, types, ids ); // enable/desable "new mesh" button - bool isMesh = true; // EAP - it's sometimes necessary to copy to a new mesh - // for ( int i = 0; i < ids.count() && isMesh; ++i ) - // { - // _PTR(SObject) sobj = - // SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); - // mySrcMesh = SMESH::SObjectToInterface( sobj ); - // isMesh = !mySrcMesh->_is_nil(); - // } + bool isMesh = true; + for ( int i = 0; i < ids.count() && isMesh; ++i ) + { + _PTR(SObject) sobj = + SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); + mySrcMesh = SMESH::SObjectToInterface( sobj ); + //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh + } myDlg->setNewMeshEnabled( isMesh ); } catch ( const SALOME::SALOME_Exception& S_ex ) { diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index a8cdcb1ea..1ebfd0622 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -377,7 +377,7 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText) void SMESHGUI_RemoveElementsDlg::SelectionIntoArgument() { if (myBusy) return; // busy - if (myFilterDlg && myFilterDlg->isVisible()) return; // filter digl active + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active if (!GroupButtons->isEnabled()) return; // inactive // clear diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 9531609ab..1ed6e0a79 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -677,6 +677,7 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText) void SMESHGUI_RotationDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active // clear myActor = 0; @@ -1064,6 +1065,15 @@ void SMESHGUI_RotationDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index 1e712f0a3..8f4ab6993 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -715,6 +715,8 @@ void SMESHGUI_ScaleDlg::onTextChange (const QString& theNewText) void SMESHGUI_ScaleDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active + BusyLocker lock( myBusy ); // clear myActor = 0; @@ -1112,6 +1114,15 @@ void SMESHGUI_ScaleDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 30c98a6aa..e272d010c 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -566,6 +566,7 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText) void SMESHGUI_SmoothingDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active // clear QString aString = ""; @@ -574,7 +575,8 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument() BusyLocker lock( myBusy ); if (myEditCurrentArgument == LineEditElements || - myEditCurrentArgument == LineEditNodes) { + myEditCurrentArgument == LineEditNodes) + { myEditCurrentArgument->setText(aString); if (myEditCurrentArgument == LineEditElements) { myNbOkElements = 0; diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 1b484b5b3..eebc605df 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -736,6 +736,7 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText) void SMESHGUI_SymmetryDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active // clear myActor = 0; @@ -1134,6 +1135,15 @@ void SMESHGUI_SymmetryDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); @@ -1173,10 +1183,13 @@ bool SMESHGUI_SymmetryDlg::isValid() // function : onDisplaySimulation // purpose : Show/Hide preview //================================================================================= -void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { - if (myPreviewCheckBox->isChecked() && toDisplayPreview) { - if ( myNbOkElements && isValid() && IsMirrorOk() ) { - QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); +void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) +{ + if (myPreviewCheckBox->isChecked() && toDisplayPreview) + { + if ( myNbOkElements && isValid() && IsMirrorOk() ) + { + QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); SMESH::long_array_var anElementsId = new SMESH::long_array; anElementsId->length(aListElementsId.count()); @@ -1185,7 +1198,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { SMESH::AxisStruct aMirror; SMESH::SMESH_MeshEditor::MirrorType aMirrorType; - + getMirror(aMirror,aMirrorType); try { @@ -1201,7 +1214,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer(); - aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy ); + aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy ); aMeshPreviewStruct << aMeshEditor->GetPreviewData(); } setSimulationPreview(aMeshPreviewStruct); @@ -1210,7 +1223,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { } } else { hidePreview(); - } + } } else { hidePreview(); } @@ -1220,7 +1233,9 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { // function : getMirror // purpose : return mirror parameters //================================================================================= -void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror, SMESH::SMESH_MeshEditor::MirrorType& theMirrorType) { +void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror, + SMESH::SMESH_MeshEditor::MirrorType& theMirrorType) +{ theMirror.x = SpinBox_X->GetValue(); theMirror.y = SpinBox_Y->GetValue(); theMirror.z = SpinBox_Z->GetValue(); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 32c94694a..5d1c66901 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -745,6 +745,8 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) void SMESHGUI_TranslationDlg::SelectionIntoArgument() { if (myBusy) return; + if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active + BusyLocker lock( myBusy ); // clear myActor = 0; @@ -1106,6 +1108,15 @@ void SMESHGUI_TranslationDlg::setFilters() if ( !myFilterDlg ) myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + QList types; + if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; + if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE; + if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME; + if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL; + if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); myFilterDlg->SetSelection(); myFilterDlg->SetMesh( myMeshes[0] ); myFilterDlg->SetSourceWg( LineEditElements ); @@ -1147,9 +1158,10 @@ bool SMESHGUI_TranslationDlg::isValid() //================================================================================= void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) { - if (myPreviewCheckBox->isChecked() && toDisplayPreview) { - - if (isValid() && myNbOkElements) { + if (myPreviewCheckBox->isChecked() && toDisplayPreview) + { + if (isValid() && myNbOkElements) + { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); SMESH::long_array_var anElementsId = new SMESH::long_array; From 7a7d7e6e48067265c3c05f5063ffb934d9056b74 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 12 Nov 2015 14:46:55 +0300 Subject: [PATCH 037/147] IPAL52943: "Apply and Close" button does not active on symmetry dialog box Enable work with not shown meshes --- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 68 ++++++++----- src/SMESHGUI/SMESHGUI_RotationDlg.h | 1 + src/SMESHGUI/SMESHGUI_ScaleDlg.cxx | 120 +++++++++-------------- src/SMESHGUI/SMESHGUI_ScaleDlg.h | 1 + src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 92 +++++++++-------- src/SMESHGUI/SMESHGUI_SymmetryDlg.h | 1 + src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 82 ++++++++++------ src/SMESHGUI/SMESHGUI_TranslationDlg.h | 1 + 8 files changed, 198 insertions(+), 168 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 1ed6e0a79..81568b57d 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -706,34 +706,35 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument() int aNbUnits = 0; - if (myEditCurrentArgument == (QWidget*)LineEditElements) { + if (myEditCurrentArgument == (QWidget*)LineEditElements) + { myElementsId = ""; myObjects.clear(); myObjectsNames.clear(); myMeshes.clear(); - for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { + for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) + { Handle(SALOME_InteractiveObject) IO = it.Value(); SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO ); if ( aMesh->_is_nil() ) return; - + myActor = SMESH::FindActorByObject( aMesh ); if ( !myActor ) myActor = SMESH::FindActorByEntry( IO->getEntry() ); - if ( !myActor && !CheckBoxMesh->isChecked() ) - return; - - if ( !SMESH::IObjectToInterface( IO )->_is_nil() ) { - if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) { - _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) ); - _PTR(GenericAttribute) anAttr; - if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) { - _PTR(AttributeName) aNameAttr( anAttr ); - myObjects << SMESH::IObjectToInterface( IO ); - myObjectsNames << aNameAttr->Value().c_str(); - myMeshes << aMesh; - } + // if ( !myActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter + // return; + + SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface( IO ); + if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc )) + { + std::string name = obj->GetName(); + if ( !name.empty() ) + { + myObjects << idSrc; + myObjectsNames << name.c_str(); + myMeshes << aMesh; } } } @@ -749,11 +750,11 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument() else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) { MakeGroupsCheck->setEnabled(true); } - if (CheckBoxMesh->isChecked()) { - SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); + if (CheckBoxMesh->isChecked()) { if ( myMeshes.isEmpty() ) return; + SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); } else { aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aList.First(), aString); @@ -764,15 +765,13 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument() myNbOkElements = true; - } else { + } + else // set coordinates by picked nodes + { Handle(SALOME_InteractiveObject) IO = aList.First(); - if ((SMESH::GetMeshByIO(IO))->_is_nil()) - return; - SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO)); + SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() ); if (!anActor) - anActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!anActor && !CheckBoxMesh->isChecked()) return; aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); @@ -1062,8 +1061,10 @@ void SMESHGUI_RotationDlg::setFilters() tr("NO_MESH_SELECTED")); return; } - if ( !myFilterDlg ) + if ( !myFilterDlg ) { myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted())); + } QList types; if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; @@ -1081,6 +1082,23 @@ void SMESHGUI_RotationDlg::setFilters() myFilterDlg->show(); } +//======================================================================= +// name : onFilterAccepted() +// Purpose : SLOT. Called when Filter dlg closed with OK button. +// Activate [Apply] if no Actor is available +//======================================================================= +void SMESHGUI_RotationDlg::onFilterAccepted() +{ + if ( myMeshes.length() > 0 && !buttonOk->isEnabled() ) + { + myElementsId = LineEditElements->text(); + QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); + myNbOkElements = aListElementsId.count(); + buttonOk->setEnabled( myNbOkElements ); + buttonApply->setEnabled( myNbOkElements ); + } +} + //================================================================================= // function : isValid // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.h b/src/SMESHGUI/SMESHGUI_RotationDlg.h index 8b4be67e6..736bafb59 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.h +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.h @@ -135,6 +135,7 @@ private: protected slots: virtual void onDisplaySimulation( bool ); virtual void reject(); + void onFilterAccepted(); private slots: void ClickOnOk(); diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index 8f4ab6993..2248ac60e 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -743,38 +743,39 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument() int aNbUnits = 0; - if (myEditCurrentArgument == (QWidget*)LineEditElements) { + if (myEditCurrentArgument == (QWidget*)LineEditElements) + { myElementsId = ""; myObjects.clear(); myObjectsNames.clear(); myMeshes.clear(); - for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { + for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) + { Handle(SALOME_InteractiveObject) IO = it.Value(); SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO ); if ( aMesh->_is_nil() ) return; - + myActor = SMESH::FindActorByObject( aMesh ); if ( !myActor ) myActor = SMESH::FindActorByEntry( IO->getEntry() ); - if ( !myActor && !CheckBoxMesh->isChecked() ) - return; + // if ( !myActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter + // return; - if ( !SMESH::IObjectToInterface( IO )->_is_nil() ) { - if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) { - _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) ); - _PTR(GenericAttribute) anAttr; - if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) { - _PTR(AttributeName) aNameAttr( anAttr ); - myObjects << SMESH::IObjectToInterface( IO ); - myObjectsNames << aNameAttr->Value().c_str(); - myMeshes << aMesh; - } + SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface( IO ); + if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc )) + { + std::string name = obj->GetName(); + if ( !name.empty() ) + { + myObjects << idSrc; + myObjectsNames << name.c_str(); + myMeshes << aMesh; } } } - + // MakeGroups is available if there are groups and "Copy" int aNbGroups = 0; for ( int i = 0; i < myMeshes.count(); i++ ) @@ -789,50 +790,11 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument() } if (CheckBoxMesh->isChecked()) { - SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString ); if (myMeshes.isEmpty()) return; - // get IDs from mesh - /* - SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh(); - if (!aSMDSMesh) - return; - - for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) { - const SMDS_MeshElement * e = aSMDSMesh->FindElement(i); - if (e) { - myElementsId += QString(" %1").arg(i); - aNbUnits++; - } - } - } else if (!SMESH::IObjectToInterface(IO)->_is_nil()) { //SUBMESH - // get submesh - SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(IO); - - // get IDs from submesh - SMESH::long_array_var anElementsIds = new SMESH::long_array; - anElementsIds = aSubMesh->GetElementsId(); - for (int i = 0; i < anElementsIds->length(); i++) { - myElementsId += QString(" %1").arg(anElementsIds[i]); - } - aNbUnits = anElementsIds->length(); - } else { // GROUP - // get smesh group - SMESH::SMESH_GroupBase_var aGroup = - SMESH::IObjectToInterface(IO); - if (aGroup->_is_nil()) - return; - - // get IDs from smesh group - SMESH::long_array_var anElementsIds = new SMESH::long_array; - anElementsIds = aGroup->GetListOfID(); - for (int i = 0; i < anElementsIds->length(); i++) { - myElementsId += QString(" %1").arg(anElementsIds[i]); - } - aNbUnits = anElementsIds->length(); - } - */ - } else { + SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString ); + } + else { aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aList.First(), aString); myElementsId = aString; if (aNbUnits < 1) @@ -840,15 +802,14 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument() } myNbOkElements = true; - } else { - Handle(SALOME_InteractiveObject) IO = aList.First(); - if ((SMESH::GetMeshByIO(IO))->_is_nil()) - return; - SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO)); + } + else // set coordinates by a picked node + { + Handle(SALOME_InteractiveObject) IO = aList.First(); + + SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() ); if (!anActor) - anActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!anActor && !CheckBoxMesh->isChecked()) return; aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); @@ -1105,14 +1066,14 @@ void SMESHGUI_ScaleDlg::keyPressEvent( QKeyEvent* e ) //================================================================================= void SMESHGUI_ScaleDlg::setFilters() { - if(myMeshes.isEmpty()) { - SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); - return; + if ( myMeshes.isEmpty() ) { + SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED")); + return; } - if ( !myFilterDlg ) + if ( !myFilterDlg ) { myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted())); + } QList types; if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; @@ -1130,6 +1091,23 @@ void SMESHGUI_ScaleDlg::setFilters() myFilterDlg->show(); } +//======================================================================= +// name : onFilterAccepted() +// Purpose : SLOT. Called when Filter dlg closed with OK button. +// Activate [Apply] if no Actor is available +//======================================================================= +void SMESHGUI_ScaleDlg::onFilterAccepted() +{ + if ( myMeshes.length() > 0 && !buttonOk->isEnabled() ) + { + myElementsId = LineEditElements->text(); + QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); + myNbOkElements = aListElementsId.count(); + buttonOk->setEnabled ( myNbOkElements ); + buttonApply->setEnabled( myNbOkElements ); + } +} + //================================================================================= // function : isValid // purpose : diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.h b/src/SMESHGUI/SMESHGUI_ScaleDlg.h index a7a15d6ba..bdd285b28 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.h +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.h @@ -131,6 +131,7 @@ private: protected slots: virtual void onDisplaySimulation( bool ); virtual void reject(); + void onFilterAccepted(); private slots: void ConstructorsClicked( int ); diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index eebc605df..d5c5d473d 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -765,44 +765,44 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument() int aNbUnits = 0; - if (myEditCurrentArgument == (QWidget*)LineEditElements) { + if (myEditCurrentArgument == (QWidget*)LineEditElements) + { myElementsId = ""; myObjects.clear(); myObjectsNames.clear(); myMeshes.clear(); - for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { + for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) + { Handle(SALOME_InteractiveObject) IO = it.Value(); - SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO ); - if( aMesh->_is_nil() ) - return; + if ( aMesh->_is_nil() ) + continue; myActor = SMESH::FindActorByObject( aMesh ); if ( !myActor ) myActor = SMESH::FindActorByEntry( IO->getEntry() ); - if ( !myActor && !CheckBoxMesh->isChecked() ) - return; + // if ( !myActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter + // return; - if ( !SMESH::IObjectToInterface( IO )->_is_nil() ) { - if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) { - _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) ); - _PTR(GenericAttribute) anAttr; - if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) { - _PTR(AttributeName) aNameAttr( anAttr ); - myObjects << SMESH::IObjectToInterface( IO ); - myObjectsNames << aNameAttr->Value().c_str(); - myMeshes << aMesh; - } + SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface( IO ); + if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc )) + { + std::string name = obj->GetName(); + if ( !name.empty() ) + { + myObjects << idSrc; + myObjectsNames << name.c_str(); + myMeshes << aMesh; } } } // MakeGroups is available if there are groups and "Copy" - int aNbGroups = 0; - for ( int i = 0; i < myMeshes.count(); i++ ) - aNbGroups += myMeshes[i]->NbGroups(); - + int aNbGroups = 0; + for ( int i = 0; i < myMeshes.count(); i++ ) + aNbGroups += myMeshes[i]->NbGroups(); + if ( aNbGroups == 0 ) { MakeGroupsCheck->setChecked(false); MakeGroupsCheck->setEnabled(false); @@ -810,31 +810,26 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument() else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) { MakeGroupsCheck->setEnabled(true); } - if (CheckBoxMesh->isChecked()) { - SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); + if (CheckBoxMesh->isChecked()) { if ( myObjects.isEmpty() ) return; - // get IDs from mesh - // get IDs from submesh - // get IDs from smesh group - } else { + SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); + } + else { aNbUnits = SMESH::GetNameOfSelectedElements( mySelector, aList.First(), aString); myElementsId = aString; if (aNbUnits < 1) return; } - myNbOkElements = true; - } else { + } + else // set coordinates by a picked node + { Handle(SALOME_InteractiveObject) IO = aList.First(); - if ((SMESH::GetMeshByIO(IO))->_is_nil()) - return; - SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO)); + SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() ); if (!anActor) - anActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!anActor && !CheckBoxMesh->isChecked()) return; aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); @@ -1126,14 +1121,14 @@ void SMESHGUI_SymmetryDlg::keyPressEvent( QKeyEvent* e ) //================================================================================= void SMESHGUI_SymmetryDlg::setFilters() { - if(myMeshes.isEmpty()) { - SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); - return; + if ( myMeshes.isEmpty() ) { + SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED")); + return; } - if ( !myFilterDlg ) + if ( !myFilterDlg ) { myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted())); + } QList types; if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; @@ -1151,6 +1146,23 @@ void SMESHGUI_SymmetryDlg::setFilters() myFilterDlg->show(); } +//======================================================================= +// name : onFilterAccepted() +// Purpose : SLOT. Called when Filter dlg closed with OK button. +// Activate [Apply] if no Actor is available +//======================================================================= +void SMESHGUI_SymmetryDlg::onFilterAccepted() +{ + if ( myMeshes.length() > 0 && !buttonOk->isEnabled() ) + { + myElementsId = LineEditElements->text(); + QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); + myNbOkElements = aListElementsId.count(); + buttonOk->setEnabled( myNbOkElements ); + buttonApply->setEnabled( myNbOkElements ); + } +} + //================================================================================= // function : isValid // purpose : diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h index 1727b59f3..c7845dcf6 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h @@ -139,6 +139,7 @@ private: protected slots: virtual void onDisplaySimulation( bool ); virtual void reject(); + void onFilterAccepted(); private slots: void ConstructorsClicked( int ); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 5d1c66901..be53d01e4 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -772,13 +772,15 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() return; int aNbUnits = 0; - if (myEditCurrentArgument == (QWidget*)LineEditElements) { + if (myEditCurrentArgument == (QWidget*)LineEditElements) + { myElementsId = ""; myObjects.clear(); myObjectsNames.clear(); myMeshes.clear(); - for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { + for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) + { Handle(SALOME_InteractiveObject) IO = it.Value(); SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO ); if ( aMesh->_is_nil() ) @@ -788,25 +790,24 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() if ( !anActor ) anActor = SMESH::FindActorByEntry( IO->getEntry() ); - if ( !anActor && !CheckBoxMesh->isChecked() ) - return; + // if ( !anActor && !CheckBoxMesh->isChecked() ) -- elems can be selected by Filter + // return; - if ( !SMESH::IObjectToInterface( IO )->_is_nil() ) { - if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) { - _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) ); - _PTR(GenericAttribute) anAttr; - if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) { - _PTR(AttributeName) aNameAttr( anAttr ); - myObjects << SMESH::IObjectToInterface( IO ); - myObjectsNames << aNameAttr->Value().c_str(); - myMeshes << aMesh; - } + SMESH::SMESH_IDSource_var idSrc = SMESH::IObjectToInterface( IO ); + if ( _PTR(SObject) obj = SMESH::FindSObject( idSrc )) + { + std::string name = obj->GetName(); + if ( !name.empty() ) + { + myObjects << idSrc; + myObjectsNames << name.c_str(); + myMeshes << aMesh; } } - - myActor = anActor; + if ( anActor ) + myActor = anActor; } - + // MakeGroups is available if there are groups and "Copy" int aNbGroups = 0; for ( int i = 0; i < myMeshes.count(); i++ ) @@ -821,10 +822,11 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() } if (CheckBoxMesh->isChecked()) { - SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString ); if (myMeshes.isEmpty()) return; - } else { + SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString ); + } + else { aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aList.First(), aString); myElementsId = aString; if (aNbUnits < 1) @@ -832,16 +834,15 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() } myNbOkElements = true; - } else { + } + else // set coordinates by a picked node + { Handle(SALOME_InteractiveObject) IO = aList.First(); - if ((SMESH::GetMeshByIO(IO))->_is_nil()) + + SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() ); + if (!anActor) return; - SMESH_Actor* anActor = SMESH::FindActorByObject(SMESH::GetMeshByIO(IO)); - if (!anActor) - anActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!anActor && !CheckBoxMesh->isChecked()) - return; aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); if (aNbUnits != 1) return; @@ -1099,14 +1100,14 @@ void SMESHGUI_TranslationDlg::keyPressEvent( QKeyEvent* e ) //================================================================================= void SMESHGUI_TranslationDlg::setFilters() { - if(myMeshes.isEmpty()) { - SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); - return; + if ( myMeshes.isEmpty() ) { + SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), tr("NO_MESH_SELECTED")); + return; } - if ( !myFilterDlg ) + if ( !myFilterDlg ) { myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + connect(myFilterDlg, SIGNAL(Accepted()), SLOT(onFilterAccepted())); + } QList types; if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE; @@ -1124,6 +1125,23 @@ void SMESHGUI_TranslationDlg::setFilters() myFilterDlg->show(); } +//======================================================================= +// name : onFilterAccepted() +// Purpose : SLOT. Called when Filter dlg closed with OK button. +// Activate [Apply] if no Actor is available +//======================================================================= +void SMESHGUI_TranslationDlg::onFilterAccepted() +{ + if ( myMeshes.length() > 0 && !buttonOk->isEnabled() ) + { + myElementsId = LineEditElements->text(); + QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); + myNbOkElements = aListElementsId.count(); + buttonOk->setEnabled( myNbOkElements ); + buttonApply->setEnabled( myNbOkElements ); + } +} + //================================================================================= // function : isValid // purpose : diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.h b/src/SMESHGUI/SMESHGUI_TranslationDlg.h index f625c61f4..cfd801c7a 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.h +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.h @@ -133,6 +133,7 @@ private: protected slots: virtual void onDisplaySimulation( bool ); virtual void reject(); + void onFilterAccepted(); private slots: void ConstructorsClicked( int ); From 70e7642a8cdf2191e246458ec5f8294a6ced6344 Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 17 Nov 2015 17:37:11 +0300 Subject: [PATCH 038/147] INT PAL 0052968: 'Mesh Information' dialog shows incorrect color of group built from geometry. --- src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx index 258084e05..deeaad22f 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx @@ -30,6 +30,7 @@ #include "SMESHGUI.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_GEOMGenUtils.h" +#include #include #include @@ -350,9 +351,17 @@ bool SMESHGUI_GroupOnShapeOp::onApply() //printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() ); group = mesh->CreateGroupFromGEOM( elemType, name.toLatin1().data(), geom ); - if( !group->_is_nil() ) + if( !group->_is_nil() ) { + // set default color for created group + QColor c = SMESH::GetColor( "SMESH", "default_grp_color" ); + SALOMEDS::Color aColor; + aColor.R = c.redF(); + aColor.G = c.greenF(); + aColor.B = c.blueF(); + group->SetColor(aColor); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) ) anEntryList.append( aSObject->GetID().c_str() ); + } } } SMESHGUI::Modified(); From 831ca6c828271732e46fba73b196d423482535ae Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Nov 2015 14:29:23 +0300 Subject: [PATCH 039/147] IPAL52980: Wire Discretization with Table density fails (StdMeshers_Regular_1D.cxx) + Compilation warnings + WIN specific errors (StdMeshers_Adaptive1D.cxx) --- doc/salome/examples/filters_ex36.py | 16 +- doc/salome/gui/SMESH/input/about_meshes.doc | 6 +- doc/salome/gui/SMESH/input/tui_filters.doc | 6 +- src/Controls/SMESH_Controls.cxx | 325 +-- src/Controls/SMESH_ControlsDef.hxx | 2 +- src/DriverGMF/DriverGMF_Read.cxx | 2 +- src/DriverGMF/DriverGMF_Write.cxx | 12 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 21 +- src/SMESH/SMESH_Mesh.cxx | 2 + src/SMESH/SMESH_MeshEditor.cxx | 1969 ++++++++--------- src/SMESH/SMESH_MeshEditor.hxx | 2 +- src/SMESH/SMESH_MesherHelper.cxx | 70 +- src/SMESH/SMESH_Pattern.cxx | 28 +- src/SMESHClient/SMESH_Client.cxx | 44 +- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 12 +- src/SMESHUtils/SMESH_Block.cxx | 4 +- src/SMESHUtils/SMESH_FreeBorders.cxx | 15 +- src/SMESHUtils/SMESH_MeshAlgos.cxx | 16 +- src/SMESHUtils/SMESH_OctreeNode.cxx | 4 +- src/SMESHUtils/SMESH_TypeDefs.hxx | 15 +- src/SMESH_I/SMESH_DumpPython.cxx | 10 +- src/SMESH_I/SMESH_Gen_i.cxx | 163 +- src/SMESH_I/SMESH_Gen_i_1.cxx | 6 +- src/StdMeshers/CMakeLists.txt | 1 + src/StdMeshers/StdMeshers_Adaptive1D.cxx | 33 +- .../StdMeshers_CartesianParameters3D.cxx | 6 +- src/StdMeshers/StdMeshers_Cartesian_3D.cxx | 4 +- .../StdMeshers_CompositeHexa_3D.cxx | 6 +- .../StdMeshers_CompositeSegment_1D.cxx | 32 +- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 4 +- src/StdMeshers/StdMeshers_ImportSource.cxx | 10 +- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 39 +- src/StdMeshers/StdMeshers_Projection_2D.cxx | 13 +- .../StdMeshers_QuadToTriaAdaptor.cxx | 29 +- src/StdMeshers/StdMeshers_RadialPrism_3D.cxx | 1 - src/StdMeshers/StdMeshers_Regular_1D.cxx | 30 +- .../StdMeshers_NumberOfSegments_i.cxx | 24 +- 37 files changed, 1508 insertions(+), 1474 deletions(-) diff --git a/doc/salome/examples/filters_ex36.py b/doc/salome/examples/filters_ex36.py index 3dc8e4fc6..ec1e2b4fb 100644 --- a/doc/salome/examples/filters_ex36.py +++ b/doc/salome/examples/filters_ex36.py @@ -1,13 +1,17 @@ -# Combine filters with Criterion structures using of "criteria". +# Combine several criteria into a filter # create mesh from SMESH_mechanic import * + # get all the quadrangle faces ... criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_QUADRANGLE, SMESH.FT_LogicalAND) -# ... AND do NOT get those from sub_face3 +# ... but those from sub_face3 criterion2 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGeom, sub_face3, SMESH.FT_LogicalNOT) -filter = smesh.CreateFilterManager().CreateFilter() -filter.SetCriteria([criterion1,criterion2]) -ids = mesh.GetIdsFromFilter(filter) -myGroup = mesh.MakeGroupByIds("Quads_on_cylindrical_faces",SMESH.FACE,ids) +quadFilter = smesh.GetFilterFromCriteria([criterion1,criterion2]) + +# get faces satisfying the criteria +ids = mesh.GetIdsFromFilter(quadFilter) + +# create a group of faces satisfying the criteria +myGroup = mesh.GroupOnFilter(SMESH.FACE,"Quads_on_cylindrical_faces",quadFilter) diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc index 80266cada..58ffb8340 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.doc +++ b/doc/salome/gui/SMESH/input/about_meshes.doc @@ -10,7 +10,7 @@ Mesh module provides several ways to create the mesh:
  • The main way is to \subpage constructing_meshes_page "construct the mesh" on the basis of the geometrical shape produced in the Geometry module. This way implies selection of - - a geometrical object ( main shape) and + - a geometrical object (main shape) and - meshing parameters (\ref basic_meshing_algos_page "meshing algorithms" and characteristics (e.g. element size) of a @@ -19,7 +19,7 @@ Mesh module provides several ways to create the mesh: Construction of \subpage constructing_submeshes_page "sub-meshes" allows to discretize some sub-shapes of the main shape, for example a face, - using the meshing parameters that differ from those for other sub-shapes.
    + using the meshing parameters that differ from those used for other sub-shapes.
    Meshing parameters of meshes and sub-meshes can be \subpage editing_meshes_page "edited". (Upon edition only mesh entities generated using changed meshing parameters are removed and will be @@ -39,7 +39,7 @@ Mesh module provides several ways to create the mesh: (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and SAUVE formats.
  • -
  • The 3D mesh can be generated from the 2D mesh, \ref +
  • The 3D mesh can be generated from the 2D mesh, which was \ref importing_exporting_meshes_page "imported" or manually created. To setup the meshing parameters of a mesh not based on a geometry, just invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on diff --git a/doc/salome/gui/SMESH/input/tui_filters.doc b/doc/salome/gui/SMESH/input/tui_filters.doc index 66cd3135d..cfe65fff5 100755 --- a/doc/salome/gui/SMESH/input/tui_filters.doc +++ b/doc/salome/gui/SMESH/input/tui_filters.doc @@ -10,7 +10,7 @@ or edit mesh groups, remove elements from the mesh object, control mesh quality by different parameters, etc. Several filtering criteria can be combined together by using logical -operators \a AND and \a OR. In addition, applied filter criterion can +operators \a AND and \a OR. In addition, a filtering criterion can be reverted using logical operator \a NOT. Mesh filters can use the functionality of mesh quality controls to filter @@ -416,9 +416,9 @@ entity type. \tui_script{filters_ex35.py} -\section combining_filters How to combine filters with Criterion structures? +\section combining_filters How to combine several criteria into a filter? -Filters can be combined by making use of "criteria". +Several criteria can be combined into a filter. Example : diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 769096df4..9978a6d68 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -521,148 +522,164 @@ double MaxElementLength3D::GetValue( long theElementId ) if( GetPoints( theElementId, P ) ) { double aVal = 0; const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId ); - SMDSAbs_ElementType aType = aElem->GetType(); + SMDSAbs_EntityType aType = aElem->GetEntityType(); int len = P.size(); - switch( aType ) { - case SMDSAbs_Volume: - if( len == 4 ) { // tetras - double L1 = getDistance(P( 1 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 1 )); - double L4 = getDistance(P( 1 ),P( 4 )); - double L5 = getDistance(P( 2 ),P( 4 )); - double L6 = getDistance(P( 3 ),P( 4 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - break; - } - else if( len == 5 ) { // pyramids - double L1 = getDistance(P( 1 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 4 )); - double L4 = getDistance(P( 4 ),P( 1 )); - double L5 = getDistance(P( 1 ),P( 5 )); - double L6 = getDistance(P( 2 ),P( 5 )); - double L7 = getDistance(P( 3 ),P( 5 )); - double L8 = getDistance(P( 4 ),P( 5 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - aVal = Max(aVal,Max(L7,L8)); - break; - } - else if( len == 6 ) { // pentas - double L1 = getDistance(P( 1 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 1 )); - double L4 = getDistance(P( 4 ),P( 5 )); - double L5 = getDistance(P( 5 ),P( 6 )); - double L6 = getDistance(P( 6 ),P( 4 )); - double L7 = getDistance(P( 1 ),P( 4 )); - double L8 = getDistance(P( 2 ),P( 5 )); - double L9 = getDistance(P( 3 ),P( 6 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - aVal = Max(aVal,Max(Max(L7,L8),L9)); - break; - } - else if( len == 8 ) { // hexas - double L1 = getDistance(P( 1 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 4 )); - double L4 = getDistance(P( 4 ),P( 1 )); - double L5 = getDistance(P( 5 ),P( 6 )); - double L6 = getDistance(P( 6 ),P( 7 )); - double L7 = getDistance(P( 7 ),P( 8 )); - double L8 = getDistance(P( 8 ),P( 5 )); - double L9 = getDistance(P( 1 ),P( 5 )); - double L10= getDistance(P( 2 ),P( 6 )); - double L11= getDistance(P( 3 ),P( 7 )); - double L12= getDistance(P( 4 ),P( 8 )); - double D1 = getDistance(P( 1 ),P( 7 )); - double D2 = getDistance(P( 2 ),P( 8 )); - double D3 = getDistance(P( 3 ),P( 5 )); - double D4 = getDistance(P( 4 ),P( 6 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10))); - aVal = Max(aVal,Max(L11,L12)); - aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4))); - break; - } - else if( len == 12 ) { // hexagonal prism - for ( int i1 = 1; i1 < 12; ++i1 ) - for ( int i2 = i1+1; i1 <= 12; ++i1 ) - aVal = Max( aVal, getDistance(P( i1 ),P( i2 ))); - break; - } - else if( len == 10 ) { // quadratic tetras - double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 )); - double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 )); - double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 )); - double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - break; - } - else if( len == 13 ) { // quadratic pyramids - double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 )); - double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 )); - double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 )); - double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 )); - double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 )); - double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - aVal = Max(aVal,Max(L7,L8)); - break; - } - else if( len == 15 ) { // quadratic pentas - double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 )); - double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 )); - double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 )); - double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 )); - double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 )); - double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 )); - double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - aVal = Max(aVal,Max(Max(L7,L8),L9)); - break; - } - else if( len == 20 || len == 27 ) { // quadratic hexas - double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 )); - double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 )); - double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 )); - double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 )); - double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 )); - double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 )); - double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 )); - double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 )); - double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 )); - double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 )); - double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 )); - double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 )); - double D1 = getDistance(P( 1 ),P( 7 )); - double D2 = getDistance(P( 2 ),P( 8 )); - double D3 = getDistance(P( 3 ),P( 5 )); - double D4 = getDistance(P( 4 ),P( 6 )); - aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); - aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10))); - aVal = Max(aVal,Max(L11,L12)); - aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4))); - break; - } - else if( len > 1 && aElem->IsPoly() ) { // polys - // get the maximum distance between all pairs of nodes - for( int i = 1; i <= len; i++ ) { - for( int j = 1; j <= len; j++ ) { - if( j > i ) { // optimization of the loop - double D = getDistance( P(i), P(j) ); - aVal = Max( aVal, D ); - } + switch ( aType ) { + case SMDSEntity_Tetra: { // tetras + double L1 = getDistance(P( 1 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 1 )); + double L4 = getDistance(P( 1 ),P( 4 )); + double L5 = getDistance(P( 2 ),P( 4 )); + double L6 = getDistance(P( 3 ),P( 4 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + break; + } + case SMDSEntity_Pyramid: { // pyramids + double L1 = getDistance(P( 1 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 4 )); + double L4 = getDistance(P( 4 ),P( 1 )); + double L5 = getDistance(P( 1 ),P( 5 )); + double L6 = getDistance(P( 2 ),P( 5 )); + double L7 = getDistance(P( 3 ),P( 5 )); + double L8 = getDistance(P( 4 ),P( 5 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + aVal = Max(aVal,Max(L7,L8)); + break; + } + case SMDSEntity_Penta: { // pentas + double L1 = getDistance(P( 1 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 1 )); + double L4 = getDistance(P( 4 ),P( 5 )); + double L5 = getDistance(P( 5 ),P( 6 )); + double L6 = getDistance(P( 6 ),P( 4 )); + double L7 = getDistance(P( 1 ),P( 4 )); + double L8 = getDistance(P( 2 ),P( 5 )); + double L9 = getDistance(P( 3 ),P( 6 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + aVal = Max(aVal,Max(Max(L7,L8),L9)); + break; + } + case SMDSEntity_Hexa: { // hexas + double L1 = getDistance(P( 1 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 4 )); + double L4 = getDistance(P( 4 ),P( 1 )); + double L5 = getDistance(P( 5 ),P( 6 )); + double L6 = getDistance(P( 6 ),P( 7 )); + double L7 = getDistance(P( 7 ),P( 8 )); + double L8 = getDistance(P( 8 ),P( 5 )); + double L9 = getDistance(P( 1 ),P( 5 )); + double L10= getDistance(P( 2 ),P( 6 )); + double L11= getDistance(P( 3 ),P( 7 )); + double L12= getDistance(P( 4 ),P( 8 )); + double D1 = getDistance(P( 1 ),P( 7 )); + double D2 = getDistance(P( 2 ),P( 8 )); + double D3 = getDistance(P( 3 ),P( 5 )); + double D4 = getDistance(P( 4 ),P( 6 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10))); + aVal = Max(aVal,Max(L11,L12)); + aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4))); + break; + } + case SMDSEntity_Hexagonal_Prism: { // hexagonal prism + for ( int i1 = 1; i1 < 12; ++i1 ) + for ( int i2 = i1+1; i1 <= 12; ++i1 ) + aVal = Max( aVal, getDistance(P( i1 ),P( i2 ))); + break; + } + case SMDSEntity_Quad_Tetra: { // quadratic tetras + double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 )); + double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 )); + double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 )); + double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + break; + } + case SMDSEntity_Quad_Pyramid: { // quadratic pyramids + double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 )); + double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 )); + double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 )); + double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 )); + double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 )); + double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + aVal = Max(aVal,Max(L7,L8)); + break; + } + case SMDSEntity_Quad_Penta: { // quadratic pentas + double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 )); + double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 )); + double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 )); + double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 )); + double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 )); + double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 )); + double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + aVal = Max(aVal,Max(Max(L7,L8),L9)); + break; + } + case SMDSEntity_Quad_Hexa: + case SMDSEntity_TriQuad_Hexa: { // quadratic hexas + double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 )); + double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 )); + double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 )); + double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 )); + double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 )); + double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 )); + double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 )); + double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 )); + double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 )); + double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 )); + double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 )); + double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 )); + double D1 = getDistance(P( 1 ),P( 7 )); + double D2 = getDistance(P( 2 ),P( 8 )); + double D3 = getDistance(P( 3 ),P( 5 )); + double D4 = getDistance(P( 4 ),P( 6 )); + aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6)); + aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10))); + aVal = Max(aVal,Max(L11,L12)); + aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4))); + break; + } + case SMDSEntity_Quad_Polyhedra: + case SMDSEntity_Polyhedra: { // polys + // get the maximum distance between all pairs of nodes + for( int i = 1; i <= len; i++ ) { + for( int j = 1; j <= len; j++ ) { + if( j > i ) { // optimization of the loop + double D = getDistance( P(i), P(j) ); + aVal = Max( aVal, D ); } } } + break; } + case SMDSEntity_Node: + case SMDSEntity_0D: + case SMDSEntity_Edge: + case SMDSEntity_Quad_Edge: + case SMDSEntity_Triangle: + case SMDSEntity_Quad_Triangle: + case SMDSEntity_BiQuad_Triangle: + case SMDSEntity_Quadrangle: + case SMDSEntity_Quad_Quadrangle: + case SMDSEntity_BiQuad_Quadrangle: + case SMDSEntity_Polygon: + case SMDSEntity_Quad_Polygon: + case SMDSEntity_Ball: + case SMDSEntity_Last: return 0; + } // switch ( aType ) if( myPrecision >= 0 ) { @@ -701,7 +718,7 @@ double MinimumAngle::GetValue( const TSequenceOfXYZ& P ) aMin = getAngle(P( P.size() ), P( 1 ), P( 2 )); aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 ))); - for ( int i = 2; i < P.size(); i++ ) + for ( size_t i = 2; i < P.size(); i++ ) { double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) ); aMin = Min(aMin,A0); @@ -1476,10 +1493,10 @@ double Area::GetValue( const TSequenceOfXYZ& P ) gp_Vec aVec2( P(3) - P(1) ); gp_Vec SumVec = aVec1 ^ aVec2; - for (int i=4; i<=P.size(); i++) + for (size_t i=4; i<=P.size(); i++) { gp_Vec aVec1( P(i-1) - P(1) ); - gp_Vec aVec2( P(i) - P(1) ); + gp_Vec aVec2( P(i ) - P(1) ); gp_Vec tmp = aVec1 ^ aVec2; SumVec.Add(tmp); } @@ -2994,6 +3011,16 @@ bool ConnectedElements::IsSatisfy( long theElementId ) */ //================================================================================ +namespace +{ + inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos2 ) + { + double dot = v1 * v2; // cos * |v1| * |v2| + double l1 = v1.SquareMagnitude(); + double l2 = v2.SquareMagnitude(); + return ( dot * dot ) / l1 / l2 >= cos2; + } +} CoplanarFaces::CoplanarFaces() : myFaceID(0), myToler(0) { @@ -3005,7 +3032,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) { // Build a set of coplanar face ids - myCoplanarIDs.clear(); + myCoplanarIDs.Clear(); if ( !myMeshModifTracer.GetMesh() || !myFaceID || !myToler ) return; @@ -3019,8 +3046,8 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) if (!normOK) return; - const double radianTol = myToler * M_PI / 180.; - std::set< SMESH_TLink > checkedLinks; + const double cosTol2 = Cos( myToler ) * Cos( myToler ); + NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks; std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue; faceQueue.push_back( make_pair( face, myNorm )); @@ -3034,7 +3061,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) { const SMDS_MeshNode* n1 = face->GetNode( i ); const SMDS_MeshNode* n2 = face->GetNode(( i+1 )%nbN); - if ( !checkedLinks.insert( SMESH_TLink( n1, n2 )).second ) + if ( !checkedLinks.Add( SMESH_TLink( n1, n2 ))) continue; SMDS_ElemIteratorPtr fIt = n1->GetInverseElementIterator(SMDSAbs_Face); while ( fIt->more() ) @@ -3043,9 +3070,9 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) if ( f->GetNodeIndex( n2 ) > -1 ) { gp_Vec norm = getNormale( static_cast(f), &normOK ); - if (!normOK || myNorm.Angle( norm ) <= radianTol) + if (!normOK || isLessAngle( myNorm, norm, cosTol2)) { - myCoplanarIDs.insert( f->GetID() ); + myCoplanarIDs.Add( f->GetID() ); faceQueue.push_back( make_pair( f, norm )); } } @@ -3056,7 +3083,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) } bool CoplanarFaces::IsSatisfy( long theElementId ) { - return myCoplanarIDs.count( theElementId ); + return myCoplanarIDs.Contains( theElementId ); } /* @@ -3667,7 +3694,7 @@ bool ManifoldPart::process() myMapIds.Add( aFaceId ); } - if ( fi == ( myAllFacePtr.size() - 1 ) ) + if ( fi == int( myAllFacePtr.size() - 1 )) fi = 0; } // end run on vector of faces return !myMapIds.IsEmpty(); @@ -4458,6 +4485,7 @@ bool BelongToGeom::IsSatisfy (long theId) case SMDS_TOP_FACE : return ( IsContains( myMeshDS,myShape,aNode,TopAbs_FACE )); case SMDS_TOP_3DSPACE: return ( IsContains( myMeshDS,myShape,aNode,TopAbs_SOLID ) || IsContains( myMeshDS,myShape,aNode,TopAbs_SHELL )); + default:; } } } @@ -4483,6 +4511,7 @@ bool BelongToGeom::IsSatisfy (long theId) case SMDSAbs_Face : return ( IsContains( myMeshDS,myShape,anElem,TopAbs_FACE )); case SMDSAbs_Volume: return ( IsContains( myMeshDS,myShape,anElem,TopAbs_SOLID )|| IsContains( myMeshDS,myShape,anElem,TopAbs_SHELL )); + default:; } } } diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index 8a2ff7e24..c7398b0ef 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -1088,7 +1088,7 @@ namespace SMESH{ TMeshModifTracer myMeshModifTracer; long myFaceID; double myToler; - std::set< long > myCoplanarIDs; + TColStd_MapOfInteger myCoplanarIDs; }; typedef boost::shared_ptr CoplanarFacesPtr; diff --git a/src/DriverGMF/DriverGMF_Read.cxx b/src/DriverGMF/DriverGMF_Read.cxx index c918eb0d3..5dee87177 100644 --- a/src/DriverGMF/DriverGMF_Read.cxx +++ b/src/DriverGMF/DriverGMF_Read.cxx @@ -407,7 +407,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() { // get ids of existing groups std::set< int > groupIDs; - const std::set& groups = myMesh->GetGroups(); + const std::set& groups = myMesh->GetGroups(); std::set::const_iterator grIter = groups.begin(); for ( ; grIter != groups.end(); ++grIter ) groupIDs.insert( (*grIter)->GetID() ); diff --git a/src/DriverGMF/DriverGMF_Write.cxx b/src/DriverGMF/DriverGMF_Write.cxx index 158eea067..963f1bc17 100644 --- a/src/DriverGMF/DriverGMF_Write.cxx +++ b/src/DriverGMF/DriverGMF_Write.cxx @@ -296,19 +296,19 @@ Driver_Mesh::Status DriverGMF_Write::Perform() SMDSAbs_EntityType smdsEntity; std::string entity = groupName.substr( pos + strlen("_required_")); if ( entity == "Vertices" ) { - gmfKwd = GmfRequiredVertices; + gmfKwd = GmfRequiredVertices; smdsEntity = SMDSEntity_Node; } else if ( entity == "Edges" ) { - gmfKwd = GmfRequiredEdges; + gmfKwd = GmfRequiredEdges; smdsEntity = SMDSEntity_Edge; } else if ( entity == "Triangles" ) { - gmfKwd = GmfRequiredTriangles; + gmfKwd = GmfRequiredTriangles; smdsEntity = SMDSEntity_Triangle; } else if ( entity == "Quadrilaterals" ) { - gmfKwd = GmfRequiredQuadrilaterals; + gmfKwd = GmfRequiredQuadrilaterals; smdsEntity = SMDSEntity_Quadrangle; } else { @@ -330,11 +330,11 @@ Driver_Mesh::Status DriverGMF_Write::Perform() // choose a TElem2IDMap TElem2IDMap* elem2IDMap = 0; - if ( smdsEntity == SMDSEntity_Quadrangle && nbOkElems != myMesh->NbFaces() ) + if ( smdsEntity == SMDSEntity_Quadrangle && nbOkElems != myMesh->NbFaces() ) elem2IDMap = & quad2IDMap; else if ( smdsEntity == SMDSEntity_Triangle && nbOkElems != myMesh->NbFaces() ) elem2IDMap = & tria2IDMap; - else if ( smdsEntity == SMDSEntity_Edge && nbOkElems != myMesh->NbEdges() ) + else if ( smdsEntity == SMDSEntity_Edge && nbOkElems != myMesh->NbEdges() ) elem2IDMap = & edge2IDMap; // write the group diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index ba851616c..74c3e6da8 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -500,7 +500,8 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() default:; } vector aNodeIds(aNbNodes); - for(int iElem = 0; iElem < aNbElems; iElem++){ + for ( int iElem = 0; iElem < aNbElems; iElem++ ) + { bool anIsValidConnect = false; TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); #ifndef _DEXCEPT_ @@ -950,17 +951,19 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() } break; + default:; + } // switch(aGeom) #ifndef _DEXCEPT_ - }catch(const std::exception& exc){ + } catch(const std::exception& exc) { INFOS("The following exception was caught:\n\t"<SetType(anElement->GetType()); } } - } - }} - } - } + } // loop on aNbElems + }} // switch(aGeom) + } // loop on aGeom2Size + } // loop on aEntityInfo + if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483 + } // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++) #ifndef _DEXCEPT_ } diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index ca3674ef8..6436b9a5d 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1349,6 +1349,8 @@ bool SMESH_Mesh::HasModificationsToDiscard() const hasNotComputed = true; if ( hasComputed && hasNotComputed) return true; + + default:; } } if ( NbNodes() < 1 ) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 5e7171660..645882b40 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -1325,7 +1325,7 @@ int SMESH_MeshEditor::Reorient2DBy3D (TIDSortedElemSet & theFaces, if ( face->GetType() != SMDSAbs_Face ) continue; - const int nbCornersNodes = face->NbCornerNodes(); + const size_t nbCornersNodes = face->NbCornerNodes(); faceNodes.assign( face->begin_nodes(), face->end_nodes() ); checkedVolumes.clear(); @@ -1341,7 +1341,7 @@ int SMESH_MeshEditor::Reorient2DBy3D (TIDSortedElemSet & theFaces, // is volume adjacent? bool allNodesCommon = true; - for ( int iN = 1; iN < nbCornersNodes && allNodesCommon; ++iN ) + for ( size_t iN = 1; iN < nbCornersNodes && allNodesCommon; ++iN ) allNodesCommon = ( volume->GetNodeIndex( faceNodes[ iN ]) > -1 ); if ( !allNodesCommon ) continue; @@ -1361,7 +1361,7 @@ int SMESH_MeshEditor::Reorient2DBy3D (TIDSortedElemSet & theFaces, for ( int i = 0; i < 2; ++i ) { const SMDS_MeshNode* n = facetNodes[ i*iQ ]; - for ( int iN = 0; iN < nbCornersNodes; ++iN ) + for ( size_t iN = 0; iN < nbCornersNodes; ++iN ) if ( faceNodes[ iN ] == n ) { iNN[ i ] = iN; @@ -1925,7 +1925,7 @@ namespace if ( hasAdjacentSplits && method._nbSplits > 0 ) { bool facetCreated = true; - for ( int iF = 0; facetCreated && iF < triaSplitsByFace.size(); ++iF ) + for ( size_t iF = 0; facetCreated && iF < triaSplitsByFace.size(); ++iF ) { list< TTriangleFacet >::const_iterator facet = triaSplitsByFace[iF].begin(); for ( ; facetCreated && facet != triaSplitsByFace[iF].end(); ++facet ) @@ -2432,12 +2432,12 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems, volNodes[ facet->_n3 ])); } } - for ( int i = 0; i < triangles.size(); ++i ) + for ( size_t i = 0; i < triangles.size(); ++i ) { - if ( !triangles[i] ) continue; + if ( !triangles[ i ]) continue; if ( fSubMesh ) - fSubMesh->AddElement( triangles[i]); - newElems.Append( triangles[i] ); + fSubMesh->AddElement( triangles[ i ]); + newElems.Append( triangles[ i ]); } ReplaceElemInGroups( face, triangles, GetMeshDS() ); GetMeshDS()->RemoveFreeElement( face, fSubMesh, /*fromGroups=*/false ); @@ -2455,7 +2455,7 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems, GetMeshDS()->RemoveNode( volNodes[i] ); } } // loop on volumes to split - + myLastCreatedNodes = newNodes; myLastCreatedElems = newElems; } @@ -2530,7 +2530,7 @@ void SMESH_MeshEditor::GetHexaFacetsToSplit( TIDSortedElemSet& theHexas, set facetNodes; const SMDS_MeshElement* curHex; - const bool allHex = ( theHexas.size() == myMesh->NbHexas() ); + const bool allHex = ((int) theHexas.size() == myMesh->NbHexas() ); while ( startHex ) { @@ -2913,7 +2913,7 @@ void SMESH_MeshEditor::ReplaceElemInGroups (const SMDS_MeshElement* for ( ; grIt != groups.end(); grIt++ ) { SMESHDS_Group* group = dynamic_cast( *grIt ); if ( group && group->SMDSGroup().Remove( elemToRm ) ) - for ( int i = 0; i < elemToAdd.size(); ++i ) + for ( size_t i = 0; i < elemToAdd.size(); ++i ) group->SMDSGroup().Add( elemToAdd[ i ] ); } } @@ -4006,7 +4006,7 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems, Handle(Geom_Surface) surface; SMESHDS_SubMesh* faceSubMesh = 0; TopoDS_Face face; - double fToler2 = 0, f,l; + double fToler2 = 0; double u1 = 0, u2 = 0, v1 = 0, v2 = 0; bool isUPeriodic = false, isVPeriodic = false; if ( *fId ) @@ -4492,7 +4492,7 @@ namespace void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, const vector & newNodesItVec, list& newElems, - const int nbSteps, + const size_t nbSteps, SMESH_SequenceOfElemPtr& srcElements) { //MESSAGE("sweepElement " << nbSteps); @@ -4620,7 +4620,7 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, } // make new elements - for (int iStep = 0; iStep < nbSteps; iStep++ ) + for ( size_t iStep = 0; iStep < nbSteps; iStep++ ) { // get next nodes for ( iNode = 0; iNode < nbNodes; iNode++ ) @@ -5853,7 +5853,7 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet theElemSets[2], // source elements for each generated one SMESH_SequenceOfElemPtr srcElems, srcNodes; - SMESHDS_Mesh* aMesh = GetMeshDS(); + //SMESHDS_Mesh* aMesh = GetMeshDS(); setElemsFirst( theElemSets ); const int nbSteps = theParams.NbSteps(); @@ -6244,21 +6244,19 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2], return EXTR_PATH_NOT_EDGE; TopTools_SequenceOfShape Edges; - double x1,x2,y1,y2,z1,z2; list< list > LLPPs; int startNid = theN1->GetID(); - for(int i = 1; i < aNodesList.size(); i++) { - x1 = aNodesList[i-1]->X();x2 = aNodesList[i]->X(); - y1 = aNodesList[i-1]->Y();y2 = aNodesList[i]->Y(); - z1 = aNodesList[i-1]->Z();z2 = aNodesList[i]->Z(); - TopoDS_Edge e = BRepBuilderAPI_MakeEdge(gp_Pnt(x1,y1,z1),gp_Pnt(x2,y2,z2)); + for ( size_t i = 1; i < aNodesList.size(); i++ ) + { + gp_Pnt p1 = SMESH_TNodeXYZ( aNodesList[i-1] ); + gp_Pnt p2 = SMESH_TNodeXYZ( aNodesList[i] ); + TopoDS_Edge e = BRepBuilderAPI_MakeEdge( p1, p2 ); list LPP; aPrms.clear(); MakeEdgePathPoints(aPrms, e, (aNodesList[i-1]->GetID()==startNid), LPP); LLPPs.push_back(LPP); - if( aNodesList[i-1]->GetID() == startNid ) startNid = aNodesList[i]->GetID(); - else startNid = aNodesList[i-1]->GetID(); - + if ( aNodesList[i-1]->GetID() == startNid ) startNid = aNodesList[i ]->GetID(); + else startNid = aNodesList[i-1]->GetID(); } list< list >::iterator itLLPP = LLPPs.begin(); @@ -6278,8 +6276,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2], PP2 = currList.front(); gp_Dir D1 = PP1.Tangent(); gp_Dir D2 = PP2.Tangent(); - gp_Dir Dnew( gp_Vec( (D1.X()+D2.X())/2, (D1.Y()+D2.Y())/2, - (D1.Z()+D2.Z())/2 ) ); + gp_Dir Dnew( 0.5 * ( D1.XYZ() + D2.XYZ() )); PP1.SetTangent(Dnew); fullList.push_back(PP1); itPP++; @@ -6292,7 +6289,8 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2], fullList.push_back(PP1); } // Sub-shape for the Pattern must be an Edge or Wire - else if( aS.ShapeType() == TopAbs_EDGE ) { + else if ( aS.ShapeType() == TopAbs_EDGE ) + { aTrackEdge = TopoDS::Edge( aS ); // the Edge must not be degenerated if ( SMESH_Algo::isDegenerated( aTrackEdge ) ) @@ -6636,7 +6634,7 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet theElemSets // if current elem is quadratic and current node is not medium // we have to check - may be it is needed to insert additional nodes list< const SMDS_MeshNode* > & listNewNodes = nIt->second; - if ( listNewNodes.size() == aNbTP-1 ) + if ((int) listNewNodes.size() == aNbTP-1 ) { vector aNodes(2*(aNbTP-1)); gp_XYZ P(node->X(), node->Y(), node->Z()); @@ -6893,7 +6891,7 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems, if ( !elem ) continue; SMDSAbs_GeometryType geomType = elem->GetGeomType(); - int nbNodes = elem->NbNodes(); + size_t nbNodes = elem->NbNodes(); if ( geomType == SMDSGeom_NONE ) continue; // node nodes.resize( nbNodes ); @@ -6931,7 +6929,7 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems, const vector& i = needReverse ? iRev : iForw; // find transformed nodes - int iNode = 0; + size_t iNode = 0; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); while ( itN->more() ) { const SMDS_MeshNode* node = static_cast( itN->next() ); @@ -9001,8 +8999,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theElemen // create new elements i1 = 0; i2 = 1; - for ( iSplit = 0; iSplit < nbSplits - 1; iSplit++ ) { - SMDS_MeshElement* newElem = 0; + for ( iSplit = 0; iSplit < nbSplits - 1; iSplit++ ) + { if ( iSplit == iBestQuad ) newElems.push_back( aMesh->AddFace (linkNodes[ i1++ ], linkNodes[ i2++ ], @@ -11097,16 +11095,16 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems, return false; const double aTol = Precision::Confusion(); - auto_ptr< BRepClass3d_SolidClassifier> bsc3d; - auto_ptr<_FaceClassifier> aFaceClassifier; + SMESHUtils::Deleter< BRepClass3d_SolidClassifier> bsc3d; + SMESHUtils::Deleter<_FaceClassifier> aFaceClassifier; if ( theShape.ShapeType() == TopAbs_SOLID ) { - bsc3d.reset( new BRepClass3d_SolidClassifier(theShape));; + bsc3d._obj = new BRepClass3d_SolidClassifier( theShape ); bsc3d->PerformInfinitePoint(aTol); } else if (theShape.ShapeType() == TopAbs_FACE ) { - aFaceClassifier.reset( new _FaceClassifier(TopoDS::Face(theShape))); + aFaceClassifier._obj = new _FaceClassifier( TopoDS::Face( theShape )); } // iterates on indicated elements and get elements by back references from their nodes @@ -11129,7 +11127,7 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems, { const SMDS_MeshElement* curElem = backElemItr->next(); if ( curElem && theElems.find(curElem) == theElems.end() && - ( bsc3d.get() ? + ( bsc3d ? isInside( curElem, *bsc3d, aTol ) : isInside( curElem, *aFaceClassifier, aTol ))) anAffected.insert( curElem ); @@ -11221,83 +11219,84 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector volume to modify) + // with all the faces shared by 2 domains (group of elements) + // and corresponding volume of this domain, for each shared face. + // a volume has a face shared by 2 domains if it has a neighbor which is not in his domain. + + MESSAGE("... Neighbors of domain #" << idom); + const TIDSortedElemSet& domain = theElems[idom]; + TIDSortedElemSet::const_iterator elemItr = domain.begin(); + for (; elemItr != domain.end(); ++elemItr) + { + const SMDS_MeshElement* anElem = *elemItr; + if (!anElem) + continue; + int vtkId = anElem->getVtkId(); + //MESSAGE(" vtkId " << vtkId << " smdsId " << anElem->GetID()); + int neighborsVtkIds[NBMAXNEIGHBORS]; + int downIds[NBMAXNEIGHBORS]; + unsigned char downTypes[NBMAXNEIGHBORS]; + int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); + for (int n = 0; n < nbNeighbors; n++) + { + int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]); + const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); + if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared + { + bool ok = false; + for ( size_t idombis = 0; idombis < theElems.size() && !ok; idombis++) // check if the neighbor belongs to another domain of the list { + // MESSAGE("Domain " << idombis); const TIDSortedElemSet& domainbis = theElems[idombis]; - if ( domainbis.count(anElem) ) + if ( domainbis.count(elem)) ok = true ; // neighbor is in a correct domain : face is kept + } + if ( ok || onAllBoundaries ) // the characteristics of the face is stored + { + DownIdType face(downIds[n], downTypes[n]); + if (!faceDomains[face].count(idom)) { - MESSAGE(".... Domain #" << idom); - MESSAGE(".... Domain #" << idombis); - throw SALOME_Exception("The domains are not disjoint."); - return false ; + faceDomains[face][idom] = vtkId; // volume associated to face in this domain + celldom[vtkId] = idom; + //MESSAGE(" cell with a border " << vtkId << " domain " << idom); + } + if ( !ok ) + { + theRestDomElems.insert( elem ); + faceDomains[face][iRestDom] = neighborsVtkIds[n]; + celldom[neighborsVtkIds[n]] = iRestDom; } } } + } } - - for (int idom = 0; idom < nbDomains; idom++) - { - - // --- build a map (face to duplicate --> volume to modify) - // with all the faces shared by 2 domains (group of elements) - // and corresponding volume of this domain, for each shared face. - // a volume has a face shared by 2 domains if it has a neighbor which is not in his domain. - - MESSAGE("... Neighbors of domain #" << idom); - const TIDSortedElemSet& domain = theElems[idom]; - TIDSortedElemSet::const_iterator elemItr = domain.begin(); - for (; elemItr != domain.end(); ++elemItr) - { - const SMDS_MeshElement* anElem = *elemItr; - if (!anElem) - continue; - int vtkId = anElem->getVtkId(); - //MESSAGE(" vtkId " << vtkId << " smdsId " << anElem->GetID()); - int neighborsVtkIds[NBMAXNEIGHBORS]; - int downIds[NBMAXNEIGHBORS]; - unsigned char downTypes[NBMAXNEIGHBORS]; - int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); - for (int n = 0; n < nbNeighbors; n++) - { - int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]); - const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); - if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared - { - bool ok = false ; - for (int idombis = 0; idombis < theElems.size() && !ok; idombis++) // check if the neighbor belongs to another domain of the list - { - // MESSAGE("Domain " << idombis); - const TIDSortedElemSet& domainbis = theElems[idombis]; - if ( domainbis.count(elem)) ok = true ; // neighbor is in a correct domain : face is kept - } - if ( ok || onAllBoundaries ) // the characteristics of the face is stored - { - DownIdType face(downIds[n], downTypes[n]); - if (!faceDomains[face].count(idom)) - { - faceDomains[face][idom] = vtkId; // volume associated to face in this domain - celldom[vtkId] = idom; - //MESSAGE(" cell with a border " << vtkId << " domain " << idom); - } - if ( !ok ) - { - theRestDomElems.insert( elem ); - faceDomains[face][iRestDom] = neighborsVtkIds[n]; - celldom[neighborsVtkIds[n]] = iRestDom; - } - } - } - } - } - } + } //MESSAGE("Number of shared faces " << faceDomains.size()); std::map, DownIdCompare>::iterator itface; @@ -11307,48 +11306,48 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector& domvol = itface->second; + if (!domvol.count(idomain)) + continue; + DownIdType face = itface->first; + //MESSAGE(" --- face " << face.cellId); + std::set oldNodes; + oldNodes.clear(); + grid->GetNodeIds(oldNodes, face.cellId, face.cellType); + std::set::iterator itn = oldNodes.begin(); + for (; itn != oldNodes.end(); ++itn) + { + int oldId = *itn; + //MESSAGE(" node " << oldId); + vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId); + for (int i=0; i& domvol = itface->second; - if (!domvol.count(idomain)) + int vtkId = l.cells[i]; + const SMDS_MeshElement* anElem = GetMeshDS()->FindElement(GetMeshDS()->fromVtkToSmds(vtkId)); + if (!domain.count(anElem)) continue; - DownIdType face = itface->first; - //MESSAGE(" --- face " << face.cellId); - std::set oldNodes; - oldNodes.clear(); - grid->GetNodeIds(oldNodes, face.cellId, face.cellType); - std::set::iterator itn = oldNodes.begin(); - for (; itn != oldNodes.end(); ++itn) - { - int oldId = *itn; - //MESSAGE(" node " << oldId); - vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId); - for (int i=0; iFindElement(GetMeshDS()->fromVtkToSmds(vtkId)); - if (!domain.count(anElem)) - continue; - int vtkType = grid->GetCellType(vtkId); - int downId = grid->CellIdToDownId(vtkId); - if (downId < 0) - { - MESSAGE("doubleNodesOnGroupBoundaries: internal algorithm problem"); - continue; // not OK at this stage of the algorithm: - //no cells created after BuildDownWardConnectivity - } - DownIdType aCell(downId, vtkType); - cellDomains[aCell][idomain] = vtkId; - celldom[vtkId] = idomain; - //MESSAGE(" cell " << vtkId << " domain " << idomain); - } - } + int vtkType = grid->GetCellType(vtkId); + int downId = grid->CellIdToDownId(vtkId); + if (downId < 0) + { + MESSAGE("doubleNodesOnGroupBoundaries: internal algorithm problem"); + continue; // not OK at this stage of the algorithm: + //no cells created after BuildDownWardConnectivity + } + DownIdType aCell(downId, vtkType); + cellDomains[aCell][idomain] = vtkId; + celldom[vtkId] = idomain; + //MESSAGE(" cell " << vtkId << " domain " << idomain); } + } } + } // --- explore the shared faces domain by domain, to duplicate the nodes in a coherent way // for each shared face, get the nodes @@ -11364,185 +11363,185 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector& domvol = itface->second; + if (!domvol.count(idomain)) + continue; + DownIdType face = itface->first; + //MESSAGE(" --- face " << face.cellId); + std::set oldNodes; + oldNodes.clear(); + grid->GetNodeIds(oldNodes, face.cellId, face.cellType); + std::set::iterator itn = oldNodes.begin(); + for (; itn != oldNodes.end(); ++itn) + { + int oldId = *itn; + if (nodeDomains[oldId].empty()) { - const std::map& domvol = itface->second; - if (!domvol.count(idomain)) - continue; - DownIdType face = itface->first; - //MESSAGE(" --- face " << face.cellId); - std::set oldNodes; - oldNodes.clear(); - grid->GetNodeIds(oldNodes, face.cellId, face.cellType); - std::set::iterator itn = oldNodes.begin(); - for (; itn != oldNodes.end(); ++itn) - { - int oldId = *itn; - if (nodeDomains[oldId].empty()) - { - nodeDomains[oldId][idomain] = oldId; // keep the old node in the first domain - //MESSAGE("-+-+-b oldNode " << oldId << " domain " << idomain); - } - std::map::const_iterator itdom = domvol.begin(); - for (; itdom != domvol.end(); ++itdom) - { - int idom = itdom->first; - //MESSAGE(" domain " << idom); - if (!nodeDomains[oldId].count(idom)) // --- node to clone - { - if (nodeDomains[oldId].size() >= 2) // a multiple node - { - vector orderedDoms; - //MESSAGE("multiple node " << oldId); - if (mutipleNodes.count(oldId)) - orderedDoms = mutipleNodes[oldId]; - else - { - map::iterator it = nodeDomains[oldId].begin(); - for (; it != nodeDomains[oldId].end(); ++it) - orderedDoms.push_back(it->first); - } - orderedDoms.push_back(idom); // TODO order ==> push_front or back - //stringstream txt; - //for (int i=0; iGetPoint(oldId); - SMDS_MeshNode *newNode = meshDS->AddNode(coords[0], coords[1], coords[2]); - copyPosition( meshDS->FindNodeVtk( oldId ), newNode ); - int newId = newNode->getVtkId(); - nodeDomains[oldId][idom] = newId; // cloned node for other domains - //MESSAGE("-+-+-c oldNode " << oldId << " domain " << idomain << " newNode " << newId << " domain " << idom << " size=" <::const_iterator itdom = domvol.begin(); + for (; itdom != domvol.end(); ++itdom) + { + int idom = itdom->first; + //MESSAGE(" domain " << idom); + if (!nodeDomains[oldId].count(idom)) // --- node to clone + { + if (nodeDomains[oldId].size() >= 2) // a multiple node + { + vector orderedDoms; + //MESSAGE("multiple node " << oldId); + if (mutipleNodes.count(oldId)) + orderedDoms = mutipleNodes[oldId]; + else + { + map::iterator it = nodeDomains[oldId].begin(); + for (; it != nodeDomains[oldId].end(); ++it) + orderedDoms.push_back(it->first); + } + orderedDoms.push_back(idom); // TODO order ==> push_front or back + //stringstream txt; + //for (int i=0; iGetPoint(oldId); + SMDS_MeshNode *newNode = meshDS->AddNode(coords[0], coords[1], coords[2]); + copyPosition( meshDS->FindNodeVtk( oldId ), newNode ); + int newId = newNode->getVtkId(); + nodeDomains[oldId][idom] = newId; // cloned node for other domains + //MESSAGE("-+-+-c oldNode " << oldId << " domain " << idomain << " newNode " << newId << " domain " << idom << " size=" < domvol = itface->second; + if (!domvol.count(idomain)) + continue; + DownIdType face = itface->first; + //MESSAGE(" --- face " << face.cellId); + std::set oldNodes; + oldNodes.clear(); + grid->GetNodeIds(oldNodes, face.cellId, face.cellType); + int nbMultipleNodes = 0; + std::set::iterator itn = oldNodes.begin(); + for (; itn != oldNodes.end(); ++itn) + { + int oldId = *itn; + if (mutipleNodes.count(oldId)) + nbMultipleNodes++; + } + if (nbMultipleNodes > 1) // check if an edge of the face is shared between 3 or more domains + { + //MESSAGE("multiple Nodes detected on a shared face"); + int downId = itface->first.cellId; + unsigned char cellType = itface->first.cellType; + // --- shared edge or shared face ? + if ((cellType == VTK_LINE) || (cellType == VTK_QUADRATIC_EDGE)) // shared edge (between two faces) { - std::map domvol = itface->second; - if (!domvol.count(idomain)) - continue; - DownIdType face = itface->first; - //MESSAGE(" --- face " << face.cellId); - std::set oldNodes; - oldNodes.clear(); - grid->GetNodeIds(oldNodes, face.cellId, face.cellType); - int nbMultipleNodes = 0; - std::set::iterator itn = oldNodes.begin(); - for (; itn != oldNodes.end(); ++itn) - { - int oldId = *itn; - if (mutipleNodes.count(oldId)) - nbMultipleNodes++; - } - if (nbMultipleNodes > 1) // check if an edge of the face is shared between 3 or more domains - { - //MESSAGE("multiple Nodes detected on a shared face"); - int downId = itface->first.cellId; - unsigned char cellType = itface->first.cellType; - // --- shared edge or shared face ? - if ((cellType == VTK_LINE) || (cellType == VTK_QUADRATIC_EDGE)) // shared edge (between two faces) - { - int nodes[3]; - int nbNodes = grid->getDownArray(cellType)->getNodes(downId, nodes); - for (int i=0; i< nbNodes; i=i+nbNodes-1) // i=0 , i=nbNodes-1 - if (mutipleNodes.count(nodes[i])) - if (!mutipleNodesToFace.count(nodes[i])) - mutipleNodesToFace[nodes[i]] = mutipleNodes[nodes[i]]; - } - else // shared face (between two volumes) - { - int nbEdges = grid->getDownArray(cellType)->getNumberOfDownCells(downId); - const int* downEdgeIds = grid->getDownArray(cellType)->getDownCells(downId); - const unsigned char* edgeType = grid->getDownArray(cellType)->getDownTypes(downId); - for (int ie =0; ie < nbEdges; ie++) - { - int nodes[3]; - int nbNodes = grid->getDownArray(edgeType[ie])->getNodes(downEdgeIds[ie], nodes); - if (mutipleNodes.count(nodes[0]) && mutipleNodes.count(nodes[nbNodes-1])) - { - vector vn0 = mutipleNodes[nodes[0]]; - vector vn1 = mutipleNodes[nodes[nbNodes - 1]]; - vector doms; - for (int i0 = 0; i0 < vn0.size(); i0++) - for (int i1 = 0; i1 < vn1.size(); i1++) - if (vn0[i0] == vn1[i1]) - doms.push_back(vn0[i0]); - if (doms.size() >2) - { - //MESSAGE(" detect edgesMultiDomains " << nodes[0] << " " << nodes[nbNodes - 1]); - double *coords = grid->GetPoint(nodes[0]); - gp_Pnt p0(coords[0], coords[1], coords[2]); - coords = grid->GetPoint(nodes[nbNodes - 1]); - gp_Pnt p1(coords[0], coords[1], coords[2]); - gp_Pnt gref; - int vtkVolIds[1000]; // an edge can belong to a lot of volumes - map domvol; // domain --> a volume with the edge - map angleDom; // oriented angles between planes defined by edge and volume centers - int nbvol = grid->GetParentVolumes(vtkVolIds, downEdgeIds[ie], edgeType[ie]); - for (int id=0; id < doms.size(); id++) - { - int idom = doms[id]; - const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom]; - for (int ivol=0; ivolfromVtkToSmds(vtkVolIds[ivol]); - SMDS_MeshElement* elem = (SMDS_MeshElement*)meshDS->FindElement(smdsId); - if (domain.count(elem)) - { - SMDS_VtkVolume* svol = dynamic_cast(elem); - domvol[idom] = svol; - //MESSAGE(" domain " << idom << " volume " << elem->GetID()); - double values[3]; - vtkIdType npts = 0; - vtkIdType* pts = 0; - grid->GetCellPoints(vtkVolIds[ivol], npts, pts); - SMDS_VtkVolume::gravityCenter(grid, pts, npts, values); - if (id ==0) - { - gref.SetXYZ(gp_XYZ(values[0], values[1], values[2])); - angleDom[idom] = 0; - } - else - { - gp_Pnt g(values[0], values[1], values[2]); - angleDom[idom] = OrientedAngle(p0, p1, gref, g); // -pisecond << " angle " << ib->first); - } - for (int ino = 0; ino < nbNodes; ino++) - vnodes.push_back(nodes[ino]); - edgesMultiDomains[vnodes] = vdom; // nodes vector --> ordered domains - } - } - } - } - } + int nodes[3]; + int nbNodes = grid->getDownArray(cellType)->getNodes(downId, nodes); + for (int i=0; i< nbNodes; i=i+nbNodes-1) // i=0 , i=nbNodes-1 + if (mutipleNodes.count(nodes[i])) + if (!mutipleNodesToFace.count(nodes[i])) + mutipleNodesToFace[nodes[i]] = mutipleNodes[nodes[i]]; } + else // shared face (between two volumes) + { + int nbEdges = grid->getDownArray(cellType)->getNumberOfDownCells(downId); + const int* downEdgeIds = grid->getDownArray(cellType)->getDownCells(downId); + const unsigned char* edgeType = grid->getDownArray(cellType)->getDownTypes(downId); + for (int ie =0; ie < nbEdges; ie++) + { + int nodes[3]; + int nbNodes = grid->getDownArray(edgeType[ie])->getNodes(downEdgeIds[ie], nodes); + if ( mutipleNodes.count(nodes[0]) && mutipleNodes.count( nodes[ nbNodes-1 ])) + { + vector vn0 = mutipleNodes[nodes[0]]; + vector vn1 = mutipleNodes[nodes[nbNodes - 1]]; + vector doms; + for ( size_t i0 = 0; i0 < vn0.size(); i0++ ) + for ( size_t i1 = 0; i1 < vn1.size(); i1++ ) + if ( vn0[i0] == vn1[i1] ) + doms.push_back( vn0[ i0 ]); + if ( doms.size() > 2 ) + { + //MESSAGE(" detect edgesMultiDomains " << nodes[0] << " " << nodes[nbNodes - 1]); + double *coords = grid->GetPoint(nodes[0]); + gp_Pnt p0(coords[0], coords[1], coords[2]); + coords = grid->GetPoint(nodes[nbNodes - 1]); + gp_Pnt p1(coords[0], coords[1], coords[2]); + gp_Pnt gref; + int vtkVolIds[1000]; // an edge can belong to a lot of volumes + map domvol; // domain --> a volume with the edge + map angleDom; // oriented angles between planes defined by edge and volume centers + int nbvol = grid->GetParentVolumes(vtkVolIds, downEdgeIds[ie], edgeType[ie]); + for ( size_t id = 0; id < doms.size(); id++ ) + { + int idom = doms[id]; + const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom]; + for ( int ivol = 0; ivol < nbvol; ivol++ ) + { + int smdsId = meshDS->fromVtkToSmds(vtkVolIds[ivol]); + SMDS_MeshElement* elem = (SMDS_MeshElement*)meshDS->FindElement(smdsId); + if (domain.count(elem)) + { + SMDS_VtkVolume* svol = dynamic_cast(elem); + domvol[idom] = svol; + //MESSAGE(" domain " << idom << " volume " << elem->GetID()); + double values[3]; + vtkIdType npts = 0; + vtkIdType* pts = 0; + grid->GetCellPoints(vtkVolIds[ivol], npts, pts); + SMDS_VtkVolume::gravityCenter(grid, pts, npts, values); + if (id ==0) + { + gref.SetXYZ(gp_XYZ(values[0], values[1], values[2])); + angleDom[idom] = 0; + } + else + { + gp_Pnt g(values[0], values[1], values[2]); + angleDom[idom] = OrientedAngle(p0, p1, gref, g); // -pisecond << " angle " << ib->first); + } + for (int ino = 0; ino < nbNodes; ino++) + vnodes.push_back(nodes[ino]); + edgesMultiDomains[vnodes] = vdom; // nodes vector --> ordered domains + } + } + } + } + } } + } // --- iterate on shared faces (volumes to modify, face to extrude) // get node id's of the face (id SMDS = id VTK) @@ -11556,50 +11555,50 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectormyMesh->AddGroup(SMDSAbs_Face, joints2DName.c_str(), idg); + SMESHDS_Group *joints2DGrp = dynamic_cast(mapOfJunctionGroups[joints2DName]->GetGroupDS()); + string joints3DName = "joints3D"; + mapOfJunctionGroups[joints3DName] = this->myMesh->AddGroup(SMDSAbs_Volume, joints3DName.c_str(), idg); + SMESHDS_Group *joints3DGrp = dynamic_cast(mapOfJunctionGroups[joints3DName]->GetGroupDS()); + + itface = faceDomains.begin(); + for (; itface != faceDomains.end(); ++itface) { - int idg; - string joints2DName = "joints2D"; - mapOfJunctionGroups[joints2DName] = this->myMesh->AddGroup(SMDSAbs_Face, joints2DName.c_str(), idg); - SMESHDS_Group *joints2DGrp = dynamic_cast(mapOfJunctionGroups[joints2DName]->GetGroupDS()); - string joints3DName = "joints3D"; - mapOfJunctionGroups[joints3DName] = this->myMesh->AddGroup(SMDSAbs_Volume, joints3DName.c_str(), idg); - SMESHDS_Group *joints3DGrp = dynamic_cast(mapOfJunctionGroups[joints3DName]->GetGroupDS()); + DownIdType face = itface->first; + std::set oldNodes; + std::set::iterator itn; + oldNodes.clear(); + grid->GetNodeIds(oldNodes, face.cellId, face.cellType); - itface = faceDomains.begin(); - for (; itface != faceDomains.end(); ++itface) - { - DownIdType face = itface->first; - std::set oldNodes; - std::set::iterator itn; - oldNodes.clear(); - grid->GetNodeIds(oldNodes, face.cellId, face.cellType); - - std::map domvol = itface->second; - std::map::iterator itdom = domvol.begin(); - int dom1 = itdom->first; - int vtkVolId = itdom->second; - itdom++; - int dom2 = itdom->first; - SMDS_MeshCell *vol = grid->extrudeVolumeFromFace(vtkVolId, dom1, dom2, oldNodes, nodeDomains, - nodeQuadDomains); - stringstream grpname; - grpname << "j_"; - if (dom1 < dom2) - grpname << dom1 << "_" << dom2; - else - grpname << dom2 << "_" << dom1; - string namegrp = grpname.str(); - if (!mapOfJunctionGroups.count(namegrp)) - mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(vol->GetType(), namegrp.c_str(), idg); - SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); - if (sgrp) - sgrp->Add(vol->GetID()); - if (vol->GetType() == SMDSAbs_Volume) - joints3DGrp->Add(vol->GetID()); - else if (vol->GetType() == SMDSAbs_Face) - joints2DGrp->Add(vol->GetID()); - } + std::map domvol = itface->second; + std::map::iterator itdom = domvol.begin(); + int dom1 = itdom->first; + int vtkVolId = itdom->second; + itdom++; + int dom2 = itdom->first; + SMDS_MeshCell *vol = grid->extrudeVolumeFromFace(vtkVolId, dom1, dom2, oldNodes, nodeDomains, + nodeQuadDomains); + stringstream grpname; + grpname << "j_"; + if (dom1 < dom2) + grpname << dom1 << "_" << dom2; + else + grpname << dom2 << "_" << dom1; + string namegrp = grpname.str(); + if (!mapOfJunctionGroups.count(namegrp)) + mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(vol->GetType(), namegrp.c_str(), idg); + SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); + if (sgrp) + sgrp->Add(vol->GetID()); + if (vol->GetType() == SMDSAbs_Volume) + joints3DGrp->Add(vol->GetID()); + else if (vol->GetType() == SMDSAbs_Face) + joints2DGrp->Add(vol->GetID()); } + } // --- create volumes on multiple domain intersection if requested // iterate on mutipleNodesToFace @@ -11607,67 +11606,67 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector >::iterator itn = mutipleNodesToFace.begin(); + for (; itn != mutipleNodesToFace.end(); ++itn) { - // --- iterate on mutipleNodesToFace + int node = itn->first; + vector orderDom = itn->second; + vector orderedNodes; + for ( size_t idom = 0; idom < orderDom.size(); idom++ ) + orderedNodes.push_back( nodeDomains[ node ][ orderDom[ idom ]]); + SMDS_MeshFace* face = this->GetMeshDS()->AddFaceFromVtkIds(orderedNodes); - std::map >::iterator itn = mutipleNodesToFace.begin(); - for (; itn != mutipleNodesToFace.end(); ++itn) - { - int node = itn->first; - vector orderDom = itn->second; - vector orderedNodes; - for (int idom = 0; idom GetMeshDS()->AddFaceFromVtkIds(orderedNodes); - - stringstream grpname; - grpname << "m2j_"; - grpname << 0 << "_" << 0; - int idg; - string namegrp = grpname.str(); - if (!mapOfJunctionGroups.count(namegrp)) - mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Face, namegrp.c_str(), idg); - SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); - if (sgrp) - sgrp->Add(face->GetID()); - } - - // --- iterate on edgesMultiDomains - - std::map, std::vector >::iterator ite = edgesMultiDomains.begin(); - for (; ite != edgesMultiDomains.end(); ++ite) - { - vector nodes = ite->first; - vector orderDom = ite->second; - vector orderedNodes; - if (nodes.size() == 2) - { - //MESSAGE(" use edgesMultiDomains " << nodes[0] << " " << nodes[1]); - for (int ino=0; ino < nodes.size(); ino++) - if (orderDom.size() == 3) - for (int idom = 0; idom =0; idom--) - orderedNodes.push_back( nodeDomains[nodes[ino]][orderDom[idom]] ); - SMDS_MeshVolume* vol = this->GetMeshDS()->AddVolumeFromVtkIds(orderedNodes); - - int idg; - string namegrp = "jointsMultiples"; - if (!mapOfJunctionGroups.count(namegrp)) - mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg); - SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); - if (sgrp) - sgrp->Add(vol->GetID()); - } - else - { - //INFOS("Quadratic multiple joints not implemented"); - // TODO quadratic nodes - } - } + stringstream grpname; + grpname << "m2j_"; + grpname << 0 << "_" << 0; + int idg; + string namegrp = grpname.str(); + if (!mapOfJunctionGroups.count(namegrp)) + mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Face, namegrp.c_str(), idg); + SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); + if (sgrp) + sgrp->Add(face->GetID()); } + // --- iterate on edgesMultiDomains + + std::map, std::vector >::iterator ite = edgesMultiDomains.begin(); + for (; ite != edgesMultiDomains.end(); ++ite) + { + vector nodes = ite->first; + vector orderDom = ite->second; + vector orderedNodes; + if (nodes.size() == 2) + { + //MESSAGE(" use edgesMultiDomains " << nodes[0] << " " << nodes[1]); + for ( size_t ino = 0; ino < nodes.size(); ino++ ) + if ( orderDom.size() == 3 ) + for ( size_t idom = 0; idom < orderDom.size(); idom++ ) + orderedNodes.push_back( nodeDomains[ nodes[ ino ]][ orderDom[ idom ]]); + else + for (int idom = orderDom.size()-1; idom >=0; idom--) + orderedNodes.push_back( nodeDomains[ nodes[ ino ]][ orderDom[ idom ]]); + SMDS_MeshVolume* vol = this->GetMeshDS()->AddVolumeFromVtkIds(orderedNodes); + + int idg; + string namegrp = "jointsMultiples"; + if (!mapOfJunctionGroups.count(namegrp)) + mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg); + SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); + if (sgrp) + sgrp->Add(vol->GetID()); + } + else + { + //INFOS("Quadratic multiple joints not implemented"); + // TODO quadratic nodes + } + } + } + // --- list the explicit faces and edges of the mesh that need to be modified, // i.e. faces and edges built with one or more duplicated nodes. // associate these faces or edges to their corresponding domain. @@ -11680,36 +11679,36 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector >::const_iterator itnod = nodeDomains.begin(); + for (; itnod != nodeDomains.end(); ++itnod) { - std::map >::const_iterator itnod = nodeDomains.begin(); - for (; itnod != nodeDomains.end(); ++itnod) - { - int oldId = itnod->first; - //MESSAGE(" node " << oldId); - vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId); - for (int i = 0; i < l.ncells; i++) + int oldId = itnod->first; + //MESSAGE(" node " << oldId); + vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId); + for (int i = 0; i < l.ncells; i++) + { + int vtkId = l.cells[i]; + int vtkType = grid->GetCellType(vtkId); + int downId = grid->CellIdToDownId(vtkId); + if (downId < 0) + continue; // new cells: not to be modified + DownIdType aCell(downId, vtkType); + int volParents[1000]; + int nbvol = grid->GetParentVolumes(volParents, vtkId); + for (int j = 0; j < nbvol; j++) + if (celldom.count(volParents[j]) && (celldom[volParents[j]] == idomain)) + if (!feDom.count(vtkId)) { - int vtkId = l.cells[i]; - int vtkType = grid->GetCellType(vtkId); - int downId = grid->CellIdToDownId(vtkId); - if (downId < 0) - continue; // new cells: not to be modified - DownIdType aCell(downId, vtkType); - int volParents[1000]; - int nbvol = grid->GetParentVolumes(volParents, vtkId); - for (int j = 0; j < nbvol; j++) - if (celldom.count(volParents[j]) && (celldom[volParents[j]] == idomain)) - if (!feDom.count(vtkId)) - { - feDom[vtkId] = idomain; - faceOrEdgeDom[aCell] = emptyMap; - faceOrEdgeDom[aCell][idomain] = vtkId; // affect face or edge to the first domain only - //MESSAGE("affect cell " << this->GetMeshDS()->fromVtkToSmds(vtkId) << " domain " << idomain - // << " type " << vtkType << " downId " << downId); - } + feDom[vtkId] = idomain; + faceOrEdgeDom[aCell] = emptyMap; + faceOrEdgeDom[aCell][idomain] = vtkId; // affect face or edge to the first domain only + //MESSAGE("affect cell " << this->GetMeshDS()->fromVtkToSmds(vtkId) << " domain " << idomain + // << " type " << vtkType << " downId " << downId); } - } + } } + } // --- iterate on shared faces (volumes to modify, face to extrude) // get node id's of the face @@ -11717,40 +11716,40 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector, DownIdCompare>* maps[3] = {&faceDomains, &cellDomains, &faceOrEdgeDom}; for (int m=0; m<3; m++) + { + std::map, DownIdCompare>* amap = maps[m]; + itface = (*amap).begin(); + for (; itface != (*amap).end(); ++itface) { - std::map, DownIdCompare>* amap = maps[m]; - itface = (*amap).begin(); - for (; itface != (*amap).end(); ++itface) - { - DownIdType face = itface->first; - std::set oldNodes; - std::set::iterator itn; - oldNodes.clear(); - grid->GetNodeIds(oldNodes, face.cellId, face.cellType); - //MESSAGE("examine cell, downId " << face.cellId << " type " << int(face.cellType)); - std::map localClonedNodeIds; + DownIdType face = itface->first; + std::set oldNodes; + std::set::iterator itn; + oldNodes.clear(); + grid->GetNodeIds(oldNodes, face.cellId, face.cellType); + //MESSAGE("examine cell, downId " << face.cellId << " type " << int(face.cellType)); + std::map localClonedNodeIds; - std::map domvol = itface->second; - std::map::iterator itdom = domvol.begin(); - for (; itdom != domvol.end(); ++itdom) - { - int idom = itdom->first; - int vtkVolId = itdom->second; - //MESSAGE("modify nodes of cell " << this->GetMeshDS()->fromVtkToSmds(vtkVolId) << " domain " << idom); - localClonedNodeIds.clear(); - for (itn = oldNodes.begin(); itn != oldNodes.end(); ++itn) - { - int oldId = *itn; - if (nodeDomains[oldId].count(idom)) - { - localClonedNodeIds[oldId] = nodeDomains[oldId][idom]; - //MESSAGE(" node " << oldId << " --> " << localClonedNodeIds[oldId]); - } - } - meshDS->ModifyCellNodes(vtkVolId, localClonedNodeIds); - } + std::map domvol = itface->second; + std::map::iterator itdom = domvol.begin(); + for (; itdom != domvol.end(); ++itdom) + { + int idom = itdom->first; + int vtkVolId = itdom->second; + //MESSAGE("modify nodes of cell " << this->GetMeshDS()->fromVtkToSmds(vtkVolId) << " domain " << idom); + localClonedNodeIds.clear(); + for (itn = oldNodes.begin(); itn != oldNodes.end(); ++itn) + { + int oldId = *itn; + if (nodeDomains[oldId].count(idom)) + { + localClonedNodeIds[oldId] = nodeDomains[oldId][idom]; + //MESSAGE(" node " << oldId << " --> " << localClonedNodeIds[oldId]); + } } + meshDS->ModifyCellNodes(vtkVolId, localClonedNodeIds); + } } + } // Remove empty groups (issue 0022812) std::map::iterator name_group = mapOfJunctionGroups.begin(); @@ -11797,137 +11796,137 @@ bool SMESH_MeshEditor::CreateFlatElementsOnFacesGroups(const std::vector mapOfJunctionGroups; mapOfJunctionGroups.clear(); - for (int idom = 0; idom < theElems.size(); idom++) + for ( size_t idom = 0; idom < theElems.size(); idom++ ) + { + const TIDSortedElemSet& domain = theElems[idom]; + TIDSortedElemSet::const_iterator elemItr = domain.begin(); + for ( ; elemItr != domain.end(); ++elemItr ) { - const TIDSortedElemSet& domain = theElems[idom]; - TIDSortedElemSet::const_iterator elemItr = domain.begin(); - for (; elemItr != domain.end(); ++elemItr) + SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr; + SMDS_MeshFace* aFace = dynamic_cast (anElem); + if (!aFace) + continue; + // MESSAGE("aFace=" << aFace->GetID()); + bool isQuad = aFace->IsQuadratic(); + vector ln0, ln1, ln2, ln3, ln4; + + // --- clone the nodes, create intermediate nodes for non medium nodes of a quad face + + SMDS_ElemIteratorPtr nodeIt = aFace->nodesIterator(); + while (nodeIt->more()) + { + const SMDS_MeshNode* node = static_cast (nodeIt->next()); + bool isMedium = isQuad && (aFace->IsMediumNode(node)); + if (isMedium) + ln2.push_back(node); + else + ln0.push_back(node); + + const SMDS_MeshNode* clone = 0; + if (!clonedNodes.count(node)) { - SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr; - SMDS_MeshFace* aFace = dynamic_cast (anElem); - if (!aFace) - continue; - // MESSAGE("aFace=" << aFace->GetID()); - bool isQuad = aFace->IsQuadratic(); - vector ln0, ln1, ln2, ln3, ln4; - - // --- clone the nodes, create intermediate nodes for non medium nodes of a quad face - - SMDS_ElemIteratorPtr nodeIt = aFace->nodesIterator(); - while (nodeIt->more()) - { - const SMDS_MeshNode* node = static_cast (nodeIt->next()); - bool isMedium = isQuad && (aFace->IsMediumNode(node)); - if (isMedium) - ln2.push_back(node); - else - ln0.push_back(node); - - const SMDS_MeshNode* clone = 0; - if (!clonedNodes.count(node)) - { - clone = meshDS->AddNode(node->X(), node->Y(), node->Z()); - copyPosition( node, clone ); - clonedNodes[node] = clone; - } - else - clone = clonedNodes[node]; - - if (isMedium) - ln3.push_back(clone); - else - ln1.push_back(clone); - - const SMDS_MeshNode* inter = 0; - if (isQuad && (!isMedium)) - { - if (!intermediateNodes.count(node)) - { - inter = meshDS->AddNode(node->X(), node->Y(), node->Z()); - copyPosition( node, inter ); - intermediateNodes[node] = inter; - } - else - inter = intermediateNodes[node]; - ln4.push_back(inter); - } - } - - // --- extrude the face - - vector ln; - SMDS_MeshVolume* vol = 0; - vtkIdType aType = aFace->GetVtkType(); - switch (aType) - { - case VTK_TRIANGLE: - vol = meshDS->AddVolume(ln0[2], ln0[1], ln0[0], ln1[2], ln1[1], ln1[0]); - // MESSAGE("vol prism " << vol->GetID()); - ln.push_back(ln1[0]); - ln.push_back(ln1[1]); - ln.push_back(ln1[2]); - break; - case VTK_QUAD: - vol = meshDS->AddVolume(ln0[3], ln0[2], ln0[1], ln0[0], ln1[3], ln1[2], ln1[1], ln1[0]); - // MESSAGE("vol hexa " << vol->GetID()); - ln.push_back(ln1[0]); - ln.push_back(ln1[1]); - ln.push_back(ln1[2]); - ln.push_back(ln1[3]); - break; - case VTK_QUADRATIC_TRIANGLE: - vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln0[0], ln0[1], ln0[2], ln3[0], ln3[1], ln3[2], - ln2[0], ln2[1], ln2[2], ln4[0], ln4[1], ln4[2]); - // MESSAGE("vol quad prism " << vol->GetID()); - ln.push_back(ln1[0]); - ln.push_back(ln1[1]); - ln.push_back(ln1[2]); - ln.push_back(ln3[0]); - ln.push_back(ln3[1]); - ln.push_back(ln3[2]); - break; - case VTK_QUADRATIC_QUAD: -// vol = meshDS->AddVolume(ln0[0], ln0[1], ln0[2], ln0[3], ln1[0], ln1[1], ln1[2], ln1[3], -// ln2[0], ln2[1], ln2[2], ln2[3], ln3[0], ln3[1], ln3[2], ln3[3], -// ln4[0], ln4[1], ln4[2], ln4[3]); - vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln1[3], ln0[0], ln0[1], ln0[2], ln0[3], - ln3[0], ln3[1], ln3[2], ln3[3], ln2[0], ln2[1], ln2[2], ln2[3], - ln4[0], ln4[1], ln4[2], ln4[3]); - // MESSAGE("vol quad hexa " << vol->GetID()); - ln.push_back(ln1[0]); - ln.push_back(ln1[1]); - ln.push_back(ln1[2]); - ln.push_back(ln1[3]); - ln.push_back(ln3[0]); - ln.push_back(ln3[1]); - ln.push_back(ln3[2]); - ln.push_back(ln3[3]); - break; - case VTK_POLYGON: - break; - default: - break; - } - - if (vol) - { - stringstream grpname; - grpname << "jf_"; - grpname << idom; - int idg; - string namegrp = grpname.str(); - if (!mapOfJunctionGroups.count(namegrp)) - mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg); - SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); - if (sgrp) - sgrp->Add(vol->GetID()); - } - - // --- modify the face - - aFace->ChangeNodes(&ln[0], ln.size()); + clone = meshDS->AddNode(node->X(), node->Y(), node->Z()); + copyPosition( node, clone ); + clonedNodes[node] = clone; } + else + clone = clonedNodes[node]; + + if (isMedium) + ln3.push_back(clone); + else + ln1.push_back(clone); + + const SMDS_MeshNode* inter = 0; + if (isQuad && (!isMedium)) + { + if (!intermediateNodes.count(node)) + { + inter = meshDS->AddNode(node->X(), node->Y(), node->Z()); + copyPosition( node, inter ); + intermediateNodes[node] = inter; + } + else + inter = intermediateNodes[node]; + ln4.push_back(inter); + } + } + + // --- extrude the face + + vector ln; + SMDS_MeshVolume* vol = 0; + vtkIdType aType = aFace->GetVtkType(); + switch (aType) + { + case VTK_TRIANGLE: + vol = meshDS->AddVolume(ln0[2], ln0[1], ln0[0], ln1[2], ln1[1], ln1[0]); + // MESSAGE("vol prism " << vol->GetID()); + ln.push_back(ln1[0]); + ln.push_back(ln1[1]); + ln.push_back(ln1[2]); + break; + case VTK_QUAD: + vol = meshDS->AddVolume(ln0[3], ln0[2], ln0[1], ln0[0], ln1[3], ln1[2], ln1[1], ln1[0]); + // MESSAGE("vol hexa " << vol->GetID()); + ln.push_back(ln1[0]); + ln.push_back(ln1[1]); + ln.push_back(ln1[2]); + ln.push_back(ln1[3]); + break; + case VTK_QUADRATIC_TRIANGLE: + vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln0[0], ln0[1], ln0[2], ln3[0], ln3[1], ln3[2], + ln2[0], ln2[1], ln2[2], ln4[0], ln4[1], ln4[2]); + // MESSAGE("vol quad prism " << vol->GetID()); + ln.push_back(ln1[0]); + ln.push_back(ln1[1]); + ln.push_back(ln1[2]); + ln.push_back(ln3[0]); + ln.push_back(ln3[1]); + ln.push_back(ln3[2]); + break; + case VTK_QUADRATIC_QUAD: + // vol = meshDS->AddVolume(ln0[0], ln0[1], ln0[2], ln0[3], ln1[0], ln1[1], ln1[2], ln1[3], + // ln2[0], ln2[1], ln2[2], ln2[3], ln3[0], ln3[1], ln3[2], ln3[3], + // ln4[0], ln4[1], ln4[2], ln4[3]); + vol = meshDS->AddVolume(ln1[0], ln1[1], ln1[2], ln1[3], ln0[0], ln0[1], ln0[2], ln0[3], + ln3[0], ln3[1], ln3[2], ln3[3], ln2[0], ln2[1], ln2[2], ln2[3], + ln4[0], ln4[1], ln4[2], ln4[3]); + // MESSAGE("vol quad hexa " << vol->GetID()); + ln.push_back(ln1[0]); + ln.push_back(ln1[1]); + ln.push_back(ln1[2]); + ln.push_back(ln1[3]); + ln.push_back(ln3[0]); + ln.push_back(ln3[1]); + ln.push_back(ln3[2]); + ln.push_back(ln3[3]); + break; + case VTK_POLYGON: + break; + default: + break; + } + + if (vol) + { + stringstream grpname; + grpname << "jf_"; + grpname << idom; + int idg; + string namegrp = grpname.str(); + if (!mapOfJunctionGroups.count(namegrp)) + mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg); + SMESHDS_Group *sgrp = dynamic_cast(mapOfJunctionGroups[namegrp]->GetGroupDS()); + if (sgrp) + sgrp->Add(vol->GetID()); + } + + // --- modify the face + + aFace->ChangeNodes(&ln[0], ln.size()); } + } return true; } @@ -11937,11 +11936,11 @@ bool SMESH_MeshEditor::CreateFlatElementsOnFacesGroups(const std::vector& nodesCoords, +void SMESH_MeshEditor::CreateHoleSkin(double radius, + const TopoDS_Shape& theShape, + SMESH_NodeSearcher* theNodeSearcher, + const char* groupName, + std::vector& nodesCoords, std::vector >& listOfListOfNodes) { MESSAGE("--------------------------------"); @@ -11959,28 +11958,28 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, SMESHDS_GroupBase* groupDS = 0; SMESH_Mesh::GroupIteratorPtr groupIt = this->myMesh->GetGroups(); while ( groupIt->more() ) - { + { + groupDS = 0; + SMESH_Group * group = groupIt->next(); + if ( !group ) continue; + groupDS = group->GetGroupDS(); + if ( !groupDS || groupDS->IsEmpty() ) continue; + std::string grpName = group->GetName(); + //MESSAGE("grpName=" << grpName); + if (grpName == groupName) + break; + else groupDS = 0; - SMESH_Group * group = groupIt->next(); - if ( !group ) continue; - groupDS = group->GetGroupDS(); - if ( !groupDS || groupDS->IsEmpty() ) continue; - std::string grpName = group->GetName(); - //MESSAGE("grpName=" << grpName); - if (grpName == groupName) - break; - else - groupDS = 0; - } + } bool isNodeGroup = false; bool isNodeCoords = false; if (groupDS) - { - if (groupDS->GetType() != SMDSAbs_Node) - return; - isNodeGroup = true; // a group of nodes exists and it is in this mesh - } + { + if (groupDS->GetType() != SMDSAbs_Node) + return; + isNodeGroup = true; // a group of nodes exists and it is in this mesh + } if (nodesCoords.size() > 0) isNodeCoords = true; // a list o nodes given by their coordinates @@ -11993,10 +11992,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, grpvName += "_vol"; SMESH_Group *grp = this->myMesh->AddGroup(SMDSAbs_Volume, grpvName.c_str(), idg); if (!grp) - { - MESSAGE("group not created " << grpvName); - return; - } + { + MESSAGE("group not created " << grpvName); + return; + } SMESHDS_Group *sgrp = dynamic_cast(grp->GetGroupDS()); int idgs; // --- group of SMDS faces on the skin @@ -12004,10 +12003,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, grpsName += "_skin"; SMESH_Group *grps = this->myMesh->AddGroup(SMDSAbs_Face, grpsName.c_str(), idgs); if (!grps) - { - MESSAGE("group not created " << grpsName); - return; - } + { + MESSAGE("group not created " << grpsName); + return; + } SMESHDS_Group *sgrps = dynamic_cast(grps->GetGroupDS()); int idgi; // --- group of SMDS faces internal (several shapes) @@ -12015,10 +12014,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, grpiName += "_internalFaces"; SMESH_Group *grpi = this->myMesh->AddGroup(SMDSAbs_Face, grpiName.c_str(), idgi); if (!grpi) - { - MESSAGE("group not created " << grpiName); - return; - } + { + MESSAGE("group not created " << grpiName); + return; + } SMESHDS_Group *sgrpi = dynamic_cast(grpi->GetGroupDS()); int idgei; // --- group of SMDS faces internal (several shapes) @@ -12026,10 +12025,10 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, grpeiName += "_internalEdges"; SMESH_Group *grpei = this->myMesh->AddGroup(SMDSAbs_Edge, grpeiName.c_str(), idgei); if (!grpei) - { - MESSAGE("group not created " << grpeiName); - return; - } + { + MESSAGE("group not created " << grpeiName); + return; + } SMESHDS_Group *sgrpei = dynamic_cast(grpei->GetGroupDS()); // --- build downward connectivity @@ -12047,157 +12046,157 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, gpnts.clear(); if (isNodeGroup) // --- a group of nodes is provided : find all the volumes using one or more of this nodes + { + MESSAGE("group of nodes provided"); + SMDS_ElemIteratorPtr elemIt = groupDS->GetElements(); + while ( elemIt->more() ) { - MESSAGE("group of nodes provided"); - SMDS_ElemIteratorPtr elemIt = groupDS->GetElements(); - while ( elemIt->more() ) - { - const SMDS_MeshElement* elem = elemIt->next(); - if (!elem) - continue; - const SMDS_MeshNode* node = dynamic_cast(elem); - if (!node) - continue; - SMDS_MeshElement* vol = 0; - SMDS_ElemIteratorPtr volItr = node->GetInverseElementIterator(SMDSAbs_Volume); - while (volItr->more()) - { - vol = (SMDS_MeshElement*)volItr->next(); - setOfInsideVol.insert(vol->getVtkId()); - sgrp->Add(vol->GetID()); - } - } + const SMDS_MeshElement* elem = elemIt->next(); + if (!elem) + continue; + const SMDS_MeshNode* node = dynamic_cast(elem); + if (!node) + continue; + SMDS_MeshElement* vol = 0; + SMDS_ElemIteratorPtr volItr = node->GetInverseElementIterator(SMDSAbs_Volume); + while (volItr->more()) + { + vol = (SMDS_MeshElement*)volItr->next(); + setOfInsideVol.insert(vol->getVtkId()); + sgrp->Add(vol->GetID()); + } } + } else if (isNodeCoords) + { + MESSAGE("list of nodes coordinates provided"); + size_t i = 0; + int k = 0; + while ( i < nodesCoords.size()-2 ) { - MESSAGE("list of nodes coordinates provided"); - int i = 0; - int k = 0; - while (i < nodesCoords.size()-2) - { - double x = nodesCoords[i++]; - double y = nodesCoords[i++]; - double z = nodesCoords[i++]; - gp_Pnt p = gp_Pnt(x, y ,z); - gpnts.push_back(p); - MESSAGE("TopoDS_Vertex " << k << " " << p.X() << " " << p.Y() << " " << p.Z()); - k++; - } + double x = nodesCoords[i++]; + double y = nodesCoords[i++]; + double z = nodesCoords[i++]; + gp_Pnt p = gp_Pnt(x, y ,z); + gpnts.push_back(p); + MESSAGE("TopoDS_Vertex " << k << " " << p.X() << " " << p.Y() << " " << p.Z()); + k++; } + } else // --- no group, no coordinates : use the vertices of the geom shape provided, and radius - { - MESSAGE("no group of nodes provided, using vertices from geom shape, and radius"); - TopTools_IndexedMapOfShape vertexMap; - TopExp::MapShapes( theShape, TopAbs_VERTEX, vertexMap ); - gp_Pnt p = gp_Pnt(0,0,0); - if (vertexMap.Extent() < 1) - return; + { + MESSAGE("no group of nodes provided, using vertices from geom shape, and radius"); + TopTools_IndexedMapOfShape vertexMap; + TopExp::MapShapes( theShape, TopAbs_VERTEX, vertexMap ); + gp_Pnt p = gp_Pnt(0,0,0); + if (vertexMap.Extent() < 1) + return; - for ( int i = 1; i <= vertexMap.Extent(); ++i ) - { - const TopoDS_Vertex& vertex = TopoDS::Vertex( vertexMap( i )); - p = BRep_Tool::Pnt(vertex); - gpnts.push_back(p); - MESSAGE("TopoDS_Vertex " << i << " " << p.X() << " " << p.Y() << " " << p.Z()); - } + for ( int i = 1; i <= vertexMap.Extent(); ++i ) + { + const TopoDS_Vertex& vertex = TopoDS::Vertex( vertexMap( i )); + p = BRep_Tool::Pnt(vertex); + gpnts.push_back(p); + MESSAGE("TopoDS_Vertex " << i << " " << p.X() << " " << p.Y() << " " << p.Z()); } + } if (gpnts.size() > 0) + { + int nodeId = 0; + const SMDS_MeshNode* startNode = theNodeSearcher->FindClosestTo(gpnts[0]); + if (startNode) + nodeId = startNode->GetID(); + MESSAGE("nodeId " << nodeId); + + double radius2 = radius*radius; + MESSAGE("radius2 " << radius2); + + // --- volumes on start node + + setOfVolToCheck.clear(); + SMDS_MeshElement* startVol = 0; + SMDS_ElemIteratorPtr volItr = startNode->GetInverseElementIterator(SMDSAbs_Volume); + while (volItr->more()) { - int nodeId = 0; - const SMDS_MeshNode* startNode = theNodeSearcher->FindClosestTo(gpnts[0]); - if (startNode) - nodeId = startNode->GetID(); - MESSAGE("nodeId " << nodeId); - - double radius2 = radius*radius; - MESSAGE("radius2 " << radius2); - - // --- volumes on start node - - setOfVolToCheck.clear(); - SMDS_MeshElement* startVol = 0; - SMDS_ElemIteratorPtr volItr = startNode->GetInverseElementIterator(SMDSAbs_Volume); - while (volItr->more()) - { - startVol = (SMDS_MeshElement*)volItr->next(); - setOfVolToCheck.insert(startVol->getVtkId()); - } - if (setOfVolToCheck.empty()) - { - MESSAGE("No volumes found"); - return; - } - - // --- starting with central volumes then their neighbors, check if they are inside - // or outside the domain, until no more new neighbor volume is inside. - // Fill the group of inside volumes - - std::map mapOfNodeDistance2; - mapOfNodeDistance2.clear(); - std::set setOfOutsideVol; - while (!setOfVolToCheck.empty()) - { - std::set::iterator it = setOfVolToCheck.begin(); - int vtkId = *it; - MESSAGE("volume to check, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); - bool volInside = false; - vtkIdType npts = 0; - vtkIdType* pts = 0; - grid->GetCellPoints(vtkId, npts, pts); - for (int i=0; iGetPoint(pts[i]); - gp_Pnt aPoint = gp_Pnt(coords[0], coords[1], coords[2]); - distance2 = 1.E40; - for (int j=0; jAdd(meshDS->fromVtkToSmds(vtkId)); - break; - } - } - if (volInside) - { - setOfInsideVol.insert(vtkId); - MESSAGE(" volume inside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); - int neighborsVtkIds[NBMAXNEIGHBORS]; - int downIds[NBMAXNEIGHBORS]; - unsigned char downTypes[NBMAXNEIGHBORS]; - int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); - for (int n = 0; n < nbNeighbors; n++) - if (!setOfInsideVol.count(neighborsVtkIds[n]) ||setOfOutsideVol.count(neighborsVtkIds[n])) - setOfVolToCheck.insert(neighborsVtkIds[n]); - } - else - { - setOfOutsideVol.insert(vtkId); - MESSAGE(" volume outside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); - } - setOfVolToCheck.erase(vtkId); - } + startVol = (SMDS_MeshElement*)volItr->next(); + setOfVolToCheck.insert(startVol->getVtkId()); } + if (setOfVolToCheck.empty()) + { + MESSAGE("No volumes found"); + return; + } + + // --- starting with central volumes then their neighbors, check if they are inside + // or outside the domain, until no more new neighbor volume is inside. + // Fill the group of inside volumes + + std::map mapOfNodeDistance2; + mapOfNodeDistance2.clear(); + std::set setOfOutsideVol; + while (!setOfVolToCheck.empty()) + { + std::set::iterator it = setOfVolToCheck.begin(); + int vtkId = *it; + MESSAGE("volume to check, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); + bool volInside = false; + vtkIdType npts = 0; + vtkIdType* pts = 0; + grid->GetCellPoints(vtkId, npts, pts); + for (int i=0; iGetPoint(pts[i]); + gp_Pnt aPoint = gp_Pnt(coords[0], coords[1], coords[2]); + distance2 = 1.E40; + for ( size_t j = 0; j < gpnts.size(); j++ ) + { + double d2 = aPoint.SquareDistance( gpnts[ j ]); + if (d2 < distance2) + { + distance2 = d2; + if (distance2 < radius2) + break; + } + } + mapOfNodeDistance2[pts[i]] = distance2; + MESSAGE(" point " << pts[i] << " distance2 " << distance2 << " coords " << coords[0] << " " << coords[1] << " " << coords[2]); + } + if (distance2 < radius2) + { + volInside = true; // one or more nodes inside the domain + sgrp->Add(meshDS->fromVtkToSmds(vtkId)); + break; + } + } + if (volInside) + { + setOfInsideVol.insert(vtkId); + MESSAGE(" volume inside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); + int neighborsVtkIds[NBMAXNEIGHBORS]; + int downIds[NBMAXNEIGHBORS]; + unsigned char downTypes[NBMAXNEIGHBORS]; + int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); + for (int n = 0; n < nbNeighbors; n++) + if (!setOfInsideVol.count(neighborsVtkIds[n]) ||setOfOutsideVol.count(neighborsVtkIds[n])) + setOfVolToCheck.insert(neighborsVtkIds[n]); + } + else + { + setOfOutsideVol.insert(vtkId); + MESSAGE(" volume outside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); + } + setOfVolToCheck.erase(vtkId); + } + } // --- for outside hexahedrons, check if they have more than one neighbor volume inside // If yes, add the volume to the inside set @@ -12205,52 +12204,52 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, bool addedInside = true; std::set setOfVolToReCheck; while (addedInside) + { + MESSAGE(" --------------------------- re check"); + addedInside = false; + std::set::iterator itv = setOfInsideVol.begin(); + for (; itv != setOfInsideVol.end(); ++itv) { - MESSAGE(" --------------------------- re check"); - addedInside = false; - std::set::iterator itv = setOfInsideVol.begin(); - for (; itv != setOfInsideVol.end(); ++itv) - { - int vtkId = *itv; - int neighborsVtkIds[NBMAXNEIGHBORS]; - int downIds[NBMAXNEIGHBORS]; - unsigned char downTypes[NBMAXNEIGHBORS]; - int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); - for (int n = 0; n < nbNeighbors; n++) - if (!setOfInsideVol.count(neighborsVtkIds[n])) - setOfVolToReCheck.insert(neighborsVtkIds[n]); - } - setOfVolToCheck = setOfVolToReCheck; - setOfVolToReCheck.clear(); - while (!setOfVolToCheck.empty()) - { - std::set::iterator it = setOfVolToCheck.begin(); - int vtkId = *it; - if (grid->GetCellType(vtkId) == VTK_HEXAHEDRON) - { - MESSAGE("volume to recheck, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); - int countInside = 0; - int neighborsVtkIds[NBMAXNEIGHBORS]; - int downIds[NBMAXNEIGHBORS]; - unsigned char downTypes[NBMAXNEIGHBORS]; - int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); - for (int n = 0; n < nbNeighbors; n++) - if (setOfInsideVol.count(neighborsVtkIds[n])) - countInside++; - MESSAGE("countInside " << countInside); - if (countInside > 1) - { - MESSAGE(" volume inside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); - setOfInsideVol.insert(vtkId); - sgrp->Add(meshDS->fromVtkToSmds(vtkId)); - addedInside = true; - } - else - setOfVolToReCheck.insert(vtkId); - } - setOfVolToCheck.erase(vtkId); - } + int vtkId = *itv; + int neighborsVtkIds[NBMAXNEIGHBORS]; + int downIds[NBMAXNEIGHBORS]; + unsigned char downTypes[NBMAXNEIGHBORS]; + int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); + for (int n = 0; n < nbNeighbors; n++) + if (!setOfInsideVol.count(neighborsVtkIds[n])) + setOfVolToReCheck.insert(neighborsVtkIds[n]); } + setOfVolToCheck = setOfVolToReCheck; + setOfVolToReCheck.clear(); + while (!setOfVolToCheck.empty()) + { + std::set::iterator it = setOfVolToCheck.begin(); + int vtkId = *it; + if (grid->GetCellType(vtkId) == VTK_HEXAHEDRON) + { + MESSAGE("volume to recheck, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); + int countInside = 0; + int neighborsVtkIds[NBMAXNEIGHBORS]; + int downIds[NBMAXNEIGHBORS]; + unsigned char downTypes[NBMAXNEIGHBORS]; + int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); + for (int n = 0; n < nbNeighbors; n++) + if (setOfInsideVol.count(neighborsVtkIds[n])) + countInside++; + MESSAGE("countInside " << countInside); + if (countInside > 1) + { + MESSAGE(" volume inside, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); + setOfInsideVol.insert(vtkId); + sgrp->Add(meshDS->fromVtkToSmds(vtkId)); + addedInside = true; + } + else + setOfVolToReCheck.insert(vtkId); + } + setOfVolToCheck.erase(vtkId); + } + } // --- map of Downward faces at the boundary, inside the global volume // map of Downward faces on the skin of the global volume (equivalent to SMDS faces on the skin) @@ -12261,50 +12260,50 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, std::map skinFaces; // faces on the skin of the global volume --> corresponding cell std::set::iterator it = setOfInsideVol.begin(); for (; it != setOfInsideVol.end(); ++it) + { + int vtkId = *it; + //MESSAGE(" vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); + int neighborsVtkIds[NBMAXNEIGHBORS]; + int downIds[NBMAXNEIGHBORS]; + unsigned char downTypes[NBMAXNEIGHBORS]; + int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId, true); + for (int n = 0; n < nbNeighbors; n++) { - int vtkId = *it; - //MESSAGE(" vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId)); - int neighborsVtkIds[NBMAXNEIGHBORS]; - int downIds[NBMAXNEIGHBORS]; - unsigned char downTypes[NBMAXNEIGHBORS]; - int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId, true); - for (int n = 0; n < nbNeighbors; n++) + int neighborDim = SMDS_Downward::getCellDimension(grid->GetCellType(neighborsVtkIds[n])); + if (neighborDim == 3) + { + if (! setOfInsideVol.count(neighborsVtkIds[n])) // neighbor volume is not inside : face is boundary { - int neighborDim = SMDS_Downward::getCellDimension(grid->GetCellType(neighborsVtkIds[n])); - if (neighborDim == 3) - { - if (! setOfInsideVol.count(neighborsVtkIds[n])) // neighbor volume is not inside : face is boundary - { - DownIdType face(downIds[n], downTypes[n]); - boundaryFaces[face] = vtkId; - } - // if the face between to volumes is in the mesh, get it (internal face between shapes) - int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]); - if (vtkFaceId >= 0) - { - sgrpi->Add(meshDS->fromVtkToSmds(vtkFaceId)); - // find also the smds edges on this face - int nbEdges = grid->getDownArray(downTypes[n])->getNumberOfDownCells(downIds[n]); - const int* dEdges = grid->getDownArray(downTypes[n])->getDownCells(downIds[n]); - const unsigned char* dTypes = grid->getDownArray(downTypes[n])->getDownTypes(downIds[n]); - for (int i = 0; i < nbEdges; i++) - { - int vtkEdgeId = grid->getDownArray(dTypes[i])->getVtkCellId(dEdges[i]); - if (vtkEdgeId >= 0) - sgrpei->Add(meshDS->fromVtkToSmds(vtkEdgeId)); - } - } - } - else if (neighborDim == 2) // skin of the volume - { - DownIdType face(downIds[n], downTypes[n]); - skinFaces[face] = vtkId; - int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]); - if (vtkFaceId >= 0) - sgrps->Add(meshDS->fromVtkToSmds(vtkFaceId)); - } + DownIdType face(downIds[n], downTypes[n]); + boundaryFaces[face] = vtkId; } + // if the face between to volumes is in the mesh, get it (internal face between shapes) + int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]); + if (vtkFaceId >= 0) + { + sgrpi->Add(meshDS->fromVtkToSmds(vtkFaceId)); + // find also the smds edges on this face + int nbEdges = grid->getDownArray(downTypes[n])->getNumberOfDownCells(downIds[n]); + const int* dEdges = grid->getDownArray(downTypes[n])->getDownCells(downIds[n]); + const unsigned char* dTypes = grid->getDownArray(downTypes[n])->getDownTypes(downIds[n]); + for (int i = 0; i < nbEdges; i++) + { + int vtkEdgeId = grid->getDownArray(dTypes[i])->getVtkCellId(dEdges[i]); + if (vtkEdgeId >= 0) + sgrpei->Add(meshDS->fromVtkToSmds(vtkEdgeId)); + } + } + } + else if (neighborDim == 2) // skin of the volume + { + DownIdType face(downIds[n], downTypes[n]); + skinFaces[face] = vtkId; + int vtkFaceId = grid->getDownArray(downTypes[n])->getVtkCellId(downIds[n]); + if (vtkFaceId >= 0) + sgrps->Add(meshDS->fromVtkToSmds(vtkFaceId)); + } } + } // --- identify the edges constituting the wire of each subshape on the skin // define polylines with the nodes of edges, equivalent to wires @@ -12317,17 +12316,17 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, SMDS_ElemIteratorPtr itelem = sgrps->GetElements(); while (itelem->more()) + { + const SMDS_MeshElement *elem = itelem->next(); + int shapeId = elem->getshapeId(); + int vtkId = elem->getVtkId(); + if (!shapeIdToVtkIdSet.count(shapeId)) { - const SMDS_MeshElement *elem = itelem->next(); - int shapeId = elem->getshapeId(); - int vtkId = elem->getVtkId(); - if (!shapeIdToVtkIdSet.count(shapeId)) - { - shapeIdToVtkIdSet[shapeId] = emptySet; - shapeIds.insert(shapeId); - } - shapeIdToVtkIdSet[shapeId].insert(vtkId); + shapeIdToVtkIdSet[shapeId] = emptySet; + shapeIds.insert(shapeId); } + shapeIdToVtkIdSet[shapeId].insert(vtkId); + } std::map > shapeIdToEdges; // shapeId --> set of downward edges std::set emptyEdges; @@ -12335,125 +12334,125 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, std::map >::iterator itShape = shapeIdToVtkIdSet.begin(); for (; itShape != shapeIdToVtkIdSet.end(); ++itShape) + { + int shapeId = itShape->first; + MESSAGE(" --- Shape ID --- "<< shapeId); + shapeIdToEdges[shapeId] = emptyEdges; + + std::vector nodesEdges; + + std::set::iterator its = itShape->second.begin(); + for (; its != itShape->second.end(); ++its) { - int shapeId = itShape->first; - MESSAGE(" --- Shape ID --- "<< shapeId); - shapeIdToEdges[shapeId] = emptyEdges; - - std::vector nodesEdges; - - std::set::iterator its = itShape->second.begin(); - for (; its != itShape->second.end(); ++its) + int vtkId = *its; + MESSAGE(" " << vtkId); + int neighborsVtkIds[NBMAXNEIGHBORS]; + int downIds[NBMAXNEIGHBORS]; + unsigned char downTypes[NBMAXNEIGHBORS]; + int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); + for (int n = 0; n < nbNeighbors; n++) + { + if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here + continue; + int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]); + const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); + if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group { - int vtkId = *its; - MESSAGE(" " << vtkId); - int neighborsVtkIds[NBMAXNEIGHBORS]; - int downIds[NBMAXNEIGHBORS]; - unsigned char downTypes[NBMAXNEIGHBORS]; - int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); - for (int n = 0; n < nbNeighbors; n++) - { - if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here - continue; - int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]); - const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); - if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group - { - DownIdType edge(downIds[n], downTypes[n]); - if (!shapeIdToEdges[shapeId].count(edge)) - { - shapeIdToEdges[shapeId].insert(edge); - int vtkNodeId[3]; - int nbNodes = grid->getDownArray(downTypes[n])->getNodes(downIds[n],vtkNodeId); - nodesEdges.push_back(vtkNodeId[0]); - nodesEdges.push_back(vtkNodeId[nbNodes-1]); - MESSAGE(" --- nodes " << vtkNodeId[0]+1 << " " << vtkNodeId[nbNodes-1]+1); - } - } - } + DownIdType edge(downIds[n], downTypes[n]); + if (!shapeIdToEdges[shapeId].count(edge)) + { + shapeIdToEdges[shapeId].insert(edge); + int vtkNodeId[3]; + int nbNodes = grid->getDownArray(downTypes[n])->getNodes(downIds[n],vtkNodeId); + nodesEdges.push_back(vtkNodeId[0]); + nodesEdges.push_back(vtkNodeId[nbNodes-1]); + MESSAGE(" --- nodes " << vtkNodeId[0]+1 << " " << vtkNodeId[nbNodes-1]+1); + } } - - std::list order; - order.clear(); - if (nodesEdges.size() > 0) - { - order.push_back(nodesEdges[0]); MESSAGE(" --- back " << order.back()+1); // SMDS id = VTK id + 1; - nodesEdges[0] = -1; - order.push_back(nodesEdges[1]); MESSAGE(" --- back " << order.back()+1); - nodesEdges[1] = -1; // do not reuse this edge - bool found = true; - while (found) - { - int nodeTofind = order.back(); // try first to push back - int i = 0; - for (i = 0; i use the previous one - if (nodesEdges[i-1] < 0) - found = false; - else - { - order.push_back(nodesEdges[i-1]); MESSAGE(" --- back " << order.back()+1); - nodesEdges[i-1] = -1; - } - else // even ==> use the next one - if (nodesEdges[i+1] < 0) - found = false; - else - { - order.push_back(nodesEdges[i+1]); MESSAGE(" --- back " << order.back()+1); - nodesEdges[i+1] = -1; - } - } - if (found) - continue; - // try to push front - found = true; - nodeTofind = order.front(); // try to push front - for (i = 0; i use the previous one - if (nodesEdges[i-1] < 0) - found = false; - else - { - order.push_front(nodesEdges[i-1]); MESSAGE(" --- front " << order.front()+1); - nodesEdges[i-1] = -1; - } - else // even ==> use the next one - if (nodesEdges[i+1] < 0) - found = false; - else - { - order.push_front(nodesEdges[i+1]); MESSAGE(" --- front " << order.front()+1); - nodesEdges[i+1] = -1; - } - } - } - - - std::vector nodes; - nodes.push_back(shapeId); - std::list::iterator itl = order.begin(); - for (; itl != order.end(); itl++) - { - nodes.push_back((*itl) + 1); // SMDS id = VTK id + 1; - MESSAGE(" ordered node " << nodes[nodes.size()-1]); - } - listOfListOfNodes.push_back(nodes); + } } + std::list order; + order.clear(); + if (nodesEdges.size() > 0) + { + order.push_back(nodesEdges[0]); MESSAGE(" --- back " << order.back()+1); // SMDS id = VTK id + 1; + nodesEdges[0] = -1; + order.push_back(nodesEdges[1]); MESSAGE(" --- back " << order.back()+1); + nodesEdges[1] = -1; // do not reuse this edge + bool found = true; + while (found) + { + int nodeTofind = order.back(); // try first to push back + int i = 0; + for ( i = 0; i < (int)nodesEdges.size(); i++ ) + if (nodesEdges[i] == nodeTofind) + break; + if ( i == (int) nodesEdges.size() ) + found = false; // no follower found on back + else + { + if (i%2) // odd ==> use the previous one + if (nodesEdges[i-1] < 0) + found = false; + else + { + order.push_back(nodesEdges[i-1]); MESSAGE(" --- back " << order.back()+1); + nodesEdges[i-1] = -1; + } + else // even ==> use the next one + if (nodesEdges[i+1] < 0) + found = false; + else + { + order.push_back(nodesEdges[i+1]); MESSAGE(" --- back " << order.back()+1); + nodesEdges[i+1] = -1; + } + } + if (found) + continue; + // try to push front + found = true; + nodeTofind = order.front(); // try to push front + for ( i = 0; i < (int)nodesEdges.size(); i++ ) + if ( nodesEdges[i] == nodeTofind ) + break; + if ( i == (int)nodesEdges.size() ) + { + found = false; // no predecessor found on front + continue; + } + if (i%2) // odd ==> use the previous one + if (nodesEdges[i-1] < 0) + found = false; + else + { + order.push_front(nodesEdges[i-1]); MESSAGE(" --- front " << order.front()+1); + nodesEdges[i-1] = -1; + } + else // even ==> use the next one + if (nodesEdges[i+1] < 0) + found = false; + else + { + order.push_front(nodesEdges[i+1]); MESSAGE(" --- front " << order.front()+1); + nodesEdges[i+1] = -1; + } + } + } + + + std::vector nodes; + nodes.push_back(shapeId); + std::list::iterator itl = order.begin(); + for (; itl != order.end(); itl++) + { + nodes.push_back((*itl) + 1); // SMDS id = VTK id + 1; + MESSAGE(" ordered node " << nodes[nodes.size()-1]); + } + listOfListOfNodes.push_back(nodes); + } + // partition geom faces with blocFissure // mesh blocFissure and geom faces of the skin (external wires given, triangle algo to choose) // mesh volume around blocFissure (skin triangles and quadrangle given, tetra algo to choose) @@ -12627,10 +12626,10 @@ int SMESH_MeshEditor::MakeBoundaryMesh(const TIDSortedElemSet& elements, if ( missType == SMDSAbs_Edge ) // boundary edges { nodes.resize( 2+iQuad ); - for ( int i = 0; i < nbFaceNodes; i += 1+iQuad) + for ( size_t i = 0; i < nbFaceNodes; i += 1+iQuad ) { - for ( int j = 0; j < nodes.size(); ++j ) - nodes[j] = nn[ i+j ]; + for ( size_t j = 0; j < nodes.size(); ++j ) + nodes[ j ] = nn[ i+j ]; if ( const SMDS_MeshElement* edge = aMesh->FindElement( nodes, SMDSAbs_Edge, /*noMedium=*/false )) presentBndElems.push_back( edge ); @@ -12717,14 +12716,14 @@ int SMESH_MeshEditor::MakeBoundaryMesh(const TIDSortedElemSet& elements, ++nbAddedBnd; } else - for ( int i = 0; i < missingBndElems.size(); ++i ) + for ( size_t i = 0; i < missingBndElems.size(); ++i ) { - TConnectivity& nodes = missingBndElems[i]; + TConnectivity& nodes = missingBndElems[ i ]; if ( aroundElements && tgtEditor.GetMeshDS()->FindElement( nodes, missType, /*noMedium=*/false)) continue; - SMDS_MeshElement* newElem = + SMDS_MeshElement* newElem = tgtEditor.AddElement( nodes, elemKind.SetPoly( nodes.size()/(iQuad+1) > 4 )); nbAddedBnd += bool( newElem ); @@ -12761,18 +12760,18 @@ int SMESH_MeshEditor::MakeBoundaryMesh(const TIDSortedElemSet& elements, // 3. Copy present boundary elements // ---------------------------------- if ( toCopyExistingBoundary ) - for ( int i = 0 ; i < presentBndElems.size(); ++i ) + for ( size_t i = 0 ; i < presentBndElems.size(); ++i ) { const SMDS_MeshElement* e = presentBndElems[i]; tgtNodes.resize( e->NbNodes() ); - for ( inode = 0; inode < nodes.size(); ++inode ) + for ( inode = 0; inode < tgtNodes.size(); ++inode ) tgtNodes[inode] = getNodeWithSameID( tgtMeshDS, e->GetNode(inode) ); presentEditor->AddElement( tgtNodes, elemToCopy.Init( e )); } else // store present elements to add them to a group - for ( int i = 0 ; i < presentBndElems.size(); ++i ) + for ( size_t i = 0 ; i < presentBndElems.size(); ++i ) { - presentEditor->myLastCreatedElems.Append( presentBndElems[i] ); + presentEditor->myLastCreatedElems.Append( presentBndElems[ i ]); } } // loop on given elements diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 13bf425ab..a2039ac8a 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -730,7 +730,7 @@ public: void sweepElement(const SMDS_MeshElement* elem, const std::vector & newNodesItVec, std::list& newElems, - const int nbSteps, + const size_t nbSteps, SMESH_SequenceOfElemPtr& srcElements); /*! diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 3ceea9fa3..3e52ed9b4 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -139,7 +139,7 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh) SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge ); - int nbOldLinks = myTLinkNodeMap.size(); + //int nbOldLinks = myTLinkNodeMap.size(); if ( !myMesh->HasShapeToMesh() ) { @@ -2070,7 +2070,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector newNodes( nodes.size() * 2 ); newNodes = nodes; - for ( int i = 0; i < nodes.size(); ++i ) + for ( size_t i = 0; i < nodes.size(); ++i ) { const SMDS_MeshNode* n1 = nodes[i]; const SMDS_MeshNode* n2 = nodes[(i+1)%nodes.size()]; @@ -2393,7 +2393,7 @@ SMESH_MesherHelper::AddPolyhedralVolume (const std::vector { vector newNodes; vector newQuantities; - for ( int iFace=0, iN=0; iFace < quantities.size(); ++iFace) + for ( size_t iFace = 0, iN = 0; iFace < quantities.size(); ++iFace ) { int nbNodesInFace = quantities[iFace]; newQuantities.push_back(0); @@ -2402,10 +2402,10 @@ SMESH_MesherHelper::AddPolyhedralVolume (const std::vector const SMDS_MeshNode* n1 = nodes[ iN + i ]; newNodes.push_back( n1 ); newQuantities.back()++; - + const SMDS_MeshNode* n2 = nodes[ iN + ( i+1==nbNodesInFace ? 0 : i+1 )]; -// if ( n1->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE && -// n2->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE ) + // if ( n1->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE && + // n2->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE ) { const SMDS_MeshNode* n12 = GetMediumNode( n1, n2, force3d, TopAbs_SOLID ); newNodes.push_back( n12 ); @@ -2606,8 +2606,8 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2 } // nb rows of nodes - int prevNbRows = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here - int expectedNbRows = faceSubMesh->NbElements() / ( theParam2ColumnMap.size()-1 ); // to be added + size_t prevNbRows = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here + size_t expectNbRows = faceSubMesh->NbElements() / ( theParam2ColumnMap.size()-1 ); // to be added // fill theParam2ColumnMap column by column by passing from nodes on // theBaseEdge up via mesh faces on theFace @@ -2620,10 +2620,10 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2 { vector& nCol1 = par_nVec_1->second; vector& nCol2 = par_nVec_2->second; - nCol1.resize( prevNbRows + expectedNbRows ); - nCol2.resize( prevNbRows + expectedNbRows ); + nCol1.resize( prevNbRows + expectNbRows ); + nCol2.resize( prevNbRows + expectNbRows ); - int i1, i2, foundNbRows = 0; + int i1, i2; size_t foundNbRows = 0; const SMDS_MeshNode *n1 = nCol1[ prevNbRows-1 ]; const SMDS_MeshNode *n2 = nCol2[ prevNbRows-1 ]; // find face sharing node n1 and n2 and belonging to faceSubMesh @@ -2635,7 +2635,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2 int nbNodes = face->NbCornerNodes(); if ( nbNodes != 4 ) return false; - if ( foundNbRows + 1 > expectedNbRows ) + if ( foundNbRows + 1 > expectNbRows ) return false; n1 = face->GetNode( (i2+2) % 4 ); // opposite corner of quadrangle face n2 = face->GetNode( (i1+2) % 4 ); @@ -2645,12 +2645,12 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2 } avoidSet.insert( face ); } - if ( foundNbRows != expectedNbRows ) + if ((size_t) foundNbRows != expectNbRows ) return false; avoidSet.clear(); } return ( theParam2ColumnMap.size() > 1 && - theParam2ColumnMap.begin()->second.size() == prevNbRows + expectedNbRows ); + theParam2ColumnMap.begin()->second.size() == prevNbRows + expectNbRows ); } namespace @@ -3553,11 +3553,11 @@ namespace { // Structures used by FixQuadraticElements() int NbVolumes() const { return !_volumes[0] ? 0 : !_volumes[1] ? 1 : 2; } void AddSelfToLinks() const { - for ( int i = 0; i < _sides.size(); ++i ) + for ( size_t i = 0; i < _sides.size(); ++i ) _sides[i]->_faces.push_back( this ); } int LinkIndex( const QLink* side ) const { - for (int i=0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i; + for (size_t i = 0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i; return -1; } bool GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& err) const; @@ -3589,7 +3589,7 @@ namespace { // Structures used by FixQuadraticElements() const SMDS_MeshNode* nodeToContain) const; const SMDS_MeshNode* GetNodeInFace() const { - for ( int iL = 0; iL < _sides.size(); ++iL ) + for ( size_t iL = 0; iL < _sides.size(); ++iL ) if ( _sides[iL]->MediumPos() == SMDS_TOP_FACE ) return _sides[iL]->_mediumNode; return 0; } @@ -3642,7 +3642,7 @@ namespace { // Structures used by FixQuadraticElements() _sides = links; _sideIsAdded[0]=_sideIsAdded[1]=_sideIsAdded[2]=_sideIsAdded[3]=false; _normal.SetCoord(0,0,0); - for ( int i = 1; i < _sides.size(); ++i ) { + for ( size_t i = 1; i < _sides.size(); ++i ) { const QLink *l1 = _sides[i-1], *l2 = _sides[i]; insert( l1->node1() ); insert( l1->node2() ); // compute normal @@ -3676,7 +3676,7 @@ namespace { // Structures used by FixQuadraticElements() bool QFace::GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& error) const { - if ( iSide >= _sides.size() ) // wrong argument iSide + if ( iSide >= (int)_sides.size() ) // wrong argument iSide return false; if ( _sideIsAdded[ iSide ]) // already in chain return true; @@ -3687,7 +3687,7 @@ namespace { // Structures used by FixQuadraticElements() list< const QFace* > faces( 1, this ); while ( !faces.empty() ) { const QFace* face = faces.front(); - for ( int i = 0; i < face->_sides.size(); ++i ) { + for ( size_t i = 0; i < face->_sides.size(); ++i ) { if ( !face->_sideIsAdded[i] && face->_sides[i] ) { face->_sideIsAdded[i] = true; // find a face side in the chain @@ -3770,7 +3770,7 @@ namespace { // Structures used by FixQuadraticElements() typedef list< pair< const QFace*, TLinkInSet > > TFaceLinkList; TFaceLinkList adjacentFaces; - for ( int iL = 0; iL < _sides.size(); ++iL ) + for ( size_t iL = 0; iL < _sides.size(); ++iL ) { if ( avoidLink._qlink == _sides[iL] ) continue; @@ -3823,10 +3823,10 @@ namespace { // Structures used by FixQuadraticElements() const TChainLink& avoidLink, const SMDS_MeshNode* nodeToContain) const { - for ( int i = 0; i < _sides.size(); ++i ) + for ( size_t i = 0; i < _sides.size(); ++i ) if ( avoidLink._qlink != _sides[i] && (_sides[i]->node1() == nodeToContain || _sides[i]->node2() == nodeToContain )) - return links.find( _sides[ i ]); + return links.find( _sides[i] ); return links.end(); } @@ -3877,7 +3877,7 @@ namespace { // Structures used by FixQuadraticElements() if ( !theStep ) return thePrevLen; // propagation limit reached - int iL; // index of theLink + size_t iL; // index of theLink for ( iL = 0; iL < _sides.size(); ++iL ) if ( theLink._qlink == _sides[ iL ]) break; @@ -4017,7 +4017,7 @@ namespace { // Structures used by FixQuadraticElements() int iFaceCont = -1, nbBoundary = 0, iBoundary[2]={-1,-1}; if ( _faces[0]->IsBoundary() ) iBoundary[ nbBoundary++ ] = 0; - for ( int iF = 1; iFaceCont < 0 && iF < _faces.size(); ++iF ) + for ( size_t iF = 1; iFaceCont < 0 && iF < _faces.size(); ++iF ) { // look for a face bounding none of volumes bound by _faces[0] bool sameVol = false; @@ -4059,10 +4059,10 @@ namespace { // Structures used by FixQuadraticElements() const QFace* QLink::GetContinuesFace( const QFace* face ) const { - for ( int i = 0; i < _faces.size(); ++i ) { + for ( size_t i = 0; i < _faces.size(); ++i ) { if ( _faces[i] == face ) { int iF = i < 2 ? 1-i : 5-i; - return iF < _faces.size() ? _faces[iF] : 0; + return iF < (int)_faces.size() ? _faces[iF] : 0; } } return 0; @@ -4075,7 +4075,7 @@ namespace { // Structures used by FixQuadraticElements() bool QLink::OnBoundary() const { - for ( int i = 0; i < _faces.size(); ++i ) + for ( size_t i = 0; i < _faces.size(); ++i ) if (_faces[i] && _faces[i]->IsBoundary()) return true; return false; } @@ -4144,7 +4144,7 @@ namespace { // Structures used by FixQuadraticElements() for ( ; bnd != bndEnd; ++bnd ) { const QLink* bndLink = *bnd; - for ( int i = 0; i < bndLink->_faces.size(); ++i ) // loop on faces of bndLink + for ( size_t i = 0; i < bndLink->_faces.size(); ++i ) // loop on faces of bndLink { const QFace* face = bndLink->_faces[i]; // quadrange lateral face of a prism if ( !face ) continue; @@ -4211,7 +4211,7 @@ namespace { // Structures used by FixQuadraticElements() { // put links in the set and evalute number of result chains by number of boundary links TLinkSet linkSet; - int nbBndLinks = 0; + size_t nbBndLinks = 0; for ( TChain::iterator lnk = allLinks.begin(); lnk != allLinks.end(); ++lnk ) { linkSet.insert( *lnk ); nbBndLinks += lnk->IsBoundary(); @@ -4260,7 +4260,7 @@ namespace { // Structures used by FixQuadraticElements() TLinkInSet botLink = startLink; // current horizontal link to go up from corner = startCorner; // current corner the botLink ends at - int iRow = 0; + size_t iRow = 0; while ( botLink != linksEnd ) // loop on rows { // add botLink to the columnChain @@ -4357,7 +4357,7 @@ namespace { // Structures used by FixQuadraticElements() // In the linkSet, there must remain the last links of rowChains; add them if ( linkSet.size() != rowChains.size() ) return _BAD_SET_SIZE; - for ( int iRow = 0; iRow < rowChains.size(); ++iRow ) { + for ( size_t iRow = 0; iRow < rowChains.size(); ++iRow ) { // find the link (startLink) ending at startCorner corner = 0; for ( startLink = linkSet.begin(); startLink != linksEnd; ++startLink ) { @@ -4449,6 +4449,7 @@ namespace { // Structures used by FixQuadraticElements() { continue; } + default:; } // get nodes shared by faces that may be distorted SMDS_NodeIteratorPtr nodeIt; @@ -4562,6 +4563,7 @@ namespace { // Structures used by FixQuadraticElements() { concaveFaces.push_back( face ); } + default:; } } if ( concaveFaces.empty() ) @@ -4627,7 +4629,7 @@ namespace { // Structures used by FixQuadraticElements() while ( volIt->more() ) { const SMDS_MeshElement* vol = volIt->next(); - int nbN = vol->NbCornerNodes(); + size_t nbN = vol->NbCornerNodes(); if ( ( nbN != 4 && nbN != 5 ) || !solidSM->Contains( vol ) || !checkedVols.insert( vol ).second ) @@ -4957,7 +4959,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError, else { continue; } - for ( int iC = 0; iC < chains.size(); ++iC ) + for ( size_t iC = 0; iC < chains.size(); ++iC ) { TChain& chain = chains[iC]; if ( chain.empty() ) continue; diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index eae5aee77..1fe3af02f 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -792,7 +792,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, double u = epos->GetUParameter(); paramNodeMap.insert( make_pair( u, node )); } - if ( paramNodeMap.size() != eSubMesh->NbNodes() ) { + if ((int) paramNodeMap.size() != eSubMesh->NbNodes() ) { // wrong U on edge, project Extrema_ExtPC proj; BRepAdaptor_Curve aCurve( edge ); @@ -818,7 +818,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, } //rnv : To fix the bug IPAL21999 Pattern Mapping - New - collapse of pattern mesh - if ( paramNodeMap.size() != eSubMesh->NbNodes() - nbMeduimNodes ) + if ((int) paramNodeMap.size() != eSubMesh->NbNodes() - nbMeduimNodes ) return setErrorCode(ERR_UNEXPECTED); } @@ -1206,7 +1206,7 @@ struct TIsoNode { TIsoNode* myNext[4]; // order: (iDir=0,isForward=0), (1,0), (0,1), (1,1) TIsoNode* myBndNodes[4]; // order: (iDir=0,i=0), (1,0), (0,1), (1,1) TIsoNode(double initU, double initV): - myInitUV( initU, initV ), myUV( 1e100, 1e100 ), myIsMovable(true) + myIsMovable(true), myInitUV( initU, initV ), myUV( 1e100, 1e100 ) { myNext[0] = myNext[1] = myNext[2] = myNext[3] = 0; } bool IsUVComputed() const { return myUV.X() != 1e100; } @@ -2425,7 +2425,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face& theFace, int nbVertices = loadVE( eList, myShapeIDMap ); myShapeIDMap.Add( face ); - if ( myShapeIDToPointsMap.size() != myShapeIDMap.Extent() ) { + if ((int) myShapeIDToPointsMap.size() != myShapeIDMap.Extent() ) { MESSAGE( myShapeIDToPointsMap.size() <<" != " << myShapeIDMap.Extent()); return setErrorCode( ERR_APPLF_INTERNAL_EEROR ); } @@ -2501,7 +2501,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face& theFace, while ( wlIt != wireList.end() ) { list< TopoDS_Edge >& wire = (*wlIt); - int nbEdges = wire.size(); + size_t nbEdges = wire.size(); wlIt++; if ( wlIt != wireList.end() && (*wlIt).size() != nbEdges ) // a unique size wire { @@ -2528,7 +2528,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face& theFace, wlIt = wireList.begin(); while ( wlIt != wireList.end() ) { - int nbSameSize = 0, nbEdges = (*wlIt).size(); + size_t nbSameSize = 0, nbEdges = (*wlIt).size(); list< list< TopoDS_Edge > >::iterator wlIt2 = wlIt; wlIt2++; while ( wlIt2 != wireList.end() && (*wlIt2).size() == nbEdges ) { // a same size wire @@ -2867,7 +2867,7 @@ bool SMESH_Pattern::Apply (SMESH_Mesh* theMesh, // compute UV and XYZ of points on edges - for ( int i = 0; i < myOrderedNodes.size(); ++i, ++iSub ) + for ( size_t i = 0; i < myOrderedNodes.size(); ++i, ++iSub ) { gp_XY& uv1 = keyUV[ i ]; gp_XY& uv2 = ( i+1 < keyUV.size() ) ? keyUV[ i+1 ] : keyUV[ 0 ]; @@ -3104,7 +3104,7 @@ bool SMESH_Pattern::Apply (std::set & theVolumes, // to find point index map< TPoint*, int > pointIndex; - for ( int i = 0; i < myPoints.size(); i++ ) + for ( size_t i = 0; i < myPoints.size(); i++ ) pointIndex.insert( make_pair( & myPoints[ i ], i )); int ind1 = 0; // lowest point index for an element @@ -4014,7 +4014,7 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh, for ( ; i_node != myXYZIdToNodeMap.end(); i_node++ ) { nodesVector[ i_node->first ] = i_node->second; } - for ( int i = 0; i < myXYZ.size(); ++i ) { + for ( size_t i = 0; i < myXYZ.size(); ++i ) { if ( !nodesVector[ i ] && isDefined( myXYZ[ i ] ) ) nodesVector[ i ] = aMeshDS->AddNode (myXYZ[ i ].X(), myXYZ[ i ].Y(), @@ -4184,7 +4184,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes groups.resize( theElements.size() ); const set& allGroups = aMeshDS->GetGroups(); set::const_iterator grIt; - for ( int i = 0; i < theElements.size(); i++ ) + for ( size_t i = 0; i < theElements.size(); i++ ) { shapeIDs[ i ] = editor.FindShape( theElements[ i ] ); for ( grIt = allGroups.begin(); grIt != allGroups.end(); grIt++ ) { @@ -4226,7 +4226,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes TElemDef::const_iterator id = elemNodeInd.begin(); int nbNodes; for ( nbNodes = 0; id != elemNodeInd.end(); id++ ) { - if ( *id < theNodesVector.size() ) + if ( *id < (int) theNodesVector.size() ) nodes[ nbNodes++ ] = theNodesVector[ *id ]; else nodes[ nbNodes++ ] = myXYZIdToNodeMap[ *id ]; @@ -4325,7 +4325,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes } if ( onMeshElements ) { list< int > elemIDs; - for ( int i = 0; i < theElements.size(); i++ ) + for ( size_t i = 0; i < theElements.size(); i++ ) { subMesh = theMesh->GetSubMeshContaining( shapeIDs[ i ] ); if ( subMesh ) @@ -4354,7 +4354,7 @@ bool SMESH_Pattern::isReversed(const SMDS_MeshNode* theFirstNode, gp_Pnt P[2]; list::const_iterator id = theIdsList.begin(); for ( int i = 0; i < 2; ++i, ++id ) { - if ( *id < myXYZ.size() ) + if ( *id < (int) myXYZ.size() ) P[ i ] = myXYZ[ *id ]; else { map< int, const SMDS_MeshNode*>::const_iterator i_n; @@ -4790,7 +4790,7 @@ bool SMESH_Pattern::setShapeToMesh(const TopoDS_Shape& theShape) // check nb of vertices TopTools_IndexedMapOfShape vMap; TopExp::MapShapes( theShape, TopAbs_VERTEX, vMap ); - if ( vMap.Extent() + nbNodeOnSeamEdge != myKeyPointIDs.size() ) { + if ( vMap.Extent() + nbNodeOnSeamEdge != (int)myKeyPointIDs.size() ) { MESSAGE( myKeyPointIDs.size() + nbNodeOnSeamEdge << " != " << vMap.Extent() ); return setErrorCode( ERR_APPL_BAD_NB_VERTICES ); } diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index f360512c6..4c9cac353 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -90,7 +90,7 @@ namespace const SMESH::double_array& aCoords = theSeq[theId].coords; const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(3*aNbElems != aCoords.length()) + if(3*aNbElems != (CORBA::Long) aCoords.length()) EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()"); for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){ SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId], @@ -112,7 +112,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if (2*aNbElems != anIndexes.length()) + if (2*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()"); CORBA::Long anIndexId = 0; for (; anElemId < aNbElems; anElemId++, anIndexId+=2) @@ -135,9 +135,9 @@ namespace const SMESH::double_array& aDiameter = theSeq[theId].coords; const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if (2*aNbElems != anIndexes.length() ) + if (2*aNbElems != (CORBA::Long) anIndexes.length() ) EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != anIndexes.length()"); - if (aNbElems != aDiameter.length()) + if (aNbElems != (CORBA::Long) aDiameter.length()) EXCEPTION(runtime_error,"AddEdgeWithID - aNbElems != aDiameter.length()"); CORBA::Long anIndexId = 0; for (; anElemId < aNbElems; anElemId++, anIndexId+=2) @@ -160,7 +160,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(3*aNbElems != anIndexes.length()) + if(3*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){ SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1], @@ -181,7 +181,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(4*aNbElems != anIndexes.length()) + if(4*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], @@ -203,7 +203,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(5*aNbElems != anIndexes.length()) + if(5*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], @@ -280,7 +280,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(5*aNbElems != anIndexes.length()) + if(5*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -303,7 +303,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(6*aNbElems != anIndexes.length()) + if(6*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -327,7 +327,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(7*aNbElems != anIndexes.length()) + if(7*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddPrismsWithID - 7*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -352,7 +352,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(9*aNbElems != anIndexes.length()) + if(9*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddHexasWithID - 9*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -378,7 +378,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(13*aNbElems != anIndexes.length()) + if(13*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddHexPrismWithID - 13*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=13){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -443,7 +443,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(4*aNbElems != anIndexes.length()) + if(4*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadEdgeWithID - 4*aNbElems != aCoords.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){ SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1], @@ -465,7 +465,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(7*aNbElems != anIndexes.length()) + if(7*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadTriasWithID - 7*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], @@ -490,7 +490,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(9*aNbElems != anIndexes.length()) + if(9*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadQuadsWithID - 9*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], @@ -516,7 +516,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(10*aNbElems != anIndexes.length()) + if(10*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddBiQuadQuadsWithID - 10*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=10){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], @@ -543,7 +543,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(8*aNbElems != anIndexes.length()) + if(8*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddBiQuadTriasWithID - 8*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=8){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], @@ -569,7 +569,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(11*aNbElems != anIndexes.length()) + if(11*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadTetrasWithID - 11*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=11){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -598,7 +598,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(14*aNbElems != anIndexes.length()) + if(14*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadPiramidsWithID - 14*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=14){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -630,7 +630,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(16*aNbElems != anIndexes.length()) + if(16*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadPentasWithID - 16*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=16){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -664,7 +664,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(21*aNbElems != anIndexes.length()) + if(21*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadHexasWithID - 21*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=21){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], @@ -702,7 +702,7 @@ namespace { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(28*aNbElems != anIndexes.length()) + if(28*aNbElems != (CORBA::Long) anIndexes.length()) EXCEPTION(runtime_error,"AddTriQuadHexasWithID - 28*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=28){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 23b24c5fe..7957b4fdd 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -1268,7 +1268,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList& ids ) SMESH::ListOfGroups_var groups = aMesh->GetGroups(); myInfo->append( "" ); // separator bool top_created = false; - for ( int i = 0; i < groups->length(); i++ ) { + for ( CORBA::ULong i = 0; i < groups->length(); i++ ) { SMESH::SMESH_GroupBase_var aGrp = groups[i]; if ( CORBA::is_nil( aGrp ) ) continue; QString aName = aGrp->GetName(); @@ -1528,7 +1528,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList& ids ) SMESH::ListOfGroups_var groups = aMesh->GetGroups(); myInfo->append( "" ); // separator bool top_created = false; - for ( int i = 0; i < groups->length(); i++ ) { + for ( CORBA::ULong i = 0; i < groups->length(); i++ ) { SMESH::SMESH_GroupBase_var aGrp = groups[i]; if ( CORBA::is_nil( aGrp ) ) continue; QString aName = aGrp->GetName(); @@ -1788,7 +1788,7 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) if ( !CORBA::is_nil( aMesh ) ) { SMESH::ListOfGroups_var groups = aMesh->GetGroups(); QTreeWidgetItem* groupsItem = 0; - for ( int i = 0; i < groups->length(); i++ ) { + for ( CORBA::ULong i = 0; i < groups->length(); i++ ) { SMESH::SMESH_GroupBase_var aGrp = groups[i]; if ( CORBA::is_nil( aGrp ) ) continue; QString aName = aGrp->GetName(); @@ -2086,7 +2086,7 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) if ( !CORBA::is_nil( aMesh ) ) { SMESH::ListOfGroups_var groups = aMesh->GetGroups(); QTreeWidgetItem* groupsItem = 0; - for ( int i = 0; i < groups->length(); i++ ) { + for ( CORBA::ULong i = 0; i < groups->length(); i++ ) { SMESH::SMESH_GroupBase_var aGrp = groups[i]; if ( CORBA::is_nil( aGrp ) ) continue; QString aName = aGrp->GetName(); @@ -2643,7 +2643,7 @@ void SMESHGUI_AddInfo::showGroups() itemGroups->setData( 0, Qt::UserRole, GROUPS_ID ); // total number of groups > 10, show extra widgets for info browsing - if ( myGroups->length() > MAXITEMS ) { + if ((int) myGroups->length() > MAXITEMS ) { ExtraWidget* extra = new ExtraWidget( this, true ); connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousGroups() ) ); connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextGroups() ) ); @@ -2704,7 +2704,7 @@ void SMESHGUI_AddInfo::showSubMeshes() itemSubMeshes->setData( 0, Qt::UserRole, SUBMESHES_ID ); // total number of sub-meshes > 10, show extra widgets for info browsing - if ( mySubMeshes->length() > MAXITEMS ) { + if ((int) mySubMeshes->length() > MAXITEMS ) { ExtraWidget* extra = new ExtraWidget( this, true ); connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousSubMeshes() ) ); connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextSubMeshes() ) ); diff --git a/src/SMESHUtils/SMESH_Block.cxx b/src/SMESHUtils/SMESH_Block.cxx index b87928995..0d7eed4a7 100644 --- a/src/SMESHUtils/SMESH_Block.cxx +++ b/src/SMESHUtils/SMESH_Block.cxx @@ -166,7 +166,7 @@ void SMESH_Block::TFace::Set( const int faceID, // pcurves vector< int > edgeIdVec; GetFaceEdgesIDs( faceID, edgeIdVec ); - for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges + for ( size_t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges { myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] ); if ( myC2d[ iE ]) delete myC2d[ iE ]; @@ -2083,7 +2083,7 @@ bool SMESH_Block::LoadFace(const TopoDS_Face& theFace, bool isForward[4]; vector< int > edgeIdVec; GetFaceEdgesIDs( theFaceID, edgeIdVec ); - for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges + for ( size_t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges { if ( edgeIdVec[ iE ] > theShapeIDMap.Extent() ) return false; diff --git a/src/SMESHUtils/SMESH_FreeBorders.cxx b/src/SMESHUtils/SMESH_FreeBorders.cxx index 6d180f8c2..52018179e 100644 --- a/src/SMESHUtils/SMESH_FreeBorders.cxx +++ b/src/SMESHUtils/SMESH_FreeBorders.cxx @@ -344,19 +344,6 @@ namespace } // namespace -// struct needed for NCollection_Map -struct TLinkHasher -{ - static int HashCode(const SMESH_TLink& link, int aLimit) - { - return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit ); - } - static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2) - { - return ( l1.node1() == l2.node1() && l1.node2() == l2.node2() ); - } -}; - //================================================================================ /* * Returns groups of TFreeBorder's coincident within the given tolerance. @@ -370,7 +357,7 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh, CoincidentFreeBorders & foundFreeBordes) { // find free links - typedef NCollection_DataMap TLink2FaceMap; + typedef NCollection_DataMap TLink2FaceMap; TLink2FaceMap linkMap; int nbSharedLinks = 0; SMDS_FaceIteratorPtr faceIt = mesh.facesIterator(); diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index e589289e8..dc29b8be2 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -270,7 +270,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() ElementBndBoxTree::~ElementBndBoxTree() { - for ( int i = 0; i < _elements.size(); ++i ) + for ( size_t i = 0; i < _elements.size(); ++i ) if ( --_elements[i]->_refCount <= 0 ) delete _elements[i]; } @@ -284,7 +284,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() Bnd_B3d* ElementBndBoxTree::buildRootBox() { Bnd_B3d* box = new Bnd_B3d; - for ( int i = 0; i < _elements.size(); ++i ) + for ( size_t i = 0; i < _elements.size(); ++i ) box->Add( *_elements[i] ); return box; } @@ -297,7 +297,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() void ElementBndBoxTree::buildChildrenData() { - for ( int i = 0; i < _elements.size(); ++i ) + for ( size_t i = 0; i < _elements.size(); ++i ) { for (int j = 0; j < 8; j++) { @@ -315,7 +315,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() for (int j = 0; j < 8; j++) { ElementBndBoxTree* child = static_cast( myChildren[j]); - if ( child->_elements.size() <= MaxNbElemsInLeaf ) + if ((int) child->_elements.size() <= MaxNbElemsInLeaf ) child->myIsLeaf = true; if ( child->_elements.capacity() - child->_elements.size() > 1000 ) @@ -337,7 +337,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() if ( isLeaf() ) { - for ( int i = 0; i < _elements.size(); ++i ) + for ( size_t i = 0; i < _elements.size(); ++i ) if ( !_elements[i]->IsOut( point.XYZ() )) foundElems.insert( _elements[i]->_element ); } @@ -362,7 +362,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() if ( isLeaf() ) { - for ( int i = 0; i < _elements.size(); ++i ) + for ( size_t i = 0; i < _elements.size(); ++i ) if ( !_elements[i]->IsOut( line )) foundElems.insert( _elements[i]->_element ); } @@ -388,7 +388,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() if ( isLeaf() ) { - for ( int i = 0; i < _elements.size(); ++i ) + for ( size_t i = 0; i < _elements.size(); ++i ) if ( !_elements[i]->IsOut( center, radius )) foundElems.insert( _elements[i]->_element ); } @@ -1325,6 +1325,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshElement* elem, return GetDistance( dynamic_cast( elem ), point); case SMDSAbs_Node: return point.Distance( SMESH_TNodeXYZ( elem )); + default:; } return -1; } @@ -1421,6 +1422,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face, // cout << distVec.Magnitude() << " VERTEX " << face->GetNode(pos._index)->GetID() << endl; return distVec.Magnitude(); } + default:; } return badDistance; } diff --git a/src/SMESHUtils/SMESH_OctreeNode.cxx b/src/SMESHUtils/SMESH_OctreeNode.cxx index e55128eb8..3c50fa8e7 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.cxx +++ b/src/SMESHUtils/SMESH_OctreeNode.cxx @@ -102,7 +102,7 @@ Bnd_B3d* SMESH_OctreeNode::buildRootBox() gp_XYZ p1( n1->X(), n1->Y(), n1->Z() ); box->Add(p1); } - if ( myNodes.size() <= getMaxNbNodes() ) + if ((int) myNodes.size() <= getMaxNbNodes() ) myIsLeaf = true; return box; @@ -151,7 +151,7 @@ void SMESH_OctreeNode::buildChildrenData() for (int i = 0; i < 8; i++) { SMESH_OctreeNode* myChild = dynamic_cast (myChildren[i]); - if ( myChild->myNodes.size() <= getMaxNbNodes() ) + if ((int) myChild->myNodes.size() <= getMaxNbNodes() ) myChild->myIsLeaf = true; } } diff --git a/src/SMESHUtils/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx index afef61b90..bd5f41d12 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -80,8 +80,11 @@ namespace SMESHUtils struct Deleter { TOBJ* _obj; - Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {} + explicit Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {} ~Deleter() { delete _obj; _obj = 0; } + TOBJ& operator*() const { return *_obj; } + TOBJ* operator->() const { return _obj; } + operator bool() const { return _obj; } private: Deleter( const Deleter& ); }; @@ -113,6 +116,16 @@ struct SMESH_TLink: public NLink { if ( first->GetID() < second->GetID() ) std::swap( first, second ); } const SMDS_MeshNode* node1() const { return first; } const SMDS_MeshNode* node2() const { return second; } + + // methods for usage of SMESH_TLink as a hasher in NCollection maps + static int HashCode(const SMESH_TLink& link, int aLimit) + { + return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit ); + } + static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2) + { + return ( l1.node1() == l2.node1() && l1.node2() == l2.node2() ); + } }; //======================================================================= diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index a676b7a16..5c7b4af5c 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -98,7 +98,7 @@ namespace SMESH myStream << "[ "; for ( size_t i = 1; i <= theVarValue.myVals.size(); ++i ) { - if ( myVarsCounter < varIDs.size() && varIDs[ myVarsCounter ] >= 0 ) + if ( myVarsCounter < (int)varIDs.size() && varIDs[ myVarsCounter ] >= 0 ) myStream << TVar::Quote() << varIDs[ myVarsCounter ] << TVar::Quote(); else myStream << theVarValue.myVals[i-1]; @@ -110,7 +110,7 @@ namespace SMESH } else { - if ( myVarsCounter < varIDs.size() && varIDs[ myVarsCounter ] >= 0 ) + if ( myVarsCounter < (int)varIDs.size() && varIDs[ myVarsCounter ] >= 0 ) myStream << TVar::Quote() << varIDs[ myVarsCounter ] << TVar::Quote(); else myStream << theVarValue.myVals[0]; @@ -247,7 +247,7 @@ namespace SMESH else { theStream << "[ "; - for (int i = 1; i <= theArray.length(); i++) { + for (CORBA::ULong i = 1; i <= theArray.length(); i++) { theStream << theArray[i-1]; if ( i < theArray.length() ) theStream << ", "; @@ -281,7 +281,7 @@ namespace SMESH TPythonDump::operator<<(const SMESH::string_array& theArray) { myStream << "[ "; - for (int i = 1; i <= theArray.length(); i++) { + for ( CORBA::ULong i = 1; i <= theArray.length(); i++ ) { myStream << "'" << theArray[i-1] << "'"; if ( i < theArray.length() ) myStream << ", "; @@ -564,7 +564,7 @@ namespace SMESH for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP ) { const SMESH::FreeBorderPart& aPART = aGRP[ iP ]; - if ( 0 <= aPART.border && aPART.border < theCFB.borders.length() ) + if ( 0 <= aPART.border && aPART.border < (CORBA::Long)theCFB.borders.length() ) { if ( iP ) myStream << ", "; const SMESH::FreeBorder& aBRD = theCFB.borders[ aPART.border ]; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 36c67c01e..a63597715 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1204,7 +1204,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa aPythonDump << "], status) = " << this << "." << theCommandNameForPython << "(r'" << theFileNameForPython << "')"; } // Dump creation of groups - for ( int i = 0; i < aResult->length(); ++i ) + for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) SMESH::ListOfGroups_var groups = aResult[ i ]->GetGroups(); return aResult._retn(); @@ -1382,7 +1382,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName, aPythonDump << "], status) = " << this << ".CreateMeshesFromCGNS(r'" << theFileName << "')"; } // Dump creation of groups - for ( int i = 0; i < aResult->length(); ++i ) + for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) SMESH::ListOfGroups_var groups = aResult[ i ]->GetGroups(); #else THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR); @@ -1777,9 +1777,10 @@ SMESH::algo_error_array* SMESH_Gen_i::GetAlgoState( SMESH::SMESH_Mesh_ptr theMes */ //============================================================================= -SMESH::long_array* SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject, - const SMESH::object_array& theListOfSubShapeObject ) - throw ( SALOME::SALOME_Exception ) +SMESH::long_array* +SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject, + const SMESH::object_array& theListOfSubShapeObject ) + throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetSubShapesId" ); @@ -1788,58 +1789,57 @@ SMESH::long_array* SMESH_Gen_i::GetSubShapesId( GEOM::GEOM_Object_ptr theMainSha set setId; if ( CORBA::is_nil( theMainShapeObject ) ) - THROW_SALOME_CORBA_EXCEPTION( "bad shape object reference", - SALOME::BAD_PARAM ); + THROW_SALOME_CORBA_EXCEPTION( "bad shape object reference", SALOME::BAD_PARAM ); try + { + TopoDS_Shape myMainShape = GeomObjectToShape(theMainShapeObject); + TopTools_IndexedMapOfShape myIndexToShape; + TopExp::MapShapes(myMainShape,myIndexToShape); + + for ( CORBA::ULong i = 0; i < theListOfSubShapeObject.length(); i++ ) { - TopoDS_Shape myMainShape = GeomObjectToShape(theMainShapeObject); - TopTools_IndexedMapOfShape myIndexToShape; - TopExp::MapShapes(myMainShape,myIndexToShape); + GEOM::GEOM_Object_var aShapeObject + = GEOM::GEOM_Object::_narrow(theListOfSubShapeObject[i]); + if ( CORBA::is_nil( aShapeObject ) ) + THROW_SALOME_CORBA_EXCEPTION ("bad shape object reference", \ + SALOME::BAD_PARAM ); - for ( int i = 0; i < theListOfSubShapeObject.length(); i++ ) - { - GEOM::GEOM_Object_var aShapeObject - = GEOM::GEOM_Object::_narrow(theListOfSubShapeObject[i]); - if ( CORBA::is_nil( aShapeObject ) ) - THROW_SALOME_CORBA_EXCEPTION ("bad shape object reference", \ - SALOME::BAD_PARAM ); - - TopoDS_Shape locShape = GeomObjectToShape(aShapeObject); - for (TopExp_Explorer exp(locShape,TopAbs_FACE); exp.More(); exp.Next()) - { - const TopoDS_Face& F = TopoDS::Face(exp.Current()); - setId.insert(myIndexToShape.FindIndex(F)); - if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(F)); - } - for (TopExp_Explorer exp(locShape,TopAbs_EDGE); exp.More(); exp.Next()) - { - const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); - setId.insert(myIndexToShape.FindIndex(E)); - if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(E)); - } - for (TopExp_Explorer exp(locShape,TopAbs_VERTEX); exp.More(); exp.Next()) - { - const TopoDS_Vertex& V = TopoDS::Vertex(exp.Current()); - setId.insert(myIndexToShape.FindIndex(V)); - if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(V)); - } - } - shapesId->length(setId.size()); - set::iterator iind; - int i=0; - for (iind = setId.begin(); iind != setId.end(); iind++) - { - if(MYDEBUG) SCRUTE((*iind)); - shapesId[i] = (*iind); - if(MYDEBUG) SCRUTE(shapesId[i]); - i++; - } + TopoDS_Shape locShape = GeomObjectToShape(aShapeObject); + for (TopExp_Explorer exp(locShape,TopAbs_FACE); exp.More(); exp.Next()) + { + const TopoDS_Face& F = TopoDS::Face(exp.Current()); + setId.insert(myIndexToShape.FindIndex(F)); + if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(F)); + } + for (TopExp_Explorer exp(locShape,TopAbs_EDGE); exp.More(); exp.Next()) + { + const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); + setId.insert(myIndexToShape.FindIndex(E)); + if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(E)); + } + for (TopExp_Explorer exp(locShape,TopAbs_VERTEX); exp.More(); exp.Next()) + { + const TopoDS_Vertex& V = TopoDS::Vertex(exp.Current()); + setId.insert(myIndexToShape.FindIndex(V)); + if(MYDEBUG) SCRUTE(myIndexToShape.FindIndex(V)); + } } + shapesId->length(setId.size()); + set::iterator iind; + int i=0; + for (iind = setId.begin(); iind != setId.end(); iind++) + { + if(MYDEBUG) SCRUTE((*iind)); + shapesId[i] = (*iind); + if(MYDEBUG) SCRUTE(shapesId[i]); + i++; + } + } catch (SALOME_Exception& S_ex) - { - THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); - } + { + THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); + } return shapesId._retn(); } @@ -2172,13 +2172,13 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, MapShapeNbElemsItr anIt = aResMap.begin(); for(; anIt!=aResMap.end(); anIt++) { const vector& aVec = (*anIt).second; - for(i = SMESH::Entity_Node; i < aVec.size(); i++) { + for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) { int nbElem = aVec[i]; if ( nbElem < 0 ) // algo failed, check that it has reported a message { - SMESH_subMesh* sm = anIt->first; + SMESH_subMesh* sm = anIt->first; SMESH_ComputeErrorPtr& error = sm->GetComputeError(); - const SMESH_Algo* algo = sm->GetAlgo(); + const SMESH_Algo* algo = sm->GetAlgo(); if ( (algo && !error.get()) || error->IsOK() ) error.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED,"Failed to evaluate",algo)); } @@ -2434,7 +2434,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, std::vector aNodesArray; // loop on sub-meshes - for ( int i = 0; i < theMeshesArray.length(); i++) + for ( CORBA::ULong i = 0; i < theMeshesArray.length(); i++) { if ( CORBA::is_nil( theMeshesArray[i] )) continue; SMESH::SMESH_Mesh_var anInitMesh = theMeshesArray[i]->GetMesh(); @@ -2443,8 +2443,8 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, if ( !anInitImpl ) continue; anInitImpl->Load(); - ::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl(); - SMESHDS_Mesh* anInitMeshDS = aInitLocMesh.GetMeshDS(); + //::SMESH_Mesh& aInitLocMesh = anInitImpl->GetImpl(); + //SMESHDS_Mesh* anInitMeshDS = aInitLocMesh.GetMeshDS(); // remember nb of elements before filling in SMESH::long_array_var prevState = aNewMesh->GetNbElementsByType(); @@ -2517,7 +2517,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, const char* typeNames[] = { "All","Nodes","Edges","Faces","Volumes","0DElems","Balls" }; { // check of typeNames, compilation failure mains that NB_ELEMENT_TYPES changed: const int nbNames = sizeof(typeNames) / sizeof(const char*); - int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 1 : -1 ]; + int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 1 : -1 ]; _assert[0]=0; } string groupName = "Gr"; SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, theMeshesArray[i] ); @@ -2558,7 +2558,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, if ( SMESH_Mesh_i* anSrcImpl = SMESH::DownCast( theMeshesArray[i] )) { // copy orphan nodes - if ( anSrcImpl->NbNodes() > nodesMap.size() ) + if ( anSrcImpl->NbNodes() > (int)nodesMap.size() ) { SMDS_ElemIteratorPtr itNodes = anInitImpl->GetElements( theMeshesArray[i], SMESH::NODE ); while ( itNodes->more() ) @@ -2580,12 +2580,12 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, // loop on groups of a source mesh aListOfGroups = anSrcImpl->GetGroups(); - for (int iG = 0; iG < aListOfGroups->length(); iG++) + for ( CORBA::ULong iG = 0; iG < aListOfGroups->length(); iG++ ) { aGroup = aListOfGroups[iG]; aGroupType = aGroup->GetType(); aGroupName = aGroup->GetName(); - string aName = aGroupName.in(); + string aName = aGroupName.in(); // convert a list of IDs anNewIDs->length( aGroup->Size() ); @@ -2632,7 +2632,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, aNewGroups.front()->SetName(aNewGroupName.c_str()); } char aGroupNum[128]; - sprintf(aGroupNum, "%u", aNewGroups.size()+1); + sprintf(aGroupNum, "%u", (unsigned int)aNewGroups.size()+1); aNewGroupName = aName + "_" + string(aGroupNum); aNewGroup->SetName(aNewGroupName.c_str()); aNewGroups.push_back(aNewGroup); @@ -2656,7 +2656,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, aPythonDump << aNewMesh << " = " << this << "." << ( theCommonGroups ? "ConcatenateWithGroups" : "Concatenate" ) << "(["; - for ( int i = 0; i < theMeshesArray.length(); i++) { + for ( CORBA::ULong i = 0; i < theMeshesArray.length(); i++) { if (i > 0) aPythonDump << ", "; aPythonDump << theMeshesArray[i]; } @@ -2747,13 +2747,13 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, SMESH::long_array_var ids = meshPart->GetIDs(); if ( srcElemTypes->length() == 1 && srcElemTypes[0] == SMESH::NODE ) // group of nodes { - for (int i=0; i < ids->length(); i++) + for ( CORBA::ULong i=0; i < ids->length(); i++ ) if ( const SMDS_MeshElement * elem = srcMeshDS->FindNode( ids[i] )) srcElems.insert( elem ); } else { - for (int i=0; i < ids->length(); i++) + for ( CORBA::ULong i = 0; i < ids->length(); i++ ) if ( const SMDS_MeshElement * elem = srcMeshDS->FindElement( ids[i] )) srcElems.insert( elem ); } @@ -3044,7 +3044,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, TPythonDump pd; // not to dump GetGroups() SMESH::ListOfGroups_var groups = myMesh->GetGroups(); pd << ""; // to avoid optimizing pd out - for ( int i = 0; i < groups->length(); ++i ) + for ( CORBA::ULong i = 0; i < groups->length(); ++i ) { SMESH_GroupBase_i* grImpl = SMESH::DownCast( groups[i]); if ( grImpl ) @@ -5047,8 +5047,8 @@ char* SMESH_Gen_i::getVersion() // Is used in the drag-n-drop functionality. //================================================================================= void SMESH_Gen_i::Move( const SMESH::sobject_list& what, - SALOMEDS::SObject_ptr where, - CORBA::Long row ) + SALOMEDS::SObject_ptr where, + CORBA::Long row ) { if ( CORBA::is_nil( where ) ) return; @@ -5070,7 +5070,7 @@ void SMESH_Gen_i::Move( const SMESH::sobject_list& what, } } - for ( int i = 0; i < what.length(); i++ ) { + for ( CORBA::ULong i = 0; i < what.length(); i++ ) { SALOMEDS::SObject_var sobj = what[i]; if ( CORBA::is_nil( sobj ) ) continue; // skip bad object // insert the object to the use case tree @@ -5130,9 +5130,10 @@ SMESH::long_array* SMESH_Gen_i::GetInsideSphere( SMESH::SMESH_IDSource_ptr meshP CORBA::Double theX, CORBA::Double theY, CORBA::Double theZ, - CORBA::Double theR) { + CORBA::Double theR) +{ SMESH::long_array_var aResult = new SMESH::long_array(); - if(meshPart->_is_nil()) + if ( meshPart->_is_nil() ) return aResult._retn(); // 1. Create geometrical object @@ -5141,9 +5142,9 @@ SMESH::long_array* SMESH_Gen_i::GetInsideSphere( SMESH::SMESH_IDSource_ptr meshP std::vector lst =_GetInside(meshPart, theElemType, aShape); - if( lst.size() > 0 ) { + if ( lst.size() > 0 ) { aResult->length( lst.size() ); - for ( long i = 0; i < lst.size(); i++ ) { + for ( size_t i = 0; i < lst.size(); i++ ) { aResult[i] = lst[i]; } } @@ -5168,7 +5169,7 @@ SMESH::long_array* SMESH_Gen_i::GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart if( lst.size() > 0 ) { aResult->length( lst.size() ); - for ( long i = 0; i < lst.size(); i++ ) { + for ( size_t i = 0; i < lst.size(); i++ ) { aResult[i] = lst[i]; } } @@ -5199,7 +5200,7 @@ SMESH::long_array* SMESH_Gen_i::GetInsideCylinder( SMESH::SMESH_IDSource_ptr mes if( lst.size() > 0 ) { aResult->length( lst.size() ); - for ( long i = 0; i < lst.size(); i++ ) { + for ( size_t i = 0; i < lst.size(); i++ ) { aResult[i] = lst[i]; } } @@ -5220,7 +5221,7 @@ SMESH::long_array* SMESH_Gen_i::GetInside( SMESH::SMESH_IDSource_ptr meshPart, if( lst.size() > 0 ) { aResult->length( lst.size() ); - for ( long i = 0; i < lst.size(); i++ ) { + for ( size_t i = 0; i < lst.size(); i++ ) { aResult[i] = lst[i]; } } @@ -5274,8 +5275,8 @@ std::vector SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart, if ( !gsource->_is_nil() ) { if(theElemType == SMESH::NODE) { SMESH::long_array_var nodes = gsource->GetNodeIDs(); - for ( int i = 0; i < nodes->length(); ++i ) { - if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] ) ) { + for ( CORBA::ULong i = 0; i < nodes->length(); ++i ) { + if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] )) { long anId = node->GetID(); if ( anElementsOnShape->IsSatisfy( anId ) ) res.push_back( anId ); @@ -5283,8 +5284,8 @@ std::vector SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart, } } else if (gsource->GetType() == theElemType || theElemType == SMESH::ALL ) { SMESH::long_array_var elems = gsource->GetListOfID(); - for ( int i = 0; i < elems->length(); ++i ) { - if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] ) ) { + for ( CORBA::ULong i = 0; i < elems->length(); ++i ) { + if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] )) { long anId = elem->GetID(); if ( anElementsOnShape->IsSatisfy( anId ) ) res.push_back( anId ); @@ -5295,7 +5296,7 @@ std::vector SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart, SMESH::SMESH_subMesh_var smsource = SMESH::SMESH_subMesh::_narrow(meshPart); if ( !smsource->_is_nil() ) { SMESH::long_array_var elems = smsource->GetElementsByType( theElemType ); - for ( int i = 0; i < elems->length(); ++i ) { + for ( CORBA::ULong i = 0; i < elems->length(); ++i ) { const SMDS_MeshElement* elem = ( theElemType == SMESH::NODE ) ? meshDS->FindNode( elems[i] ) : meshDS->FindElement( elems[i] ); if (elem) { long anId = elem->GetID(); diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 76c2f35d6..66422047d 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -585,7 +585,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr theStudy, // Publish global hypotheses SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( aShapeObject ); - for ( int i = 0; i < hypList->length(); i++ ) + for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) { SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]); SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp ); @@ -710,7 +710,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr theS // Publish hypothesis SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( theShapeObject ); - for ( int i = 0; i < hypList->length(); i++ ) { + for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) { SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]); SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp ); AddHypothesisToShape( theStudy, theMesh, theShapeObject, aHyp ); @@ -742,7 +742,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy if ( aMeshSO->_is_nil()) return SALOMEDS::SObject::_nil(); } - int aType = (int)theGroup->GetType(); + size_t aType = (int)theGroup->GetType(); const char* aRootNames[] = { "Compound Groups", "Groups of Nodes", "Groups of Edges", "Groups of Faces", "Groups of Volumes", "Groups of 0D Elements", diff --git a/src/StdMeshers/CMakeLists.txt b/src/StdMeshers/CMakeLists.txt index 05af0db64..6327d5d21 100644 --- a/src/StdMeshers/CMakeLists.txt +++ b/src/StdMeshers/CMakeLists.txt @@ -62,6 +62,7 @@ SET(_link_LIBRARIES ${CAS_TKAdvTools} ${CAS_TKTopAlgo} ${CAS_TKG3d} + ${CAS_TKOffset} ${GEOM_GEOMUtils} SMESHimpl SMESHDS diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 24c054636..2fc76a7b3 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -703,7 +703,7 @@ namespace // internal utils void ElementBndBoxTree::buildChildrenData() { ElemTreeData* data = GetElemData(); - for ( int i = 0; i < _elementIDs.size(); ++i ) + for ( size_t i = 0; i < _elementIDs.size(); ++i ) { const Bnd_B3d* elemBox = data->GetBox( _elementIDs[i] ); for (int j = 0; j < 8; j++) @@ -718,7 +718,7 @@ namespace // internal utils { ElementBndBoxTree* child = static_cast( myChildren[j] ); child->_elementIDs = data->myWorkIDs[ j ]; - if ( child->_elementIDs.size() <= theMaxNbElemsInLeaf ) + if ((int) child->_elementIDs.size() <= theMaxNbElemsInLeaf ) child->myIsLeaf = true; data->myWorkIDs[ j ].clear(); } @@ -741,7 +741,7 @@ namespace // internal utils if ( isLeaf() ) { ElemTreeData* data = GetElemData(); - for ( int i = 0; i < _elementIDs.size(); ++i ) + for ( size_t i = 0; i < _elementIDs.size(); ++i ) if ( !data->GetBox( _elementIDs[i] )->IsOut( center, radius )) foundElemIDs.push_back( _elementIDs[i] ); } @@ -1197,7 +1197,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, StdMeshers_Regular_1D::_value[ DEFLECTION_IND ] = myHyp->GetDeflection(); list< double > params; - for ( int iE = 0; iE < myEdges.size(); ++iE ) + for ( size_t iE = 0; iE < myEdges.size(); ++iE ) { EdgeData& eData = myEdges[ iE ]; //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl; @@ -1243,7 +1243,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, triaSearcher->SetSizeByTrias( sizeTree, myHyp->GetDeflection() ); - for ( int iE = 0; iE < myEdges.size(); ++iE ) + for ( size_t iE = 0; iE < myEdges.size(); ++iE ) { EdgeData& eData = myEdges[ iE ]; @@ -1260,7 +1260,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, double maxSegSize = 0; // get points to check distance to the face - EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++, pItLast; + EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++; maxSegSize = pIt1->mySegSize = Min( pIt1->mySegSize, sizeTree.GetSize( pIt1->myP )); for ( ; pIt2 != eData.myPoints.end(); ) { @@ -1290,7 +1290,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl; sizeDecreased = false; const gp_Pnt* avoidPnt = & eData.First().myP; - pItLast = --eData.myPoints.end(); + EdgeData::TPntIter pItLast = --eData.myPoints.end(), pItFirst = eData.myPoints.begin(); for ( pIt1 = eData.myPoints.begin(); pIt1 != eData.myPoints.end(); ) { double distToFace = @@ -1308,19 +1308,16 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, // << "\t SetSize " << allowedSize << " at " // << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<myP.Z() << endl; pIt2 = pIt1; - if ( --pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize ) + if ( pIt1 != pItFirst && ( --pIt2 )->mySegSize > allowedSize ) sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize ); pIt2 = pIt1; - if ( ++pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize ) + if ( pIt1 != pItLast && ( ++pIt2 )->mySegSize > allowedSize ) sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize ); } pIt1->mySegSize = allowedSize; } ++pIt1; - if ( pIt1 == pItLast ) - avoidPnt = & eData.Last().myP; - else - avoidPnt = NULL; + avoidPnt = ( pIt1 == pItLast ) ? & eData.Last().myP : NULL; if ( iLoop > 20 ) { @@ -1357,7 +1354,7 @@ bool AdaptiveAlgo::makeSegments() vector< double > nbSegs, params; - for ( int iE = 0; iE < myEdges.size(); ++iE ) + for ( size_t iE = 0; iE < myEdges.size(); ++iE ) { EdgeData& eData = myEdges[ iE ]; @@ -1368,13 +1365,13 @@ bool AdaptiveAlgo::makeSegments() edgeMinSize = Min( edgeMinSize, Min( pIt1->mySegSize, mySizeTree->GetSize( pIt1->myP ))); - const double f = eData.myC3d.FirstParameter(), l = eData.myC3d.LastParameter(); + const double f = eData.myC3d.FirstParameter(), l = eData.myC3d.LastParameter(); const double parLen = l - f; const int nbDivSeg = 5; - int nbDiv = Max( 1, int ( eData.myLength / edgeMinSize * nbDivSeg )); + size_t nbDiv = Max( 1, int ( eData.myLength / edgeMinSize * nbDivSeg )); // compute nb of segments - bool toRecompute = true; + bool toRecompute = true; double maxSegSize = 0; size_t i = 1, segCount; //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl; @@ -1432,7 +1429,7 @@ bool AdaptiveAlgo::makeSegments() } // compute parameters of nodes - int nbSegFinal = Max( 1, int(floor( nbSegs.back() + 0.5 ))); + size_t nbSegFinal = Max( 1, int(floor( nbSegs.back() + 0.5 ))); double fact = nbSegFinal / nbSegs.back(); if ( maxSegSize / fact > myHyp->GetMaxSize() ) fact = ++nbSegFinal / nbSegs.back(); diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index 5b03b484a..6d8135590 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -240,6 +240,7 @@ bool StdMeshers_CartesianParameters3D::GetFixedPoint(double p[3]) const if ( Precision::IsInfinite( _fixedPoint[0] )) return false; std::copy( &_fixedPoint[0], &_fixedPoint[0]+3, &p[0] ); + return true; } @@ -371,7 +372,7 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0, // correct coords if a forced point is too close to a neighbor node if ( forced ) { - int iF = 0; + size_t iF = 0; double minLen = ( x1 - x0 ); for ( size_t i = 1; i < coords.size(); ++i ) { @@ -522,9 +523,8 @@ ComputeOptimalAxesDirs(const TopoDS_Shape& shape, const TCooTriple* norm1 = 0; double sumArea = 0; vector< const TCooTriple* > norms; - for ( int iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF ) + for ( size_t iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF ) { - if ( !norm1 || !sameDir( *norm1, norm2a->first )) { if ( !norms.empty() ) diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 52ac9f8f3..c2aa6f3e4 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -2731,7 +2731,7 @@ namespace chn.back()->IsLinked( quad._eIntNodes[ iP ]->_intPoint )) { chn.push_back( quad._eIntNodes[ iP ]); - found = quad._eIntNodes[ iP ]->_usedInFace = &quad; + found = ( quad._eIntNodes[ iP ]->_usedInFace = &quad ); break; } } while ( found && ! chn.back()->IsLinked( n2->_intPoint ) ); @@ -2823,7 +2823,7 @@ namespace ( !avoidFace || quad._eIntNodes[ iP ]->IsOnFace( avoidFace ))) { chn.push_back( quad._eIntNodes[ iP ]); - found = quad._eIntNodes[ iP ]->_usedInFace = &quad; + found = ( quad._eIntNodes[ iP ]->_usedInFace = &quad ); break; } } while ( found ); diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 07919e0ff..57bf3eaca 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -62,9 +62,7 @@ #ifdef _DEBUG_ // #define DEB_FACES // #define DEB_GRID -// #define DUMP_VERT(msg,V) \ -// { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); \ -// cout << msg << "( "<< p.X()<<", "<GetSubShape() ); - auto_ptr< StdMeshers_FaceSide > side + SMESHUtils::Deleter< StdMeshers_FaceSide > side ( StdMeshers_CompositeSegment_1D::GetFaceSide(*subMesh->GetFather(), edge, face, false )); if ( side->NbEdges() > 1 && side->NbSegments() ) @@ -287,21 +287,21 @@ void StdMeshers_CompositeSegment_1D::SetEventListener(SMESH_subMesh* subMesh) // check if an edge is a part of a complex side TopoDS_Face face; TopoDS_Edge edge = TopoDS::Edge( subMesh->GetSubShape() ); - auto_ptr< StdMeshers_FaceSide > side - ( StdMeshers_CompositeSegment_1D::GetFaceSide(*subMesh->GetFather(),edge, face, false )); + SMESHUtils::Deleter< StdMeshers_FaceSide > side + ( StdMeshers_CompositeSegment_1D::GetFaceSide( *subMesh->GetFather(), edge, face, false )); if ( side->NbEdges() > 1 ) { // complex // set _alwaysComputed to vertices for ( int iE = 1; iE < side->NbEdges(); ++iE ) { - TopoDS_Vertex V = side->FirstVertex( iE ); + TopoDS_Vertex V = side->FirstVertex( iE ); SMESH_subMesh* sm = side->GetMesh()->GetSubMesh( V ); sm->SetIsAlwaysComputed( true ); } } } // set listener that will remove _alwaysComputed from submeshes at algorithm change - subMesh->SetEventListener( new VertexNodesRestoringListener(), 0, subMesh); + subMesh->SetEventListener( new VertexNodesRestoringListener(), 0, subMesh ); StdMeshers_Regular_1D::SetEventListener( subMesh ); } @@ -368,7 +368,7 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh & aMesh, // Get edges to be discretized as a whole TopoDS_Face nullFace; - auto_ptr< StdMeshers_FaceSide > side( GetFaceSide(aMesh, edge, nullFace, true )); + SMESHUtils::Deleter< StdMeshers_FaceSide > side( GetFaceSide(aMesh, edge, nullFace, true )); //side->dump("IN COMPOSITE SEG"); if ( side->NbEdges() < 2 ) @@ -384,7 +384,7 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh & aMesh, } // Compute node parameters - auto_ptr< BRepAdaptor_CompCurve > C3d ( side->GetCurve3d() ); + SMESHUtils::Deleter< BRepAdaptor_CompCurve > C3d ( side->GetCurve3d() ); double f = C3d->FirstParameter(), l = C3d->LastParameter(); list< double > params; if ( !computeInternalParameters ( aMesh, *C3d, side->Length(), f, l, params, false )) diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index c8d4c7a72..34af3a6fd 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -504,8 +504,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, { aCubeSide[i]._columns.resize( aCubeSide[i]._u2nodesMap.size() ); - int iFwd = 0, iRev = aCubeSide[i]._columns.size()-1; - int* pi = isReverse[i] ? &iRev : &iFwd; + size_t iFwd = 0, iRev = aCubeSide[i]._columns.size()-1; + size_t* pi = isReverse[i] ? &iRev : &iFwd; TParam2ColumnMap::iterator u2nn = aCubeSide[i]._u2nodesMap.begin(); for ( ; iFwd < aCubeSide[i]._columns.size(); --iRev, ++iFwd, ++u2nn ) aCubeSide[i]._columns[ *pi ].swap( u2nn->second ); diff --git a/src/StdMeshers/StdMeshers_ImportSource.cxx b/src/StdMeshers/StdMeshers_ImportSource.cxx index 7ed56e331..de6bfc047 100644 --- a/src/StdMeshers/StdMeshers_ImportSource.cxx +++ b/src/StdMeshers/StdMeshers_ImportSource.cxx @@ -125,14 +125,14 @@ namespace bool loaded=false) { vector okGroups; - for ( int i = 0; i < groups.size(); ++i ) + for ( size_t i = 0; i < groups.size(); ++i ) { try { // we expect SIGSEGV on a dead group OCC_CATCH_SIGNALS; SMESH_Group* okGroup = 0; - map::iterator itm = itm = studyContext->mapMesh.begin(); + map::iterator itm = studyContext->mapMesh.begin(); for ( ; !okGroup && itm != studyContext->mapMesh.end(); itm++) { SMESH_Mesh::GroupIteratorPtr gIt = itm->second->GetGroups(); @@ -174,7 +174,7 @@ namespace { int tgtID = resMapKey.second; SMESH_Mesh* tgtMesh = 0; - map::iterator itm = itm = studyContext->mapMesh.begin(); + map::iterator itm = studyContext->mapMesh.begin(); for ( ; !tgtMesh && itm != studyContext->mapMesh.end(); itm++) { tgtMesh = (*itm).second; @@ -250,7 +250,7 @@ std::vector StdMeshers_ImportSource1D::GetSourceMeshes() const StudyContextStruct* studyContext = _gen->GetStudyContext(_studyId); for ( set::iterator id = meshIDs.begin(); id != meshIDs.end(); ++id ) { - map::iterator itm = itm = studyContext->mapMesh.begin(); + map::iterator itm = studyContext->mapMesh.begin(); for ( ; itm != studyContext->mapMesh.end(); itm++) { SMESH_Mesh* mesh = (*itm).second; @@ -394,7 +394,7 @@ void StdMeshers_ImportSource1D::RestoreGroups(const std::vector& g _groups = groups; _resultGroups.clear(); - int i = 0; + size_t i = 0; while ( i < _resultGroupsStorage.size() ) { int key1 = _resultGroupsStorage[i++]; diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index a2f1047fe..51a639869 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -79,23 +79,9 @@ using namespace std; #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; } #define CONT_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); continue; } #define SHOW_SHAPE(v,msg) \ -// { \ -// if ( (v).IsNull() ) cout << msg << " NULL SHAPE" << endl; \ -// else if ((v).ShapeType() == TopAbs_VERTEX) {\ -// gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( (v) ));\ -// cout<::const_iterator e = l.begin();\ -// for ( int i = 0; e != l.end(); ++e, ++i ) {\ -// cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") "\ -// << i << "E (" << e->TShape().operator->() << "); "; }\ -// cout << endl;\ -// } + // { show_list((msg),(l)); } namespace HERE = StdMeshers_ProjectionUtils; @@ -108,7 +94,24 @@ namespace { return max(theMeshDS[0]->ShapeToIndex(S), theMeshDS[1]->ShapeToIndex(S) ); return long(S.TShape().operator->()); } - + void show_shape( TopoDS_Shape v, const char* msg ) // debug + { + if ( v.IsNull() ) cout << msg << " NULL SHAPE" << endl; + else if (v.ShapeType() == TopAbs_VERTEX) { + gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( v )); + cout<& l ) // debug + { + cout << msg << " "; + list< TopoDS_Edge >::const_iterator e = l.begin(); + for ( int i = 0; e != l.end(); ++e, ++i ) { + cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") " + << i << "E (" << e->TShape().operator->() << "); "; } + cout << endl; + } //================================================================================ /*! * \brief Write shape for debug purposes @@ -2180,7 +2183,7 @@ FindMatchingNodesOnFaces( const TopoDS_Face& face1, static_cast(node->GetPosition()); pos2nodes.insert( make_pair( pos->GetUParameter(), node )); } - if ( pos2nodes.size() != edgeSM->NbNodes() ) + if ((int) pos2nodes.size() != edgeSM->NbNodes() ) RETURN_BAD_RESULT("Equal params of nodes on edge " << smDS->ShapeToIndex( edge ) << " of face " << is2 ); } diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 87572c18f..66c893628 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -423,15 +423,13 @@ namespace { TAssocTool::TNodeNodeMap& src2tgtNodes, bool& is1DComputed) { - SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS(); - SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS(); - src2tgtNodes.clear(); // get ordered src EDGEs TError err; srcWires = StdMeshers_FaceSide::GetFaceWires( srcFace, *srcMesh,/*skipMediumNodes=*/0, err); - if ( err && !err->IsOK() || srcWires.empty() ) + if (( err && !err->IsOK() ) || + ( srcWires.empty() )) return err; SMESH_MesherHelper srcHelper( *srcMesh ); @@ -591,7 +589,7 @@ namespace { const double minSegLen = srcWires[iW]->Length() / totNbSeg; for ( int iE = 0; iE < srcWires[iW]->NbEdges(); ++iE ) { - int nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen )); + size_t nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen )); double srcU = srcWires[iW]->FirstParameter( iE ); double tgtU = tgtWires[iW]->FirstParameter( iE ); double srcDu = ( srcWires[iW]->LastParameter( iE )- srcU ) / nbSeg; @@ -830,7 +828,7 @@ namespace { const double minSegLen = srcWires[iW]->Length() / totNbSeg; for ( int iE = 0; iE < srcWires[iW]->NbEdges(); ++iE ) { - int nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen )); + size_t nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen )); double srcU = srcWires[iW]->FirstParameter( iE ); double tgtU = tgtWires[iW]->FirstParameter( iE ); double srcDu = ( srcWires[iW]->LastParameter( iE )- srcU ) / nbSeg; @@ -920,6 +918,7 @@ namespace { tgtMeshDS->SetNodeOnVertex( n, TopoDS::Vertex( tgtV )); break; } + default:; } srcN_tgtN->second = n; } @@ -952,7 +951,7 @@ namespace { { SMESH_Mesh * tgtMesh = tgtWires[0]->GetMesh(); SMESH_Mesh * srcMesh = srcWires[0]->GetMesh(); - SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS(); + //SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS(); SMESHDS_Mesh * srcMeshDS = srcMesh->GetMeshDS(); if ( srcWires[0]->NbEdges() != 4 ) diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index 1832f48e7..3c3abe385 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -548,7 +548,7 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, //SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); //cout<<" CheckIntersection: meshDS->NbFaces() = "<NbFaces()< suspectElems; searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); - for ( int i = 0; i < suspectElems.size(); ++i ) + for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { - const SMDS_MeshElement* face = suspectElems[i]; + const SMDS_MeshElement* face = suspectElems[iF]; if ( face == NotCheckedFace ) continue; Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; for ( int i = 0; i < face->NbCornerNodes(); ++i ) @@ -566,7 +566,7 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, if( HasIntersection(P, PC, Pres, aContour) ) { res = true; double tmp = PC.Distance(Pres); - if(tmp suspectElems; searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); - for ( int iF = 0; iF < suspectElems.size(); ++iF ) { + for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { const SMDS_MeshElement* F = suspectElems[iF]; - if(F==face) continue; + if ( F == face ) continue; Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; for ( int i = 0; i < 4; ++i ) aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) )); gp_Pnt PPP; - if( !volumes[0] && HasIntersection(Ptmp1, PC, PPP, aContour) ) { + if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) { IsOK1 = true; double tmp = PC.Distance(PPP); - if(tmpValue(i), PN->Value(i+1), PC, VN->Value(i)); PCbest += Pbest.XYZ(); } @@ -1074,10 +1074,10 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) vector< const SMDS_MeshElement* > suspectElems; searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); - for ( int iF = 0; iF < suspectElems.size(); ++iF ) + for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { const SMDS_MeshElement* F = suspectElems[iF]; - if(F==face) continue; + if ( F == face ) continue; Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 ); for ( i = 0; i < nbN; ++i ) @@ -1162,7 +1162,8 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh& return true; SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); - int i, j, k, myShapeID = myPyramids[0]->GetNode(4)->getshapeId(); + size_t i, j, k; + int myShapeID = myPyramids[0]->GetNode(4)->getshapeId(); if ( myElemSearcher ) delete myElemSearcher; myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx index 3334af950..9ac099c2d 100644 --- a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx @@ -598,7 +598,6 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, bool StdMeshers_RadialPrism_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll ) { - bool isCurShellApp; int nbFoundSolids = 0; for (TopExp_Explorer exp( aShape, TopAbs_SOLID ); exp.More(); exp.Next(), ++nbFoundSolids ) { diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index c414e51f4..413a92494 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -343,9 +343,9 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh, return ( aStatus == SMESH_Hypothesis::HYP_OK ); } -static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last, - double length, bool theReverse, - int nbSeg, Function& func, +static bool computeParamByFunc(Adaptor3d_Curve& C3d, + double first, double last, double length, + bool theReverse, int nbSeg, Function& func, list& theParams) { // never do this way @@ -359,31 +359,23 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last, int nbPnt = 1 + nbSeg; vector x(nbPnt, 0.); - if (!buildDistribution(func, 0.0, 1.0, nbSeg, x, 1E-4)) + if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, 1E-4 )) return false; - MESSAGE( "Points:\n" ); - char buf[1024]; - for ( int i=0; i<=nbSeg; i++ ) - { - sprintf( buf, "%f\n", float(x[i] ) ); - MESSAGE( buf ); - } - - - // apply parameters in range [0,1] to the space of the curve double prevU = first; - double sign = 1.; - if (theReverse) + double sign = 1.; + if ( theReverse ) { prevU = last; - sign = -1.; + sign = -1.; } - for( int i = 1; i < nbSeg; i++ ) + + for ( int i = 1; i < nbSeg; i++ ) { double curvLength = length * (x[i] - x[i-1]) * sign; - GCPnts_AbscissaPoint Discret( C3d, curvLength, prevU ); + double tol = Min( Precision::Confusion(), curvLength / 100. ); + GCPnts_AbscissaPoint Discret( tol, C3d, curvLength, prevU ); if ( !Discret.IsDone() ) return false; double U = Discret.Parameter(); diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index 4e6ef16ae..47bbbcd79 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -88,7 +88,7 @@ SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const SMESH::double_array_var aRes = new SMESH::double_array(); const std::vector& res = this->GetImpl()->BuildDistributionExpr( func, nbSeg, conv ); aRes->length( res.size() ); - for (int i = 0; i < res.size(); i++) + for (size_t i = 0; i < res.size(); i++) aRes[i] = res[i]; return aRes._retn(); } @@ -98,23 +98,24 @@ SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const } } -SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func, - CORBA::Long nbSeg, - CORBA::Long conv ) +SMESH::double_array* +StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func, + CORBA::Long nbSeg, + CORBA::Long conv ) throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); std::vector tbl( func.length() ); - for (int i = 0; i < func.length(); i++) + for ( size_t i = 0; i < tbl.size(); i++ ) tbl[i] = func[i]; try { - SMESH::double_array_var aRes = new SMESH::double_array(); + SMESH::double_array_var aRes = new SMESH::double_array(); const std::vector& res = this->GetImpl()->BuildDistributionTab( tbl, nbSeg, conv ); aRes->length( res.size() ); - for (int i = 0; i < res.size(); i++) + for (size_t i = 0; i < res.size(); i++) aRes[i] = res[i]; return aRes._retn(); } @@ -251,7 +252,7 @@ SMESH::long_array* StdMeshers_NumberOfSegments_i::GetReversedEdges() SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); anArray->length( ids.size() ); - for ( CORBA::Long i = 0; i < ids.size(); i++) + for ( size_t i = 0; i < ids.size(); i++) anArray [ i ] = ids [ i ]; return anArray._retn(); @@ -348,7 +349,7 @@ void StdMeshers_NumberOfSegments_i::SetTableFunction(const SMESH::double_array& { ASSERT( myBaseImpl ); std::vector tbl( table.length() ); - for (int i = 0; i < table.length(); i++) + for ( CORBA::ULong i = 0; i < table.length(); i++) tbl[i] = table[i]; try { this->GetImpl()->SetTableFunction( tbl ); @@ -375,12 +376,11 @@ SMESH::double_array* StdMeshers_NumberOfSegments_i::GetTableFunction() tbl = &this->GetImpl()->GetTableFunction(); } catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); } SMESH::double_array_var aRes = new SMESH::double_array(); aRes->length(tbl->size()); - for (int i = 0; i < tbl->size(); i++) + for ( size_t i = 0; i < tbl->size(); i++ ) aRes[i] = (*tbl)[i]; return aRes._retn(); } From 25b7d7ffe76e153c93cb67055192b11b16c3d0e2 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 25 Nov 2015 13:53:04 +0300 Subject: [PATCH 040/147] Compilation error on Mageia 5 (DriverMED_W_SMESHDS_Mesh.cxx) + small changes for 23190: EDF 11636 - Problem of viscous layer (not yet fixed) --- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 2 +- src/SMESH/SMESH_subMesh.cxx | 22 +++++++++++--- src/SMESH/SMESH_subMesh.hxx | 1 + src/SMESHDS/SMESHDS_SubMesh.cxx | 34 +++++++++++++++++----- src/SMESHDS/SMESHDS_SubMesh.hxx | 2 ++ src/SMESHUtils/SMESH_MeshAlgos.cxx | 30 +++++++++++++++++-- 6 files changed, 77 insertions(+), 14 deletions(-) diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index b4ab8dbe4..cee3e1b09 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -525,7 +525,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() const SMDS_MeshInfo& nbElemInfo = myMesh->GetMeshInfo(); // poly elements are not supported by med-2.1 - bool polyTypesSupported = myMed->CrPolygoneInfo(aMeshInfo,eMAILLE,ePOLYGONE,0,0); + bool polyTypesSupported = ( myMed->CrPolygoneInfo(aMeshInfo,eMAILLE,ePOLYGONE,0,0).get() != 0 ); TInt nbPolygonNodes = 0, nbPolyhedronNodes = 0, nbPolyhedronFaces = 0; // nodes on VERTEXes where 0D elements are absent diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 5bb65b5b3..57a401df9 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -457,14 +457,17 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() namespace { - int dependsOnMapKey( const SMESH_subMesh* sm ) + int dependsOnMapKey( TopAbs_ShapeEnum type, int shapeID ) { - int type = sm->GetSubShape().ShapeType(); - int ordType = 9 - type; // 2 = Vertex, 8 = CompSolid - int cle = sm->GetId(); + int ordType = 9 - int(type); // 2 = Vertex, 8 = CompSolid + int cle = shapeID; cle += 10000000 * ordType; // sort map by ordType then index return cle; } + int dependsOnMapKey( const SMESH_subMesh* sm ) + { + return dependsOnMapKey( sm->GetSubShape().ShapeType(), sm->GetId() ); + } } //============================================================================= @@ -503,6 +506,17 @@ bool SMESH_subMesh::DependsOn( const SMESH_subMesh* other ) const return other ? _mapDepend.count( dependsOnMapKey( other )) : false; } +//================================================================================ +/*! + * \brief Return \c true if \a this sub-mesh depends on a \a shape + */ +//================================================================================ + +bool SMESH_subMesh::DependsOn( const int shapeID ) const +{ + return DependsOn( _father->GetSubMeshContaining( shapeID )); +} + //============================================================================= /*! * Return a shape of \a this sub-mesh diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 249784c08..24152268d 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -81,6 +81,7 @@ class SMESH_EXPORT SMESH_subMesh const std::map < int, SMESH_subMesh * >& DependsOn(); bool DependsOn( const SMESH_subMesh* other ) const; + bool DependsOn( const int shapeID ) const; /*! * \brief Return iterator on the sub-meshes this one depends on. By default * most simple sub-meshes go first. diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 04a0021fc..32f89c9a6 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -89,7 +89,7 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME) MESSAGE("add element in subshape already belonging to that subshape " << ME->GetID() << " " << oldShapeId << " " << idInSubShape); // check if ok: do nothing if ok - if (idInSubShape >= myElements.size()) + if (idInSubShape >= (int)myElements.size()) { throw SALOME_Exception(LOCALIZED("out of bounds")); } @@ -128,7 +128,7 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME); elem->setShapeId(0); elem->setIdInShape(-1); - if ((idInSubShape >= 0) && (idInSubShape < myElements.size())) + if ((idInSubShape >= 0) && (idInSubShape < (int) myElements.size())) { myElements[idInSubShape] = 0; // this vector entry is no more used if ( ++myUnusedIdElements == (int) myElements.size() ) @@ -160,7 +160,7 @@ void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N) if ( shapeId != myIndex ) throw SALOME_Exception (LOCALIZED("a node being in sub-mesh is added to another sub-mesh")); - if ( idInSubShape >= myNodes.size() || myNodes[ idInSubShape ] != N ) + if ( idInSubShape >= (int)myNodes.size() || myNodes[ idInSubShape ] != N ) throw SALOME_Exception (LOCALIZED("a node with wrong idInSubShape is re-added to the same sub-mesh")); return; // already in @@ -187,7 +187,7 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) SMDS_MeshNode* node = (SMDS_MeshNode*) (N); node->setShapeId(0); node->setIdInShape(-1); - if ((idInSubShape >= 0) && (idInSubShape < myNodes.size())) + if ((idInSubShape >= 0) && (idInSubShape < (int) myNodes.size())) { myNodes[idInSubShape] = 0; // this vector entry is no more used if ( ++myUnusedIdNodes == (int) myNodes.size() ) @@ -284,7 +284,7 @@ template class MyIterator : public SMDS_Iterator { public: MyIterator (const set& theSubMeshes) - : mySubIt( theSubMeshes.begin() ), mySubEnd( theSubMeshes.end() ), myMore(false) + : myMore(false), mySubIt( theSubMeshes.begin() ), mySubEnd( theSubMeshes.end() ) {} bool more() { @@ -388,14 +388,14 @@ bool SMESHDS_SubMesh::Contains(const SMDS_MeshElement * ME) const if (ME->GetType() == SMDSAbs_Node) { int idInShape = ME->getIdInShape(); - if ((idInShape >= 0) && (idInShape < myNodes.size())) + if ((idInShape >= 0) && (idInShape < (int) myNodes.size())) if (myNodes[idInShape] == ME) return true; } else { int idInShape = ME->getIdInShape(); - if ((idInShape >= 0) && (idInShape < myElements.size())) + if ((idInShape >= 0) && (idInShape < (int) myElements.size())) if (myElements[idInShape] == ME) return true; } @@ -539,3 +539,23 @@ void SMESHDS_SubMesh::compactList() myUnusedIdNodes = 0; } } + +//======================================================================= +//function : GetElement +//purpose : Return an element by its IdInShape +//======================================================================= + +const SMDS_MeshElement* SMESHDS_SubMesh::GetElement( size_t idInShape ) const +{ + return ( !IsComplexSubmesh() && idInShape < myElements.size() ) ? myElements[idInShape] : 0; +} + +//======================================================================= +//function : GetElement +//purpose : Return a node by its IdInShape +//======================================================================= + +const SMDS_MeshNode* SMESHDS_SubMesh::GetNode( size_t idInShape ) const +{ + return ( !IsComplexSubmesh() && idInShape < myNodes.size() ) ? myNodes[idInShape] : 0; +} diff --git a/src/SMESHDS/SMESHDS_SubMesh.hxx b/src/SMESHDS/SMESHDS_SubMesh.hxx index c70857c60..4eab3aa44 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.hxx +++ b/src/SMESHDS/SMESHDS_SubMesh.hxx @@ -52,6 +52,8 @@ class SMESHDS_EXPORT SMESHDS_SubMesh virtual bool RemoveElement(const SMDS_MeshElement * ME, bool isElemDeleted); // ret true if ME was in virtual void AddNode(const SMDS_MeshNode * ME); virtual bool RemoveNode(const SMDS_MeshNode * ME, bool isNodeDeleted); // ret true if ME was in + virtual const SMDS_MeshElement* GetElement( size_t idInShape ) const; + virtual const SMDS_MeshNode* GetNode ( size_t idInShape ) const; // if IsComplexSubmesh() void AddSubMesh( const SMESHDS_SubMesh* theSubMesh ); diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index dc29b8be2..c42f02023 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1433,9 +1433,35 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face, */ //======================================================================= -double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* edge, const gp_Pnt& point ) +double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* seg, const gp_Pnt& point ) { - throw SALOME_Exception(LOCALIZED("not implemented so far")); + double dist = Precision::Infinite(); + if ( !seg ) return dist; + + int i = 0, nbNodes = seg->NbNodes(); + + vector< SMESH_TNodeXYZ > xyz( nbNodes ); + SMDS_ElemIteratorPtr nodeIt = seg->interlacedNodesElemIterator(); + while ( nodeIt->more() ) + xyz[ i++ ].Set( nodeIt->next() ); + + for ( i = 1; i < nbNodes; ++i ) + { + gp_Vec edge( xyz[i-1], xyz[i] ); + gp_Vec n1p ( xyz[i-1], point ); + double u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge + if ( u <= 0. ) { + dist = Min( dist, n1p.SquareMagnitude() ); + } + else if ( u >= 1. ) { + dist = Min( dist, point.SquareDistance( xyz[i] )); + } + else { + gp_XYZ proj = ( 1. - u ) * xyz[i-1] + u * xyz[i]; // projection of the point on the edge + dist = Min( dist, point.SquareDistance( proj )); + } + } + return Sqrt( dist ); } //======================================================================= From cd8f63e177668f374f675a3163750e31abf2c4b6 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 27 Nov 2015 12:22:06 +0300 Subject: [PATCH 041/147] Another compilation error on Mageia 5 --- src/OBJECT/SMESH_DeviceActor.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index cf6405554..6f9e3e44c 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -297,7 +297,7 @@ SMESH_DeviceActor SMESH_ScalarBarActor* theScalarBarActor, vtkLookupTable* theLookupTable) { - bool anIsInitialized = theFunctor; + bool anIsInitialized = theFunctor != NULL; if(anIsInitialized){ vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New(); From 8348eecb6ba5e7429a15e7466af805f1c925c2e4 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 27 Nov 2015 13:13:27 +0300 Subject: [PATCH 042/147] One more compilation error on Mageia 5 --- src/OBJECT/SMESH_DeviceActor.cxx | 2 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 6f9e3e44c..aeba34ad9 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -363,7 +363,7 @@ SMESH_DeviceActor SMESH_ScalarBarActor* theScalarBarActor, vtkLookupTable* theLookupTable) { - bool anIsInitialized = theFunctor; + bool anIsInitialized = theFunctor != NULL; myExtractUnstructuredGrid->ClearRegisteredCells(); myExtractUnstructuredGrid->ClearRegisteredCellsWithType(); myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index e2330e95e..6227072d9 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -407,8 +407,8 @@ namespace { if ( nbQuads > 0 ) toRemove = helper->IsStructured( faceSm ); else - toRemove = quadAlgo->CheckNbEdges( *helper->GetMesh(), - faceSm->GetSubShape() ); + toRemove = ( quadAlgo->CheckNbEdges( *helper->GetMesh(), + faceSm->GetSubShape() ) != NULL ); nbRemoved += toRemove; if ( toRemove ) smIt = notQuadSubMesh.erase( smIt ); From aac6ba83a954d30516057206ead49bf3f0c23e93 Mon Sep 17 00:00:00 2001 From: mpa Date: Mon, 30 Nov 2015 13:31:21 +0300 Subject: [PATCH 043/147] INT PAL 0052968: 'Mesh Information' dialog shows incorrect color of group built from geometry (edited) --- src/SMESHDS/SMESHDS_GroupBase.cxx | 4 +++- src/SMESHDS/SMESHDS_GroupBase.hxx | 5 +++++ src/SMESHGUI/SMESHGUI.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx | 11 +---------- src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx | 12 ++++++++++++ src/SMESHGUI/SMESHGUI_GroupOpDlg.h | 1 + src/SMESH_I/SMESH_Gen_i.cxx | 20 ++++++++++++++++++++ src/SMESH_I/SMESH_Gen_i.hxx | 3 +++ 8 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index a9c378fd6..ef2f2de4a 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -32,6 +32,8 @@ using namespace std; +Quantity_Color SMESHDS_GroupBase::myDefaultColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB ); + //============================================================================= /*! * @@ -44,7 +46,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID, myID(theID), myMesh(theMesh), myType(theType), myStoreName(""), myCurIndex(0), myCurID(-1) { - myColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB ); + myColor = myDefaultColor; } //============================================================================= diff --git a/src/SMESHDS/SMESHDS_GroupBase.hxx b/src/SMESHDS/SMESHDS_GroupBase.hxx index 959498e82..305ecb8c0 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.hxx +++ b/src/SMESHDS/SMESHDS_GroupBase.hxx @@ -85,6 +85,9 @@ class SMESHDS_EXPORT SMESHDS_GroupBase int GetColorGroup() const; + static void SetDefaultColor (const Quantity_Color& theColor) + { myDefaultColor = theColor;} + protected: const SMDS_MeshElement* findInMesh (const int theID) const; void resetIterator(); @@ -105,6 +108,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase int myCurIndex; int myCurID; SMDS_ElemIteratorPtr myIterator; + + static Quantity_Color myDefaultColor; }; #endif diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index b3d61a763..d72312ddb 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1951,7 +1951,7 @@ SalomeApp_Module( "SMESH" ) nbSeg = aResourceMgr->integerValue( "SMESH", "nb_segments_per_edge", 15 ); myComponentSMESH->SetDefaultNbSegments( nbSeg ); - const char* options[] = { "historical_python_dump", "forget_mesh_on_hyp_modif" }; + const char* options[] = { "historical_python_dump", "forget_mesh_on_hyp_modif", "default_grp_color" }; for ( size_t i = 0; i < sizeof(options)/sizeof(char*); ++i ) if ( aResourceMgr->hasValue( "SMESH", options[i] )) { @@ -5376,7 +5376,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) int nbSeg = aResourceMgr->integerValue( "SMESH", "nb_segments_per_edge", 15 ); myComponentSMESH->SetDefaultNbSegments( nbSeg ); } - else if ( name == "historical_python_dump" || name == "forget_mesh_on_hyp_modif") + else if ( name == "historical_python_dump" || name == "forget_mesh_on_hyp_modif" || name == "default_grp_color" ) { QString val = aResourceMgr->stringValue( "SMESH", name ); myComponentSMESH->SetOption( name.toLatin1().constData(), val.toLatin1().constData() ); diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx index deeaad22f..258084e05 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx @@ -30,7 +30,6 @@ #include "SMESHGUI.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_GEOMGenUtils.h" -#include #include #include @@ -351,17 +350,9 @@ bool SMESHGUI_GroupOnShapeOp::onApply() //printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() ); group = mesh->CreateGroupFromGEOM( elemType, name.toLatin1().data(), geom ); - if( !group->_is_nil() ) { - // set default color for created group - QColor c = SMESH::GetColor( "SMESH", "default_grp_color" ); - SALOMEDS::Color aColor; - aColor.R = c.redF(); - aColor.G = c.greenF(); - aColor.B = c.blueF(); - group->SetColor(aColor); + if( !group->_is_nil() ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) ) anEntryList.append( aSObject->GetID().c_str() ); - } } } SMESHGUI::Modified(); diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index 69077f967..6f32383c0 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -31,6 +31,7 @@ #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" #include "SMESH_TypeFilter.hxx" +#include #include #include @@ -232,6 +233,8 @@ void SMESHGUI_GroupOpDlg::Init() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP)); + + setDefaultGroupColor(); } /*! @@ -447,6 +450,14 @@ SALOMEDS::Color SMESHGUI_GroupOpDlg::getColor() const return aColor; } +/*! + \brief Set default color for group +*/ +void SMESHGUI_GroupOpDlg::setDefaultGroupColor() +{ + myColorBtn->setColor( SMESH::GetColor( "SMESH", "default_grp_color", QColor( 255, 170, 0 ) ) ); +} + /*! \brief SLOT, called when selection is changed. Current implementation does nothing. The method should be redefined in derived classes to update @@ -505,6 +516,7 @@ void SMESHGUI_GroupOpDlg::reset() { myNameEdit->setText(""); myNameEdit->setFocus(); + setDefaultGroupColor(); } /*! diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h index 6f6b70175..f4191a942 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h @@ -88,6 +88,7 @@ protected: SMESH::ListOfGroups* convert( const QList& ); SALOMEDS::Color getColor() const; + void setDefaultGroupColor(); void setIsApplyAndClose( const bool theFlag ); bool isApplyAndClose() const; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index a63597715..d069a3df8 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -953,6 +953,22 @@ void SMESH_Gen_i::SetOption(const char* name, const char* value) msgToGUI = "preferences/SMESH/forget_mesh_on_hyp_modif/"; msgToGUI += myToForgetMeshDataOnHypModif ? "true" : "false"; } + else if ( strcmp(name, "default_grp_color") == 0 ) + { + vector color; + string str = value; + if ( str.at(0) == '#' && str.length() == 7 ) // color should be presented as a string (#aaaaaa, for example) + str = str.substr(1); + for ( int i = 0; i < str.length()/2; i++ ) + if ( str.at(i*2) >= '0' && str.at(i*2) <= 'f' && str.at(i*2+1) >= '0' && str.at(i*2+1) <= 'f' ) + color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) ); + if ( color.size() == 3 ) { // color must have three valid component + SMESHDS_GroupBase::SetDefaultColor( Quantity_Color( color[0]/255., color[1]/255., color[2]/255., Quantity_TOC_RGB ) ); + myDefaultGroupColor = value; + msgToGUI = "preferences/SMESH/default_grp_color/"; + msgToGUI += value; + } + } // update preferences in case if SetOption() is invoked from python console if ( !msgToGUI.empty() ) @@ -983,6 +999,10 @@ char* SMESH_Gen_i::GetOption(const char* name) { return CORBA::string_dup( myToForgetMeshDataOnHypModif ? "true" : "false" ); } + if ( strcmp(name, "default_grp_color") == 0 ) + { + return CORBA::string_dup( myDefaultGroupColor.c_str() ); + } } return CORBA::string_dup( "" ); } diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 7f6427205..e2be6042d 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -679,6 +679,9 @@ private: SALOMEDS::Study_var myCurrentStudy; // Current study CORBA::Boolean myIsEmbeddedMode; // Current mode + // Default color of groups + std::string myDefaultGroupColor; + // To load full mesh data from study at hyp modification or not bool myToForgetMeshDataOnHypModif; From 7d08ac8481b4a92dcad8fe4a3ea88956856dea15 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 1 Dec 2015 14:32:09 +0300 Subject: [PATCH 044/147] Fix regression of non-regression tests - Coplanar faces filter (SMESH_Controls.cxx) - Convert to quadratic (SMESH_MesherHelper.cxx) - Missing Compute item in mesh pop-up in presence of a sub-mesh on compound only (no other algos) (SSMESHGUI_ComputeDlg.cxx) - set checkAll=False in call of SMESH_Gen::IsApplicable() (smeshBuilder.py) --- src/Controls/SMESH_Controls.cxx | 9 +++++---- src/SMESH/SMESH_MesherHelper.cxx | 11 ++++++----- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 2 +- src/SMESH_SWIG/StdMeshersBuilder.py | 2 ++ src/SMESH_SWIG/smeshBuilder.py | 7 ++++--- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 9978a6d68..3f612a24f 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -3013,12 +3013,13 @@ bool ConnectedElements::IsSatisfy( long theElementId ) namespace { - inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos2 ) + inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos ) { double dot = v1 * v2; // cos * |v1| * |v2| double l1 = v1.SquareMagnitude(); double l2 = v2.SquareMagnitude(); - return ( dot * dot ) / l1 / l2 >= cos2; + return (( dot * cos >= 0 ) && + ( dot * dot ) / l1 / l2 >= ( cos * cos )); } } CoplanarFaces::CoplanarFaces() @@ -3046,7 +3047,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) if (!normOK) return; - const double cosTol2 = Cos( myToler ) * Cos( myToler ); + const double cosTol = Cos( myToler * M_PI / 180. ); NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks; std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue; @@ -3070,7 +3071,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) if ( f->GetNodeIndex( n2 ) > -1 ) { gp_Vec norm = getNormale( static_cast(f), &normOK ); - if (!normOK || isLessAngle( myNorm, norm, cosTol2)) + if (!normOK || isLessAngle( myNorm, norm, cosTol)) { myCoplanarIDs.Add( f->GetID() ); faceQueue.push_back( make_pair( f, norm )); diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 3e52ed9b4..3703a7215 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -4059,12 +4059,13 @@ namespace { // Structures used by FixQuadraticElements() const QFace* QLink::GetContinuesFace( const QFace* face ) const { - for ( size_t i = 0; i < _faces.size(); ++i ) { - if ( _faces[i] == face ) { - int iF = i < 2 ? 1-i : 5-i; - return iF < (int)_faces.size() ? _faces[iF] : 0; + if ( _faces.size() <= 4 ) + for ( size_t i = 0; i < _faces.size(); ++i ) { + if ( _faces[i] == face ) { + int iF = i < 2 ? 1-i : 5-i; + return iF < (int)_faces.size() ? _faces[iF] : 0; + } } - } return 0; } //================================================================================ diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 429531fd2..a71b425d4 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1773,7 +1773,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh, } // check sub-meshes - for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart < SMESH::Tag_LastSubMesh; ++aPart ) + for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart <= SMESH::Tag_LastSubMesh; ++aPart ) { if ( !theMesh->FindSubObject( aPart, aHypFolder )) continue; diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index 98acce5f6..d9ad9bf5e 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -1421,6 +1421,8 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm): hyp.GetCopySourceMesh() == args[1], args[2] ) hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups], UseExisting=UseExisting, CompareMethod=compFun, toAdd=False) + if groups and isinstance( groups, SMESH._objref_SMESH_GroupBase ): + groups = [groups] hyp.SetSourceFaces(groups) hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups) self.mesh.AddHypothesis(hyp, self.geom) diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 22ea69d83..0dc3b25f0 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1680,9 +1680,10 @@ class Mesh: if self.mesh.HasShapeToMesh(): hyp_type = hyp.GetName() lib_name = hyp.GetLibName() - checkAll = ( not geom.IsSame( self.mesh.GetShapeToMesh() )) - if checkAll and geom: - checkAll = geom.GetType() == 37 + # checkAll = ( not geom.IsSame( self.mesh.GetShapeToMesh() )) + # if checkAll and geom: + # checkAll = geom.GetType() == 37 + checkAll = False isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll) if isApplicable: AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName()) From a023eb130715d5475257b16d0f84353dae527d78 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 1 Dec 2015 16:28:08 +0300 Subject: [PATCH 045/147] 52981: Dump python on MESH module does't work --- src/SMESH_I/SMESH_DumpPython.cxx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index 5c7b4af5c..187055df5 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -1179,9 +1179,11 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl if ( importGeom && isMultiFile ) { initPart += ("\n## import GEOM dump file ## \n" - "import string, os, sys, re\n" - "sys.path.insert( 0, os.path.dirname(__file__) )\n" - "exec(\"from \"+re.sub(\"SMESH$\",\"GEOM\",__name__)+\" import *\")\n"); + "import string, os, sys, re, inspect\n" + "thisFile = inspect.getfile( inspect.currentframe() )\n" + "thisModule = os.path.splitext( os.path.basename( thisFile ))[0]\n" + "sys.path.insert( 0, os.path.dirname( thisFile ))\n" + "exec(\"from \"+re.sub(\"SMESH$\",\"GEOM\",thisModule)+\" import *\")\n\n"); } // import python files corresponding to plugins if they are used in anUpdatedScript { @@ -1207,7 +1209,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl initPart += importStr + "\n"; } - if( isMultiFile ) + if ( isMultiFile ) initPart += "def RebuildData(theStudy):"; initPart += "\n"; @@ -1271,8 +1273,18 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl anUpdatedScript += removeObjPart + '\n' + setNamePart + '\n' + visualPropertiesPart; - if( isMultiFile ) - anUpdatedScript += "\n\tpass"; + if ( isMultiFile ) + { + anUpdatedScript += + "\n\tpass" + "\n" + "\nif __name__ == '__main__':" + "\n\tSMESH_RebuildData = RebuildData" + "\n\texec('import '+re.sub('SMESH$','GEOM',thisModule)+' as GEOM_dump')" + "\n\tGEOM_dump.RebuildData( salome.myStudy )" + "\n\texec('from '+re.sub('SMESH$','GEOM',thisModule)+' import * ')" + "\n\tSMESH_RebuildData( salome.myStudy )"; + } anUpdatedScript += "\n"; // no need now as we use 'tab' and 'nt' variables depending on isMultiFile From 03335084a6a8286c16af9f416fb7e1a6df936ca6 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 2 Dec 2015 12:42:04 +0300 Subject: [PATCH 046/147] Add missing import SMESH --- src/SMESH_SWIG/StdMeshersBuilder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index d9ad9bf5e..6dd91e288 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -1417,6 +1417,7 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm): # @param UseExisting if ==true - searches for the existing hypothesis created with # the same parameters, else (default) - creates a new one def SourceFaces(self, groups, toCopyMesh=False, toCopyGroups=False, UseExisting=False): + import SMESH compFun = lambda hyp, args: ( hyp.GetSourceFaces() == args[0] and \ hyp.GetCopySourceMesh() == args[1], args[2] ) hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups], From 733276c6f76d930f6772878442bc3cac5f6af553 Mon Sep 17 00:00:00 2001 From: ctn Date: Wed, 28 Oct 2015 13:38:46 +0100 Subject: [PATCH 047/147] Variables for MGCleaner/Yams are already set in the Salome environment --- src/Tools/MGCleanerPlug/MGCleanerMonViewText.py | 17 ----------------- src/Tools/YamsPlug/monViewText.py | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py b/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py index 64179ae4c..df1076832 100644 --- a/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py +++ b/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py @@ -51,23 +51,6 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog): # Je n arrive pas a utiliser le setEnvironment du QProcess # fonctionne hors Salome mais pas dans Salome ??? cmds='' - try : - LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_MGCLEANER"] - except: - LICENCE_FILE='' - try : - PATH=os.environ["DISTENE_PATH_FOR_MGCLEANER"] - except: - PATH='' - if LICENCE_FILE != '': - cmds+='source '+LICENCE_FILE+'\n' - else: - cmds+="# $DISTENE_LICENCE_FILE_FOR_MGCLEANER NOT SET\n" - if PATH != '': - cmds+='export PATH='+PATH+':$PATH\n' - else: - cmds+="# $DISTENE_PATH_FOR_MGCLEANER NOT SET\n" - #cmds+='env\n' cmds+='rm -f '+self.parent().fichierOut+'\n' cmds+=txt+'\n' cmds+='echo END_OF_MGCleaner\n' diff --git a/src/Tools/YamsPlug/monViewText.py b/src/Tools/YamsPlug/monViewText.py index 35171babb..7b518b574 100644 --- a/src/Tools/YamsPlug/monViewText.py +++ b/src/Tools/YamsPlug/monViewText.py @@ -49,23 +49,6 @@ class MonViewText(Ui_ViewExe, QDialog): # Je n arrive pas a utiliser le setEnvironment du QProcess # fonctionne hors Salome mais pas dans Salome ??? cmds='' - try : - LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_YAMS"] - except: - LICENCE_FILE='' - try : - PATH=os.environ["DISTENE_PATH_FOR_YAMS"] - except: - PATH='' - if LICENCE_FILE != '': - cmds+='source '+LICENCE_FILE+'\n' - else: - cmds+="# $DISTENE_LICENCE_FILE_FOR_YAMS NOT SET\n" - if PATH != '': - cmds+='export PATH='+PATH+':$PATH\n' - else: - cmds+="# $DISTENE_PATH_FOR_YAMS NOT SET\n" - #cmds+='env\n' cmds+='rm -f '+self.parent().fichierOut+'\n' cmds+=txt+'\n' cmds+='echo END_OF_Yams\n' From f573f79fc8f2013e495d92f16319b5762e9fb7ae Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 9 Dec 2015 10:33:24 +0300 Subject: [PATCH 048/147] INT PAL 53009: 'Remove row' removes 1st row always. --- src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx index c5ba29ec4..2066cac77 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx @@ -445,7 +445,7 @@ deleteRow() { QList selRows = selectedRows(); for ( int r = selRows.count()-1; r >= 0; r-- ) - removeRow( r ); + removeRow( selRows.at(r) ); } void From 9f2962eb000753a1525d0a5b2971859cbcac8661 Mon Sep 17 00:00:00 2001 From: mpa Date: Thu, 17 Dec 2015 10:53:53 +0300 Subject: [PATCH 049/147] INT PAL 52986: Previously selected 'Scale distribution' type is not selected at edit of 'Nb. Segments' hypothesis --- src/StdMeshers/StdMeshers_NumberOfSegments.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 29e55e4a5..8d262e36f 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -186,8 +186,9 @@ void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor) if (_distrType != DT_Scale) _distrType = DT_Scale; - if ( fabs(scaleFactor - 1.0) < PRECISION ) - _distrType = DT_Regular; +// commented by mpa for IPAL 52986 +// if ( fabs(scaleFactor - 1.0) < PRECISION ) +// _distrType = DT_Regular; if ( fabs(_scaleFactor - scaleFactor) > PRECISION ) { From e8abed47ddbe3165daf1f40f4809988c82bee22f Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 17 Dec 2015 15:38:56 +0100 Subject: [PATCH 050/147] Porting PV50 --- src/OBJECT/SMESH_ScalarBarActor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OBJECT/SMESH_ScalarBarActor.h b/src/OBJECT/SMESH_ScalarBarActor.h index 6bcd2fb5a..77546227f 100644 --- a/src/OBJECT/SMESH_ScalarBarActor.h +++ b/src/OBJECT/SMESH_ScalarBarActor.h @@ -122,7 +122,7 @@ class SMESHOBJECT_EXPORT SMESH_ScalarBarActor: public vtkActor2D { // Set/Get the maximum number of scalar bar segments to show. This may // differ from the number of colors in the lookup table, in which case // the colors are samples from the lookup table. - vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_LARGE_INTEGER); + vtkSetClampMacro(MaximumNumberOfColors, int, 2, VTK_INT_MAX); vtkGetMacro(MaximumNumberOfColors, int); // Description: From 14440f49669dab69af74c1fb39526daae2bad91b Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 23 Dec 2015 14:00:59 +0300 Subject: [PATCH 051/147] INT PAL 0052968: 'Mesh Information' dialog shows incorrect color of group built from geometry. (added a new form for defining color) --- src/SMESH_I/SMESH_Gen_i.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index d069a3df8..fe64ce7b7 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -957,11 +957,23 @@ void SMESH_Gen_i::SetOption(const char* name, const char* value) { vector color; string str = value; - if ( str.at(0) == '#' && str.length() == 7 ) // color should be presented as a string (#aaaaaa, for example) + // color must be presented as a string of next form: + if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example) str = str.substr(1); for ( int i = 0; i < str.length()/2; i++ ) if ( str.at(i*2) >= '0' && str.at(i*2) <= 'f' && str.at(i*2+1) >= '0' && str.at(i*2+1) <= 'f' ) color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) ); + } + else { // rgb color ("255,170,0", for example) + char* tempValue = strdup( value ); + char* colorValue = strtok( tempValue, "," ); + while ( colorValue != NULL ) { + int c_value = atoi( colorValue ); + if ( c_value >= 0 && c_value <= 255 ) + color.push_back( c_value ); + colorValue = strtok( NULL, "," ); + } + } if ( color.size() == 3 ) { // color must have three valid component SMESHDS_GroupBase::SetDefaultColor( Quantity_Color( color[0]/255., color[1]/255., color[2]/255., Quantity_TOC_RGB ) ); myDefaultGroupColor = value; From 3db9cecef8cc72d6b5065a23cfc42f7349cbb691 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 30 Dec 2015 19:55:01 +0300 Subject: [PATCH 052/147] IPAL53054: Hexahedron(ijk) fails with SIGSEGV --- doc/salome/gui/SMESH/input/about_meshes.doc | 7 +++- .../StdMeshers_CompositeHexa_3D.cxx | 32 +++++++++++-------- src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx | 31 ++++++++++-------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc index 58ffb8340..9d92487c5 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.doc +++ b/doc/salome/gui/SMESH/input/about_meshes.doc @@ -3,7 +3,12 @@ \page about_meshes_page About meshes \n \b MESH represents a discrete approximation of a subset of the -three-dimensional space by \ref mesh_entities "elementary geometrical elements". +three-dimensional space by \ref mesh_entities "elementary geometrical +elements". + +A SALOME study can contain multiple meshes, but they do not +implicitly compose one super-mesh, and finally each of them +can be used (e.g. exported) only individually. Mesh module provides several ways to create the mesh:
      diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 57bf3eaca..20e7048b9 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -929,7 +929,7 @@ bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other, { const _FaceSide& otherSide = other.GetSide( i ); int iMyCommon; - if ( mySides.Contain( otherSide, &iMyCommon ) ) + if ( mySides.Contain( otherSide, &iMyCommon )) { if ( internalEdges.Contains( otherSide.Edge( 0 ))) { @@ -937,13 +937,23 @@ bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other, DUMP_VERT("Cont 2", mySides.GetSide(iMyCommon)->LastVertex()); DUMP_VERT("Cont 3", otherSide.FirstVertex()); DUMP_VERT("Cont 4", otherSide.LastVertex()); - if ( myChildren.empty() ) { + + if ( myChildren.empty() ) + { myChildren.push_back( *this ); myFace.Nullify(); } + else // find iMyCommon in myChildren + { + for ( TChildIterator children = GetChildren(); children.more(); ) { + const _QuadFaceGrid& child = children.next(); + if ( child.mySides.Contain( otherSide, &iMyCommon )) + break; + } + } // orient new children equally - int otherBottomIndex = ( 4 + i - iMyCommon + 2 ) % 4; + int otherBottomIndex = SMESH_MesherHelper::WrapIndex( i - iMyCommon + 2, 4 ); if ( other.IsComplex() ) for ( TChildIterator children = other.GetChildren(); children.more(); ) { myChildren.push_back( children.next() ); @@ -960,7 +970,7 @@ bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other, if ( other.IsComplex() ) for ( TChildIterator children = other.GetChildren(); children.more(); ) { - const _QuadFaceGrid& child = children.next(); + const _QuadFaceGrid& child = children.next(); for ( int i = 0; i < 4; ++i ) mySides.AppendSide( child.GetSide(i) ); } @@ -1002,9 +1012,9 @@ bool _QuadFaceGrid::SetBottomSide(const _FaceSide& bottom, int* sideIndex) { if ( childFace->SetBottomSide( bottom, &myBottomIndex )) { - TChildren::iterator orientedCild = childFace; + TChildren::iterator orientedChild = childFace; for ( childFace = myChildren.begin(); childFace != childEnd; ++childFace ) { - if ( childFace != orientedCild ) + if ( childFace != orientedChild ) childFace->SetBottomSide( childFace->GetSide( myBottomIndex )); } if ( sideIndex ) @@ -1076,7 +1086,7 @@ const _FaceSide& _QuadFaceGrid::GetSide(int i) const */ //================================================================================ -void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/) +void _QuadFaceGrid::ReverseEdges() { myReverse = !myReverse; @@ -1087,8 +1097,6 @@ void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/) if ( myChildren.empty() ) { -// mySides.GetSide( e1 )->Reverse(); -// mySides.GetSide( e2 )->Reverse(); DumpVertices(); } else @@ -1096,7 +1104,7 @@ void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/) DumpVertices(); TChildren::iterator child = myChildren.begin(), childEnd = myChildren.end(); for ( ; child != childEnd; ++child ) - child->ReverseEdges( /*e1, e2*/ ); + child->ReverseEdges(); } } @@ -1672,8 +1680,6 @@ _FaceSide::_FaceSide(const list& edges): for ( ; edge != eEnd; ++edge ) { myChildren.push_back( _FaceSide( *edge )); myNbChildren++; -// myVertices.insert( myChildren.back().myVertices.begin(), -// myChildren.back().myVertices.end() ); myVertices.Add( myChildren.back().FirstVertex() ); myVertices.Add( myChildren.back().LastVertex() ); myChildren.back().SetID( Q_CHILD ); // not to splice them @@ -1682,7 +1688,7 @@ _FaceSide::_FaceSide(const list& edges): //======================================================================= //function : GetSide -//purpose : +//purpose : //======================================================================= _FaceSide* _FaceSide::GetSide(const int i) diff --git a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx index 5ba63a48b..6f87ebf4a 100644 --- a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx +++ b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx @@ -107,14 +107,14 @@ namespace return true; set nodesInInverseFaces; - SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face ); + SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator( SMDSAbs_Face ); while ( fIt->more() ) { const SMDS_MeshElement* face = fIt->next(); nodesInInverseFaces.insert( face->begin_nodes(), face->end_nodes() ); } - return nodesInInverseFaces.size() != ( 6 + (nbF/2-1)*3 ); + return (int)nodesInInverseFaces.size() != ( 6 + (nbF/2-1)*3 ); } //================================================================================ @@ -212,7 +212,7 @@ namespace int _nbBlocksFound; #ifdef _DEBUG_ // want to get SIGSEGV in case of invalid index -#define _grid_access_(pobj, i) pobj->_grid[ ((i) < pobj->_grid.size()) ? i : int(1e100)] +#define _grid_access_(pobj, i) pobj->_grid[ ((i) < (int)pobj->_grid.size()) ? i : int(1e100)] #else #define _grid_access_(pobj, i) pobj->_grid[ i ] #endif @@ -269,8 +269,8 @@ namespace //!< safely return a node by XY const SMDS_MeshNode* node(int x, int y) const { - int i = _index( x, y ); - return ( i < 0 || i >= _side->_grid.size()) ? 0 : _side->_grid[i]; + size_t i = _index( x, y ); + return ( i >= _side->_grid.size() ) ? 0 : _side->_grid[i]; } //!< Return an edge SMESH_OrientedLink edge(EQuadEdge edge) const @@ -372,7 +372,7 @@ namespace //================================================================================ /*! - * \brief Find and return number of submeshes corresponding to blocks + * \brief Find blocks and return their number */ //================================================================================ @@ -421,7 +421,7 @@ namespace _allSides.push_back( _BlockSide() ); _BlockSide& side = _allSides.back(); - if ( !fillSide( side, face, *corner ) ) + if ( !fillSide( side, face, *corner )) { if ( !_error.empty() ) return false; @@ -522,7 +522,7 @@ namespace ok = block.setSide( i, findBlockSide( B_FRONT, edgeOfFront[i], edgeOfAdj[i], advAnalys, sidesAround)); // try to find a BACK side by a TOP one - if ( ok || !advAnalys) + if ( ok || !advAnalys ) if ( !block._side[B_BACK] && block._side[B_TOP] ) ok = block.setSide( B_BACK, findBlockSide( B_TOP, Q_TOP, Q_TOP, advAnalys, sidesAround )); @@ -533,7 +533,7 @@ namespace { // check if just found block is same as one of previously found blocks bool isSame = false; - for ( int i = 1; i < _blocks.size() && !isSame; ++i ) + for ( size_t i = 1; i < _blocks.size() && !isSame; ++i ) isSame = ( block._corners == _blocks[i-1]._corners ); ok = !isSame; } @@ -606,12 +606,12 @@ namespace side._index._ySize = verRow1.size(); side._grid.resize( side._index.size(), NULL ); - for ( x = 0; x < horRow1.size(); ++x ) + for ( x = 0; x < nbX; ++x ) { side.setNode( x, 0, horRow1[x] ); side.setNode( x, 1, horRow2[x] ); } - for ( y = 0; y < verRow1.size(); ++y ) + for ( y = 0; y < nbY; ++y ) { side.setNode( 0, y, verRow1[y] ); side.setNode( 1, y, verRow2[y] ); @@ -725,7 +725,9 @@ namespace if ( !n ) return false; prevSide = nextSide; - nbChainLinks++; + + if ( ++nbChainLinks > NB_QUAD_SIDES ) + return false; } return ( n == n2 && nbChainLinks == NB_QUAD_SIDES ); @@ -1003,6 +1005,9 @@ namespace SMESH_OrientedLink eAdja = _side[ adjacent[i] ].edge( edgeAdj[i] ); ok = ( eBack == eAdja ); } + ok = ok && ( _side[ B_BOTTOM ]._index.size() == _side[ B_TOP ]._index.size() && + _side[ B_RIGHT ]._index.size() == _side[ B_LEFT ]._index.size() && + _side[ B_FRONT ]._index.size() == _side[ B_BACK ]._index.size() ); return ok; } @@ -1250,7 +1255,7 @@ bool StdMeshers_HexaFromSkin_3D::Evaluate(SMESH_Mesh & aMesh, int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa; vector& nbByType = aResMap[ aMesh.GetSubMesh( aShape )]; - if ( entity >= nbByType.size() ) + if ( entity >= (int) nbByType.size() ) nbByType.resize( SMDSEntity_Last, 0 ); for ( int i = 0; i < nbBlocks; ++i ) From d770d518487d373e50fcd88b18f3b8dcdead0ba0 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 11 Jan 2016 11:44:48 +0100 Subject: [PATCH 053/147] debug bloc fissure after merge master --- src/Tools/blocFissure/ihm/fissureCoude_plugin.py | 2 +- src/Tools/smesh_plugins.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py index d6144f20a..d88841900 100644 --- a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py @@ -30,7 +30,7 @@ from blocFissure.gmu import initLog initLog.setVerbose() from blocFissure.gmu import geomsmesh -from blocFissure.casStandard import casStandard +from blocFissure.gmu.casStandard import casStandard from blocFissure.ihm.fissureCoude_ihm import fissureCoude_ihm diff --git a/src/Tools/smesh_plugins.py b/src/Tools/smesh_plugins.py index e8798921d..3fedbd281 100644 --- a/src/Tools/smesh_plugins.py +++ b/src/Tools/smesh_plugins.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- # Copyright (C) 2011-2015 EDF R&D # # This library is free software; you can redistribute it and/or From f8923c57965084c2260bfd4cee3d0d5266ae0c9f Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 11 Jan 2016 18:11:57 +0100 Subject: [PATCH 054/147] correction des scripts de materiel pour les cas tests bloc fissure --- src/Tools/blocFissure/CMakeLists.txt | 2 +- src/Tools/blocFissure/CasTests/CMakeLists.txt | 2 +- src/Tools/blocFissure/README | 7 +- src/Tools/blocFissure/gmu/CMakeLists.txt | 2 +- src/Tools/blocFissure/ihm/CMakeLists.txt | 5 +- .../materielCasTests/CMakeLists.txt | 2 +- .../blocFissure/materielCasTests/cubeAngle.py | 4 +- .../blocFissure/materielCasTests/cubeFin.py | 6 +- .../materielCasTests/decoupeCylindre.py | 6 +- .../blocFissure/materielCasTests/ellipse.py | 4 +- .../materielCasTests/ellipse_disque.py | 4 +- .../materielCasTests/ellipse_probleme.py | 4 +- .../materielCasTests/eprouvetteCourbe.py | 4 +- .../materielCasTests/eprouvetteDroite.py | 10 +- .../materielCasTests/fissureGauche.py | 2 +- .../materielCasTests/fissureGauche2.py | 4 +- src/Tools/blocFissure/materielCasTests/vis.py | 127 +++++++----------- 17 files changed, 84 insertions(+), 111 deletions(-) diff --git a/src/Tools/blocFissure/CMakeLists.txt b/src/Tools/blocFissure/CMakeLists.txt index ccebbba99..3b69e0f83 100644 --- a/src/Tools/blocFissure/CMakeLists.txt +++ b/src/Tools/blocFissure/CMakeLists.txt @@ -36,4 +36,4 @@ SET(plugin_SCRIPTS # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure) +SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure) diff --git a/src/Tools/blocFissure/CasTests/CMakeLists.txt b/src/Tools/blocFissure/CasTests/CMakeLists.txt index a2d4b2a7f..75757011b 100644 --- a/src/Tools/blocFissure/CasTests/CMakeLists.txt +++ b/src/Tools/blocFissure/CasTests/CMakeLists.txt @@ -55,4 +55,4 @@ SET(plugin_SCRIPTS # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/CasTests) +SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/CasTests) diff --git a/src/Tools/blocFissure/README b/src/Tools/blocFissure/README index 62a3fa88e..03333c3f4 100644 --- a/src/Tools/blocFissure/README +++ b/src/Tools/blocFissure/README @@ -4,22 +4,19 @@ Exécution des exemples et cas tests : - lancer salome - exécuter les instructions suivantes dans la console Python embarquée, ou dans une console Python avec l'environnement SALOME - # les shapes et fichiers med nécessaires aux tests sont créés dans ${SMESH_ROOT_DIR}/share/salome/plugins/smesh/blocFissure/CasTests + # les shapes et fichiers med nécessaires aux tests sont créés dans ${SMESH_ROOT_DIR}/lib/python2.7/site-packages/salome/blocFissure/CasTests # les maillages fissurés sont écrits dans le répertoire d'exécution. # preparation des shapes et fichiers MED -import sys, os -sys.path.append(os.path.join(os.environ["SMESH_ROOT_DIR"], "share", "salome", "plugins", "smesh")) from blocFissure.materielCasTests import genereMateriel # execution exemples -from blocFissure import exemple from blocFissure import exemple -# execution des cas tests +# execution des cas tests (long: 1/2 heure) from blocFissure.CasTests import execution_Cas diff --git a/src/Tools/blocFissure/gmu/CMakeLists.txt b/src/Tools/blocFissure/gmu/CMakeLists.txt index abe18806b..c0afb86be 100644 --- a/src/Tools/blocFissure/gmu/CMakeLists.txt +++ b/src/Tools/blocFissure/gmu/CMakeLists.txt @@ -111,4 +111,4 @@ SET(plugin_SCRIPTS # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/gmu) +SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/gmu) diff --git a/src/Tools/blocFissure/ihm/CMakeLists.txt b/src/Tools/blocFissure/ihm/CMakeLists.txt index f8187ef72..0ee274979 100644 --- a/src/Tools/blocFissure/ihm/CMakeLists.txt +++ b/src/Tools/blocFissure/ihm/CMakeLists.txt @@ -26,6 +26,7 @@ SET(plugin_SCRIPTS __init__.py fissureCoude_ihm.py fissureCoude_plugin.py + dialogFissureCoude.dic ) # --- resources --- @@ -41,6 +42,6 @@ PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/ihm) +SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm) -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/ihm) \ No newline at end of file +SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm) \ No newline at end of file diff --git a/src/Tools/blocFissure/materielCasTests/CMakeLists.txt b/src/Tools/blocFissure/materielCasTests/CMakeLists.txt index af9a2996d..688a815df 100644 --- a/src/Tools/blocFissure/materielCasTests/CMakeLists.txt +++ b/src/Tools/blocFissure/materielCasTests/CMakeLists.txt @@ -39,4 +39,4 @@ SET(plugin_SCRIPTS # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/materielCasTests) +SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/materielCasTests) diff --git a/src/Tools/blocFissure/materielCasTests/cubeAngle.py b/src/Tools/blocFissure/materielCasTests/cubeAngle.py index e596663ca..cef66f65e 100644 --- a/src/Tools/blocFissure/materielCasTests/cubeAngle.py +++ b/src/Tools/blocFissure/materielCasTests/cubeAngle.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -35,7 +35,7 @@ Vertex_2 = geompy.MakeVertex(-5, -5, 90) Vertex_3 = geompy.MakeVertex(65, 65, 110) Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) Common_1 = geompy.MakeCommon(Disk_1, Box_2) -geompy.Export(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP") +geompy.ExportBREP(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/cubeFin.py b/src/Tools/blocFissure/materielCasTests/cubeFin.py index 6f9129bfe..02fe24314 100644 --- a/src/Tools/blocFissure/materielCasTests/cubeFin.py +++ b/src/Tools/blocFissure/materielCasTests/cubeFin.py @@ -93,9 +93,9 @@ geompy.addToStudy( O_1, 'O' ) geompy.addToStudy( OX_1, 'OX' ) geompy.addToStudy( OY_1, 'OY' ) geompy.addToStudy( OZ_1, 'OZ' ) -geompy.Export(cubeFin_Transverse, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep"), "BREP") -geompy.Export(cubeFin_Coin, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"), "BREP") -geompy.Export(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"), "BREP") +geompy.ExportBREP(cubeFin_Transverse, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Transverse.brep")) +geompy.ExportBREP(cubeFin_Coin, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep")) +geompy.ExportBREP(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep")) ### ### SMESH component diff --git a/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py b/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py index b650fb2e9..6c55b0e02 100644 --- a/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py +++ b/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -62,14 +62,14 @@ FissInCylindre = geompy.MakeFaceWires([Curve_2, Arc_1], 1) Divided_Cylinder_1 = geompy.MakeDividedCylinder(145, 800, GEOM.SQUARE) CylindreSain = geompy.MakeRotation(Divided_Cylinder_1, OZ, 45*math.pi/180.0) [Compound_1, vertical, radial, Compound_4] = geompy.Propagate(CylindreSain) -geompy.Export(FissInCylindre, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre.brep"), "BREP") +geompy.ExportBREP(FissInCylindre, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre.brep")) Vertex_12 = geompy.MakeVertex(0, -145, 500) Circle_2 = geompy.MakeCircle(Vertex_12, None, 145) Face_1 = geompy.MakeFaceWires([Circle_2], 1) Vertex_13 = geompy.MakeVertex(0, 0, 500) Disk_1 = geompy.MakeDiskPntVecR(Vertex_13, OZ_1, 170) FissInCylindre2 = geompy.MakeCommon(Face_1, Disk_1) -geompy.Export(FissInCylindre2, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep"), "BREP") +geompy.ExportBREP(FissInCylindre2, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/ellipse.py b/src/Tools/blocFissure/materielCasTests/ellipse.py index 8cf26ab68..ebb4e40fa 100644 --- a/src/Tools/blocFissure/materielCasTests/ellipse.py +++ b/src/Tools/blocFissure/materielCasTests/ellipse.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -54,7 +54,7 @@ geompy.addToStudy( Vertex_4, 'Vertex_4' ) geompy.addToStudy( Box_1, 'Box_1' ) geompy.addToStudy( ellipse1, 'ellipse1' ) geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' ) -geompy.Export(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"), "BREP") +geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep")) if salome.sg.hasDesktop(): diff --git a/src/Tools/blocFissure/materielCasTests/ellipse_disque.py b/src/Tools/blocFissure/materielCasTests/ellipse_disque.py index 9e74ff06f..1eb504f23 100644 --- a/src/Tools/blocFissure/materielCasTests/ellipse_disque.py +++ b/src/Tools/blocFissure/materielCasTests/ellipse_disque.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -35,7 +35,7 @@ Vertex_2 = geompy.MakeVertex(98, -2, -2) Vertex_3 = geompy.MakeVertex(120, 2, 60) Box_1 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) Ellipse_disque = geompy.MakeCommon(Box_1, Scale_1) -geompy.Export(Ellipse_disque, os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"), "BREP") +geompy.ExportBREP(Ellipse_disque, os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py b/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py index 742197ede..4fa377ae4 100644 --- a/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py +++ b/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -52,7 +52,7 @@ geompy.addToStudy( Box_1, 'Box_1' ) geompy.addToStudy( Vertex_4, 'Vertex_4' ) geompy.addToStudy( Cut_1, 'Cut_1' ) geompy.addToStudy( ellipse1, 'ellipse1_pb' ) -geompy.Export(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"), "BREP") +geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep")) if salome.sg.hasDesktop(): diff --git a/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py b/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py index 7cbff0698..9098f115f 100644 --- a/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py +++ b/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -43,7 +43,7 @@ EprouvetteCourbe = geompy.MakeCut(Common_1, Cylinder_3) geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0) Sketch_1 = geompy.MakeSketcherOnPlane("Sketcher:F -110.000000 85.000000:T 220.000000 0.000000:T 0.000000 75.000000:T -220.000000 0.000000:WW", geomObj_1 ) SectionDroite = geompy.MakeFaceWires([Sketch_1], 1) -geompy.Export(SectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep"), "BREP") +geompy.ExportBREP(SectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py b/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py index 0a70a2685..33199d2e5 100644 --- a/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py +++ b/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -45,8 +45,8 @@ Plane_2 = geompy.MakePlane(Vertex_1, Line_1, 2000) geomObj_4 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0) Sketch_2 = geompy.MakeSketcherOnPlane("Sketcher:F 0.000000 0.000000:T 120.000000 0.000000:T 0.000000 100.000000:T -120.000000 20.000000:WW", Plane_2 ) SectionInclinee = geompy.MakeFaceWires([Sketch_2], 1) -geompy.Export(sectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFissPb1.brep"), "BREP") -geompy.Export(SectionInclinee, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss2.brep"), "BREP") +geompy.ExportBREP(sectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFissPb1.brep")) +geompy.ExportBREP(SectionInclinee, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss2.brep")) Vertex_2 = geompy.MakeVertex(110, -10, 200) Vertex_3 = geompy.MakeVertex(110, 80, 200) Vertex_4 = geompy.MakeVertex(-10, 80, 200) @@ -63,8 +63,8 @@ Line_7 = geompy.MakeLineTwoPnt(Vertex_5, Vertex_6) Face_1_vertex_9 = geompy.GetSubShape(Face_1, [9]) Line_8 = geompy.MakeLineTwoPnt(Vertex_6, Face_1_vertex_9) Face_2 = geompy.MakeFaceWires([Line_5, Line_6, Line_7, Line_8], 1) -geompy.Export(Face_1, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep"), "BREP") -geompy.Export(Face_2, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_2.brep"), "BREP") +geompy.ExportBREP(Face_1, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep")) +geompy.ExportBREP(Face_2, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_2.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche.py b/src/Tools/blocFissure/materielCasTests/fissureGauche.py index 2660e04de..b7e8188a5 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche.py @@ -59,7 +59,7 @@ Box_2 = geompy.MakeBoxTwoPnt(Vertex_7, Vertex_6) Common_1 = geompy.MakeCommon(Box_2, Cut_2) objetSain = geompy.MakePartition([Common_1], [Plane_1, Plane_2, Plane_3], [], [], geompy.ShapeType["SOLID"], 0, [], 0) [hauteurs, epaisseurs, Compound_3, Compound_4, Compound_5, Compound_6] = geompy.Propagate(objetSain) -geompy.Export(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep"), "BREP") +geompy.ExportBREP(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py index 289102c69..9a508a5f9 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py @@ -36,7 +36,7 @@ Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000) Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0) [Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13]) FaceFissExt = geompy.MakeFuse(Face_2, Face_1) -geompy.Export(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep"), "BREP") +geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep")) Vertex_2 = geompy.MakeVertex(0, -500, 0) Vertex_3 = geompy.MakeVertex(400, 500, 800) objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) @@ -47,7 +47,7 @@ geompy.addToStudy( Partition_2, 'Partition_2' ) geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) Plane_1 = geompy.MakePlaneLCS(None, 2000, 3) FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0) -geompy.Export(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP") +geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) diff --git a/src/Tools/blocFissure/materielCasTests/vis.py b/src/Tools/blocFissure/materielCasTests/vis.py index 1819a56f7..8956aaf35 100644 --- a/src/Tools/blocFissure/materielCasTests/vis.py +++ b/src/Tools/blocFissure/materielCasTests/vis.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- import sys import salome @@ -56,11 +56,11 @@ Line_4 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3) coupe_vis = geompy.MakePartition([Face_1], [Line_1, Line_2, Line_3, Line_4], [], [], geompy.ShapeType["FACE"], 0, [], 0) [tige, section, tige_haute, rond, tete, section_tete] = geompy.Propagate(coupe_vis) conge = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(conge, [21]) +geompy.UnionIDs(conge, [25]) appui = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(appui, [37]) +geompy.UnionIDs(appui, [39]) p_imp = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(p_imp, [4]) +geompy.UnionIDs(p_imp, [11]) Vertex_4 = geompy.MakeVertex(11.25, 98.75, 0) Vertex_5 = geompy.MakeVertexWithRef(Vertex_4, -0.5, 0.5, 0) @@ -98,7 +98,7 @@ Revolution_2 = geompy.MakeRevolution2Ways(generatrice, OY, 65*math.pi/180.0) Fissure = geompy.MakeCommonList([Extrusion_1, Revolution_2], True) fondFiss = geompy.CreateGroup(Fissure, geompy.ShapeType["EDGE"]) geompy.UnionIDs(fondFiss, [9, 7, 4]) -geompy.Export(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP") +geompy.ExportBREP(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) @@ -171,31 +171,13 @@ smesh = smeshBuilder.New(theStudy) coupe_vis_1 = smesh.Mesh(coupe_vis) Regular_1D = coupe_vis_1.Segment() Nb_Segments_1 = Regular_1D.NumberOfSegments(10) -Nb_Segments_1.SetDistrType( 0 ) Quadrangle_2D = coupe_vis_1.Quadrangle(algo=smeshBuilder.QUADRANGLE) +Regular_1D_1 = coupe_vis_1.Segment(geom=tige) +Nb_Segments_2 = Regular_1D_1.NumberOfSegments(30) +Regular_1D_2 = coupe_vis_1.Segment(geom=section) +Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,1,[ 7, 11, 16, 23 ]) isDone = coupe_vis_1.Compute() -Nb_Segments_2 = smesh.CreateHypothesis('NumberOfSegments') -Nb_Segments_2.SetNumberOfSegments( 30 ) -Nb_Segments_2.SetDistrType( 0 ) -status = coupe_vis_1.AddHypothesis(Regular_1D,tige) -status = coupe_vis_1.AddHypothesis(Nb_Segments_2,tige) -isDone = coupe_vis_1.Compute() -Nb_Segments_3 = smesh.CreateHypothesis('NumberOfSegments') -Nb_Segments_3.SetNumberOfSegments( 10 ) -Nb_Segments_3.SetScaleFactor( 3 ) -Nb_Segments_3.SetReversedEdges( [ ] ) -Nb_Segments_3.SetObjectEntry( "0:1:1:14" ) -status = coupe_vis_1.AddHypothesis(Regular_1D,section) -status = coupe_vis_1.AddHypothesis(Nb_Segments_3,section) -coupe_vis_1.Clear() -isDone = coupe_vis_1.Compute() -coupe_vis_1.Clear() -Nb_Segments_3.SetNumberOfSegments( 10 ) -Nb_Segments_3.SetDistrType( 1 ) -Nb_Segments_3.SetScaleFactor( 3 ) -Nb_Segments_3.SetReversedEdges( [ 23, 4, 9, 16 ] ) -Nb_Segments_3.SetObjectEntry( "0:1:1:14" ) -isDone = coupe_vis_1.Compute() +isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 ) tige_1 = coupe_vis_1.GroupOnGeom(tige,'tige',SMESH.EDGE) section_1 = coupe_vis_1.GroupOnGeom(section,'section',SMESH.EDGE) tige_haute_1 = coupe_vis_1.GroupOnGeom(tige_haute,'tige_haute',SMESH.EDGE) @@ -205,69 +187,62 @@ section_tete_1 = coupe_vis_1.GroupOnGeom(section_tete,'section_tete',SMESH.EDGE) conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE) appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE) p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE) -isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 ) visHex80 = smesh.CopyMesh( coupe_vis_1, 'visHex80', 1, 0) [ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2 ] = visHex80.GetGroups() -[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObject2D( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), math.pi/40, 40, 1e-05 ,True) +[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObjects( [ visHex80 ], [ visHex80 ], [ visHex80 ], SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), 0.0785398, 40, 1e-05, 1 ) [ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top ] = visHex80.GetGroups() -[ tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.MirrorObject( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 0, 10 ), SMESH.SMESH_MeshEditor.PLANE ,True,True) -[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups() -coincident_nodes_on_part = visHex80.FindCoincidentNodesOnPart( visHex80, 1e-05, [ ] ) -visHex80.MergeNodes(coincident_nodes_on_part) -equal_elements = visHex80.FindEqualElements( visHex80 ) -visHex80.MergeElements(equal_elements) -[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups() -SubMesh_1 = coupe_vis_1.GetSubMesh( tige, 'SubMesh_1' ) -SubMesh_2 = coupe_vis_1.GetSubMesh( section, 'SubMesh_2' ) +Sub_mesh_1 = Regular_1D_1.GetSubMesh() +Sub_mesh_2 = Regular_1D_2.GetSubMesh() visHex80.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/visSain.med"), 0, SMESH.MED_V2_2, 1 ) - + ## Set names of Mesh objects -smesh.SetName(appui_rotated, 'appui_rotated') -smesh.SetName(p_imp_rotated, 'p_imp_rotated') -smesh.SetName(section_tete_rotated, 'section_tete_rotated') -smesh.SetName(conge_rotated, 'conge_rotated') -smesh.SetName(rond_rotated, 'rond_rotated') -smesh.SetName(tete_rotated, 'tete_rotated') -smesh.SetName(section_rotated, 'section_rotated') -smesh.SetName(tige_haute_rotated, 'tige_haute_rotated') -smesh.SetName(tige_rotated, 'tige_rotated') -smesh.SetName(SubMesh_2, 'SubMesh_2') -smesh.SetName(SubMesh_1, 'SubMesh_1') +smesh.SetName(tige_2, 'tige') smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D') smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D') -smesh.SetName(appui_1, 'appui') -smesh.SetName(p_imp_1, 'p_imp') +smesh.SetName(Nb_Segments_2, 'Nb. Segments_2') +smesh.SetName(Nb_Segments_1, 'Nb. Segments_1') +smesh.SetName(Nb_Segments_3, 'Nb. Segments_3') smesh.SetName(coupe_vis_1.GetMesh(), 'coupe_vis') smesh.SetName(visHex80.GetMesh(), 'visHex80') -smesh.SetName(tige_1, 'tige') -smesh.SetName(p_imp_2, 'p_imp') -smesh.SetName(section_1, 'section') -smesh.SetName(appui_2, 'appui') -smesh.SetName(tige_haute_1, 'tige_haute') -smesh.SetName(conge_2, 'conge') -smesh.SetName(rond_1, 'rond') -smesh.SetName(section_tete_2, 'section_tete') -smesh.SetName(tete_1, 'tete') -smesh.SetName(tete_2, 'tete') -smesh.SetName(section_tete_1, 'section_tete') -smesh.SetName(rond_2, 'rond') -smesh.SetName(conge_1, 'conge') -smesh.SetName(tige_haute_2, 'tige_haute') -smesh.SetName(section_2, 'section') -smesh.SetName(tige_2, 'tige') smesh.SetName(p_imp_top, 'p_imp_top') -smesh.SetName(Nb_Segments_3, 'Nb. Segments_3') -smesh.SetName(conge_top, 'conge_top') -smesh.SetName(Nb_Segments_2, 'Nb. Segments_2') smesh.SetName(appui_top, 'appui_top') -smesh.SetName(Nb_Segments_1, 'Nb. Segments_1') -smesh.SetName(tete_top, 'tete_top') +smesh.SetName(conge_top, 'conge_top') smesh.SetName(section_tete_top, 'section_tete_top') -smesh.SetName(tige_haute_top, 'tige_haute_top') +smesh.SetName(tete_top, 'tete_top') smesh.SetName(rond_top, 'rond_top') -smesh.SetName(tige_top, 'tige_top') +smesh.SetName(tige_haute_top, 'tige_haute_top') smesh.SetName(section_top, 'section_top') +smesh.SetName(tige_top, 'tige_top') +smesh.SetName(Sub_mesh_2, 'Sub-mesh_2') +smesh.SetName(Sub_mesh_1, 'Sub-mesh_1') +smesh.SetName(p_imp_1, 'p_imp') +smesh.SetName(p_imp_rotated, 'p_imp_rotated') +smesh.SetName(appui_1, 'appui') +smesh.SetName(appui_rotated, 'appui_rotated') +smesh.SetName(conge_rotated, 'conge_rotated') +smesh.SetName(section_tete_rotated, 'section_tete_rotated') +smesh.SetName(tete_rotated, 'tete_rotated') +smesh.SetName(rond_rotated, 'rond_rotated') +smesh.SetName(tige_haute_rotated, 'tige_haute_rotated') +smesh.SetName(section_rotated, 'section_rotated') +smesh.SetName(tige_1, 'tige') +smesh.SetName(tige_rotated, 'tige_rotated') +smesh.SetName(tige_haute_1, 'tige_haute') +smesh.SetName(section_1, 'section') +smesh.SetName(tete_1, 'tete') +smesh.SetName(rond_1, 'rond') +smesh.SetName(conge_1, 'conge') +smesh.SetName(appui_2, 'appui') +smesh.SetName(section_tete_1, 'section_tete') +smesh.SetName(p_imp_2, 'p_imp') +smesh.SetName(section_tete_2, 'section_tete') +smesh.SetName(conge_2, 'conge') +smesh.SetName(rond_2, 'rond') +smesh.SetName(tete_2, 'tete') +smesh.SetName(section_2, 'section') +smesh.SetName(tige_haute_2, 'tige_haute') + if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) From b5bd7f1852f0ca0122b4fed4be66c262a3356363 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 12 Jan 2016 15:00:56 +0100 Subject: [PATCH 055/147] =?UTF-8?q?debug=20de=20GetInPlace=20pour=20Cas=20?= =?UTF-8?q?7=20eprouvette=20courbe=20non=20r=C3=A9solu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/gmu/compoundFromList.py | 9 +++++---- src/Tools/blocFissure/gmu/identifieEdgesPeau.py | 1 + src/Tools/blocFissure/gmu/mailleFacesPeau.py | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Tools/blocFissure/gmu/compoundFromList.py b/src/Tools/blocFissure/gmu/compoundFromList.py index 8f1ed1962..85b321281 100644 --- a/src/Tools/blocFissure/gmu/compoundFromList.py +++ b/src/Tools/blocFissure/gmu/compoundFromList.py @@ -22,13 +22,14 @@ def compoundFromList(elements, nom=None): if nom is not None: for i,a in enumerate(shapeList): - nom = nom +"%d"%i - logging.debug('nom: %s',nom) - geomPublish(initLog.debug, a, nom) + nomi = nom +"%d"%i + logging.debug('nom: %s',nomi) + geomPublish(initLog.debug, a, nomi) shapeCompound = None if len(shapeList) > 0: shapeCompound =geompy.MakeCompound(shapeList) - + nomc = "compound_%s"%nom + geomPublish(initLog.debug, shapeCompound, nomc) return shapeCompound diff --git a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py index 19335d7fa..a3abb6208 100644 --- a/src/Tools/blocFissure/gmu/identifieEdgesPeau.py +++ b/src/Tools/blocFissure/gmu/identifieEdgesPeau.py @@ -96,6 +96,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor geompy.UnionList(groupEdgesBordPeau, edgesBords) bordsVifs = None if aretesVivesC is not None: + logging.debug("identification des bords vifs par GetInPlace (old)") bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC) if bordsVifs is not None: geomPublishInFather(initLog.debug, facePeau, bordsVifs, "bordsVifs") diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index c73cf1d59..41a72e9ab 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -31,7 +31,8 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, for ifil in range(nbFacesFilling): meshFacePeau = None if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte - + + logging.debug("meshFacePeau %d intacte", ifil) # --- edges de bord de la face de filling filling = facesDefaut[ifil] edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False) @@ -49,6 +50,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, else: + logging.debug("meshFacePeau %d coupée par la fissure", ifil) facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] From 8ebd5942d472464912e3e3f4862359829f0e2afd Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 12 Jan 2016 17:02:55 +0100 Subject: [PATCH 056/147] =?UTF-8?q?correction=20cas=20test=20vis:=20face?= =?UTF-8?q?=20de=20fissure=20trop=20d=C3=A9bordante.=20Un=20probleme=20de?= =?UTF-8?q?=20GetInPlace=20sur=20ce=20cas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/blocFissure/CasTests/vis_1.py | 2 +- src/Tools/blocFissure/materielCasTests/vis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/vis_1.py b/src/Tools/blocFissure/CasTests/vis_1.py index cc7c6a1fd..cf4400faa 100644 --- a/src/Tools/blocFissure/CasTests/vis_1.py +++ b/src/Tools/blocFissure/CasTests/vis_1.py @@ -59,7 +59,7 @@ class vis_1(fissureGenerique): shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP") fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"]) - geompy.UnionIDs(fondFiss, [4, 7, 9]) + geompy.UnionIDs(fondFiss, [7, 9]) geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) diff --git a/src/Tools/blocFissure/materielCasTests/vis.py b/src/Tools/blocFissure/materielCasTests/vis.py index 8956aaf35..59653c93e 100644 --- a/src/Tools/blocFissure/materielCasTests/vis.py +++ b/src/Tools/blocFissure/materielCasTests/vis.py @@ -75,7 +75,7 @@ Partition_2 = geompy.MakePartition([Revolution_1], [conge], [], [], geompy.Shape Partition_2_vertex_11 = geompy.GetSubShape(Partition_2, [11]) Plane_1 = geompy.MakePlane(Partition_2_vertex_11, OY, 2000) Partition_3 = geompy.MakePartition([Revolution_1], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0) -Vertex_9 = geompy.MakeVertex(0, 99.633883, 8.977320000000001) +Vertex_9 = geompy.MakeVertex(0, 99.633883, 1.977320000000001) Vertex_10 = geompy.MakeVertex(0, 99.633883, -8.977320000000001) Vertex_11 = geompy.MakeVertexWithRef(Vertex_9, 0, 0, -1) Vertex11x = geompy.MakeVertexWithRef(Vertex_11, 1, 0, 0) From 9afabd719b1a9d990fd1a4a5405cb699d433669e Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 12 Jan 2016 17:21:43 +0100 Subject: [PATCH 057/147] correction cas test cubeMilieu (indice edge fond) --- src/Tools/blocFissure/CasTests/cubeMilieu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/CasTests/cubeMilieu.py b/src/Tools/blocFissure/CasTests/cubeMilieu.py index 913fa7fce..0d93518cd 100644 --- a/src/Tools/blocFissure/CasTests/cubeMilieu.py +++ b/src/Tools/blocFissure/CasTests/cubeMilieu.py @@ -6,7 +6,7 @@ from blocFissure import gmu dicoParams = dict(nomCas = 'cubeMilieu', maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'), brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"), - edgeFissIds = [4], + edgeFissIds = [7], lgInfluence = 50, meshBrep = (5,10), rayonPipe = 10, From c3445f225d61018a15ecfe6e90f3a99057226c81 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 12 Jan 2016 17:40:50 +0100 Subject: [PATCH 058/147] Readme cas tests bloc fissure --- src/Tools/blocFissure/README | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Tools/blocFissure/README b/src/Tools/blocFissure/README index 03333c3f4..97e3d10ac 100644 --- a/src/Tools/blocFissure/README +++ b/src/Tools/blocFissure/README @@ -1,22 +1,38 @@ Exécution des exemples et cas tests : ------------------------------------- +===================================== - lancer salome -- exécuter les instructions suivantes dans la console Python embarquée, ou dans une console Python avec l'environnement SALOME - # les shapes et fichiers med nécessaires aux tests sont créés dans ${SMESH_ROOT_DIR}/lib/python2.7/site-packages/salome/blocFissure/CasTests +- exécuter les instructions suivantes dans la console Python embarquée, + ou dans une console Python avec l'environnement SALOME (salome shell) + + # les shapes et fichiers med nécessaires aux tests sont créés dans + ${SMESH_ROOT_DIR}/lib/python2.7/site-packages/salome/blocFissure/CasTests + # les maillages fissurés sont écrits dans le répertoire d'exécution. -# preparation des shapes et fichiers MED +# préparation des shapes et fichiers MED +---------------------------------------- from blocFissure.materielCasTests import genereMateriel -# execution exemples +# exécution exemple +------------------- from blocFissure import exemple -# execution des cas tests (long: 1/2 heure) +# exécution des cas tests (long: 1/2 heure) +------------------------------------------- from blocFissure.CasTests import execution_Cas +# bug et problèmes des cas tests +-------------------------------- + +Mauvaise détection d'arête vive avec GetInPlace : cas 7, 24 + +Le maillage longitudinal du pipe peut creer des mailles de faible épaisseur +à une des extrémités : le maillage en triangles des faces de fissure et de peau +peut être moche au voisinage, de même que les tétraèdres qui s'appuient dessus. +(2,3,16,26 ?) From 59627b07d70f4caa4c768be6805334d2610fa54c Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 13 Jan 2016 16:47:35 +0300 Subject: [PATCH 059/147] Fix compilation errors using gcc-5.X relating to explicit stream::operator bool() + Fix compilation warnings --- idl/SMESH_MeshEditor.idl | 5 +- src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx | 5 + src/OBJECT/SMESH_Actor.cxx | 7 +- src/OBJECT/SMESH_ActorUtils.h | 2 +- src/OBJECT/SMESH_ExtractGeometry.cxx | 4 +- src/OBJECT/SMESH_ScalarBarActor.cxx | 45 ++- src/SMDS/SMDS_Downward.cxx | 264 +++++++++--------- src/SMDS/SMDS_IteratorOfElements.cxx | 32 +-- src/SMDS/SMDS_IteratorOfElements.hxx | 4 +- src/SMDS/SMDS_Mesh.cxx | 2 + src/SMDS/SMDS_MeshCell.cxx | 2 +- src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx | 6 +- src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx | 4 +- src/SMDS/SMDS_VolumeTool.cxx | 12 +- src/SMDS/chrono.cxx | 2 +- src/SMESHFiltersSelection/SMESH_Type.h | 4 +- .../SMESH_TypeFilter.cxx | 1 + src/SMESHGUI/SMESHGUI.h | 2 +- .../SMESHGUI_AddQuadraticElementDlg.cxx | 11 +- src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ClippingDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 22 +- src/SMESHGUI/SMESHGUI_Hypotheses.cxx | 16 +- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 6 +- src/SMESHGUI/SMESHGUI_MeshOp.h | 6 +- src/SMESHUtils/SMESH_File.cxx | 4 +- src/SMESHUtils/SMESH_MAT2d.cxx | 20 +- src/SMESHUtils/SMESH_Tree.hxx | 4 +- src/SMESH_I/SMESH_Gen_i.cxx | 4 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 57 ++-- src/SMESH_I/SMESH_NoteBook.cxx | 26 +- src/StdMeshers/StdMeshers_Adaptive1D.cxx | 2 +- src/StdMeshers/StdMeshers_Arithmetic1D.cxx | 10 +- .../StdMeshers_CartesianParameters3D.cxx | 20 +- src/StdMeshers/StdMeshers_Cartesian_3D.cxx | 26 +- src/StdMeshers/StdMeshers_Deflection1D.cxx | 2 +- src/StdMeshers/StdMeshers_Distribution.cxx | 4 +- src/StdMeshers/StdMeshers_FaceSide.cxx | 34 +-- src/StdMeshers/StdMeshers_FixedPoints1D.cxx | 14 +- src/StdMeshers/StdMeshers_Geometric1D.cxx | 4 +- src/StdMeshers/StdMeshers_LengthFromEdges.cxx | 2 +- src/StdMeshers/StdMeshers_LocalLength.cxx | 4 +- src/StdMeshers/StdMeshers_MaxElementArea.cxx | 2 +- .../StdMeshers_MaxElementVolume.cxx | 2 +- src/StdMeshers/StdMeshers_MaxLength.cxx | 6 +- src/StdMeshers/StdMeshers_NumberOfLayers.cxx | 2 +- .../StdMeshers_NumberOfSegments.cxx | 20 +- .../StdMeshers_QuadToTriaAdaptor.cxx | 126 ++++----- .../StdMeshers_QuadToTriaAdaptor.hxx | 8 +- .../StdMeshers_QuadrangleParams.cxx | 6 +- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 46 +-- .../StdMeshers_RadialQuadrangle_1D2D.cxx | 48 ++-- src/StdMeshers/StdMeshers_Reversible1D.cxx | 12 +- .../StdMeshers_SegmentLengthAroundVertex.cxx | 2 +- src/StdMeshers/StdMeshers_StartEndLength.cxx | 10 +- .../StdMeshersGUI_DistrPreview.cxx | 20 +- .../StdMeshersGUI_DistrTable.cxx | 2 +- .../StdMeshersGUI_FixedPointsParamWdg.cxx | 4 +- ...tdMeshersGUI_LayerDistributionParamWdg.cxx | 6 +- .../StdMeshersGUI_NbSegmentsCreator.cxx | 6 +- .../padder/meshjob/impl/MeshJobManager_i.cxx | 2 +- 61 files changed, 520 insertions(+), 517 deletions(-) diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl index 8c63fdbda..b28fb1432 100644 --- a/idl/SMESH_MeshEditor.idl +++ b/idl/SMESH_MeshEditor.idl @@ -773,8 +773,9 @@ module SMESH SEW_DIFF_NB_OF_ELEMENTS, SEW_TOPO_DIFF_SETS_OF_ELEMENTS, SEW_BAD_SIDE1_NODES, - SEW_BAD_SIDE2_NODES - }; + SEW_BAD_SIDE2_NODES, + SEW_INTERNAL_ERROR + }; Sew_Error SewFreeBorders (in long FirstNodeID1, in long SecondNodeID1, diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx index 95d6a2ff1..f72df42cf 100644 --- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx @@ -435,6 +435,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]); if (aElement) { switch (aElement->GetType()) { + case SMDSAbs_Edge: if (!aEdgesGroup) { aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge); @@ -449,6 +450,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } aEdgesGroup->Add(aElement); break; + case SMDSAbs_Face: if (!aFacesGroup) { aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face); @@ -463,6 +465,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } aFacesGroup->Add(aElement); break; + case SMDSAbs_Volume: if (!aVolumeGroup) { aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume); @@ -477,6 +480,8 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } aVolumeGroup->Add(aElement); break; + + default:; } } } diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 1c9af415d..bdd94da6b 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -1707,13 +1707,14 @@ void SMESH_ActorDef::SetRepresentation (int theMode) my0DActor->SetRepresentation(aReperesent); myBallActor->SetRepresentation(aReperesent); - switch(myControlMode){ + switch ( myControlMode ) { case eLength: case eMultiConnection: aProp = aBackProp = my1DProp; if(myRepresentation != ePoint) aReperesent = SMESH_DeviceActor::eInsideframe; break; + default:; } if(aQuadraticMode == SMESH_Actor::eLines) @@ -2253,7 +2254,7 @@ vtkPlane* SMESH_ActorDef:: GetClippingPlane(vtkIdType theID) { - if(theID >= myCippingPlaneCont.size()) + if ( theID >= (vtkIdType)myCippingPlaneCont.size() ) return NULL; return myCippingPlaneCont[theID].Get(); } @@ -2487,7 +2488,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() { bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10; fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic); - for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ ) + for ( size_t i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ ) my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast(nbEvents[i])); if(funValues.size() >= 2) diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index 87a7c8401..9d8e4f3f3 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -37,7 +37,7 @@ namespace SMESH enum LabelFont { FntArial, //!< arial font family FntCourier, //!< courier font family - FntTimes, //!< times font family + FntTimes //!< times font family }; SMESHOBJECT_EXPORT diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx index b3ff7d74b..d96609719 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.cxx +++ b/src/OBJECT/SMESH_ExtractGeometry.cxx @@ -60,14 +60,14 @@ SMESH_ExtractGeometry::~SMESH_ExtractGeometry() vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID) { - if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1; + if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1; return myElemVTK2ObjIds[theVtkID]; } vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID) { - if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1; + if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1; return myNodeVTK2ObjIds[theVtkID]; } diff --git a/src/OBJECT/SMESH_ScalarBarActor.cxx b/src/OBJECT/SMESH_ScalarBarActor.cxx index d82962cb9..561182114 100644 --- a/src/OBJECT/SMESH_ScalarBarActor.cxx +++ b/src/OBJECT/SMESH_ScalarBarActor.cxx @@ -320,7 +320,7 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) // rnv begin // Customization of the vtkScalarBarActor to show distribution histogram. - bool distrVisibility = (numColors == this->myNbValues.size()); + bool distrVisibility = (numColors == (int)this->myNbValues.size()); vtkPoints *distrPts; vtkCellArray *distrPolys; vtkUnsignedCharArray *distColors = 0; @@ -328,12 +328,12 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) if(!distrVisibility) vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()"); - if (distrVisibility && GetDistributionVisibility()) { - for( i=0 ;iMaximumNumberOfColors == this->myNbValues.size(); + bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() ); double coef; if( GetDistributionVisibility() && distrVisibility ) if(this->Orientation == VTK_ORIENT_VERTICAL) @@ -856,40 +856,39 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, } //---------------------------------------------------------------------------- -void SMESH_ScalarBarActor::SizeTitle(int *titleSize, - int *size, - vtkViewport *viewport) +void SMESH_ScalarBarActor::SizeTitle(int *titleSize, + int *size, + vtkViewport *viewport) { titleSize[0] = titleSize[1] = 0; if (this->Title == NULL || !strlen(this->Title)) - { + { return; - } + } int targetWidth, targetHeight; - + targetWidth = size[0]; // rnv begin // Customization of the vtkScalarBarActor to show distribution histogram. - bool distrVisibility = this->MaximumNumberOfColors == this->myNbValues.size(); + bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() ); double coef; - if( GetDistributionVisibility() && distrVisibility ) + if ( GetDistributionVisibility() && distrVisibility ) coef=0.18; - else + else coef=0.25; if ( this->Orientation == VTK_ORIENT_VERTICAL ) - { - targetHeight = (int)(0.1*size[1]); - } + { + targetHeight = (int)(0.1*size[1]); + } else - { - targetHeight = (int)(coef*size[1]); - } + { + targetHeight = (int)(coef*size[1]); + } - this->TitleMapper->SetConstrainedFontSize( - viewport, targetWidth, targetHeight); + this->TitleMapper->SetConstrainedFontSize(viewport, targetWidth, targetHeight); this->TitleMapper->GetSize(viewport, titleSize); } diff --git a/src/SMDS/SMDS_Downward.cxx b/src/SMDS/SMDS_Downward.cxx index d6049c0bd..257ab88dd 100644 --- a/src/SMDS/SMDS_Downward.cxx +++ b/src/SMDS/SMDS_Downward.cxx @@ -217,13 +217,13 @@ void SMDS_Down1D::initCell(int cellId) */ void SMDS_Down1D::allocate(int nbElems) { - if (nbElems >= _vtkCellIds.size()) - { - _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); - _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); - _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize); - _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize); - } + if (nbElems >= (int)_vtkCellIds.size()) + { + _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); + _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); + _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize); + _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize); + } } void SMDS_Down1D::compactStorage() @@ -239,15 +239,15 @@ void SMDS_Down1D::compactStorage() _upCellIndex.resize(_maxId + 1, -1); // id and types of rank i correspond to [ _upCellIndex[i], _upCellIndex[i+1] [ int current = 0; for (int i = 0; i < _maxId; i++) + { + _upCellIndex[i] = current; + for (size_t j = 0; j < _upCellIdsVector[i].size(); j++) { - _upCellIndex[i] = current; - for (int j = 0; j < _upCellIdsVector[i].size(); j++) - { - _upCellIds[current] = _upCellIdsVector[i][j]; - _upCellTypes[current] = _upCellTypesVector[i][j]; - current++; - } + _upCellIds[current] = _upCellIdsVector[i][j]; + _upCellTypes[current] = _upCellTypesVector[i][j]; + current++; } + } _upCellIndex[_maxId] = current; _upCellIdsVector.clear(); @@ -674,14 +674,14 @@ bool SMDS_Down2D::isInFace(int cellId, int *pts, int npts) */ void SMDS_Down2D::allocate(int nbElems) { - if (nbElems >= _vtkCellIds.size()) - { - _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); - _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); - _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1); - _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1); - _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1); - } + if (nbElems >= (int)_vtkCellIds.size()) + { + _cellIds.resize (_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); + _vtkCellIds.resize (nbElems + SMDS_Mesh::chunkSize, -1); + _upCellIds.resize (2 * (nbElems + SMDS_Mesh::chunkSize), -1); + _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1); + _tempNodes.resize (_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1); + } } void SMDS_Down2D::compactStorage() @@ -764,11 +764,11 @@ SMDS_Down3D::~SMDS_Down3D() void SMDS_Down3D::allocate(int nbElems) { - if (nbElems >= _vtkCellIds.size()) - { - _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); - _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); - } + if (nbElems >= (int)_vtkCellIds.size()) + { + _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); + _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); + } } void SMDS_Down3D::compactStorage() @@ -1121,7 +1121,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector& o { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1131,19 +1131,19 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector& o set tofind; int ids[12] = { 0, 1, 2, 0, 3, 1, 2, 3, 0, 1, 3, 2 }; -//int ids[12] = { 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 }; + //int ids[12] = { 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 }; for (int k = 0; k < 4; k++) + { + tofind.clear(); + for (int i = 0; i < 3; i++) + tofind.insert(nodes[ids[3 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 3; i++) - tofind.insert(nodes[ids[3 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 3; i++) - orderedNodes[i] = nodes[ids[3 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[3 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1229,7 +1229,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1239,19 +1239,19 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector tofind; int ids[24] = { 0, 1, 2, 4, 5, 6, 0, 3, 1, 7, 8, 4, 2, 3, 0, 9, 7, 6, 1, 3, 2, 8, 9, 5 }; -//int ids[24] = { 2, 1, 0, 5, 4, 6, 1, 3, 0, 8, 7, 4, 0, 3, 2, 7, 9, 6, 2, 3, 1, 9, 8, 5 }; + //int ids[24] = { 2, 1, 0, 5, 4, 6, 1, 3, 0, 8, 7, 4, 0, 3, 2, 7, 9, 6, 2, 3, 1, 9, 8, 5 }; for (int k = 0; k < 4; k++) + { + tofind.clear(); + for (int i = 0; i < 6; i++) + tofind.insert(nodes[ids[6 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 6; i++) - tofind.insert(nodes[ids[6 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 6; i++) - orderedNodes[i] = nodes[ids[6 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[6 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1352,7 +1352,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector& { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1368,24 +1368,24 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector& for (int i = 0; i < 4; i++) tofind.insert(nodes[ids[i]]); if (setNodes == tofind) - { - for (int i = 0; i < 4; i++) - orderedNodes[i] = nodes[ids[i]]; - return; - } + { + for (int i = 0; i < 4; i++) + orderedNodes[i] = nodes[ids[i]]; + return; + } // Triangular faces for (int k = 0; k < 4; k++) + { + tofind.clear(); + for (int i = 0; i < 3; i++) + tofind.insert(nodes[ids[4 + 3 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 3; i++) - tofind.insert(nodes[ids[4 + 3 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 3; i++) - orderedNodes[i] = nodes[ids[4 + 3 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[4 + 3 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1492,10 +1492,10 @@ SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid() void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector& orderedNodes) { -// MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId); + // MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId); set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1512,24 +1512,24 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1655,7 +1655,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector& o { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1664,35 +1664,35 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector& o _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; -//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; + //int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; int ids[18] = { 0, 1, 2, 3, 5, 4, 0, 3, 4, 1, 1, 4, 5, 2, 2, 5, 3, 0 }; // Triangular faces for (int k = 0; k < 2; k++) + { + tofind.clear(); + for (int i = 0; i < 3; i++) + tofind.insert(nodes[ids[3 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 3; i++) - tofind.insert(nodes[ids[3 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 3; i++) - orderedNodes[i] = nodes[ids[3 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[3 * k + i]]; + return; } + } // Quadrangular faces for (int k = 0; k < 3; k++) + { + tofind.clear(); + for (int i = 0; i < 4; i++) + tofind.insert(nodes[ids[6 + 4 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 4; i++) - tofind.insert(nodes[ids[6 + 4 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 4; i++) - orderedNodes[i] = nodes[ids[6 + 4 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[6 + 4 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1704,7 +1704,7 @@ void SMDS_DownPenta::addDownCell(int cellId, int lowCellId, unsigned char aType) int *faces = &_cellIds[_nbDownCells * cellId]; if (aType == VTK_QUAD) for (int i = 0; i < 3; i++) - { + { if (faces[i] < 0) { faces[i] = lowCellId; @@ -1805,7 +1805,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1814,36 +1814,36 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vectorGetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; -//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; + //int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; int ids[36] = { 0, 1, 2, 6, 7, 8, 3, 5, 4, 11, 10, 9, 0, 3, 4, 1, 12, 9, 13, 6, 1, 4, 5, 2, 13, 10, 14, 7, 2, 5, 3, 0, 14, 11, 12, 8 }; // Triangular faces for (int k = 0; k < 2; k++) + { + tofind.clear(); + for (int i = 0; i < 6; i++) + tofind.insert(nodes[ids[6 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 6; i++) - tofind.insert(nodes[ids[6 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 6; i++) - orderedNodes[i] = nodes[ids[6 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[6 * k + i]]; + return; } + } // Quadrangular faces for (int k = 0; k < 3; k++) + { + tofind.clear(); + for (int i = 0; i < 8; i++) + tofind.insert(nodes[ids[12 + 8 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 8; i++) - tofind.insert(nodes[ids[12 + 8 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 8; i++) - orderedNodes[i] = nodes[ids[12 + 8 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[12 + 8 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1976,7 +1976,7 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector& or { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1985,20 +1985,20 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector& or _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; -//int ids[24] = { 0, 1, 2, 3, 7, 6, 5, 4, 4, 0, 3, 7, 5, 1, 0, 4, 6, 2, 1, 5, 7, 3, 2, 6}; + //int ids[24] = { 0, 1, 2, 3, 7, 6, 5, 4, 4, 0, 3, 7, 5, 1, 0, 4, 6, 2, 1, 5, 7, 3, 2, 6}; int ids[24] = { 3, 2, 1, 0, 4, 5, 6, 7, 7, 3, 0, 4, 4, 0, 1, 5, 5, 1, 2, 6, 6, 2, 3, 7}; for (int k = 0; k < 6; k++) // loop on the 6 faces + { + tofind.clear(); + for (int i = 0; i < 4; i++) + tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 4; i++) - tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i - if (setNodes == tofind) - { - for (int i = 0; i < 4; i++) - orderedNodes[i] = nodes[ids[4 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[4 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -2107,7 +2107,7 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -2120,17 +2120,17 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector int ids[48] = { 3, 2, 1, 0,10, 9, 8,11, 4, 5, 6, 7,12,13,14,15, 7, 3, 0, 4,19,11,16,15, 4, 0, 1, 5,16, 8,17,12, 5, 1, 2, 6,17, 9,18,13, 6, 2, 3, 7,18,10,19,14}; for (int k = 0; k < 6; k++) + { + tofind.clear(); + for (int i = 0; i < 8; i++) + tofind.insert(nodes[ids[8 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 8; i++) - tofind.insert(nodes[ids[8 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 8; i++) - orderedNodes[i] = nodes[ids[8 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[8 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); diff --git a/src/SMDS/SMDS_IteratorOfElements.cxx b/src/SMDS/SMDS_IteratorOfElements.cxx index 3719c6b56..e775b5bda 100644 --- a/src/SMDS/SMDS_IteratorOfElements.cxx +++ b/src/SMDS/SMDS_IteratorOfElements.cxx @@ -54,24 +54,24 @@ const SMDS_MeshElement * SMDS_IteratorOfElements::subNext() /// Create an iterator which look for elements of type type which are linked /// to the element element. it is the iterator to get connectivity of element ////////////////////////////////////////////////////////////////////////////// -SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element, - SMDSAbs_ElementType type, +SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element, + SMDSAbs_ElementType type, const SMDS_ElemIteratorPtr& it) - : t1Iterator(it), - t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)), - myType(type), myElement(element), - myProxyElement(NULL) + : t1Iterator(it), + t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)), + myType(type), myElement(element), + myProxyElement(NULL) { - while(subMore()) - alreadyReturnedElements.insert(subNext()); - itAlreadyReturned= alreadyReturnedElements.begin(); - switch(myElement->GetType()) - { - case SMDSAbs_Node: - case SMDSAbs_Edge: myReverseIteration=true; break; - case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break; - default: myReverseIteration=false; - } + while(subMore()) + alreadyReturnedElements.insert(subNext()); + itAlreadyReturned= alreadyReturnedElements.begin(); + switch(myElement->GetType()) + { + case SMDSAbs_Node: + case SMDSAbs_Edge: myReverseIteration=true; break; + case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break; + default: myReverseIteration=false; + } } bool SMDS_IteratorOfElements::more() diff --git a/src/SMDS/SMDS_IteratorOfElements.hxx b/src/SMDS/SMDS_IteratorOfElements.hxx index e0756198c..2b720b0cc 100644 --- a/src/SMDS/SMDS_IteratorOfElements.hxx +++ b/src/SMDS/SMDS_IteratorOfElements.hxx @@ -43,11 +43,11 @@ class SMDS_EXPORT SMDS_IteratorOfElements:public SMDS_ElemIterator const SMDS_MeshElement * next(); private: - SMDS_ElemIteratorPtr t2Iterator; SMDS_ElemIteratorPtr t1Iterator; + SMDS_ElemIteratorPtr t2Iterator; SMDSAbs_ElementType myType; - const SMDS_MeshElement * myProxyElement; const SMDS_MeshElement * myElement; + const SMDS_MeshElement * myProxyElement; bool myReverseIteration; std::set alreadyReturnedElements; diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index c4cadf10f..f37887482 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -3149,6 +3149,7 @@ void SMDS_Mesh::addChildrenWithNodes(set& setOfChildren MESSAGE("Internal Error: This should not happen"); break; case SMDSAbs_0DElement: + case SMDSAbs_Ball: { } break; @@ -3199,6 +3200,7 @@ void SMDS_Mesh::addChildrenWithNodes(set& setOfChildren addChildrenWithNodes(setOfChildren, ite->next(), nodes); } } + case SMDSAbs_NbElementTypes: case SMDSAbs_All: break; } } diff --git a/src/SMDS/SMDS_MeshCell.cxx b/src/SMDS/SMDS_MeshCell.cxx index e629a2f5b..8b7b2f63c 100644 --- a/src/SMDS/SMDS_MeshCell.cxx +++ b/src/SMDS/SMDS_MeshCell.cxx @@ -278,7 +278,7 @@ const std::vector& SMDS_MeshCell::reverseSmdsOrder(SMDSAbs_EntityType smdsT reverseInterlaces[ smdsType ][pos++] = 0; for ( int i = nbNodes / 2 - 1; i > 0 ; --i ) // 3,2,1 reverseInterlaces[ smdsType ][pos++] = i; - for ( int i = nbNodes - 1; i >= nbNodes / 2; --i ) // 7,6,5,4 + for ( int i = nbNodes - 1, nb = nbNodes / 2; i >= nb; --i ) // 7,6,5,4 reverseInterlaces[ smdsType ][pos++] = i; } } diff --git a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx index 2dfa337db..22cab1ab8 100644 --- a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx +++ b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx @@ -101,7 +101,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbEdges() const { int nbEdges = 0; - for (int ifa = 0; ifa < myQuantities.size(); ifa++) { + for ( size_t ifa = 0; ifa < myQuantities.size(); ifa++) { nbEdges += myQuantities[ifa]; } nbEdges /= 2; @@ -124,7 +124,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbFaces() const //======================================================================= int SMDS_PolyhedralVolumeOfNodes::NbFaceNodes (const int face_ind) const { - if (face_ind < 1 || myQuantities.size() < face_ind) + if (face_ind < 1 || (int)myQuantities.size() < face_ind) return 0; return myQuantities[face_ind - 1]; } @@ -201,7 +201,7 @@ struct _MyIterator:public SMDS_NodeVectorElemIterator class _MySubIterator : public SMDS_ElemIterator { vector< const SMDS_MeshElement* > myElems; - int myIndex; + size_t myIndex; public: _MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) { SMDS_VolumeTool vTool(vol); diff --git a/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx b/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx index 2a356d581..0ab7e8c84 100644 --- a/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx +++ b/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx @@ -215,7 +215,7 @@ bool SMDS_QuadraticVolumeOfNodes::IsMediumNode(const SMDS_MeshNode* node) const case 15: nbCorners = 6; break; default: nbCorners = 8; } - for ( int i = nbCorners; i myElems; - int myIndex; + size_t myIndex; public: _MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) { SMDS_VolumeTool vTool(vol); diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index c0c506d9c..06755badf 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -843,7 +843,7 @@ bool SMDS_VolumeTool::GetBaryCenter(double & X, double & Y, double & Z) const if ( !myVolume ) return false; - for ( int i = 0; i < myVolumeNodes.size(); i++ ) { + for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) { X += myVolumeNodes[ i ]->X(); Y += myVolumeNodes[ i ]->Y(); Z += myVolumeNodes[ i ]->Z(); @@ -1390,7 +1390,7 @@ bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1, // find nodes indices int i1 = -1, i2 = -1, nbFound = 0; - for ( int i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ ) + for ( size_t i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ ) { if ( myVolumeNodes[ i ] == theNode1 ) i1 = i, ++nbFound; @@ -1418,7 +1418,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, int minInd = min( theNode1Index, theNode2Index ); int maxInd = max( theNode1Index, theNode2Index ); - if ( minInd < 0 || maxInd > myVolumeNodes.size() - 1 || maxInd == minInd ) + if ( minInd < 0 || maxInd > (int)myVolumeNodes.size() - 1 || maxInd == minInd ) return false; VolumeType type = GetVolumeType(); @@ -1535,7 +1535,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const { if ( myVolume ) { - for ( int i = 0; i < myVolumeNodes.size(); i++ ) { + for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) { if ( myVolumeNodes[ i ] == theNode ) return i; } @@ -1596,8 +1596,8 @@ int SMDS_VolumeTool::GetAllExistingEdges(vector & edges { edges.clear(); edges.reserve( myVolumeNodes.size() * 2 ); - for ( int i = 0; i < myVolumeNodes.size()-1; ++i ) { - for ( int j = i + 1; j < myVolumeNodes.size(); ++j ) { + for ( size_t i = 0; i < myVolumeNodes.size()-1; ++i ) { + for ( size_t j = i + 1; j < myVolumeNodes.size(); ++j ) { if ( IsLinked( i, j )) { const SMDS_MeshElement* edge = SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] ); diff --git a/src/SMDS/chrono.cxx b/src/SMDS/chrono.cxx index caa6031f4..e09007076 100644 --- a/src/SMDS/chrono.cxx +++ b/src/SMDS/chrono.cxx @@ -60,7 +60,7 @@ void counters::stats() } chrono::chrono(int i) : - _ctr(i), _run(true) + _run(true), _ctr(i) { //MESSAGE("chrono::chrono " << _ctr << " " << _run); _start = clock(); diff --git a/src/SMESHFiltersSelection/SMESH_Type.h b/src/SMESHFiltersSelection/SMESH_Type.h index 9398fe649..94e1b6fb4 100644 --- a/src/SMESHFiltersSelection/SMESH_Type.h +++ b/src/SMESHFiltersSelection/SMESH_Type.h @@ -39,7 +39,7 @@ #define SMESHFILTERSSELECTION_EXPORT #endif -namespace SMESH{ +namespace SMESH { enum MeshObjectType { HYPOTHESIS, ALGORITHM, @@ -64,5 +64,5 @@ namespace SMESH{ IDSOURCE_FACE, IDSOURCE_VOLUME }; -}; +} #endif diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx index 5f12c7faa..fc0c43bdd 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx @@ -264,6 +264,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const Ok = isIDSourceOfType( obj, SMESH::VOLUME ); break; } + default:; } } return Ok; diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 12d43fc6d..a429e8818 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -84,7 +84,7 @@ typedef std::map SMESHGUI_Cli //================================================================================= class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module { - Q_OBJECT; + Q_OBJECT public : SMESHGUI(); diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index 5cfddb9ce..deacb22f0 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -338,8 +338,8 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myGeomType( theType ), - myBusy( false ) + myBusy( false ), + myGeomType( theType ) { setModal( false ); setAttribute( Qt::WA_DeleteOnClose, true ); @@ -599,6 +599,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init() myNbCenterNodes = 1; myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons break; + default:; } myMidFaceLabel ->setVisible( myNbMidFaceNodes ); @@ -724,6 +725,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply() anIds.push_back( aListId[ 0 ].toInt() ); } break; + default:; } if ( myReverseCB->isChecked()) ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false ); @@ -849,6 +851,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply() case SMESH::VOLUME: myActor->SetRepresentation(SMESH_Actor::eSurface); myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break; + default:; } } @@ -1068,6 +1071,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument() case SMDSEntity_Quad_Hexa: case SMDSEntity_TriQuad_Hexa: anElementType = SMESH::VOLUME; break; + default:; } myGroups.clear(); ComboBox_GroupName->clear(); @@ -1309,7 +1313,7 @@ bool SMESHGUI_AddQuadraticElementDlg::IsValid() okIDs.insert( anID ); } - return okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes; + return (int) okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes; } //================================================================================= @@ -1406,6 +1410,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity ) aFirstColIds = FirstHexahedronIds; aLastColIds = LastHexahedronIds; break; + default:; } // fill the First and the Last columns diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h index 161d2183f..b3e117556 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h @@ -56,7 +56,7 @@ class SUIT_SelectionFilter; //================================================================================= class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog { - Q_OBJECT; + Q_OBJECT public: diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 1d68b74fa..d38e638ca 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -601,12 +601,12 @@ SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg() if (myViewWindow) SMESH::RenderViewWindow(myViewWindow); - for( int i=0; i< myPlanes.size(); i++ ) { + for ( size_t i = 0; i < myPlanes.size(); i++ ) { SMESH::TPlaneData aPlaneData = myPlanes[i]; aPlaneData.Plane->Delete(); } - if (myPreviewWidget) { + if ( myPreviewWidget ) { myPreviewWidget->Off(); myPreviewWidget->Delete(); } diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index a71b425d4..001416791 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -271,7 +271,7 @@ namespace SMESH GEOM_Actor* getActor(const TopoDS_Shape& shape) { int index = myIndexToShape.FindIndex( shape ) - 1; - if ( index < 0 || index >= myActors.size() ) + if ( index < 0 || index >= (int) myActors.size() ) return 0; GEOM_Actor* & actor = myActors[ index ]; if ( !actor ) { @@ -887,7 +887,7 @@ void SMESHGUI_BaseComputeOp::computeMesh() #endif aCompErrors = gen->GetComputeErrors( myMesh, myMainShape ); // check if there are memory problems - for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) + for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB ); } catch(const SALOME::SALOME_Exception & S_ex) { @@ -922,7 +922,7 @@ void SMESHGUI_BaseComputeOp::computeMesh() aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) ); SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes(); // put SubMeshes into list - for ( int i = 0; i < aSubMeshes->length(); i++ ) { + for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ ) { SMESH::SMESH_subMesh_var sm = aSubMeshes[i]; if ( CORBA::is_nil( sm ) ) continue; _PTR(SObject) smSObj = SMESH::ObjectToSObject( sm ); @@ -1081,7 +1081,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, else { bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported - for ( int i = 0; i < theCompErrors->length() && onlyWarnings; ++i ) + for ( CORBA::ULong i = 0; i < theCompErrors->length() && onlyWarnings; ++i ) onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING || theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE ); @@ -1136,7 +1136,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, tbl->setColumnWidth( COL_ERROR, 200 ); bool hasBadMesh = false; - for ( int row = 0; row < theCompErrors->length(); ++row ) + for ( int row = 0; row < (int) theCompErrors->length(); ++row ) { SMESH::ComputeError & err = theCompErrors[ row ]; @@ -1542,15 +1542,15 @@ LightApp_Dialog* SMESHGUI_ComputeOp::dlg() const //================================================================================ /*! * \brief Constructor -*/ + */ //================================================================================ SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp() : SMESHGUI_BaseComputeOp(), - myDlg( 0 ), - myOrderMgr( 0 ), myActiveDlg( 0 ), - myPreviewDisplayer( 0 ) + myDlg( 0 ), + myPreviewDisplayer( 0 ), + myOrderMgr( 0 ) { } @@ -1962,7 +1962,7 @@ void SMESHGUI_PrecomputeOp::onPreview() #endif aCompErrors = gen->GetComputeErrors( myMesh, myMainShape ); // check if there are memory problems - for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) + for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB ); } catch(const SALOME::SALOME_Exception & S_ex){ @@ -2293,7 +2293,7 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes, tbl->setColumnWidth( COL_ERROR, 200 ); bool hasBadMesh = false; - for ( int row = 0; row < theCompErrors->length(); ++row ) + for ( int row = 0; row < (int) theCompErrors->length(); ++row ) { SMESH::ComputeError & err = theCompErrors[ row ]; diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 06d9172e4..7d1495845 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -239,7 +239,9 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() } } break; - } + + default:; + } // switch( (*anIt).myValue.type() ) if( w ) { @@ -297,7 +299,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) { SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo ); if( listSOmesh.size() > 0 ) - for( int i = 0; i < listSOmesh.size(); i++ ) + for( size_t i = 0; i < listSOmesh.size(); i++ ) { _PTR(SObject) submSO = listSOmesh[i]; SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface( submSO ); @@ -391,8 +393,8 @@ QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams { QString valueStr = ""; ListOfStdParams::const_iterator param = params.begin(), aLast = params.end(); - uint len0 = 0; - for( int i=0; param!=aLast; param++, i++ ) + int len0 = 0; + for ( ; param != aLast; param++ ) { if ( valueStr.length() > len0 ) { valueStr += "; "; @@ -749,12 +751,12 @@ HypothesisData::HypothesisData( const QString& theTypeName, Context( theContext ), Dim( theDim ), IsAuxOrNeedHyp( theIsAuxOrNeedHyp ), + IsNeedGeometry( theIsNeedGeometry ), + IsSupportSubmeshes( supportSub ), BasicHypos( theBasicHypos ), OptionalHypos( theOptionalHypos ), InputTypes( theInputTypes ), - OutputTypes( theOutputTypes ), - IsNeedGeometry( theIsNeedGeometry ), - IsSupportSubmeshes( supportSub ) + OutputTypes( theOutputTypes ) { } diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 351639e89..1ddf9b2a4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -88,10 +88,10 @@ //================================================================================ SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh ) : SMESHGUI_SelectionOp(), - myToCreate( theToCreate ), - myIsMesh( theIsMesh ), myDlg( 0 ), myShapeByMeshOp( 0 ), + myToCreate( theToCreate ), + myIsMesh( theIsMesh ), myHypoSet( 0 ) { if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists @@ -576,7 +576,7 @@ void SMESHGUI_MeshOp::selectionDone() if (aSeq->length() > 0) { shapeDim = -1; - for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) { + for ( CORBA::ULong iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) { GEOM::GEOM_Object_var aGeomVar = aSeq[iss]; switch ( aGeomVar->GetShapeType() ) { case GEOM::SOLID: shapeDim = 3; break; diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index 206f4504e..35bd50672 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -157,15 +157,15 @@ private: bool myHasConcurrentSubBefore; TDim2Type2HypList myExistingHyps; //!< all hypothesis of SMESH module - TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current + TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current // edited mesh/sub-mesh // hypdata corresponding to hypotheses present in myDlg THypDataList myAvailableHypData[4][NbHypTypes]; QString myLastGeomToSelect; THypLabelIsAppMap myHypMapIsApplicable; bool myIgnoreAlgoSelection; - HypothesesSet* myHypoSet; - int myDim, myType, myMaxShapeDim; + HypothesesSet* myHypoSet; + int myDim, myType, myMaxShapeDim; QString myObjectToSelect; }; diff --git a/src/SMESHUtils/SMESH_File.cxx b/src/SMESHUtils/SMESH_File.cxx index 8d138b46c..10c1f533f 100644 --- a/src/SMESHUtils/SMESH_File.cxx +++ b/src/SMESHUtils/SMESH_File.cxx @@ -271,7 +271,7 @@ void SMESH_File::rewind() bool SMESH_File::getInts(std::vector& ints) { - int i = 0; + size_t i = 0; while ( i < ints.size() ) { while ( !isdigit( *_pos ) && !eof()) ++_pos; @@ -330,7 +330,7 @@ bool SMESH_File::writeRaw(const void* data, size_t size) #else ssize_t nbWritten = ::write( _file, data, size ); - return ( nbWritten == size ); + return ( nbWritten == (ssize_t) size ); #endif } diff --git a/src/SMESHUtils/SMESH_MAT2d.cxx b/src/SMESHUtils/SMESH_MAT2d.cxx index 970d560e5..c9fcd8501 100644 --- a/src/SMESHUtils/SMESH_MAT2d.cxx +++ b/src/SMESHUtils/SMESH_MAT2d.cxx @@ -448,14 +448,14 @@ namespace addedEdges.insert( bndSegs[i]._edge->twin() ).second ) { v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex0(), v2Node.size() + 1 )).first; - int n0 = v2n->second; + size_t n0 = v2n->second; if ( n0 == v2Node.size() ) text << "n" << n0 << " = m.AddNode( " << bndSegs[i]._edge->vertex0()->x() / theScale[0] << ", " << bndSegs[i]._edge->vertex0()->y() / theScale[1] << ", 0 )\n"; v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex1(), v2Node.size() + 1 )).first; - int n1 = v2n->second; + size_t n1 = v2n->second; if ( n1 == v2Node.size() ) text << "n" << n1 << " = m.AddNode( " << bndSegs[i]._edge->vertex1()->x() / theScale[0] << ", " @@ -1210,7 +1210,7 @@ namespace else // bndSegs[ i ]._branchID > 0 { dInd = +1; - for ( edgeInd = 0; edgeInd < branchEdges[ brID ].size(); ++edgeInd ) + for ( edgeInd = 0; edgeInd < (int)branchEdges[ brID ].size(); ++edgeInd ) if ( branchEdges[ brID ][ edgeInd ] == bndSegs[ i ]._edge ) break; } @@ -1386,7 +1386,7 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge, int di = ( points._params[0] == points._params[i] ) ? +1 : -1; while ( points._params[i] == points._params[i+1] ) i += di; - if ( i < 0 || i+1 >= points._params.size() ) + if ( i < 0 || i+1 >= (int)points._params.size() ) i = 0; } @@ -1394,9 +1394,9 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge, if ( !points._maEdges[ i ].second ) // no branch at the EDGE end, look for a closest branch { - if ( i < points._maEdges.size() / 2 ) // near 1st point + if ( i < (int)points._maEdges.size() / 2 ) // near 1st point { - while ( i < points._maEdges.size()-1 && !points._maEdges[ i ].second ) + while ( i < (int)points._maEdges.size()-1 && !points._maEdges[ i ].second ) ++i; edgeParam = edgeReverse; } @@ -1699,7 +1699,7 @@ bool SMESH_MAT2d::Branch::getParameter(const BranchPoint & p, double & u ) const if ( p._iEdge > _params.size()-1 ) return false; if ( p._iEdge == _params.size()-1 ) - return u = 1.; + return ( u = 1. ); u = ( _params[ p._iEdge ] * ( 1 - p._edgeParam ) + _params[ p._iEdge+1 ] * p._edgeParam ); @@ -1805,7 +1805,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >& { // look for a VERTEX of the opposite EDGE // iNext - next after all null-length segments - while ( maE = ++iNext ) + while (( maE = ++iNext )) { iSeg2 = getBndSegment( maE ); if ( !_boundary->isConcaveSegment( ie1, iSeg2 )) @@ -1837,7 +1837,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >& else if ( isConcaPrev ) { // all null-length segments passed, find their beginning - while ( maE = iPrev.edgePrev() ) + while (( maE = iPrev.edgePrev() )) { iSeg1 = getBndSegment( maE ); if ( _boundary->isConcaveSegment( edgeIDs1.back(), iSeg1 )) @@ -1909,7 +1909,7 @@ void SMESH_MAT2d::Branch::getOppositeGeomEdges( std::vector< std::size_t >& edge BranchPoint divisionPnt; divisionPnt._branch = this; - for ( ++maIter, ++twIter; maIter.index() < _maEdges.size(); ++maIter, ++twIter ) + for ( ++maIter, ++twIter; maIter.index() < (int)_maEdges.size(); ++maIter, ++twIter ) { size_t ie1 = getGeomEdge( maIter.edge() ); size_t ie2 = getGeomEdge( twIter.edge() ); diff --git a/src/SMESHUtils/SMESH_Tree.hxx b/src/SMESHUtils/SMESH_Tree.hxx index eb7b2b864..983aa064b 100644 --- a/src/SMESHUtils/SMESH_Tree.hxx +++ b/src/SMESHUtils/SMESH_Tree.hxx @@ -138,8 +138,8 @@ SMESH_Tree::SMESH_Tree (SMESH_TreeLimit* limit): myFather(0), myIsLeaf( false ), myLimit( limit ), - myLevel(0), - myBox(0) + myBox(0), + myLevel(0) { //if ( !myLimit ) myLimit = new SMESH_TreeLimit(); } diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index fe64ce7b7..532c9a450 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -960,7 +960,7 @@ void SMESH_Gen_i::SetOption(const char* name, const char* value) // color must be presented as a string of next form: if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example) str = str.substr(1); - for ( int i = 0; i < str.length()/2; i++ ) + for ( size_t i = 0; i < str.length()/2; i++ ) if ( str.at(i*2) >= '0' && str.at(i*2) <= 'f' && str.at(i*2+1) >= '0' && str.at(i*2+1) <= 'f' ) color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) ); } @@ -4896,7 +4896,7 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent, _CORBA_Octet* buffer = new _CORBA_Octet[real_size]; char tmp[3]; tmp[2]='\0'; - int c = -1; + uint c = -1; for ( int i = 0; i < real_size; i++ ) { memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 ); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 0b927273c..f31e583eb 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -285,13 +285,13 @@ namespace MeshEditor_I { SMDS_MeshElement::Filter & filter = *aFilter; if ( aType == SMDSAbs_Node ) - for (int i=0; iFindNode( IDs[i] ); if ( filter( elem )) aMap.insert( aMap.end(), elem ); } else - for (int i=0; iFindElement( IDs[i] ); if ( filter( elem )) aMap.insert( aMap.end(), elem ); @@ -315,7 +315,7 @@ namespace MeshEditor_I { SMESH::long_array_var aElementsId = theObject->GetIDs(); if ( types->length() == 1 && types[0] == SMESH::NODE) { - for(int i = 0; i < aElementsId->length(); i++) + for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ ) if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] )) theNodeSet.insert( theNodeSet.end(), n); } @@ -323,13 +323,13 @@ namespace MeshEditor_I { { SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator(); while ( nIt->more( )) - if( const SMDS_MeshElement * elem = nIt->next() ) + if ( const SMDS_MeshElement * elem = nIt->next() ) theNodeSet.insert( elem->begin_nodes(), elem->end_nodes()); } else { - for(int i = 0; i < aElementsId->length(); i++) - if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] )) + for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ ) + if ( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] )) theNodeSet.insert( elem->begin_nodes(), elem->end_nodes()); } } @@ -349,7 +349,7 @@ namespace MeshEditor_I { SMDSAbs_ElementType elemType = (*theElements.begin())->GetType(); bool sameElemType = ( elemType == (*theElements.rbegin())->GetType() ); if ( sameElemType && - theMeshDS->GetMeshInfo().NbElements( elemType ) == theElements.size() ) + theMeshDS->GetMeshInfo().NbElements( elemType ) == (int) theElements.size() ) return; // all the elements are in theElements if ( !sameElemType ) @@ -794,7 +794,7 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements) list< int > IdList; - for (int i = 0; i < IDsOfElements.length(); i++) + for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ ) IdList.push_back( IDsOfElements[i] ); // Update Python script @@ -823,7 +823,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo initData(); list< int > IdList; - for (int i = 0; i < IDsOfNodes.length(); i++) + for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++) IdList.push_back( IDsOfNodes[i] ); // Update Python script @@ -859,9 +859,7 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes() SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq ); // remove orphan nodes (if there are any) - list< int > IdList; - for ( int i = 0; i < seq.size(); i++ ) - IdList.push_back( seq[i] ); + list< int > IdList( seq.begin(), seq.end() ); int nbNodesBefore = myMesh->NbNodes(); getEditor().Remove( IdList, true ); @@ -1584,7 +1582,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfEleme SMESH_TRY; initData(); - for (int i = 0; i < IDsOfElements.length(); i++) + for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ ) { CORBA::Long index = IDsOfElements[i]; const SMDS_MeshElement * elem = getMeshDS()->FindElement(index); @@ -2273,7 +2271,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements, arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face); set fixedNodes; - for (int i = 0; i < IDsOfFixedNodes.length(); i++) { + for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) { CORBA::Long index = IDsOfFixedNodes[i]; const SMDS_MeshNode * node = aMesh->FindNode(index); if ( node ) @@ -2866,7 +2864,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face ); list angles; - for (int i = 0; i < theAngles.length(); i++) { + for ( CORBA::ULong i = 0; i < theAngles.length(); i++ ) { angles.push_back( theAngles[i] ); } @@ -4091,7 +4089,7 @@ FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr theObject, TIDSortedNodeSet nodes; idSourceToNodeSet( theObject, getMeshDS(), nodes ); - for ( int i = 0; i < theExceptSubMeshOrGroups.length(); ++i ) + for ( CORBA::ULong i = 0; i < theExceptSubMeshOrGroups.length(); ++i ) { SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( theExceptSubMeshOrGroups[i], SMESH::NODE ); @@ -4127,7 +4125,7 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN aTPythonDump << this << ".MergeNodes(["; TIDSortedNodeSet setOfNodesToKeep; - for ( int i = 0; i < NodesToKeep.length(); ++i ) + for ( CORBA::ULong i = 0; i < NodesToKeep.length(); ++i ) { prepareIdSource( NodesToKeep[i] ); SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( NodesToKeep[i], SMESH::NODE ); @@ -4136,12 +4134,12 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN } ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes; - for (int i = 0; i < GroupsOfNodes.length(); i++) + for ( CORBA::ULong i = 0; i < GroupsOfNodes.length(); i++ ) { const SMESH::long_array& aNodeGroup = GroupsOfNodes[ i ]; aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() ); list< const SMDS_MeshNode* >& aListOfNodes = aListOfListOfNodes.back(); - for ( int j = 0; j < aNodeGroup.length(); j++ ) + for ( CORBA::ULong j = 0; j < aNodeGroup.length(); j++ ) { CORBA::Long index = aNodeGroup[ j ]; if ( const SMDS_MeshNode * node = aMesh->FindNode( index )) @@ -4227,11 +4225,11 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& GroupsO ::SMESH_MeshEditor::TListOfListOfElementsID aListOfListOfElementsID; - for (int i = 0; i < GroupsOfElementsID.length(); i++) { + for ( CORBA::ULong i = 0; i < GroupsOfElementsID.length(); i++ ) { const SMESH::long_array& anElemsIDGroup = GroupsOfElementsID[ i ]; aListOfListOfElementsID.push_back( list< int >() ); list< int >& aListOfElemsID = aListOfListOfElementsID.back(); - for ( int j = 0; j < anElemsIDGroup.length(); j++ ) { + for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ ) { CORBA::Long id = anElemsIDGroup[ j ]; aListOfElemsID.push_back( id ); } @@ -4456,7 +4454,7 @@ SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x, SMDSAbs_ElementType( type ), foundElems); res->length( foundElems.size() ); - for ( int i = 0; i < foundElems.size(); ++i ) + for ( size_t i = 0; i < foundElems.size(); ++i ) res[i] = foundElems[i]->GetID(); return res._retn(); @@ -4517,7 +4515,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID SMDSAbs_ElementType( type ), foundElems); res->length( foundElems.size() ); - for ( int i = 0; i < foundElems.size(); ++i ) + for ( size_t i = 0; i < foundElems.size(); ++i ) res[i] = foundElems[i]->GetID(); return res._retn(); @@ -4568,6 +4566,7 @@ static SMESH::SMESH_MeshEditor::Sew_Error convError( const::SMESH_MeshEditor::Se RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS ); RETCASE( SEW_BAD_SIDE1_NODES ); RETCASE( SEW_BAD_SIDE2_NODES ); + RETCASE( SEW_INTERNAL_ERROR ); } return SMESH::SMESH_MeshEditor::SEW_OK; } @@ -4651,16 +4650,16 @@ SewCoincidentFreeBorders(const SMESH::CoincidentFreeBorders& freeBorders, for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP ) { const SMESH::FreeBorderPart& aPART = aGRP[ iP ]; - if ( aPART.border < 0 || aPART.border >= freeBorders.borders.length() ) + if ( aPART.border < 0 || aPART.border >= (int) freeBorders.borders.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::border index", SALOME::BAD_PARAM); const SMESH::FreeBorder& aBRD = freeBorders.borders[ aPART.border ]; - if ( aPART.node1 < 0 || aPART.node1 > aBRD.nodeIDs.length() ) + if ( aPART.node1 < 0 || aPART.node1 > (int) aBRD.nodeIDs.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node1", SALOME::BAD_PARAM); - if ( aPART.node2 < 0 || aPART.node2 > aBRD.nodeIDs.length() ) + if ( aPART.node2 < 0 || aPART.node2 > (int) aBRD.nodeIDs.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node2", SALOME::BAD_PARAM); - if ( aPART.nodeLast < 0 || aPART.nodeLast > aBRD.nodeIDs.length() ) + if ( aPART.nodeLast < 0 || aPART.nodeLast > (int) aBRD.nodeIDs.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::nodeLast", SALOME::BAD_PARAM); // do not keep these nodes for further sewing as nodes can be removed by the sewing @@ -6500,7 +6499,7 @@ void SMESH_MeshEditor_i::CreateHoleSkin(CORBA::Double radius, theNodeSearcher = SMESH_MeshAlgos::GetNodeSearcher( *getMeshDS() ); vector nodesCoords; - for (int i = 0; i < theNodesCoords.length(); i++) + for ( CORBA::ULong i = 0; i < theNodesCoords.length(); i++) { nodesCoords.push_back( theNodesCoords[i] ); } @@ -6666,7 +6665,7 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim, groupsOfThisMesh ->length( groups.length() ); groupsOfOtherMesh->length( groups.length() ); int nbGroups = 0, nbGroupsOfOtherMesh = 0; - for ( int i = 0; i < groups.length(); ++i ) + for ( CORBA::ULong i = 0; i < groups.length(); ++i ) { SMESH::SMESH_Mesh_var m = groups[i]->GetMesh(); if ( myMesh_i != SMESH::DownCast( m )) diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx index 943a1b767..75297f2db 100644 --- a/src/SMESH_I/SMESH_NoteBook.cxx +++ b/src/SMESH_I/SMESH_NoteBook.cxx @@ -53,7 +53,7 @@ namespace */ void SetVariable(Handle(_pyCommand) theCommand, const SMESH_ObjectStates* theStates, - int position, int theArgNb) + size_t position, int theArgNb) { if(theStates->GetCurrectState().size() > position) if(!theStates->GetCurrectState().at(position).IsEmpty()) @@ -100,7 +100,7 @@ void SMESH_ObjectStates::AddState(const TState &theState) //================================================================================ TState SMESH_ObjectStates::GetCurrectState() const { - if(_states.size() > _dumpstate) + if ( (int) _states.size() > _dumpstate) return _states[_dumpstate]; TState empty; return empty; @@ -236,7 +236,7 @@ SMESH_NoteBook::~SMESH_NoteBook() //================================================================================ void SMESH_NoteBook::ReplaceVariables() { - for(int i=0;i<_commands.size();i++) + for ( size_t i = 0 ; i < _commands.size(); i++ ) { Handle(_pyCommand) aCmd = _commands[i]; TCollection_AsciiString aMethod = aCmd->GetMethod(); @@ -714,7 +714,7 @@ void SMESH_NoteBook::ReplaceVariables() { TState aCurrentState = aStates->GetCurrectState(); int argIndex = h->getParamIndex( aMethod, aCurrentState.size() ); - if ( 0 <= argIndex && argIndex < aCurrentState.size() && + if ( 0 <= argIndex && argIndex < (int)aCurrentState.size() && !aCurrentState[argIndex].IsEmpty() ) aCmd->SetArg( 1, aCurrentState[argIndex] ); @@ -790,10 +790,10 @@ void SMESH_NoteBook::InitObjectMap() else aState = new SMESH_ObjectStates(anObjType); - for(int i = 0; i < aSections->length(); i++) { + for ( size_t i = 0; i < aSections->length(); i++ ) { TState aVars; SALOMEDS::ListOfStrings aListOfVars = aSections[i]; - for ( int j = 0; jIsVariable(aVar.ToCString())) { @@ -859,8 +859,8 @@ void SMESH_NoteBook::ProcessLayerDistribution() return; // 2) Initialize all type of 1D Distribution hypothesis - for(int i=0;i<_commands.size();i++){ - for(int j =0;j < aLDS.size();j++){ + for ( size_t i = 0; i < _commands.size(); i++ ) { + for ( size_t j = 0; j < aLDS.size(); j++ ) { TCollection_AsciiString aResultValue = _commands[i]->GetResultValue(); if(_commands[i]->GetMethod() == "CreateHypothesis" && aLDS[j]->HasDistribution(aResultValue)){ @@ -872,8 +872,8 @@ void SMESH_NoteBook::ProcessLayerDistribution() } // 3) ... and replase variables ... - for(int i=0;i<_commands.size();i++){ - for(int j =0;j < aLDS.size();j++){ + for ( size_t i = 0; i < _commands.size(); i++ ) { + for ( size_t j = 0; j < aLDS.size(); j++ ) { TCollection_AsciiString anObject = _commands[i]->GetObject(); if(aLDS[j]->HasDistribution(anObject)) { @@ -929,8 +929,8 @@ void SMESH_NoteBook::ProcessLayerDistribution() TCollection_AsciiString SMESH_NoteBook::GetResultScript() const { TCollection_AsciiString aResult; - for(int i=0;i<_commands.size();i++) - aResult+=_commands[i]->GetString()+"\n"; + for ( size_t i = 0; i < _commands.size(); i++ ) + aResult += _commands[i]->GetString() + "\n"; return aResult; } @@ -941,7 +941,7 @@ TCollection_AsciiString SMESH_NoteBook::GetResultScript() const //================================================================================ void SMESH_NoteBook::GetResultLines(std::list< TCollection_AsciiString >& lines) const { - for(int i=0;i<_commands.size();i++) + for ( size_t i = 0; i < _commands.size(); i++ ) lines.push_back( _commands[i]->GetString() ); } diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 2fc76a7b3..8ffcc0ce2 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -992,7 +992,7 @@ ostream & StdMeshers_Adaptive1D::SaveTo(ostream & save) istream & StdMeshers_Adaptive1D::LoadFrom(istream & load) { int dummyParam; - bool isOK = (load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam); + bool isOK = static_cast(load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam); if (!isOK) load.clear(ios::badbit | load.rdstate()); return load; diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx index 2642dd1af..deabddb71 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx @@ -144,22 +144,22 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load) { bool isOK = true; int intVal; - isOK = (load >> _begLength); + isOK = static_cast(load >> _begLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _endLength); + isOK = static_cast(load >> _endLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index 6d8135590..7226e4beb 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -799,51 +799,51 @@ std::istream & StdMeshers_CartesianParameters3D::LoadFrom(std::istream & load) { bool ok; - ok = ( load >> _sizeThreshold ); + ok = static_cast( load >> _sizeThreshold ); for ( int ax = 0; ax < 3; ++ax ) { if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _coords[ax].resize( i ); for ( i = 0; i < _coords[ax].size() && ok; ++i ) - ok = (load >> _coords[ax][i] ); + ok = static_cast(load >> _coords[ax][i] ); } } if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _internalPoints[ax].resize( i ); for ( i = 0; i < _internalPoints[ax].size() && ok; ++i ) - ok = (load >> _internalPoints[ax][i] ); + ok = static_cast(load >> _internalPoints[ax][i] ); } } if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _spaceFunctions[ax].resize( i ); for ( i = 0; i < _spaceFunctions[ax].size() && ok; ++i ) - ok = (load >> _spaceFunctions[ax][i] ); + ok = static_cast(load >> _spaceFunctions[ax][i] ); } } } - ok = ( load >> _toAddEdges ); + ok = static_cast( load >> _toAddEdges ); for ( int i = 0; i < 9 && ok; ++i ) - ok = ( load >> _axisDirs[i]); + ok = static_cast( load >> _axisDirs[i]); for ( int i = 0; i < 3 && ok ; ++i ) - ok = ( load >> _fixedPoint[i]); + ok = static_cast( load >> _fixedPoint[i]); return load; } diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index c2aa6f3e4..b896de3b6 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -696,17 +696,17 @@ namespace int& di, double tol ) { //val += values[0]; // input \a val is measured from 0. - if ( i > values.size()-2 ) + if ( i > (int) values.size()-2 ) i = values.size()-2; else - while ( i+2 < values.size() && val > values[ i+1 ]) + while ( i+2 < (int) values.size() && val > values[ i+1 ]) ++i; while ( i > 0 && val < values[ i ]) --i; if ( i > 0 && val - values[ i ] < tol ) di = -1; - else if ( i+2 < values.size() && values[ i+1 ] - val < tol ) + else if ( i+2 < (int) values.size() && values[ i+1 ] - val < tol ) di = 1; else di = 0; @@ -1776,7 +1776,7 @@ namespace if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon )) quad._eIntNodes[ iP ]->_usedInFace = 0; #endif - int nbUsedEdgeNodes = 0; + size_t nbUsedEdgeNodes = 0; _Face* prevPolyg = 0; // polygon previously created from this quad while ( nbSplits > 0 ) @@ -1839,7 +1839,7 @@ namespace else { _OrientedLink foundSplit; - for ( int i = iS; i < splits.size() && !foundSplit; ++i ) + for ( size_t i = iS; i < splits.size() && !foundSplit; ++i ) if (( foundSplit = splits[ i ]) && ( n2->IsLinked( foundSplit.FirstNode()->_intPoint ))) { @@ -2100,7 +2100,7 @@ namespace { sortVertexNodes( chainNodes, curNode, curFace ); } - for ( int i = 0; i < chainNodes.size(); ++i ) + for ( size_t i = 0; i < chainNodes.size(); ++i ) { polygon.AddPolyLink( chainNodes[ i ], curNode ); curNode = chainNodes[ i ]; @@ -2322,9 +2322,9 @@ namespace i = int(lineInd.I()) + dInd[iL][0]; j = int(lineInd.J()) + dInd[iL][1]; k = int(lineInd.K()) + dInd[iL][2]; - if ( i < 0 || i >= nbCells[0] || - j < 0 || j >= nbCells[1] || - k < 0 || k >= nbCells[2] ) continue; + if ( i < 0 || i >= (int) nbCells[0] || + j < 0 || j >= (int) nbCells[1] || + k < 0 || k >= (int) nbCells[2] ) continue; const size_t hexIndex = _grid->CellIndex( i,j,k ); Hexahedron *& hex = allHexa[ hexIndex ]; @@ -2436,7 +2436,7 @@ namespace planes._zProjs [0] = 0; const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm; const vector< double > & u = _grid->_coords[ iDirZ ]; - for ( int i = 1; i < planes._zProjs.size(); ++i ) + for ( size_t i = 1; i < planes._zProjs.size(); ++i ) { planes._zProjs [i] = zFactor * ( u[i] - u[0] ); } @@ -2870,7 +2870,7 @@ namespace { bool isOut = false; - const bool moreIntPoints = ( iP+1 < link._fIntPoints.size() ); + const bool moreIntPoints = ( iP+1 < (int) link._fIntPoints.size() ); // get 2 _Node's _Node* n1 = link._fIntNodes[ iP ]; @@ -3049,7 +3049,7 @@ namespace // sort nodes accoring to the order of edges _Node* orderNodes [20]; TGeomID orderShapeIDs[20]; - int nbN = 0; + size_t nbN = 0; TGeomID id, *pID; for ( e = edges.begin(); e != edges.end(); ++e ) { @@ -3536,7 +3536,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh & theMesh, map< TGeomID, vector< TGeomID > > edge2faceIDsMap; TopExp_Explorer eExp; Bnd_Box shapeBox; - for ( int i = 0; i < faceVec.size(); ++i ) + for ( size_t i = 0; i < faceVec.size(); ++i ) { facesItersectors[i]._face = TopoDS::Face ( faceVec[i] ); facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] ); diff --git a/src/StdMeshers/StdMeshers_Deflection1D.cxx b/src/StdMeshers/StdMeshers_Deflection1D.cxx index 2fbaefb01..d2bc5501c 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.cxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.cxx @@ -119,7 +119,7 @@ ostream & StdMeshers_Deflection1D::SaveTo(ostream & save) istream & StdMeshers_Deflection1D::LoadFrom(istream & load) { - bool isOK = (load >> _value); + bool isOK = static_cast(load >> _value); if (!isOK) load.clear(ios::badbit | load.rdstate()); return load; diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 455f82bae..574466cc7 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -132,8 +132,8 @@ bool FunctionTable::value( const double t, double& f ) const double FunctionTable::integral( const int i ) const { - if( i>=0 && i= 0 && i < (int)myData.size()-1 ) + return integral( i, myData[2*(i+1)] - myData[2*i] ); else return 0; } diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 2625b9fb1..3849040e9 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -310,14 +310,14 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, if ( NbEdges() == 0 ) return myPoints; StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this ); - SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); + //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() ); SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() ); fHelper.SetSubShape( myFace ); bool paramOK; double eps = 1e-100; - // sort nodes of all edges putting them into a map + // sort nodes of all edges by putting them into a map map< double, const SMDS_MeshNode*> u2node; vector< pair< double, const SMDS_MeshNode*> > u2nodeVec; @@ -428,8 +428,8 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, u2node.insert( u2node.end(), make_pair( 1., node )); } - if ( u2node.size() + nbProxyNodes != myNbPonits && - u2node.size() + nbProxyNodes != NbPoints( /*update=*/true )) + if ((int) u2node.size() + nbProxyNodes != myNbPonits && + (int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true )) { MESSAGE("Wrong node parameters on edges, u2node.size():" <& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, // set if ( isXConst ) - for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].x = constValue; + for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].x = constValue; else - for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].y = constValue; + for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].y = constValue; } // if ( myPoints.empty()) @@ -543,7 +543,7 @@ const vector& StdMeshers_FaceSide::SimulateUVPtStruct(int nbSeg, int EdgeIndex = 0; double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ]; - for (int i = 0 ; i < myFalsePoints.size(); ++i ) { + for ( size_t i = 0 ; i < myFalsePoints.size(); ++i ) { double normPar = double(i) / double(nbSeg); UVPtStruct & uvPt = (*points)[i]; uvPt.node = 0; @@ -582,7 +582,7 @@ std::vector StdMeshers_FaceSide::GetOrderedNodes(int theEd { if ( NbEdges() == 0 ) return resultNodes; - SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); + //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() ); SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() ); fHelper.SetSubShape( myFace ); @@ -682,8 +682,8 @@ std::vector StdMeshers_FaceSide::GetOrderedNodes(int theEd // Fill the result vector if ( theEdgeInd < 0 && - u2node.size() != myNbPonits && - u2node.size() != NbPoints( /*update=*/true )) + (int) u2node.size() != myNbPonits && + (int) u2node.size() != NbPoints( /*update=*/true )) { u2node.clear(); } @@ -810,7 +810,7 @@ const SMDS_MeshNode* StdMeshers_FaceSide::VertexNode(std::size_t i, bool* isMove n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false ); if (( !n ) && - (( i > 0 && i < NbEdges() ) || IsClosed() )) + (( i > 0 && (int) i < NbEdges() ) || IsClosed() )) { iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() ); sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]); @@ -1051,7 +1051,7 @@ void StdMeshers_FaceSide::dump(const char* msg) const if (msg) MESSAGE ( std::endl << msg ); MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() ); MESSAGE_ADD ( "nbPoints: "<()<() - << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() ); + << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() ); } MESSAGE_ADD ( "\tC2d: "); - + if (myC2d[i].IsNull()) { MESSAGE_ADD ( "NULL" ); } else { MESSAGE_ADD ( myC2d[i].operator->() ); } - + MESSAGE_ADD ( "\tF: "< 0 && myPoints[ i ].normParam > U ) --i; - while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U ) + while ( i+1 < (int)myPoints.size() && myPoints[ i+1 ].normParam < U ) ++i; double r = (( U - myPoints[ i ].normParam ) / ( myPoints[ i+1 ].normParam - myPoints[ i ].normParam )); diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx index cd9b520d3..83e19296b 100644 --- a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx @@ -150,37 +150,37 @@ istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load) int intVal; double dblVal; - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _params.clear(); _params.reserve( intVal ); for ( size_t i = 0; i < _params.capacity() && isOK; i++) { - isOK = (load >> dblVal); + isOK = static_cast(load >> dblVal); if ( isOK ) _params.push_back( dblVal ); } } - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _nbsegs.clear(); _nbsegs.reserve( intVal ); for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _nbsegs.push_back( intVal ); } } - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.clear(); _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); return load; } diff --git a/src/StdMeshers/StdMeshers_Geometric1D.cxx b/src/StdMeshers/StdMeshers_Geometric1D.cxx index eb50e45a9..dd77350f7 100644 --- a/src/StdMeshers/StdMeshers_Geometric1D.cxx +++ b/src/StdMeshers/StdMeshers_Geometric1D.cxx @@ -132,8 +132,8 @@ ostream & StdMeshers_Geometric1D::SaveTo(ostream & save) istream & StdMeshers_Geometric1D::LoadFrom(istream & load) { bool isOK = true; - isOK = (load >> _begLength); - isOK = (load >> _ratio); + isOK = static_cast(load >> _begLength); + isOK = static_cast(load >> _ratio); if (isOK) StdMeshers_Reversible1D::LoadFrom( load ); diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx index a31944c64..340271d55 100644 --- a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx @@ -106,7 +106,7 @@ istream & StdMeshers_LengthFromEdges::LoadFrom(istream & load) { bool isOK = true; int a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_mode = a; else diff --git a/src/StdMeshers/StdMeshers_LocalLength.cxx b/src/StdMeshers/StdMeshers_LocalLength.cxx index ea14e8126..d86e9becb 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.cxx +++ b/src/StdMeshers/StdMeshers_LocalLength.cxx @@ -148,13 +148,13 @@ istream & StdMeshers_LocalLength::LoadFrom(istream & load) bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_length = a; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_precision = a; else diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.cxx b/src/StdMeshers/StdMeshers_MaxElementArea.cxx index 726909c3d..ed2d53fb2 100644 --- a/src/StdMeshers/StdMeshers_MaxElementArea.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementArea.cxx @@ -114,7 +114,7 @@ istream & StdMeshers_MaxElementArea::LoadFrom(istream & load) { bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_maxArea = a; else diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx index 4ece14008..21a4d78a9 100644 --- a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx @@ -116,7 +116,7 @@ istream & StdMeshers_MaxElementVolume::LoadFrom(istream & load) { bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_maxVolume = a; else diff --git a/src/StdMeshers/StdMeshers_MaxLength.cxx b/src/StdMeshers/StdMeshers_MaxLength.cxx index 3d5529940..75ca617c8 100644 --- a/src/StdMeshers/StdMeshers_MaxLength.cxx +++ b/src/StdMeshers/StdMeshers_MaxLength.cxx @@ -158,20 +158,20 @@ istream & StdMeshers_MaxLength::LoadFrom(istream & load) bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _length = a; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _preestimated = a; else load.clear(ios::badbit | load.rdstate()); bool pre; - isOK = (load >> pre); + isOK = static_cast(load >> pre); if ( isOK ) _preestimation = pre; else diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx index d3e0b5277..f3fa3104c 100644 --- a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx @@ -118,7 +118,7 @@ ostream & StdMeshers_NumberOfLayers::SaveTo(ostream & save) istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load) { bool isOK = true; - isOK = (load >> _nbLayers); + isOK = static_cast(load >> _nbLayers); if (!isOK) load.clear(ios::badbit | load.rdstate()); return load; diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 8d262e36f..2fec858ef 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -548,7 +548,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) int a; // read number of segments - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _numberOfSegments = a; else @@ -561,7 +561,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) // (nb.segments, distr.type, some other params.), // we wait here the ditribution type, which is integer double scale_factor; - isOK = (load >> scale_factor); + isOK = static_cast(load >> scale_factor); a = (int)scale_factor; // try to interprete ditribution type, @@ -582,7 +582,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) { case DT_Scale: { - isOK = (load >> b); + isOK = static_cast(load >> b); if (isOK) _scaleFactor = b; else @@ -596,13 +596,13 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) break; case DT_TabFunc: { - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) { _table.resize(a, 0.); for ( size_t i=0; i < _table.size(); i++ ) { - isOK = (load >> b); + isOK = static_cast(load >> b); if (isOK) _table[i] = b; else @@ -621,7 +621,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) case DT_ExprFunc: { string str; - isOK = (load >> str); + isOK = static_cast(load >> str); if (isOK) _func = str; else @@ -640,7 +640,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc) { - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _convMode = a; else @@ -649,14 +649,14 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) // load reversed edges IDs int intVal; - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK && _distrType != DT_Regular && intVal > 0 ) { _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index 3c3abe385..f4c519ae7 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -495,26 +495,23 @@ static bool HasIntersection3(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint, //======================================================================= static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint, - Handle(TColgp_HSequenceOfPnt)& aContour) + TColgp_SequenceOfPnt& aContour) { - if(aContour->Length()==3) { - return HasIntersection3( P, PC, Pint, aContour->Value(1), - aContour->Value(2), aContour->Value(3) ); + if ( aContour.Length() == 3 ) { + return HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) ); } else { bool check = false; - if( (aContour->Value(1).Distance(aContour->Value(2)) > 1.e-6) && - (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) && - (aContour->Value(2).Distance(aContour->Value(3)) > 1.e-6) ) { - check = HasIntersection3( P, PC, Pint, aContour->Value(1), - aContour->Value(2), aContour->Value(3) ); + if( (aContour(1).Distance(aContour(2)) > 1.e-6) && + (aContour(1).Distance(aContour(3)) > 1.e-6) && + (aContour(2).Distance(aContour(3)) > 1.e-6) ) { + check = HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) ); } if(check) return true; - if( (aContour->Value(1).Distance(aContour->Value(4)) > 1.e-6) && - (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) && - (aContour->Value(4).Distance(aContour->Value(3)) > 1.e-6) ) { - check = HasIntersection3( P, PC, Pint, aContour->Value(1), - aContour->Value(3), aContour->Value(4) ); + if( (aContour(1).Distance(aContour(4)) > 1.e-6) && + (aContour(1).Distance(aContour(3)) > 1.e-6) && + (aContour(4).Distance(aContour(3)) > 1.e-6) ) { + check = HasIntersection3( P, PC, Pint, aContour(1), aContour(3), aContour(4) ); } if(check) return true; } @@ -546,24 +543,23 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() ); SMESH_ElementSearcher* searcher = const_cast(myElemSearcher); - //SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); - //cout<<" CheckIntersection: meshDS->NbFaces() = "<NbFaces()< suspectElems; searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); + TColgp_SequenceOfPnt aContour; for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { const SMDS_MeshElement* face = suspectElems[iF]; if ( face == NotCheckedFace ) continue; - Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; + aContour.Clear(); for ( int i = 0; i < face->NbCornerNodes(); ++i ) - aContour->Append( SMESH_TNodeXYZ( face->GetNode(i) )); - if( HasIntersection(P, PC, Pres, aContour) ) { + aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) )); + if ( HasIntersection(P, PC, Pres, aContour)) { res = true; double tmp = PC.Distance(Pres); if ( tmp < dist ) { @@ -591,8 +587,8 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, //================================================================================ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face, - Handle(TColgp_HArray1OfPnt)& PN, - Handle(TColgp_HArray1OfVec)& VN, + TColgp_Array1OfPnt& PN, + TColgp_Array1OfVec& VN, vector& FNodes, gp_Pnt& PC, gp_Vec& VNorm, @@ -608,7 +604,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face for ( i = 0; i < 4; ++i ) { gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) ); - PN->SetValue( i+1, p ); + PN.SetValue( i+1, p ); xyzC += p; } PC = xyzC/4; @@ -619,7 +615,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face for(i=1; i<4; i++) { j = i+1; for(; j<=4; j++) { - if( PN->Value(i).Distance(PN->Value(j)) < 1.e-6 ) + if( PN(i).Distance(PN(j)) < 1.e-6 ) break; } if(j<=4) break; @@ -630,7 +626,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face if(i<4) { //cout<<"find degeneration"<Value(i); + gp_Pnt Pdeg = PN(i); list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin(); const SMDS_MeshNode* DegNode = 0; @@ -651,24 +647,24 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face FNodes[i-1] = DegNode; } for(i=j; i<4; i++) { - PN->SetValue(i,PN->Value(i+1)); + PN.SetValue(i,PN.Value(i+1)); FNodes[i-1] = FNodes[i]; } nbp = 3; } - PN->SetValue(nbp+1,PN->Value(1)); + PN.SetValue(nbp+1,PN(1)); FNodes[nbp] = FNodes[0]; // find normal direction - gp_Vec V1(PC,PN->Value(nbp)); - gp_Vec V2(PC,PN->Value(1)); + gp_Vec V1(PC,PN(nbp)); + gp_Vec V2(PC,PN(1)); VNorm = V1.Crossed(V2); - VN->SetValue(nbp,VNorm); + VN.SetValue(nbp,VNorm); for(i=1; iValue(i)); - V2 = gp_Vec(PC,PN->Value(i+1)); + V1 = gp_Vec(PC,PN(i)); + V2 = gp_Vec(PC,PN(i+1)); gp_Vec Vtmp = V1.Crossed(V2); - VN->SetValue(i,Vtmp); + VN.SetValue(i,Vtmp); VNorm += Vtmp; } @@ -736,8 +732,8 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); const SMESHDS_SubMesh * aSubMeshDSFace; - Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5); - Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4); + TColgp_Array1OfPnt PN(1,5); + TColgp_Array1OfVec VN(1,4); vector FNodes(5); gp_Pnt PC; gp_Vec VNorm; @@ -796,9 +792,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, for(; i<=4; i++) { gp_Pnt Pbest; if(!isRev) - Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i).Reversed()); + Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i).Reversed()); else - Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i)); + Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i)); xc += Pbest.X(); yc += Pbest.Y(); zc += Pbest.Z(); @@ -807,31 +803,21 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, // check PCbest double height = PCbest.Distance(PC); - if(height<1.e-6) { + if ( height < 1.e-6 ) { // create new PCbest using a bit shift along VNorm PCbest = PC.XYZ() + VNorm.XYZ() * 0.001; } else { // check possible intersection with other faces gp_Pnt Pint; - bool check = CheckIntersection(PCbest, PC, Pint, aMesh, aShape, face); - if(check) { - //cout<<"--PC("<(myElemSearcher); + TColgp_Array1OfPnt PN(1,5); + TColgp_Array1OfVec VN(1,4); + vector FNodes(5); + TColgp_SequenceOfPnt aContour; + SMDS_FaceIteratorPtr fIt = meshDS->facesIterator(/*idInceasingOrder=*/true); while( fIt->more()) { const SMDS_MeshElement* face = fIt->next(); if ( !face ) continue; // retrieve needed information about a face - Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5); - Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4); - vector FNodes(5); gp_Pnt PC; gp_Vec VNorm; const SMDS_MeshElement* volumes[2]; @@ -970,7 +958,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) SMDS_MeshFace* NewFace; // check orientation - double tmp = PN->Value(1).Distance(PN->Value(2)) + PN->Value(2).Distance(PN->Value(3)); + double tmp = PN(1).Distance(PN(2)) + PN(2).Distance(PN(3)); // far points in VNorm direction gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6; gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6; @@ -989,9 +977,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { const SMDS_MeshElement* F = suspectElems[iF]; if ( F == face ) continue; - Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; + aContour.Clear(); for ( int i = 0; i < 4; ++i ) - aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) )); + aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) )); gp_Pnt PPP; if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) { IsOK1 = true; @@ -1045,7 +1033,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) gp_XYZ PCbest(0., 0., 0.); // pyramid peak int i = 1; for ( ; i <= 4; i++ ) { - gp_Pnt Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i)); + gp_Pnt Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i)); PCbest += Pbest.XYZ(); } PCbest /= 4; @@ -1061,7 +1049,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) // Restrict pyramid height by intersection with other faces gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize(); - double tmp = PN->Value(1).Distance(PN->Value(3)) + PN->Value(2).Distance(PN->Value(4)); + double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4)); // far points: in (PC, PCbest) direction and vice-versa gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6, PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 }; @@ -1078,10 +1066,10 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) { const SMDS_MeshElement* F = suspectElems[iF]; if ( F == face ) continue; - Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; - int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 ); + aContour.Clear(); + int nbN = F->NbCornerNodes(); for ( i = 0; i < nbN; ++i ) - aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) )); + aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) )); gp_Pnt intP; for ( int isRev = 0; isRev < 2; ++isRev ) { diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx index c1082f7ce..44470b8e9 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx @@ -32,8 +32,8 @@ class SMESH_ElementSearcher; class SMDS_MeshElement; class SMDS_MeshNode; class SMDS_MeshFace; -class Handle_TColgp_HArray1OfPnt; -class Handle_TColgp_HArray1OfVec; +class TColgp_Array1OfPnt; +class TColgp_Array1OfVec; class gp_Pnt; class gp_Vec; @@ -65,8 +65,8 @@ public: protected: int Preparation(const SMDS_MeshElement* face, - Handle_TColgp_HArray1OfPnt& PN, - Handle_TColgp_HArray1OfVec& VN, + TColgp_Array1OfPnt& PN, + TColgp_Array1OfVec& VN, std::vector& FNodes, gp_Pnt& PC, gp_Vec& VNorm, const SMDS_MeshElement** volumes=0); diff --git a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx index 708b9a2fa..9ba7ec23a 100644 --- a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx +++ b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx @@ -153,16 +153,16 @@ ostream & StdMeshers_QuadrangleParams::SaveTo(ostream & save) istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load) { bool isOK = true; - isOK = (load >> _triaVertexID); + isOK = static_cast(load >> _triaVertexID); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); if (!isOK) load.clear(ios::badbit | load.rdstate()); int type; - isOK = (load >> type); + isOK = static_cast(load >> type); if (isOK) _quadType = StdMeshers_QuadType(type); diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index a3bf670cb..e55edf26a 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -1781,10 +1781,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh, // 0 bottom 1 - const int bfrom = quad->side[0].from; - const int rfrom = quad->side[1].from; + //const int bfrom = quad->side[0].from; + //const int rfrom = quad->side[1].from; const int tfrom = quad->side[2].from; - const int lfrom = quad->side[3].from; + //const int lfrom = quad->side[3].from; { const vector& uv_eb_vec = quad->side[0].GetUVPtStruct(true,0); const vector& uv_er_vec = quad->side[1].GetUVPtStruct(false,1); @@ -1925,10 +1925,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh, } // if ( dv != 0 && dh != 0 ) - const int db = quad->side[0].IsReversed() ? -1 : +1; - const int dr = quad->side[1].IsReversed() ? -1 : +1; + //const int db = quad->side[0].IsReversed() ? -1 : +1; + //const int dr = quad->side[1].IsReversed() ? -1 : +1; const int dt = quad->side[2].IsReversed() ? -1 : +1; - const int dl = quad->side[3].IsReversed() ? -1 : +1; + //const int dl = quad->side[3].IsReversed() ? -1 : +1; // Case dv == 0, here possibly myQuadList.size() > 1 // @@ -2970,7 +2970,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh, const vector& uv_et = quad->side[2].GetUVPtStruct(true,1); const vector& uv_el = quad->side[3].GetUVPtStruct(false,0); - if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl) + if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr || + (int) uv_et.size() != nt || (int) uv_el.size() != nl) return error(COMPERR_BAD_INPUT_MESH); // arrays for normalized params @@ -3283,7 +3284,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh, const vector& uv_et = quad->side[2].GetUVPtStruct(true,1); const vector& uv_el = quad->side[3].GetUVPtStruct(false,0); - if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl) + if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr || + (int) uv_et.size() != nt || (int) uv_el.size() != nl) return error(COMPERR_BAD_INPUT_MESH); gp_UV uv[ UV_SIZE ]; @@ -4337,7 +4339,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, // check if there are possible variations in choosing corners bool haveVariants = false; - if ( vertexByAngle.size() > nbCorners ) + if ((int) vertexByAngle.size() > nbCorners ) { double lostAngle = a2v->first; double lastAngle = ( --a2v, a2v->first ); @@ -4345,7 +4347,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, } const double angleTol = 5.* M_PI/180; - myCheckOri = ( vertexByAngle.size() > nbCorners || + myCheckOri = ( (int)vertexByAngle.size() > nbCorners || vertexByAngle.begin()->first < angleTol ); // make theWire begin from a corner vertex or triaVertex @@ -4475,7 +4477,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, { // select two halfDivider's as corners TGeoIndex hd1, hd2 = -1; - int iC2; + size_t iC2; for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 ) { hd1 = cornerInd[ iC2 ]; @@ -4521,10 +4523,10 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, vector< double > accuLength; double totalLen = 0; vector< TGeoIndex > evVec( equVerts.begin(), equVerts.end() ); - int iEV = 0; + size_t iEV = 0; TGeoIndex iE = cornerInd[ helper.WrapIndex( iC - nbC[0] - 1, cornerInd.size() )]; TGeoIndex iEEnd = cornerInd[ helper.WrapIndex( iC + nbC[1] + 1, cornerInd.size() )]; - while ( accuLength.size() < nbEqualV + int( !allCornersSame ) ) + while ((int) accuLength.size() < nbEqualV + int( !allCornersSame ) ) { // accumulate length of edges before iEV-th equal vertex accuLength.push_back( totalLen ); @@ -4780,8 +4782,6 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes() quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt ); } - SMESH_Mesh* mesh = myHelper->GetMesh(); - SMESHDS_Mesh* meshDS = myHelper->GetMeshDS(); const TopoDS_Face& face = TopoDS::Face( myHelper->GetSubShape() ); Handle(Geom_Surface) surf = BRep_Tool::Surface( face ); @@ -4961,8 +4961,8 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes() continue; const vector& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct(); const UVPtStruct& uvPt = points[ side.contacts[iC].point ]; - if ( side.contacts[iC].other_point >= oGrid .size() || - side.contacts[iC].point >= points.size() ) + if ( side.contacts[iC].other_point >= (int) oGrid .size() || + side.contacts[iC].point >= (int) points.size() ) throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" ); if ( oGrid[ side.contacts[iC].other_point ].node ) (( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node; @@ -5118,9 +5118,9 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side, return; } - const int iFrom = Min ( iForced, *iNext ); - const int iTo = Max ( iForced, *iNext ) + 1; - const int sideSize = iTo - iFrom; + const int iFrom = Min ( iForced, *iNext ); + const int iTo = Max ( iForced, *iNext ) + 1; + const size_t sideSize = iTo - iFrom; vector points[4]; // side points of a temporary quad @@ -5130,7 +5130,7 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side, for ( int is2nd = 0; is2nd < 2; ++is2nd ) { points[ is2nd ].reserve( sideSize ); - int nbLoops = 0; + size_t nbLoops = 0; while ( points[is2nd].size() < sideSize ) { int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() ); @@ -5624,8 +5624,8 @@ bool FaceQuadStruct::Side::IsForced( int nodeIndex ) const void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop ) { - if ( ip >= GetUVPtStruct().size() || - iop >= side->GetUVPtStruct().size() ) + if ( ip >= (int) GetUVPtStruct().size() || + iop >= (int) side->GetUVPtStruct().size() ) throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" ); if ( ip < from || ip >= to ) return; diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index e9aab2b29..b861f3701 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -537,8 +537,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, gp_Vec2d aVec2d(PC,p2dV); Nodes1.resize( myLayerPositions.size()+1 ); Nodes2.resize( myLayerPositions.size()+1 ); - int i = 0; - for(; iSetNodeOnEdge(NC, edgeID, cp); Nodes1.resize( myLayerPositions.size()+1 ); Nodes2.resize( myLayerPositions.size()+1 ); - int i = 0; + size_t i = 0; for(; isecond == NF ); NC = const_cast ( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second ); - int i = 0, ir = Nodes1.size()-1; - int * pi = nodesFromP0ToP1 ? &i : &ir; + size_t i = 0, ir = Nodes1.size()-1; + size_t * pi = nodesFromP0ToP1 ? &i : &ir; itn = theNodes.begin(); if ( nodesFromP0ToP1 ) ++itn; for ( ; i < Nodes1.size(); ++i, --ir, ++itn ) @@ -817,8 +817,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, meshDS->SetNodeOnVertex(NC, vertID); } double dp = lp-fp; - int i = 0; - for(; iAddNode(P.X(), P.Y(), P.Z()); Nodes1[i] = node; double param; - if(!ori) + if ( !ori ) param = fp + dp*(1-myLayerPositions[i]); else param = fp + dp*myLayerPositions[i]; @@ -840,11 +840,11 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, // create 1D elements on edge SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] ); if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); - for(i=1; iAddEdge( Nodes1[i-1], Nodes1[i] ); if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); } - if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL ) + if ( nbe == 2 && LinEdge1.Orientation() == TopAbs_INTERNAL ) Nodes2 = Nodes1; } markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F )); @@ -856,8 +856,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, return error("Invalid mesh on a straight edge"); bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL ); - int i = 0, ir = Nodes1.size()-1; - int * pi = nodesFromP0ToP2 ? &i : &ir; + size_t i = 0, ir = Nodes1.size()-1; + size_t * pi = nodesFromP0ToP2 ? &i : &ir; itn = theNodes.begin(); if ( nodesFromP0ToP2 ) ++itn; for ( ; i < Nodes2.size(); ++i, --ir, ++itn ) @@ -886,7 +886,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, PC = PL; } double dp = lp-fp; - for(int i=0; iAddEdge( NC, Nodes2[0] ); - if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); - for(int i=1; iSetMeshElementOnShape(ME, edgeID); + for ( size_t i = 1; i < Nodes2.size(); i++ ) { ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] ); if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); } @@ -953,7 +953,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, // create faces tmpNodes.push_back( CNodes[i] ); // quad - for(j=0; jAddFace( tmpNodes[j], Nodes1[j], @@ -969,14 +969,14 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] ); else MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] ); - if(MF) meshDS->SetMeshElementOnShape(MF, faceID); - for(j=0; jSetMeshElementOnShape(MF, faceID); + for ( j = 0; j < (int) Nodes1.size(); j++ ) { Nodes1[j] = tmpNodes[j]; } } // create last faces // quad - for(i=0; iAddFace( Nodes2[i], Nodes1[i], @@ -1106,7 +1106,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt& } else { - if ( myLayerPositions.size() != nbNodes ) + if ((int) myLayerPositions.size() != nbNodes ) return error("Radial edge is meshed by other algorithm"); } } @@ -1196,7 +1196,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) ); if ( !ok ) { const vector& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ]; - ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() ); + ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() ); } if(ok) { ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap ); @@ -1243,7 +1243,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, // other curve not line return error(COMPERR_BAD_SHAPE); } - int nbLayers = myLayerPositions.size(); + size_t nbLayers = myLayerPositions.size(); computeLayerPositions( P0, P1, LinEdge2 ); if ( nbLayers != myLayerPositions.size() ) return error("Different hypotheses apply to radial edges"); @@ -1254,7 +1254,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, ok = true; // override other 1d hyps else { const vector& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ]; - ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() ); + ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() ); } } if( ok && aResMap.count( aMesh.GetSubMesh(LinEdge2) )) { @@ -1262,7 +1262,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, ok = true; // override other 1d hyps else { const vector& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ]; - ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() ); + ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() ); } } if(ok) { diff --git a/src/StdMeshers/StdMeshers_Reversible1D.cxx b/src/StdMeshers/StdMeshers_Reversible1D.cxx index 6a088119b..d653bfb0b 100644 --- a/src/StdMeshers/StdMeshers_Reversible1D.cxx +++ b/src/StdMeshers/StdMeshers_Reversible1D.cxx @@ -66,7 +66,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save) if ( !_edgeIDs.empty() ) { - for ( size_t i = 0; i < _edgeIDs.size(); i++) + for ( size_t i = 0; i < _edgeIDs.size(); i++ ) save << " " << _edgeIDs[i]; save << " " << _objEntry << " "; } @@ -76,7 +76,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save) //============================================================================= /*! - * + * */ //============================================================================= @@ -85,14 +85,14 @@ std::istream & StdMeshers_Reversible1D::LoadFrom(std::istream & load) bool isOK; int intVal; - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++ ) { + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx index e53ca6231..3cc7562b4 100644 --- a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx +++ b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx @@ -117,7 +117,7 @@ istream & StdMeshers_SegmentLengthAroundVertex::LoadFrom(istream & load) { bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_length = a; else diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index dffe92e9a..2c230524e 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -146,22 +146,22 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load) { bool isOK = true; int intVal; - isOK = (load >> _begLength); + isOK = static_cast(load >> _begLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _endLength); + isOK = static_cast(load >> _endLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index 0d567e4fb..e2471de3a 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -64,19 +64,19 @@ Plot2d_QwtLegendLabel* getLegendLabel( QwtPlotCurve* plotCurve ) QwtLegend* legend = dynamic_cast( plotCurve->plot()->legend() ); QWidget* widget = legend->legendWidget( itemInfo ); QwtLegendLabel* label = dynamic_cast( widget ); - if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label ) - return anItem; + Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label; + return anItem; } StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h ) -: QwtPlot( p ), - myPoints( 50 ), - myIsTable( false ), - myVars( 1, 1 ), - myValues( 1, 1 ), - myConv( CUT_NEGATIVE ), - myIsDone( true ), - myNbSeg( 1 ) + : QwtPlot( p ), + myPoints( 50 ), + myNbSeg( 1 ), + myIsTable( false ), + myConv( CUT_NEGATIVE ), + myVars( 1, 1 ), + myValues( 1, 1 ), + myIsDone( true ) { Kernel_Utils::Localizer loc; myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx index 2066cac77..0b5246735 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx @@ -574,7 +574,7 @@ StdMeshersGUI_DistrTableFrame:: setData( const DataArray& array ) { QList d; - for ( int i = 0; i < array.length(); i++ ) + for ( CORBA::ULong i = 0; i < array.length(); i++ ) d.append( array[i] ); sortData( d ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx index 3b5ece91c..7f75b9b6c 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx @@ -360,7 +360,7 @@ SMESH::double_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfPoints() void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints) { clear(); - for ( int i = 0; i < thePoints->length(); i++ ) { + for ( CORBA::ULong i = 0; i < thePoints->length(); i++ ) { addPoint( thePoints[ i ] ); } } @@ -388,7 +388,7 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var { if ( myListWidget->count() > 0 && theSegments->length() == 1) mySameValues->setChecked(true); - for ( int i = 0; i < theSegments->length(); i++ ) { + for ( CORBA::ULong i = 0; i < theSegments->length(); i++ ) { setNbSegments( i, theSegments[i] ); } } diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx index 82d2e437d..57e21193d 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx @@ -45,7 +45,7 @@ //================================================================================ /*! * \brief Constructor initialized by filter - * \param f - object filter + * \param f - object filter */ //================================================================================ @@ -53,8 +53,8 @@ StdMeshersGUI_LayerDistributionParamWdg ::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp, SMESH::SMESH_Hypothesis_ptr distribHyp, const QString& name, - QDialog* dlg): - QWidget(), myName(name), myDlg( dlg ) + QDialog* dlg): + QWidget(), myDlg( dlg ), myName(name) { myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp ); init(); diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index 6749e0b9c..9a9f2756b 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -295,13 +295,13 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const case Regular : valStr += tr("SMESH_DISTR_REGULAR"); break; - case Scale : - valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );\ + case Scale : + valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale ); break; case TabFunc : { //valStr += tr("SMESH_TAB_FUNC"); bool param = true; - for( int i=0; i < data.myTable.length(); i++, param = !param ) { + for( CORBA::ULong i = 0; i < data.myTable.length(); i++, param = !param ) { if ( param ) valStr += "["; valStr += QString::number( data.myTable[ i ]); diff --git a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx index 379e593d5..accf0ccb7 100644 --- a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx +++ b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx @@ -656,7 +656,7 @@ std::vector * MeshJobManager_i::_getResourceNames() { LOG("### resource list:"); std::vector* resourceNames = new std::vector(); if (resourceList) { - for (int i = 0; i < resourceList->length(); i++) { + for ( size_t i = 0; i < resourceList->length(); i++) { const char* aResourceName = (*resourceList)[i]; resourceNames->push_back(std::string(aResourceName)); LOG("resource["< Date: Thu, 14 Jan 2016 11:14:55 +0300 Subject: [PATCH 060/147] 0023198: EDF 8842 - Management of additional hypothesis --- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 84 ++++++++++++-------------------- 1 file changed, 32 insertions(+), 52 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 1ddf9b2a4..cda44524c 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1500,31 +1500,22 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, // check that tab enabled of one less dimension if ( aDim > SMESH::DIM_0D ) { - if ( isAccessibleDim( aDim - 1 ) ) { - if ( algoData && myIsOnGeometry ) { - for (int i = aDim - 1; i >= SMESH::DIM_0D; i--) { - if ( isAccessibleDim( i ) && ( currentHyp( i, Algo ) < 0 || - algoData->InputTypes.isEmpty() ) ) { + if ( myIsOnGeometry ) { + QString anCompareType = currentMeshTypeName(myDlg->currentMeshType()); + bool is2dtype = ( anCompareType == "QUAD" ) || ( anCompareType == "TRIA" ); + int dim = is2dtype ? SMESH::DIM_2D : SMESH::DIM_3D; + for (int i = dim; i >= SMESH::DIM_0D; i--) { + if ( i != aDim ) { + if ( algoData && algoData->InputTypes.isEmpty() ) { myDlg->disableTab( i ); setCurrentHyp(i, Algo, -1); } + else { + myDlg->enableTab( i ); + } } } } - if ( algoData && myIsOnGeometry && !algoData->InputTypes.isEmpty() ) { - myDlg->enableTab( aDim - 1 ); - } - if ( !algoData ) { - if ( aDim != SMESH::DIM_2D || ( aDim == SMESH::DIM_2D && - currentHyp( SMESH::DIM_2D, Algo ) < 0) ) { - for (int i = aDim - 1; i >= SMESH::DIM_0D; i--) - myDlg->enableTab( i ); - } - else { - for (int i = aDim - 1; i >= SMESH::DIM_0D; i--) - myDlg->disableTab( i ); - } - } } int algoDim = aDim; @@ -2263,6 +2254,9 @@ void SMESHGUI_MeshOp::readMesh() { // get hypotheses existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] ); + if ( myObjHyps[ dim ][ hypType ].count() == 0 ) { + setCurrentHyp( dim, hypType, -1 ); + } for ( int i = 0, nb = myObjHyps[ dim ][ hypType ].count(); i < nb; ++i ) { // find index of required hypothesis among existing ones for this dimension and type @@ -2702,8 +2696,6 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI setCurrentHyp( dim, Algo, anCurrentAvailableAlgo ); if ( anCurrentAvailableAlgo > -1 ) isReqDisBound = algoCur->InputTypes.isEmpty(); - else if ( dim != SMESH::DIM_3D && currentHyp( SMESH::DIM_3D, Algo ) >= 0 ) - isReqDisBound = true; if ( isReqDisBound ) { aReqDim = dim; break; @@ -2716,8 +2708,8 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI } else for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) { - if ( i > myMaxShapeDim || ( isReqDisBound && i < aReqDim ) ) myDlg->disableTab( i ); - else myDlg->enableTab( i ); + if ( i > myMaxShapeDim || ( isReqDisBound && i != aReqDim ) ) myDlg->disableTab( i ); + else myDlg->enableTab( i ); } myDlg->setCurrentTab( theTabIndex ); } @@ -2754,40 +2746,28 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI setCurrentHyp( dim, Algo, anCurrentAvailableAlgo ); } - if ( isNone || isReqDisBound ) { - for ( int i = SMESH::DIM_0D; i <= myMaxShapeDim; i++ ) { - if ( aDim != i ) { - myDlg->disableTab( i ); - } - } + if ( aDim == SMESH::DIM_2D) { + myDlg->disableTab( SMESH::DIM_3D ); + setCurrentHyp( SMESH::DIM_3D, Algo, -1); } - else if ( !isNone ) { - if ( aDim == SMESH::DIM_2D) { - myDlg->disableTab( SMESH::DIM_3D ); - setCurrentHyp( SMESH::DIM_3D, Algo, -1); - } - for ( int i = myMaxShapeDim; i > SMESH::DIM_0D; i-- ) { - bool isNoneAlg = currentHyp( i, Algo ) < 0; - if ( !isNoneAlg ) - isReqDisBound = myAvailableHypData[i][Algo].at( currentHyp( i, Algo ) )->InputTypes.isEmpty(); - else - isReqDisBound = true; - if ( isReqDisBound && isNoneAlg ) { - for (int j = i - 1; j >= SMESH::DIM_0D; j--) { - if ( j < aDim && currentHyp( j+1, Algo ) < 0 ) { - myDlg->disableTab( j ); - setCurrentHyp( j , Algo, -1 ); - } + for ( int i = myMaxShapeDim; i > SMESH::DIM_0D; i-- ) { + bool isNoneAlg = currentHyp( i, Algo ) < 0; + if ( !isNoneAlg ) + isReqDisBound = myAvailableHypData[i][Algo].at( currentHyp( i, Algo ) )->InputTypes.isEmpty(); + else + isReqDisBound = true; + if ( isReqDisBound && !isNoneAlg) { + for (int j = i; j >= SMESH::DIM_0D; j--) { + if ( currentHyp( j, Algo ) < 0 ) { + myDlg->disableTab( j ); + setCurrentHyp( j , Algo, -1 ); } - break; - } - else if ( isNoneAlg ) { - myDlg->disableTab( i ); } + break; } } - myDlg->enableTab( aDim ); - myDlg->setCurrentTab( aDim ); + int currentTab = ( theTabIndex <= aDim ) ? theTabIndex : aDim; + myDlg->setCurrentTab( currentTab ); } THypDataList anAvailableAlgsData; QStringList aHypothesesSetsList = SMESH::GetHypothesesSets( aDim ); From d1ed915c6868c000dc9125ac68641c92c0961349 Mon Sep 17 00:00:00 2001 From: mpa Date: Mon, 18 Jan 2016 16:55:45 +0300 Subject: [PATCH 061/147] INT PAL 0053060: Preview in clipping --- src/SMESHGUI/SMESHGUI_ClippingDlg.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index d38e638ca..c02181bee 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -1134,9 +1134,10 @@ void SMESHGUI_ClippingDlg::updateActorItem( QListWidgetItem* theItem, anActorList.remove( anActor ); if( SMESH::ComputeBounds( anActorList, myBounds ) ) { - myPreviewWidget->On(); myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2], myBounds[3], myBounds[4], myBounds[5] ); + if( PreviewCheckBox->isChecked() ) + myPreviewWidget->On(); } else myPreviewWidget->Off(); @@ -1249,9 +1250,10 @@ void SMESHGUI_ClippingDlg::ClickOnNew() bool anIsBlocked = ActorList->blockSignals( true ); if( SMESH::ComputeBounds( anActorList, myBounds ) ) { - myPreviewWidget->On(); myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2], myBounds[3], myBounds[4], myBounds[5] ); + if( PreviewCheckBox->isChecked() ) + myPreviewWidget->On(); } else myPreviewWidget->Off(); @@ -1342,9 +1344,10 @@ void SMESHGUI_ClippingDlg::onSelectPlane ( int theIndex ) myIsSelectPlane = false; if( SMESH::ComputeBounds( aPlaneData.ActorList, myBounds ) ) { - myPreviewWidget->On(); myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2], myBounds[3], myBounds[4], myBounds[5] ); + if( PreviewCheckBox->isChecked() ) + myPreviewWidget->On(); } else myPreviewWidget->Off(); From 3c33b141570dd9eee180f7149b5f97a0a30884db Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Jan 2016 16:02:17 +0300 Subject: [PATCH 062/147] 0023212: EDF 12054 - Problem with a pyramidal layer --- .../gui/SMESH/input/extrusion_along_path.doc | 2 +- src/SMDS/SMDS_Mesh.cxx | 40 +- src/SMDS/SMDS_MeshNode.cxx | 5 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 9 +- src/SMESHUtils/SMESH_MeshAlgos.cxx | 31 +- src/SMESHUtils/SMESH_MeshAlgos.hxx | 7 + .../StdMeshers_QuadToTriaAdaptor.cxx | 432 ++++++++++-------- .../StdMeshers_QuadToTriaAdaptor.hxx | 14 +- 8 files changed, 316 insertions(+), 224 deletions(-) diff --git a/doc/salome/gui/SMESH/input/extrusion_along_path.doc b/doc/salome/gui/SMESH/input/extrusion_along_path.doc index 03717c77f..2253d08d8 100644 --- a/doc/salome/gui/SMESH/input/extrusion_along_path.doc +++ b/doc/salome/gui/SMESH/input/extrusion_along_path.doc @@ -153,7 +153,7 @@ The following dialog will appear: Linear variation of the angles option allows defining the angle of gradual rotation for the whole path. At each step the elements will -be rotated by angle / nb. of steps. +be rotated by ( angle / nb. of steps ).
  • diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index f37887482..86524eb8d 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -3228,7 +3228,6 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, list& removedNodes, bool removenodes) { - //MESSAGE("SMDS_Mesh::RemoveElement " << elem->getVtkId() << " " << removenodes); // get finite elements built on elem set * s1; if ( (elem->GetType() == SMDSAbs_0DElement) @@ -3273,19 +3272,16 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, // Remove element from of its nodes SMDS_ElemIteratorPtr itn = (*it)->nodesIterator(); while (itn->more()) - { - SMDS_MeshNode * n = static_cast (const_cast (itn->next())); - n->RemoveInverseElement((*it)); - } + { + SMDS_MeshNode * n = static_cast (const_cast (itn->next())); + n->RemoveInverseElement((*it)); + } int IdToRemove = (*it)->GetID(); int vtkid = (*it)->getVtkId(); - //MESSAGE("elem Id to remove " << IdToRemove << " vtkid " << vtkid << - // " vtktype " << (*it)->GetVtkType() << " type " << (*it)->GetType()); switch ((*it)->GetType()) { case SMDSAbs_Node: - MYASSERT("Internal Error: This should not happen") - ; + MYASSERT("Internal Error: This should not happen"); break; case SMDSAbs_0DElement: if (IdToRemove >= 0) @@ -3305,8 +3301,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_VtkEdge* vtkElem = dynamic_cast(*it)) + if (const SMDS_VtkEdge* vtkElem = dynamic_cast(*it)) { myEdgePool->destroy((SMDS_VtkEdge*) vtkElem); + ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse + } else delete (*it); break; @@ -3318,8 +3316,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_VtkFace* vtkElem = dynamic_cast(*it)) + if (const SMDS_VtkFace* vtkElem = dynamic_cast(*it)) { myFacePool->destroy((SMDS_VtkFace*) vtkElem); + ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse + } else delete (*it); break; @@ -3331,8 +3331,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_VtkVolume* vtkElem = dynamic_cast(*it)) + if (const SMDS_VtkVolume* vtkElem = dynamic_cast(*it)) { myVolumePool->destroy((SMDS_VtkVolume*) vtkElem); + ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse + } else delete (*it); break; @@ -3344,18 +3346,19 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_BallElement* vtkElem = dynamic_cast(*it)) + if (const SMDS_BallElement* vtkElem = dynamic_cast(*it)) { myBallPool->destroy(const_cast( vtkElem )); + ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse + } else delete (*it); break; - case SMDSAbs_All: + case SMDSAbs_All: // avoid compilation warning case SMDSAbs_NbElementTypes: break; } if (vtkid >= 0) { - //MESSAGE("VTK_EMPTY_CELL in " << vtkid); this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL); } it++; @@ -3368,7 +3371,6 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, while (it != s2->end()) { int IdToRemove = (*it)->GetID(); - //MESSAGE( "SMDS: RM node " << IdToRemove); if (IdToRemove >= 0) { myNodes[IdToRemove] = 0; @@ -3430,11 +3432,12 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem) } // in meshes without descendants elements are always free - switch (aType) { + switch (aType) { case SMDSAbs_0DElement: myCells[elemId] = 0; myInfo.remove(elem); delete elem; + elem = 0; break; case SMDSAbs_Edge: myCells[elemId] = 0; @@ -3463,6 +3466,9 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem) this->myGrid->GetCellTypesArray()->SetValue(vtkId, VTK_EMPTY_CELL); // --- to do: keep vtkid in a list of reusable cells + + if ( elem ) + ((SMDS_MeshElement*) elem)->init( -1, -1, -1 ); // avoid reuse } } diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index 3524480cc..7b0f6a97c 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -182,17 +182,14 @@ public: MESSAGE("SMDS_MeshNode_MyInvIterator problem Null element"); throw SALOME_Exception("SMDS_MeshNode_MyInvIterator problem Null element"); } - //MESSAGE("vtkId " << vtkId << " smdsId " << smdsId << " " << elem->GetType()); iter++; return elem; } }; -SMDS_ElemIteratorPtr SMDS_MeshNode:: -GetInverseElementIterator(SMDSAbs_ElementType type) const +SMDS_ElemIteratorPtr SMDS_MeshNode::GetInverseElementIterator(SMDSAbs_ElementType type) const { vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID); - //MESSAGE("myID " << myID << " ncells " << l.ncells); return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type)); } diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 1ebfd0622..e60f386b6 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -225,7 +226,10 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply() if (mySMESHGUI->isActiveStudyLocked()) return; - if (myNbOkElements) { + if (myNbOkElements) + { + SUIT_OverrideCursor wc; + QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts); SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array; anArrayOfIdeces->length(aListId.count()); @@ -233,7 +237,8 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply() anArrayOfIdeces[i] = aListId[ i ].toInt(); bool aResult = false; - try { + try + { SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); aResult = aMeshEditor->RemoveElements(anArrayOfIdeces.in()); diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index c42f02023..a897decd6 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -458,6 +458,10 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher void GetElementsNearLine( const gp_Ax1& line, SMDSAbs_ElementType type, vector< const SMDS_MeshElement* >& foundElems); + void GetElementsInSphere( const gp_XYZ& center, + const double radius, + SMDSAbs_ElementType type, + vector< const SMDS_MeshElement* >& foundElems); double getTolerance(); bool getIntersParamOnLine(const gp_Lin& line, const SMDS_MeshElement* face, const double tolerance, double & param); @@ -466,6 +470,7 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher { return _outerFaces.empty() || _outerFaces.count(face); } + struct TInters //!< data of intersection of the line and the mesh face (used in GetPointState()) { const SMDS_MeshElement* _face; @@ -646,6 +651,7 @@ void SMESH_ElementSearcherImpl::findOuterBoundary(const SMDS_MeshElement* outerF set< const SMDS_MeshElement*, TIDCompare >::const_iterator face = faces.begin(); for ( ; face != faces.end(); ++face ) { + if ( *face == outerFace ) continue; if ( !SMESH_MeshAlgos::FaceNormal( *face, fNorm, /*normalized=*/false )) continue; gp_Vec dirInF = gp_Vec( fNorm ) ^ n1n2; @@ -660,8 +666,8 @@ void SMESH_ElementSearcherImpl::findOuterBoundary(const SMDS_MeshElement* outerF // store the found outer face and add its links to continue seaching from if ( outerFace2 ) { - _outerFaces.insert( outerFace ); - int nbNodes = outerFace2->NbNodes()/( outerFace2->IsQuadratic() ? 2 : 1 ); + _outerFaces.insert( outerFace2 ); + int nbNodes = outerFace2->NbCornerNodes(); for ( int i = 0; i < nbNodes; ++i ) { SMESH_TLink link2( outerFace2->GetNode(i), outerFace2->GetNode((i+1)%nbNodes)); @@ -1078,6 +1084,27 @@ void SMESH_ElementSearcherImpl::GetElementsNearLine( const gp_Ax1& foundElems.assign( suspectFaces.begin(), suspectFaces.end()); } +//======================================================================= +/* + * Return elements whose bounding box intersects a sphere + */ +//======================================================================= + +void SMESH_ElementSearcherImpl::GetElementsInSphere( const gp_XYZ& center, + const double radius, + SMDSAbs_ElementType type, + vector< const SMDS_MeshElement* >& foundElems) +{ + if ( !_ebbTree || _elementType != type ) + { + if ( _ebbTree ) delete _ebbTree; + _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type, _meshPartIt ); + } + TIDSortedElemSet suspectFaces; // elements possibly intersecting the line + _ebbTree->getElementsInSphere( center, radius, suspectFaces ); + foundElems.assign( suspectFaces.begin(), suspectFaces.end() ); +} + //======================================================================= /*! * \brief Return true if the point is IN or ON of the element diff --git a/src/SMESHUtils/SMESH_MeshAlgos.hxx b/src/SMESHUtils/SMESH_MeshAlgos.hxx index 9b860a6ab..f8ea69a6b 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.hxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.hxx @@ -88,6 +88,13 @@ struct SMESHUtils_EXPORT SMESH_ElementSearcher virtual void GetElementsNearLine( const gp_Ax1& line, SMDSAbs_ElementType type, std::vector< const SMDS_MeshElement* >& foundElems) = 0; + /*! + * \brief Return elements whose bounding box intersects a sphere + */ + virtual void GetElementsInSphere( const gp_XYZ& center, + const double radius, + SMDSAbs_ElementType type, + std::vector< const SMDS_MeshElement* >& foundElems) = 0; /*! * \brief Find out if the given point is out of closed 2D mesh. */ diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index f4c519ae7..a286e0e48 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -24,6 +24,7 @@ #include "StdMeshers_QuadToTriaAdaptor.hxx" +#include "SMDS_IteratorOnIterators.hxx" #include "SMDS_SetIterator.hxx" #include "SMESHDS_GroupBase.hxx" #include "SMESH_Algo.hxx" @@ -115,20 +116,20 @@ namespace gp_Vec nJ = baseVec.Crossed( baJ ); // Check angle between normals - double angle = nI.Angle( nJ ); + double angle = nI.Angle( nJ ); bool tooClose = ( angle < 15. * M_PI / 180. ); // Check if pyramids collide if ( !tooClose && ( baI * baJ > 0 ) && ( nI * nJ > 0 )) { // find out if nI points outside of PrmI or inside - int dInd = baseNodesIndI[1] - baseNodesIndI[0]; + int dInd = baseNodesIndI[1] - baseNodesIndI[0]; bool isOutI = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0; - // find out sign of projection of nJ to baI + // find out sign of projection of baI to nJ double proj = baI * nJ; - tooClose = isOutI ? proj > 0 : proj < 0; + tooClose = ( isOutI ? proj > 0 : proj < 0 ); } // Check if PrmI and PrmJ are in same domain @@ -170,8 +171,9 @@ namespace continue; // f is a base quadrangle // check projections of face direction (baOFN) to triange normals (nI and nJ) - gp_Vec baOFN( base1, SMESH_TNodeXYZ( otherFaceNode )); - if ( nI * baOFN > 0 && nJ * baOFN > 0 ) + gp_Vec baOFN( base2, SMESH_TNodeXYZ( otherFaceNode )); + if ( nI * baOFN > 0 && nJ * baOFN > 0 && + baI* baOFN > 0 && baJ* baOFN > 0 ) // issue 0023212 { tooClose = false; // f is between pyramids break; @@ -253,7 +255,6 @@ namespace } } } - } //================================================================================ @@ -266,6 +267,8 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement* Pr const SMDS_MeshElement* PrmJ, set & nodesToMove) { + // cout << endl << "Merge " << PrmI->GetID() << " " << PrmJ->GetID() << " " + // << PrmI->GetNode(4) << PrmJ->GetNode(4) << endl; const SMDS_MeshNode* Nrem = PrmJ->GetNode(4); // node to remove //int nbJ = Nrem->NbInverseElements( SMDSAbs_Volume ); SMESH_TNodeXYZ Pj( Nrem ); @@ -288,7 +291,7 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement* Pr vector< const SMDS_MeshElement* > inverseElems // copy inverse elements to avoid iteration on changing container ( TStdElemIterator( CommonNode->GetInverseElementIterator(SMDSAbs_Face)), itEnd); - for ( unsigned i = 0; i < inverseElems.size(); ++i ) + for ( size_t i = 0; i < inverseElems.size(); ++i ) { const SMDS_MeshElement* FI = inverseElems[i]; const SMDS_MeshElement* FJEqual = 0; @@ -309,11 +312,12 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement* Pr } // set the common apex node to pyramids and triangles merged with J + vector< const SMDS_MeshNode* > nodes; inverseElems.assign( TStdElemIterator( Nrem->GetInverseElementIterator()), itEnd ); - for ( unsigned i = 0; i < inverseElems.size(); ++i ) + for ( size_t i = 0; i < inverseElems.size(); ++i ) { const SMDS_MeshElement* elem = inverseElems[i]; - vector< const SMDS_MeshNode* > nodes( elem->begin_nodes(), elem->end_nodes() ); + nodes.assign( elem->begin_nodes(), elem->end_nodes() ); nodes[ elem->GetType() == SMDSAbs_Volume ? PYRAM_APEX : TRIA_APEX ] = CommonNode; GetMeshDS()->ChangeElementNodes( elem, &nodes[0], nodes.size()); } @@ -330,33 +334,34 @@ void StdMeshers_QuadToTriaAdaptor::MergePiramids( const SMDS_MeshElement* Pr //================================================================================ void StdMeshers_QuadToTriaAdaptor::MergeAdjacent(const SMDS_MeshElement* PrmI, - set& nodesToMove) + set& nodesToMove, + const bool isRecursion) { TIDSortedElemSet adjacentPyrams; bool mergedPyrams = false; - for(int k=0; k<4; k++) // loop on 4 base nodes of PrmI + for ( int k=0; k<4; k++ ) // loop on 4 base nodes of PrmI { - const SMDS_MeshNode* n = PrmI->GetNode(k); + const SMDS_MeshNode* n = PrmI->GetNode(k); SMDS_ElemIteratorPtr vIt = n->GetInverseElementIterator( SMDSAbs_Volume ); while ( vIt->more() ) { const SMDS_MeshElement* PrmJ = vIt->next(); - if ( PrmJ->NbCornerNodes() != 5 || !adjacentPyrams.insert( PrmJ ).second ) + if ( PrmJ == PrmI || PrmJ->NbCornerNodes() != 5 || !adjacentPyrams.insert( PrmJ ).second ) continue; - if ( PrmI != PrmJ && TooCloseAdjacent( PrmI, PrmJ, GetMesh()->HasShapeToMesh() )) + if ( TooCloseAdjacent( PrmI, PrmJ, GetMesh()->HasShapeToMesh() )) { MergePiramids( PrmI, PrmJ, nodesToMove ); mergedPyrams = true; // container of inverse elements can change - vIt = n->GetInverseElementIterator( SMDSAbs_Volume ); + // vIt = n->GetInverseElementIterator( SMDSAbs_Volume ); -- iterator re-implemented } } } - if ( mergedPyrams ) + if ( mergedPyrams && !isRecursion ) { TIDSortedElemSet::iterator prm; for (prm = adjacentPyrams.begin(); prm != adjacentPyrams.end(); ++prm) - MergeAdjacent( *prm, nodesToMove ); + MergeAdjacent( *prm, nodesToMove, true ); } } @@ -414,79 +419,58 @@ static gp_Pnt FindBestPoint(const gp_Pnt& P1, const gp_Pnt& P2, //======================================================================= //function : HasIntersection3 -//purpose : Auxilare for HasIntersection() -// find intersection point between triangle (P1,P2,P3) -// and segment [PC,P] +//purpose : Find intersection point between a triangle (P1,P2,P3) +// and a segment [PC,P] //======================================================================= static bool HasIntersection3(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint, const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3) { - //cout<<"HasIntersection3"< preci ) || - ( (PC.Y()-PIn.Y())*(P.Y()-PIn.Y()) > preci ) || - ( (PC.Z()-PIn.Z())*(P.Z()-PIn.Z()) > preci ); - if(IsExternal) { - return false; - } - // check if this point is internal for triangle (P1,P2,P3) - gp_Vec V1(PIn,P1); - gp_Vec V2(PIn,P2); - gp_Vec V3(PIn,P3); - if( V1.Magnitude() -EPSILON && det < EPSILON) + return false; + + /* calculate U parameter and test bounds */ + double u = ( tvec * pvec ) / det; + //if (u < 0.0 || u > 1.0) + if (u < -EPSILON || u > 1.0 + EPSILON) + return false; + + /* prepare to test V parameter */ + gp_XYZ qvec = tvec ^ edge1; + + /* calculate V parameter and test bounds */ + double v = (dir * qvec) / det; + //if ( v < 0.0 || u + v > 1.0 ) + if ( v < -EPSILON || u + v > 1.0 + EPSILON) + return false; + + /* calculate t, ray intersects triangle */ + double t = (edge2 * qvec) / det; + + Pint = orig + dir * t; + + return ( t > 0. && t < segLen ); } //======================================================================= @@ -521,54 +505,99 @@ static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint, //================================================================================ /*! - * \brief Checks if a line segment (P,PC) intersects any mesh face. - * \param P - first segment end - * \param PC - second segment end (it is a gravity center of quadrangle) - * \param Pint - (out) intersection point + * \brief Return allowed height of a pyramid + * \param Papex - optimal pyramid apex + * \param PC - gravity center of a quadrangle + * \param PN - four nodes of the quadrangle * \param aMesh - mesh - * \param aShape - shape to check faces on - * \param NotCheckedFace - mesh face not to check - * \retval bool - true if there is an intersection + * \param NotCheckedFace - the quadrangle face + * \retval double - pyramid height */ //================================================================================ -bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, - const gp_Pnt& PC, - gp_Pnt& Pint, - SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape, - const SMDS_MeshElement* NotCheckedFace) +void StdMeshers_QuadToTriaAdaptor::LimitHeight (gp_Pnt& Papex, + const gp_Pnt& PC, + const TColgp_Array1OfPnt& PN, + const vector& FNodes, + SMESH_Mesh& aMesh, + const SMDS_MeshElement* NotCheckedFace, + const bool UseApexRay) { if ( !myElemSearcher ) myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() ); SMESH_ElementSearcher* searcher = const_cast(myElemSearcher); - bool res = false; - double dist = RealLast(); // find intersection closest to PC - gp_Pnt Pres; - - gp_Ax1 line( P, gp_Vec(P,PC)); - vector< const SMDS_MeshElement* > suspectElems; - searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); + // Find intersection of faces with (P,PC) segment elongated 3 times + double height = Papex.Distance( PC ); + gp_Ax1 line( PC, gp_Vec( PC, Papex )); + gp_Pnt Pint, Ptest; + vector< const SMDS_MeshElement* > suspectFaces; TColgp_SequenceOfPnt aContour; - for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) + + if ( UseApexRay ) { - const SMDS_MeshElement* face = suspectElems[iF]; - if ( face == NotCheckedFace ) continue; - aContour.Clear(); - for ( int i = 0; i < face->NbCornerNodes(); ++i ) - aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) )); - if ( HasIntersection(P, PC, Pres, aContour)) { - res = true; - double tmp = PC.Distance(Pres); - if ( tmp < dist ) { - Pint = Pres; - dist = tmp; + // find intersection closest to PC + Ptest = PC.XYZ() + line.Direction().XYZ() * height * 3; + + searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces ); + for ( size_t iF = 0; iF < suspectFaces.size(); ++iF ) + { + const SMDS_MeshElement* face = suspectFaces[iF]; + if ( face == NotCheckedFace ) continue; + + aContour.Clear(); + for ( int i = 0, nb = face->NbCornerNodes(); i < nb; ++i ) + aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) )); + + if ( HasIntersection( Ptest, PC, Pint, aContour )) + { + double dInt = PC.Distance( Pint ); + height = Min( height, dInt / 3. ); } } } - return res; + + // Find faces intersecting triangular facets of the pyramid (issue 23212) + + gp_XYZ center = PC.XYZ() + line.Direction().XYZ() * height * 0.5; + double diameter = Max( PN(1).Distance(PN(3)), PN(2).Distance(PN(4))); + suspectFaces.clear(); + searcher->GetElementsInSphere( center, diameter * 0.6, SMDSAbs_Face, suspectFaces); + + const double upShift = 1.5; + Ptest = PC.XYZ() + line.Direction().XYZ() * height * upShift; // tmp apex + + for ( size_t iF = 0; iF < suspectFaces.size(); ++iF ) + { + const SMDS_MeshElement* face = suspectFaces[iF]; + if ( face == NotCheckedFace ) continue; + if ( face->GetNodeIndex( FNodes[0] ) >= 0 || + face->GetNodeIndex( FNodes[1] ) >= 0 || + face->GetNodeIndex( FNodes[2] ) >= 0 || + face->GetNodeIndex( FNodes[3] ) >= 0 ) + continue; // neighbor face of the quadrangle + + // limit height using points of intersection of face links with pyramid facets + int nbN = face->NbCornerNodes(); + gp_Pnt P1 = SMESH_TNodeXYZ( face->GetNode( nbN-1 )); // 1st link end + for ( int i = 0; i < nbN; ++i ) + { + gp_Pnt P2 = SMESH_TNodeXYZ( face->GetNode(i) ); // 2nd link end + + for ( int iN = 1; iN <= 4; ++iN ) // loop on pyramid facets + { + if ( HasIntersection3( P1, P2, Pint, PN(iN), PN(iN+1), Ptest )) + { + height = Min( height, gp_Vec( PC, Pint ) * line.Direction() ); + //Ptest = PC.XYZ() + line.Direction().XYZ() * height * upShift; // new tmp apex + } + } + P1 = P2; + } + } + + Papex = PC.XYZ() + line.Direction().XYZ() * height; } //================================================================================ @@ -720,25 +749,36 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, vector myPyramids; + const SMESHDS_SubMesh * aSubMeshDSFace; SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); SMESH_MesherHelper helper(aMesh); helper.IsQuadraticSubMesh(aShape); helper.SetElementsOnShape( true ); if ( myElemSearcher ) delete myElemSearcher; + vector< SMDS_ElemIteratorPtr > itVec; if ( aProxyMesh ) - myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, aProxyMesh->GetFaces(aShape)); + { + itVec.push_back( aProxyMesh->GetFaces( aShape )); + } else - myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); + { + for ( TopExp_Explorer exp(aShape,TopAbs_FACE); exp.More(); exp.Next() ) + if (( aSubMeshDSFace = aProxyMesh->GetSubMesh( exp.Current() ))) + itVec.push_back( aSubMeshDSFace->GetElements() ); + } + typedef + SMDS_IteratorOnIterators< const SMDS_MeshElement*, vector< SMDS_ElemIteratorPtr > > TIter; + SMDS_ElemIteratorPtr faceIt( new TIter( itVec )); + myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, faceIt ); - const SMESHDS_SubMesh * aSubMeshDSFace; TColgp_Array1OfPnt PN(1,5); TColgp_Array1OfVec VN(1,4); vector FNodes(5); gp_Pnt PC; gp_Vec VNorm; - for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next()) + for ( TopExp_Explorer exp(aShape,TopAbs_FACE); exp.More(); exp.Next() ) { const TopoDS_Shape& aShapeFace = exp.Current(); if ( aProxyMesh ) @@ -809,17 +849,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, } else { // check possible intersection with other faces - gp_Pnt Pint; - gp_Vec VB(PC,PCbest); - gp_Pnt PCbestTmp = PC.XYZ() + VB.XYZ() * 3.0; - bool hasInters = CheckIntersection(PCbestTmp, PC, Pint, aMesh, aShape, face); - if ( hasInters ) { - double dist = PC.Distance(Pint)/3.; - if ( dist < height ) { - gp_Dir aDir( VB ); - PCbest = PC.XYZ() + aDir.XYZ() * dist; - } - } + LimitHeight( PCbest, PC, PN, FNodes, aMesh, face, /*UseApexRay=*/true ); } // create node for PCbest SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() ); @@ -971,11 +1001,11 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) gp_Pnt Pres1,Pres2; gp_Ax1 line( PC, VNorm ); - vector< const SMDS_MeshElement* > suspectElems; - searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); + vector< const SMDS_MeshElement* > suspectFaces; + searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces); - for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { - const SMDS_MeshElement* F = suspectElems[iF]; + for ( size_t iF = 0; iF < suspectFaces.size(); ++iF ) { + const SMDS_MeshElement* F = suspectFaces[iF]; if ( F == face ) continue; aContour.Clear(); for ( int i = 0; i < 4; ++i ) @@ -1026,7 +1056,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) continue; } + // ----------------------------------- // Case of non-degenerated quadrangle + // ----------------------------------- // Find pyramid peak @@ -1059,12 +1091,12 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) gp_Pnt intPnt[2]; gp_Ax1 line( PC, tmpDir ); - vector< const SMDS_MeshElement* > suspectElems; - searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); + vector< const SMDS_MeshElement* > suspectFaces; + searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces); - for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) + for ( size_t iF = 0; iF < suspectFaces.size(); ++iF ) { - const SMDS_MeshElement* F = suspectElems[iF]; + const SMDS_MeshElement* F = suspectFaces[iF]; if ( F == face ) continue; aContour.Clear(); int nbN = F->NbCornerNodes(); @@ -1109,13 +1141,15 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) { if( !intersected[isRev] ) continue; double pyramidH = Min( height, PC.Distance(intPnt[isRev])/3.); - PCbest = PC.XYZ() + tmpDir.XYZ() * (isRev ? -pyramidH : pyramidH); + gp_Pnt Papex = PC.XYZ() + tmpDir.XYZ() * (isRev ? -pyramidH : pyramidH); - // create node for PCbest - SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() ); + LimitHeight( Papex, PC, PN, FNodes, aMesh, face, /*UseApexRay=*/false ); + + // create node for Papex + SMDS_MeshNode* NewNode = helper.AddNode( Papex.X(), Papex.Y(), Papex.Z() ); // add triangles to result map - for(i=0; i<4; i++) { + for ( i = 0; i < 4; i++) { SMDS_MeshFace* NewFace; if(isRev) NewFace = meshDS->AddFace( NewNode, FNodes[i], FNodes[i+1] ); @@ -1146,16 +1180,19 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh& aMesh, const vector& myPyramids) { - if(myPyramids.empty()) + if ( myPyramids.empty() ) return true; SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); size_t i, j, k; - int myShapeID = myPyramids[0]->GetNode(4)->getshapeId(); - - if ( myElemSearcher ) delete myElemSearcher; - myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); - SMESH_ElementSearcher* searcher = const_cast(myElemSearcher); + //int myShapeID = myPyramids[0]->GetNode(4)->getshapeId(); + { + SMDS_ElemIteratorPtr + pyramIt( new SMDS_ElementVectorIterator( myPyramids.begin(), myPyramids.end() )); + if ( myElemSearcher ) delete myElemSearcher; + myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, pyramIt ); + } + SMESH_ElementSearcher* searcher = const_cast( myElemSearcher ); set nodesToMove; @@ -1167,17 +1204,19 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh& MergeAdjacent( PrmI, nodesToMove ); } - // iterate on all pyramids + // iterate on all new pyramids + vector< const SMDS_MeshElement* > suspectPyrams; for ( i = 0; i < myPyramids.size(); ++i ) { - const SMDS_MeshElement* PrmI = myPyramids[i]; + const SMDS_MeshElement* PrmI = myPyramids[i]; + const SMDS_MeshNode* apexI = PrmI->GetNode( PYRAM_APEX ); // compare PrmI with all the rest pyramids // collect adjacent pyramids and nodes coordinates of PrmI set checkedPyrams; - vector PsI(5); - for(k=0; k<5; k++) // loop on 4 base nodes of PrmI + gp_Pnt PsI[5]; + for ( k = 0; k < 5; k++ ) { const SMDS_MeshNode* n = PrmI->GetNode(k); PsI[k] = SMESH_TNodeXYZ( n ); @@ -1190,70 +1229,77 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh& } } + // get pyramids to check + gp_XYZ PC = ( PsI[0].XYZ() + PsI[1].XYZ() + PsI[2].XYZ() + PsI[3].XYZ() ) / 4.; + gp_XYZ ray = PsI[4].XYZ() - PC; + gp_XYZ center = PC + 0.5 * ray; + double diameter = Max( PsI[0].Distance(PsI[2]), PsI[1].Distance(PsI[3])); + suspectPyrams.clear(); + searcher->GetElementsInSphere( center, diameter * 0.6, SMDSAbs_Volume, suspectPyrams); + // check intersection with distant pyramids - for(k=0; k<4; k++) // loop on 4 base nodes of PrmI + for ( j = 0; j < suspectPyrams.size(); ++j ) { - gp_Vec Vtmp(PsI[k],PsI[4]); - gp_Ax1 line( PsI[k], Vtmp ); - vector< const SMDS_MeshElement* > suspectPyrams; - searcher->GetElementsNearLine( line, SMDSAbs_Volume, suspectPyrams); + const SMDS_MeshElement* PrmJ = suspectPyrams[j]; + if ( PrmJ == PrmI ) + continue; + if ( apexI == PrmJ->GetNode( PYRAM_APEX )) + continue; // pyramids PrmI and PrmJ already merged + if ( !checkedPyrams.insert( PrmJ ).second ) + continue; // already checked - for ( j = 0; j < suspectPyrams.size(); ++j ) + gp_Pnt PsJ[5]; + for ( k = 0; k < 5; k++ ) + PsJ[k] = SMESH_TNodeXYZ( PrmJ->GetNode(k) ); + + if ( ray * ( PsJ[4].XYZ() - PC ) < 0. ) + continue; // PrmJ is below PrmI + + for ( k = 0; k < 4; k++ ) // loop on 4 base nodes of PrmI { - const SMDS_MeshElement* PrmJ = suspectPyrams[j]; - if ( PrmJ == PrmI || PrmJ->NbCornerNodes() != 5 ) - continue; - if ( myShapeID != PrmJ->GetNode(4)->getshapeId()) - continue; // pyramid from other SOLID - if ( PrmI->GetNode(4) == PrmJ->GetNode(4) ) - continue; // pyramids PrmI and PrmJ already merged - if ( !checkedPyrams.insert( PrmJ ).second ) - continue; // already checked - - TXyzIterator xyzIt( PrmJ->nodesIterator() ); - vector PsJ( xyzIt, TXyzIterator() ); - gp_Pnt Pint; bool hasInt=false; - for(k=0; k<4 && !hasInt; k++) { - gp_Vec Vtmp(PsI[k],PsI[4]); + for ( k = 0; k < 4 && !hasInt; k++ ) + { + gp_Vec Vtmp( PsI[k], PsI[ PYRAM_APEX ]); gp_Pnt Pshift = PsI[k].XYZ() + Vtmp.XYZ() * 0.01; // base node moved a bit to apex hasInt = - ( HasIntersection3( Pshift, PsI[4], Pint, PsJ[0], PsJ[1], PsJ[4]) || - HasIntersection3( Pshift, PsI[4], Pint, PsJ[1], PsJ[2], PsJ[4]) || - HasIntersection3( Pshift, PsI[4], Pint, PsJ[2], PsJ[3], PsJ[4]) || - HasIntersection3( Pshift, PsI[4], Pint, PsJ[3], PsJ[0], PsJ[4]) ); + ( HasIntersection3( Pshift, PsI[4], Pint, PsJ[0], PsJ[1], PsJ[PYRAM_APEX]) || + HasIntersection3( Pshift, PsI[4], Pint, PsJ[1], PsJ[2], PsJ[PYRAM_APEX]) || + HasIntersection3( Pshift, PsI[4], Pint, PsJ[2], PsJ[3], PsJ[PYRAM_APEX]) || + HasIntersection3( Pshift, PsI[4], Pint, PsJ[3], PsJ[0], PsJ[PYRAM_APEX]) ); } - for(k=0; k<4 && !hasInt; k++) { - gp_Vec Vtmp(PsJ[k],PsJ[4]); + for ( k = 0; k < 4 && !hasInt; k++ ) + { + gp_Vec Vtmp( PsJ[k], PsJ[ PYRAM_APEX ]); gp_Pnt Pshift = PsJ[k].XYZ() + Vtmp.XYZ() * 0.01; hasInt = - ( HasIntersection3( Pshift, PsJ[4], Pint, PsI[0], PsI[1], PsI[4]) || - HasIntersection3( Pshift, PsJ[4], Pint, PsI[1], PsI[2], PsI[4]) || - HasIntersection3( Pshift, PsJ[4], Pint, PsI[2], PsI[3], PsI[4]) || - HasIntersection3( Pshift, PsJ[4], Pint, PsI[3], PsI[0], PsI[4]) ); + ( HasIntersection3( Pshift, PsJ[4], Pint, PsI[0], PsI[1], PsI[PYRAM_APEX]) || + HasIntersection3( Pshift, PsJ[4], Pint, PsI[1], PsI[2], PsI[PYRAM_APEX]) || + HasIntersection3( Pshift, PsJ[4], Pint, PsI[2], PsI[3], PsI[PYRAM_APEX]) || + HasIntersection3( Pshift, PsJ[4], Pint, PsI[3], PsI[0], PsI[PYRAM_APEX]) ); } if ( hasInt ) { // count common nodes of base faces of two pyramids int nbc = 0; - for (k=0; k<4; k++) + for ( k = 0; k < 4; k++ ) nbc += int ( PrmI->GetNodeIndex( PrmJ->GetNode(k) ) >= 0 ); if ( nbc == 4 ) continue; // pyrams have a common base face - if(nbc>0) + if ( nbc > 0 ) { // Merge the two pyramids and others already merged with them MergePiramids( PrmI, PrmJ, nodesToMove ); } - else { // nbc==0 - + else // nbc==0 + { // decrease height of pyramids gp_XYZ PCi(0,0,0), PCj(0,0,0); - for(k=0; k<4; k++) { + for ( k = 0; k < 4; k++ ) { PCi += PsI[k].XYZ(); PCj += PsJ[k].XYZ(); } @@ -1272,9 +1318,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh& VN1.Scale(coef1); VN2.Scale(coef2); - SMDS_MeshNode* aNode1 = const_cast(PrmI->GetNode(4)); + SMDS_MeshNode* aNode1 = const_cast( apexI ); aNode1->setXYZ( PCi.X()+VN1.X(), PCi.Y()+VN1.Y(), PCi.Z()+VN1.Z() ); - SMDS_MeshNode* aNode2 = const_cast(PrmJ->GetNode(4)); + SMDS_MeshNode* aNode2 = const_cast(PrmJ->GetNode( PYRAM_APEX )); aNode2->setXYZ( PCj.X()+VN2.X(), PCj.Y()+VN2.Y(), PCj.Z()+VN2.Z() ); nodesToMove.insert( aNode1 ); nodesToMove.insert( aNode2 ); diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx index 44470b8e9..3c2807a14 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx @@ -71,10 +71,13 @@ protected: gp_Pnt& PC, gp_Vec& VNorm, const SMDS_MeshElement** volumes=0); - bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC, - gp_Pnt& Pint, SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape, - const SMDS_MeshElement* NotCheckedFace); + void LimitHeight (gp_Pnt& Papex, + const gp_Pnt& PC, + const TColgp_Array1OfPnt& PN, + const std::vector& FNodes, + SMESH_Mesh& aMesh, + const SMDS_MeshElement* NotCheckedFace, + const bool UseApexRay); bool Compute2ndPart(SMESH_Mesh& aMesh, const std::vector& pyramids); @@ -85,7 +88,8 @@ protected: std::set & nodesToMove); void MergeAdjacent(const SMDS_MeshElement* PrmI, - std::set& nodesToMove); + std::set& nodesToMove, + const bool isRecursion = false); TopoDS_Shape myShape; From 18dade91d06a5b9964bb5604dbfdbc0ff4deef0a Mon Sep 17 00:00:00 2001 From: imn Date: Wed, 20 Jan 2016 17:33:43 +0300 Subject: [PATCH 063/147] INT PAL 0053067: Algorithm disable in "Edit mesh" dialog --- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index cda44524c..fb05a8471 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1504,6 +1504,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, QString anCompareType = currentMeshTypeName(myDlg->currentMeshType()); bool is2dtype = ( anCompareType == "QUAD" ) || ( anCompareType == "TRIA" ); int dim = is2dtype ? SMESH::DIM_2D : SMESH::DIM_3D; + dim = ( myMaxShapeDim < dim ) ? myMaxShapeDim : dim; for (int i = dim; i >= SMESH::DIM_0D; i--) { if ( i != aDim ) { if ( algoData && algoData->InputTypes.isEmpty() ) { @@ -2746,18 +2747,14 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI setCurrentHyp( dim, Algo, anCurrentAvailableAlgo ); } - if ( aDim == SMESH::DIM_2D) { - myDlg->disableTab( SMESH::DIM_3D ); - setCurrentHyp( SMESH::DIM_3D, Algo, -1); - } - for ( int i = myMaxShapeDim; i > SMESH::DIM_0D; i-- ) { + for ( int i = myMaxShapeDim; i >= SMESH::DIM_0D; i-- ) { bool isNoneAlg = currentHyp( i, Algo ) < 0; if ( !isNoneAlg ) isReqDisBound = myAvailableHypData[i][Algo].at( currentHyp( i, Algo ) )->InputTypes.isEmpty(); else isReqDisBound = true; - if ( isReqDisBound && !isNoneAlg) { - for (int j = i; j >= SMESH::DIM_0D; j--) { + if ( isReqDisBound && !isNoneAlg && i <= aDim) { + for (int j = myMaxShapeDim; j >= SMESH::DIM_0D; j--) { if ( currentHyp( j, Algo ) < 0 ) { myDlg->disableTab( j ); setCurrentHyp( j , Algo, -1 ); @@ -2765,7 +2762,15 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI } break; } + else { + myDlg->enableTab( i ); + } } + if ( aDim == SMESH::DIM_2D) { + myDlg->disableTab( SMESH::DIM_3D ); + setCurrentHyp( SMESH::DIM_3D, Algo, -1); + } + int currentTab = ( theTabIndex <= aDim ) ? theTabIndex : aDim; myDlg->setCurrentTab( currentTab ); } From dbf226547fc4b1b1c901ab994db7c1708dd6576d Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 22 Jan 2016 20:10:27 +0300 Subject: [PATCH 064/147] IPAL53073: Hexotic Mesh is not compute --- doc/salome/gui/SMESH/input/extrusion.doc | 18 ++--- .../gui/SMESH/input/extrusion_along_path.doc | 8 ++- src/SMDS/SMDS_Mesh.cxx | 70 +++++++++---------- src/SMESHDS/SMESHDS_Mesh.cxx | 11 +-- src/SMESHDS/SMESHDS_SubMesh.cxx | 27 +++++-- 5 files changed, 72 insertions(+), 62 deletions(-) diff --git a/doc/salome/gui/SMESH/input/extrusion.doc b/doc/salome/gui/SMESH/input/extrusion.doc index 5a603b229..6b07af9e1 100644 --- a/doc/salome/gui/SMESH/input/extrusion.doc +++ b/doc/salome/gui/SMESH/input/extrusion.doc @@ -68,30 +68,30 @@ The following dialog will appear: the \ref filtering_elements "Selection filters" page. -
  • If the Extrusion to Distance radio button is selected - - specify the translation vector by which the elements will be extruded. -
  • -


    -\image html extrusionalongaline2.png +
  • If the Extrusion to Distance radio button is selected +
      +
    • specify the translation vector by which the elements will + be extruded.
    • +
    +
  • If the Extrusion Along Vector radio button is selected +\image html extrusionalongaline2.png
      -
    • specify the coordinates of the \b Vector along which the elements +
    • specify the components of the \b Vector along which the elements will be extruded, either directly or by selecting the mesh face (the normal to the face will define the vector),
    • specify the \b Distance of extrusion along the vector (it can be negative).
  • -


    -\image html extrusionalongaline3.png -
  • If the Extrusion By Normal radio button is selected, every node of the selected faces is extruded along the \a average of the \a normal vectors to the faces sharing the node. (Nodes and edges cannot be extruded in this mode.) +\image html extrusionalongaline3.png
    • Specify the \b Distance of extrusion (it can be negative),
    • Use Along average normal check-box to specify along diff --git a/doc/salome/gui/SMESH/input/extrusion_along_path.doc b/doc/salome/gui/SMESH/input/extrusion_along_path.doc index 2253d08d8..ca782049a 100644 --- a/doc/salome/gui/SMESH/input/extrusion_along_path.doc +++ b/doc/salome/gui/SMESH/input/extrusion_along_path.doc @@ -134,9 +134,11 @@ The following dialog will appear:
    • If the path of extrusion is curvilinear, at each iteration the extruded elements are rotated to keep its initial angularity to the curve. By default, the Base Point around which the elements - are rotated is the mass center of the elements, however, you can - specify any point as the Base Point and the elements will be - rotated with respect to this point.
      + are rotated is the mass center of the elements (note that it can + differ from the gravity center computed by \a Geometry module for the + underlying shape), however, you can specify any point as the Base + Point and the elements will be rotated with respect to this + point.
      Note that only the displacement of the Base Point exactly equals to the path, and all other extruded elements simply keep their position relatively to the Base Point at each diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 86524eb8d..72da1ad74 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -3301,12 +3301,12 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_VtkEdge* vtkElem = dynamic_cast(*it)) { + if (const SMDS_VtkEdge* vtkElem = dynamic_cast(*it)) myEdgePool->destroy((SMDS_VtkEdge*) vtkElem); + else { ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse - } - else delete (*it); + } break; case SMDSAbs_Face: if (IdToRemove >= 0) @@ -3316,12 +3316,12 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_VtkFace* vtkElem = dynamic_cast(*it)) { + if (const SMDS_VtkFace* vtkElem = dynamic_cast(*it)) myFacePool->destroy((SMDS_VtkFace*) vtkElem); + else { ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse - } - else delete (*it); + } break; case SMDSAbs_Volume: if (IdToRemove >= 0) @@ -3331,12 +3331,12 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_VtkVolume* vtkElem = dynamic_cast(*it)) { + if (const SMDS_VtkVolume* vtkElem = dynamic_cast(*it)) myVolumePool->destroy((SMDS_VtkVolume*) vtkElem); + else { ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse - } - else delete (*it); + } break; case SMDSAbs_Ball: if (IdToRemove >= 0) @@ -3346,48 +3346,48 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, } removedElems.push_back((*it)); myElementIDFactory->ReleaseID(IdToRemove, vtkid); - if (const SMDS_BallElement* vtkElem = dynamic_cast(*it)) { + if (const SMDS_BallElement* vtkElem = dynamic_cast(*it)) myBallPool->destroy(const_cast( vtkElem )); + else { ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse - } - else delete (*it); + } break; case SMDSAbs_All: // avoid compilation warning case SMDSAbs_NbElementTypes: break; } if (vtkid >= 0) - { - this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL); - } + { + this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL); + } it++; } // remove exclusive (free) nodes if (removenodes) + { + it = s2->begin(); + while (it != s2->end()) { - it = s2->begin(); - while (it != s2->end()) - { - int IdToRemove = (*it)->GetID(); - if (IdToRemove >= 0) - { - myNodes[IdToRemove] = 0; - myInfo.myNbNodes--; - } - myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId()); - removedNodes.push_back((*it)); - if (const SMDS_MeshNode* vtkElem = dynamic_cast(*it)) - { - ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition()); - myNodePool->destroy((SMDS_MeshNode*) vtkElem); - } - else - delete (*it); - it++; - } + int IdToRemove = (*it)->GetID(); + if (IdToRemove >= 0) + { + myNodes[IdToRemove] = 0; + myInfo.myNbNodes--; + } + myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId()); + removedNodes.push_back((*it)); + if (const SMDS_MeshNode* vtkElem = dynamic_cast(*it)) + { + ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition()); + myNodePool->destroy((SMDS_MeshNode*) vtkElem); + } + else + delete (*it); + it++; } + } delete s2; delete s1; diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index a66f4482f..072fcdac7 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -894,16 +894,7 @@ void SMESHDS_Mesh::RemoveNode(const SMDS_MeshNode * n) { if ( n->NbInverseElements() == 0 && !(hasConstructionEdges() || hasConstructionFaces())) { - SMESHDS_SubMesh* subMesh = MeshElements( n->getshapeId() ); - SMESHDS_SubMeshIteratorPtr subIt; - if ( !subMesh ) - subIt = SubMeshes(); - for ( ; !subMesh && subIt->more(); ) { - subMesh = const_cast< SMESHDS_SubMesh* >( subIt->next() ); - if ( subMesh->IsComplexSubmesh() || !subMesh->Contains( n )) - subMesh = 0; - } - RemoveFreeNode( n, subMesh, true); + RemoveFreeNode( n, 0, true ); return; } diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 32f89c9a6..1e7dd6ab3 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -117,13 +117,22 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele { if (!ME) { - MESSAGE("-----------------> Remove Null Element " << isElemDeleted); return false; } if (!IsComplexSubmesh()) { - if ( ME->getshapeId() != myIndex ) + if ( ME->getshapeId() != myIndex ) // elem not in a pool can loose it's data already + { + if ( isElemDeleted ) + for ( size_t i = 0; i < myElements.size(); ++i ) + if ( myElements[i] == ME ) + { + myElements[i] = 0; + ++myUnusedIdElements; + return true; + } return false; + } int idInSubShape = ME->getIdInShape(); SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME); elem->setShapeId(0); @@ -140,7 +149,6 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele } return false; } - MESSAGE("Try to remove an element from a complex submesh "); return false; } @@ -182,7 +190,17 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) if (!IsComplexSubmesh()) { if ( N->getshapeId() != myIndex ) + { + if ( isNodeDeleted ) + for ( size_t i = 0; i < myNodes.size(); ++i ) + if ( myNodes[i] == N ) + { + myNodes[i] = 0; + ++myUnusedIdNodes; + return true; + } return false; + } int idInSubShape = N->getIdInShape(); SMDS_MeshNode* node = (SMDS_MeshNode*) (N); node->setShapeId(0); @@ -199,13 +217,12 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) } return false; } - MESSAGE("Try to remove a node from a complex submesh"); return false; } //======================================================================= //function : NbElements -//purpose : +//purpose : //======================================================================= int SMESHDS_SubMesh::NbElements() const From f0e2178ff8f4acf31599b9838f15dc6ad3947805 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 22 Jan 2016 20:29:39 +0300 Subject: [PATCH 065/147] OCCT Exception in "Cutting of quadrangles" dialog --- src/SMESH/SMESH_MeshEditor.cxx | 43 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 645882b40..56371d711 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -2939,14 +2939,13 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, SMESH_MesherHelper helper( *GetMesh() ); TIDSortedElemSet::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) + { const SMDS_MeshElement* elem = *itElem; - if ( !elem || elem->GetType() != SMDSAbs_Face ) + if ( !elem || elem->GetGeomType() != SMDSGeom_QUADRANGLE ) continue; - bool isquad = elem->NbNodes()==4 || elem->NbNodes()==8; - if(!isquad) continue; - if(elem->NbNodes()==4) { + if ( elem->NbNodes() == 4 ) { // retrieve element nodes const SMDS_MeshNode* aNodes [4]; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); @@ -2969,10 +2968,10 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, myLastCreatedElems.Append(newElem2); // put a new triangle on the same shape and add to the same groups if ( aShapeId ) - { - aMesh->SetMeshElementOnShape( newElem1, aShapeId ); - aMesh->SetMeshElementOnShape( newElem2, aShapeId ); - } + { + aMesh->SetMeshElementOnShape( newElem1, aShapeId ); + aMesh->SetMeshElementOnShape( newElem2, aShapeId ); + } AddToSameGroups( newElem1, elem, aMesh ); AddToSameGroups( newElem2, elem, aMesh ); aMesh->RemoveElement( elem ); @@ -2980,8 +2979,8 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, // Quadratic quadrangle - if( elem->NbNodes()==8 && elem->IsQuadratic() ) { - + else if ( elem->NbNodes() == 8 ) + { // get surface elem is on int aShapeId = FindShape( elem ); if ( aShapeId != helper.GetSubShapeID() ) { @@ -3001,14 +3000,14 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, const SMDS_MeshNode* inFaceNode = 0; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); int i = 0; - while ( itN->more() ) { - aNodes[ i++ ] = static_cast( itN->next() ); - if ( !inFaceNode && helper.GetNodeUVneedInFaceNode() && - aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) - { - inFaceNode = aNodes[ i-1 ]; + if ( helper.GetNodeUVneedInFaceNode() ) + while ( itN->more() && !inFaceNode ) { + aNodes[ i++ ] = static_cast( itN->next() ); + if ( aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) + { + inFaceNode = aNodes[ i-1 ]; + } } - } // find middle point for (0,1,2,3) // and create a node in this point; @@ -3048,10 +3047,10 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, myLastCreatedElems.Append(newElem2); // put a new triangle on the same shape and add to the same groups if ( aShapeId ) - { - aMesh->SetMeshElementOnShape( newElem1, aShapeId ); - aMesh->SetMeshElementOnShape( newElem2, aShapeId ); - } + { + aMesh->SetMeshElementOnShape( newElem1, aShapeId ); + aMesh->SetMeshElementOnShape( newElem2, aShapeId ); + } AddToSameGroups( newElem1, elem, aMesh ); AddToSameGroups( newElem2, elem, aMesh ); aMesh->RemoveElement( elem ); From 8ae46824610592a518edf794fd90eff15ed68739 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 25 Jan 2016 15:42:49 +0300 Subject: [PATCH 066/147] 53075: Create mesh dialog: 3D tab disabled --- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 64 ++++++++--------- src/StdMeshers/StdMeshers_Prism_3D.cxx | 98 +++++++++++++++++--------- 2 files changed, 93 insertions(+), 69 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index fb05a8471..69053214a 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -224,7 +224,7 @@ void SMESHGUI_MeshOp::startOperation() } } SMESHGUI_SelectionOp::startOperation(); - // iterate through dimensions and get available algoritms, set them to the dialog + // iterate through dimensions and get available algorithms, set them to the dialog _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" ); for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) { @@ -1481,14 +1481,6 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, if (aDim == -1) return; - // find highest available dimension, all algos of this dimension are available for choice - int aTopDim = -1; - for (int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++) - if (isAccessibleDim( i )) - aTopDim = i; - if (aTopDim == -1) - return; - const bool isSubmesh = ( myToCreate ? !myIsMesh : myDlg->isObjectShown( SMESHGUI_MeshDlg::Mesh )); HypothesisData* algoData = hypData( aDim, Algo, theIndex ); @@ -1497,23 +1489,24 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, QStringList anAvailable; - // check that tab enabled of one less dimension - if ( aDim > SMESH::DIM_0D ) - { - if ( myIsOnGeometry ) { - QString anCompareType = currentMeshTypeName(myDlg->currentMeshType()); - bool is2dtype = ( anCompareType == "QUAD" ) || ( anCompareType == "TRIA" ); - int dim = is2dtype ? SMESH::DIM_2D : SMESH::DIM_3D; - dim = ( myMaxShapeDim < dim ) ? myMaxShapeDim : dim; - for (int i = dim; i >= SMESH::DIM_0D; i--) { - if ( i != aDim ) { - if ( algoData && algoData->InputTypes.isEmpty() ) { - myDlg->disableTab( i ); - setCurrentHyp(i, Algo, -1); - } - else { - myDlg->enableTab( i ); - } + // enable / disable tabs + if ( myIsOnGeometry ) { + for (int i = SMESH::DIM_3D; i >= SMESH::DIM_0D; i--) { + if ( i > aDim ) { + if ( i > myMaxShapeDim ) myDlg->disableTab( i ); + else myDlg->enableTab( i ); + } + else if ( i == aDim ) { + continue; + } + else {//( i < aDim ) + if ( algoData && algoData->InputTypes.isEmpty() ) { + myDlg->disableTab( i ); + for ( int type = Algo, nbTypes = nbDlgHypTypes(i); type < nbTypes; type++ ) + setCurrentHyp(i, type, -1); + } + else { + myDlg->enableTab( i ); } } } @@ -1558,7 +1551,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, nextAlgo = 0; } - // set new available algoritms + // set new available algorithms availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], prevAlgo, nextAlgo, anCurrentCompareType); HypothesisData* soleCompatible = 0; if ( anAvailable.count() == 1 ) @@ -1568,13 +1561,15 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, algoIndex = myAvailableHypData[dim][Algo].indexOf( curAlgo ); if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D) { // select the sole compatible algo - algoIndex = myAvailableHypData[dim][Algo].indexOf( soleCompatible ); + algoIndex = 0; } - setCurrentHyp( dim, Algo, algoIndex); + setCurrentHyp( dim, Algo, algoIndex ); // remember current algo prevAlgo = algoByDim[ dim ] = hypData( dim, Algo, algoIndex ); - } + + } // loop on dims + if ( myMaxShapeDim == SMESH::DIM_3D && forward && algoDim == SMESH::DIM_1D ) { algoDim = SMESH::DIM_3D; @@ -1582,9 +1577,10 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, a3DAlgo = prevAlgo; continue; } - } + } // loops backward and forward - // set hypotheses corresponding to the found algoritms + + // set hypotheses corresponding to the found algorithms _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); @@ -2118,7 +2114,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) return anAlgoVar; QString aHypName = dataList[ aHypIndex ]->TypeName; - // get existing algoritms + // get existing algorithms _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); QStringList tmp; existingHyps( theDim, Algo, pObj, tmp, myExistingHyps[ theDim ][ Algo ]); @@ -2398,7 +2394,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess ) // Assign new algorithms and hypotheses for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ ) { - if ( !isAccessibleDim( dim )) continue; + //if ( !isAccessibleDim( dim )) continue; // find or create algorithm SMESH::SMESH_Hypothesis_var anAlgoVar = getAlgo( dim ); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 6227072d9..1485332b3 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -339,7 +339,7 @@ namespace { // gravity center of a layer gp_XYZ O(0,0,0); int vertexCol = -1; - for ( int i = 0; i < columns.size(); ++i ) + for ( size_t i = 0; i < columns.size(); ++i ) { O += gpXYZ( (*columns[ i ])[ z ]); if ( vertexCol < 0 && @@ -351,7 +351,7 @@ namespace { // Z axis gp_Vec Z(0,0,0); int iPrev = columns.size()-1; - for ( int i = 0; i < columns.size(); ++i ) + for ( size_t i = 0; i < columns.size(); ++i ) { gp_Vec v1( O, gpXYZ( (*columns[ iPrev ])[ z ])); gp_Vec v2( O, gpXYZ( (*columns[ i ] )[ z ])); @@ -363,11 +363,11 @@ namespace { { O = gpXYZ( (*columns[ vertexCol ])[ z ]); } - if ( xColumn < 0 || xColumn >= columns.size() ) + if ( xColumn < 0 || xColumn >= (int) columns.size() ) { // select a column for X dir double maxDist = 0; - for ( int i = 0; i < columns.size(); ++i ) + for ( size_t i = 0; i < columns.size(); ++i ) { double dist = ( O - gpXYZ((*columns[ i ])[ z ])).SquareModulus(); if ( dist > maxDist ) @@ -454,9 +454,9 @@ namespace { std::advance( edgeIt, nbEdges-1 ); TopoDS_Edge prevE = *edgeIt; // bool isPrevStraight = SMESH_Algo::IsStraight( prevE ); - int iPrev = nbEdges - 1; + // int iPrev = nbEdges - 1; - int iUnite = -1; // the first of united EDGEs + // int iUnite = -1; // the first of united EDGEs // analyse angles between EDGEs int nbCorners = 0; @@ -524,7 +524,7 @@ namespace { void pointsToPython(const std::vector& p) { #ifdef _DEBUG_ - for ( int i = SMESH_Block::ID_V000; i < p.size(); ++i ) + for ( size_t i = SMESH_Block::ID_V000; i < p.size(); ++i ) { cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ; SMESH_Block::DumpShapeID( i, cout ) << endl; @@ -933,6 +933,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism, list< TopoDS_Edge >::iterator edge = thePrism.myBottomEdges.begin(); std::list< int >::iterator nbE = thePrism.myNbEdgesInWires.begin(); + std::list< int > nbQuadsPerWire; int iE = 0; double f,l; while ( edge != thePrism.myBottomEdges.end() ) @@ -976,6 +977,8 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism, { iE = 0; ++nbE; + int nbQuadPrev = nbQuadsPerWire.empty() ? 0 : nbQuadsPerWire.back(); + nbQuadsPerWire.push_back( thePrism.myWallQuads.size() - nbQuadPrev ); } } @@ -987,12 +990,14 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism, // that is not so evident in case of several WIREs in the bottom FACE thePrism.myRightQuadIndex.clear(); for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i ) - thePrism.myRightQuadIndex.push_back( i+1 ); - list< int >::iterator nbEinW = thePrism.myNbEdgesInWires.begin(); - for ( int iLeft = 0; nbEinW != thePrism.myNbEdgesInWires.end(); ++nbEinW ) { - thePrism.myRightQuadIndex[ iLeft + *nbEinW - 1 ] = iLeft; // 1st EDGE index of a current WIRE - iLeft += *nbEinW; + thePrism.myRightQuadIndex.push_back( i+1 ); // OK for all but the last EDGE of a WIRE + } + list< int >::iterator nbQinW = nbQuadsPerWire.begin(); + for ( int iLeft = 0; nbQinW != nbQuadsPerWire.end(); ++nbQinW ) + { + thePrism.myRightQuadIndex[ iLeft + *nbQinW - 1 ] = iLeft; // for the last EDGE of a WIRE + iLeft += *nbQinW; } while ( totalNbFaces - faceMap.Extent() > 2 ) @@ -1072,7 +1077,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism, { // now only top and bottom FACEs are not in the faceMap faceMap.Add( thePrism.myBottom ); - for ( TopExp_Explorer f( thePrism.myShape3D, TopAbs_FACE );f.More(); f.Next() ) + for ( TopExp_Explorer f( thePrism.myShape3D, TopAbs_FACE ); f.More(); f.Next() ) if ( !faceMap.Contains( f.Current() )) { thePrism.myTop = TopoDS::Face( f.Current() ); break; @@ -1975,7 +1980,7 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top( const gp_Trsf & bottomToTopTrsf n2nMapPtr = & TProjction2dAlgo::instance( this )->GetNodesMap(); } - if ( !n2nMapPtr || n2nMapPtr->size() < botSMDS->NbNodes() ) + if ( !n2nMapPtr || (int) n2nMapPtr->size() < botSMDS->NbNodes() ) { // associate top and bottom faces NSProjUtils::TShapeShapeMap shape2ShapeMap; @@ -2510,6 +2515,8 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() int _nbCheckedEdges; // nb of EDGEs whose location is defined PrismSide *_leftSide; PrismSide *_rightSide; + void SetExcluded() { _leftSide = _rightSide = NULL; } + bool IsExcluded() const { return !_leftSide; } const TopoDS_Edge& Edge( int i ) const { return (*_edges)[ i ]._edge; @@ -2571,16 +2578,34 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() /*! * \brief Return another faces sharing an edge */ - const TopoDS_Shape & getAnotherFace( const TopoDS_Face& face, - const TopoDS_Edge& edge, - TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge) + const TopoDS_Face & getAnotherFace( const TopoDS_Face& face, + const TopoDS_Edge& edge, + TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge) { TopTools_ListIteratorOfListOfShape faceIt( facesOfEdge.FindFromKey( edge )); for ( ; faceIt.More(); faceIt.Next() ) if ( !face.IsSame( faceIt.Value() )) - return faceIt.Value(); + return TopoDS::Face( faceIt.Value() ); return face; } + + //-------------------------------------------------------------------------------- + /*! + * \brief Return number of faces sharing given edges + */ + int nbAdjacentFaces( const std::vector< EdgeWithNeighbors >& edges, + const TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge ) + { + TopTools_MapOfShape adjFaces; + + for ( size_t i = 0; i < edges.size(); ++i ) + { + TopTools_ListIteratorOfListOfShape faceIt( facesOfEdge.FindFromKey( edges[i]._edge )); + for ( ; faceIt.More(); faceIt.Next() ) + adjFaces.Add( faceIt.Value() ); + } + return adjFaces.Extent(); + } } //================================================================================ @@ -2646,11 +2671,13 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA typedef vector< EdgeWithNeighbors > TEdgeWithNeighborsVec; vector< TEdgeWithNeighborsVec > faceEdgesVec( allFaces.Extent() + 1 ); - TopTools_IndexedMapOfShape* facesOfSide = new TopTools_IndexedMapOfShape[ faceEdgesVec.size() ]; + const size_t nbEdgesMax = facesOfEdge.Extent() * 2; // there can be seam EDGES + TopTools_IndexedMapOfShape* facesOfSide = new TopTools_IndexedMapOfShape[ nbEdgesMax ]; SMESHUtils::ArrayDeleter delFacesOfSide( facesOfSide ); // try to use each face as a bottom one bool prismDetected = false; + vector< PrismSide > sides; for ( int iF = 1; iF < allFaces.Extent() && !prismDetected; ++iF ) { const TopoDS_Face& botF = TopoDS::Face( allFaces( iF )); @@ -2663,11 +2690,12 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA continue; // all faces are adjacent to botF - no top FACE // init data of side FACEs - vector< PrismSide > sides( botEdges.size() ); - for ( int iS = 0; iS < botEdges.size(); ++iS ) + sides.clear(); + sides.resize( botEdges.size() ); + for ( size_t iS = 0; iS < botEdges.size(); ++iS ) { - sides[ iS ]._topEdge = botEdges[ iS ]._edge; - sides[ iS ]._face = botF; + sides[ iS ]._topEdge = botEdges[ iS ]._edge; + sides[ iS ]._face = botF; sides[ iS ]._leftSide = & sides[ botEdges[ iS ]._iR ]; sides[ iS ]._rightSide = & sides[ botEdges[ iS ]._iL ]; sides[ iS ]._faces = & facesOfSide[ iS ]; @@ -2699,8 +2727,8 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA if ( side._isCheckedEdge[ iE ] ) continue; const TopoDS_Edge& vertE = side.Edge( iE ); const TopoDS_Shape& neighborF = getAnotherFace( side._face, vertE, facesOfEdge ); - bool isEdgeShared = adjSide->IsSideFace( neighborF ); - if ( isEdgeShared ) + bool isEdgeShared = adjSide->IsSideFace( neighborF ); + if ( isEdgeShared ) // vertE is shared with adjSide { isAdvanced = true; side._isCheckedEdge[ iE ] = true; @@ -2811,7 +2839,7 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA const TopoDS_Shape& topFace = sides[0]._faces->FindKey( nbFaces ); size_t iS; for ( iS = 1; iS < sides.size(); ++iS ) - if ( !sides[ iS ]._faces->Contains( topFace )) + if ( ! sides[ iS ]._faces->Contains( topFace )) break; prismDetected = ( iS == sides.size() ); } @@ -3285,7 +3313,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, if ( nbUnitePerEdge[ iE ] < 0 ) continue; // look for already united faces - for ( int i = iE; i < iE + nbExraFaces; ++i ) + for ( size_t i = iE; i < iE + nbExraFaces; ++i ) { if ( nbUnitePerEdge[ i ] > 0 ) // a side including nbUnitePerEdge[i]+1 edge nbExraFaces += nbUnitePerEdge[ i ]; @@ -3324,7 +3352,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, else if ( nbExraFaces > 1 ) // unite { double u0 = 0, sumLen = 0; - for ( int i = iE; i < iE + nbExraFaces; ++i ) + for ( size_t i = iE; i < iE + nbExraFaces; ++i ) sumLen += edgeLength[ i ]; vector< TSideFace* > components( nbExraFaces ); @@ -3568,7 +3596,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & double tol2; { Bnd_B3d bndBox; - for ( int i = 0; i < columns.size(); ++i ) + for ( size_t i = 0; i < columns.size(); ++i ) bndBox.Add( gpXYZ( columns[i]->front() )); tol2 = bndBox.SquareExtent() * 1e-5; } @@ -3591,7 +3619,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & //t.SetScaleFactor( distZ/dist0 ); - it does not work properly, wrong base point // check a transformation - for ( int i = 0; i < columns.size(); ++i ) + for ( size_t i = 0; i < columns.size(); ++i ) { gp_Pnt p0 = gpXYZ( (*columns[i])[0] ); gp_Pnt pz = gpXYZ( (*columns[i])[z] ); @@ -3795,7 +3823,7 @@ StdMeshers_PrismAsBlock::TSideFace::TSideFace( const TSideFace& other ): myComponents ( other.myComponents.size() ), myHelper ( *other.myHelper.GetMesh() ) { - for (int i = 0 ; i < myComponents.size(); ++i ) + for ( size_t i = 0 ; i < myComponents.size(); ++i ) myComponents[ i ] = new TSideFace( *other.myComponents[ i ]); } @@ -3807,7 +3835,7 @@ StdMeshers_PrismAsBlock::TSideFace::TSideFace( const TSideFace& other ): StdMeshers_PrismAsBlock::TSideFace::~TSideFace() { - for (int i = 0 ; i < myComponents.size(); ++i ) + for ( size_t i = 0 ; i < myComponents.size(); ++i ) if ( myComponents[ i ] ) delete myComponents[ i ]; } @@ -3907,7 +3935,7 @@ StdMeshers_PrismAsBlock::TSideFace::GetComponent(const double U,double & localU) if ( myComponents.empty() ) return const_cast( this ); - int i; + size_t i; for ( i = 0; i < myComponents.size(); ++i ) if ( U < myParams[ i ].second ) break; @@ -4346,9 +4374,9 @@ gp_Pnt StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::Value(const Standard_Real void StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::dumpNodes(int nbNodes) const { #ifdef _DEBUG_ - for ( int i = 0; i < nbNodes && i < myNodeColumn->size(); ++i ) + for ( int i = 0; i < nbNodes && i < (int)myNodeColumn->size(); ++i ) cout << (*myNodeColumn)[i]->GetID() << " "; - if ( nbNodes < myNodeColumn->size() ) + if ( nbNodes < (int) myNodeColumn->size() ) cout << myNodeColumn->back()->GetID(); #endif } From 63d763e7b204a8381ad2287798627af96cd18253 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 25 Jan 2016 21:06:20 +0300 Subject: [PATCH 067/147] 53076: OCC exception in Netgen algorithm (regression of StdMeshers_QuadToTriaAdaptor.cxx) --- src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index a286e0e48..5eaaf6609 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -764,7 +764,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, else { for ( TopExp_Explorer exp(aShape,TopAbs_FACE); exp.More(); exp.Next() ) - if (( aSubMeshDSFace = aProxyMesh->GetSubMesh( exp.Current() ))) + if (( aSubMeshDSFace = meshDS->MeshElements( exp.Current() ))) itVec.push_back( aSubMeshDSFace->GetElements() ); } typedef From e074bae4b74bc02aeebb7437fbae12a55bdad0c1 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 29 Jan 2016 15:47:48 +0300 Subject: [PATCH 068/147] Avoid MED file reading failure caused by low memory Failure reason: system(...) command exits with "Cannot allocate memory" --- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 18 +++++++++--------- src/MEDWrapper/Factory/MED_Factory.cxx | 8 +++++--- src/SMESH/SMESH_Mesh.cxx | 4 ++++ src/SMESH_SWIG/smeshBuilder.py | 4 +++- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 74c3e6da8..58f9c0ca0 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -172,7 +172,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() //------------------------------------------------------ PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); if (!aNodeInfo) { - aResult = DRS_FAIL; + aResult = addMessage("No nodes", /*isFatal=*/true ); continue; } aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false @@ -365,9 +365,9 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() } #ifndef _DEXCEPT_ } catch(const std::exception& exc) { - aResult = DRS_FAIL; + aResult = addMessage( exc.what(), /*isFatal=*/true ); } catch (...) { - aResult = DRS_FAIL; + aResult = addMessage( "Unknown exception", /*isFatal=*/true ); } #endif if ( !anElement ) { @@ -522,10 +522,10 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #ifndef _DEXCEPT_ }catch(const std::exception& exc){ INFOS("Following exception was caught:\n\t"< +#include #include #include @@ -53,7 +54,7 @@ namespace MED #ifndef WIN32 if (access(theFileName.c_str(),F_OK)) return aVersion; - if(theDoPreCheckInSeparateProcess){ + if ( theDoPreCheckInSeparateProcess ) { // First check, is it possible to deal with the file std::ostringstream aStr; // File name is in quotes for the case of space(s) inside it (PAL13009) @@ -64,8 +65,9 @@ namespace MED std::string aCommand = aStr.str(); int aStatus = system(aCommand.c_str()); - BEGMSG(MYDEBUG,"aCommand = '"<NbFaces() = "<<_myMeshDS->NbFaces()); MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); } +#ifdef _DEBUG_ + SMESH_ComputeErrorPtr er = myReader.GetError(); + if ( er && !er->IsOK() ) cout << er->myComment << endl; +#endif // Reading groups (sub-meshes are out of scope of MED import functionality) list aGroupNames = myReader.GetGroupNamesAndTypes(); diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 0dc3b25f0..2c98e1653 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1424,8 +1424,10 @@ class Mesh: # Treat compute errors computeErrors = self.smeshpyD.GetComputeErrors( self.mesh, geom ) + shapeText = "" for err in computeErrors: - shapeText = " on %s" % self.GetSubShapeName( err.subShapeID ) + if self.mesh.HasShapeToMesh(): + shapeText = " on %s" % self.GetSubShapeName( err.subShapeID ) errText = "" stdErrors = ["OK", #COMPERR_OK "Invalid input mesh", #COMPERR_BAD_INPUT_MESH From 6f5fd35e49b3c1e209a65548ff3358cdbb795398 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 29 Jan 2016 18:03:18 +0300 Subject: [PATCH 069/147] 23221: EDF - all edges are not meshed an internal EDGE in a SOLID to be meshed --- src/SMESH/SMESH_subMesh.cxx | 8 +++++--- src/SMESH/SMESH_subMesh.hxx | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 57a401df9..38a445708 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -438,7 +438,8 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() } break; case TopAbs_COMPSOLID: insertDependence( _subShape, TopAbs_SOLID ); break; - case TopAbs_SOLID: insertDependence( _subShape, TopAbs_FACE ); break; + case TopAbs_SOLID: insertDependence( _subShape, TopAbs_FACE ); + { /*internal EDGE*/ insertDependence( _subShape, TopAbs_EDGE, TopAbs_WIRE ); break; } case TopAbs_SHELL: insertDependence( _subShape, TopAbs_FACE ); break; case TopAbs_FACE: insertDependence( _subShape, TopAbs_EDGE ); break; case TopAbs_WIRE: insertDependence( _subShape, TopAbs_EDGE ); break; @@ -477,9 +478,10 @@ namespace //============================================================================= void SMESH_subMesh::insertDependence(const TopoDS_Shape aShape, - TopAbs_ShapeEnum aSubType) + TopAbs_ShapeEnum aSubType, + TopAbs_ShapeEnum avoidType) { - TopExp_Explorer sub( aShape, aSubType ); + TopExp_Explorer sub( aShape, aSubType, avoidType ); for ( ; sub.More(); sub.Next() ) { SMESH_subMesh *aSubMesh = _father->GetSubMesh( sub.Current() ); diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 24152268d..8f9f83c2c 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -281,7 +281,9 @@ public: protected: // ================================================================== - void insertDependence(const TopoDS_Shape aShape, TopAbs_ShapeEnum aSubType ); + void insertDependence(const TopoDS_Shape aShape, + TopAbs_ShapeEnum aSubType, + TopAbs_ShapeEnum avoidType=TopAbs_SHAPE); void removeSubMeshElementsAndNodes(); void updateDependantsState(const compute_event theEvent); From 85b03c36436cae5428fcf5a971eac4bccb127675 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 2 Feb 2016 20:38:56 +0300 Subject: [PATCH 070/147] Regression of 3D_mesh_Extrusion_00/B2 + avoid failure because of different 'vertical' discretization --- src/StdMeshers/StdMeshers_Prism_3D.cxx | 26 +++++++++++++++++--------- src/StdMeshers/StdMeshers_Prism_3D.hxx | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 1485332b3..645bad1e2 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -62,6 +62,7 @@ #include #include +#include using namespace std; @@ -977,7 +978,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism, { iE = 0; ++nbE; - int nbQuadPrev = nbQuadsPerWire.empty() ? 0 : nbQuadsPerWire.back(); + int nbQuadPrev = std::accumulate( nbQuadsPerWire.begin(), nbQuadsPerWire.end(), 0 ); nbQuadsPerWire.push_back( thePrism.myWallQuads.size() - nbQuadPrev ); } } @@ -1291,6 +1292,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) if ( !smDS ) return toSM( error(COMPERR_BAD_INPUT_MESH, "Null submesh")); // loop on bottom mesh faces + vector< const TNodeColumn* > columns; SMDS_ElemIteratorPtr faceIt = smDS->GetElements(); while ( faceIt->more() ) { @@ -1300,7 +1302,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) // find node columns for each node int nbNodes = face->NbCornerNodes(); - vector< const TNodeColumn* > columns( nbNodes ); + columns.resize( nbNodes ); for ( int i = 0; i < nbNodes; ++i ) { const SMDS_MeshNode* n = face->GetNode( i ); @@ -1317,7 +1319,8 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) } } // create prisms - AddPrisms( columns, myHelper ); + if ( !AddPrisms( columns, myHelper )) + return toSM( error("Different 'vertical' discretization")); } // loop on bottom mesh faces @@ -1815,17 +1818,20 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, */ //================================================================================ -void StdMeshers_Prism_3D::AddPrisms( vector & columns, +bool StdMeshers_Prism_3D::AddPrisms( vector & columns, SMESH_MesherHelper* helper) { - int nbNodes = columns.size(); - int nbZ = columns[0]->size(); - if ( nbZ < 2 ) return; + size_t nbNodes = columns.size(); + size_t nbZ = columns[0]->size(); + if ( nbZ < 2 ) return false; + for ( size_t i = 1; i < nbNodes; ++i ) + if ( columns[i]->size() != nbZ ) + return false; // find out orientation bool isForward = true; SMDS_VolumeTool vTool; - int z = 1; + size_t z = 1; switch ( nbNodes ) { case 3: { SMDS_VolumeOfNodes tmpPenta ( (*columns[0])[z-1], // bottom @@ -1911,7 +1917,7 @@ void StdMeshers_Prism_3D::AddPrisms( vector & columns, vector nodes( 2*nbNodes + 4*nbNodes); for ( z = 1; z < nbZ; ++z ) { - for ( int i = 0; i < nbNodes; ++i ) { + for ( size_t i = 0; i < nbNodes; ++i ) { nodes[ i ] = (*columns[ i ])[z+iBase1]; // bottom or top nodes[ 2*nbNodes-i-1 ] = (*columns[ i ])[z+iBase2]; // top or bottom // side @@ -1925,6 +1931,8 @@ void StdMeshers_Prism_3D::AddPrisms( vector & columns, } } // switch ( nbNodes ) + + return true; } //================================================================================ diff --git a/src/StdMeshers/StdMeshers_Prism_3D.hxx b/src/StdMeshers/StdMeshers_Prism_3D.hxx index 708a92ca9..0a2428401 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.hxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.hxx @@ -472,7 +472,7 @@ public: * \param nodeColumns - columns of nodes generated from nodes of a mesh face * \param helper - helper initialized by mesh and shape to add prisms to */ - static void AddPrisms( std::vector & nodeColumns, + static bool AddPrisms( std::vector & nodeColumns, SMESH_MesherHelper* helper); static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll); From 475d7c1304e733196b4da8b4c083f9c0ae6927d2 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 2 Feb 2016 21:10:57 +0300 Subject: [PATCH 071/147] Fix regressions in QuadTo4Tri() and QuadToTri() mesh_Quadratic_00/A3 imps_09/K8 --- src/SMESH/SMESH_MeshEditor.cxx | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 56371d711..79ecf615d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -1601,13 +1601,13 @@ void SMESH_MeshEditor::QuadTo4Tri (TIDSortedElemSet & theElems) // create 4 triangles - GetMeshDS()->RemoveFreeElement( quad, subMeshDS, /*fromGroups=*/false ); - helper.SetIsQuadratic ( nodes.size() > 4 ); helper.SetIsBiQuadratic( nodes.size() == 9 ); if ( helper.GetIsQuadratic() ) helper.AddTLinks( static_cast< const SMDS_MeshFace*>( quad )); + GetMeshDS()->RemoveFreeElement( quad, subMeshDS, /*fromGroups=*/false ); + for ( int i = 0; i < 4; ++i ) { SMDS_MeshElement* tria = helper.AddFace( nodes[ i ], @@ -2997,30 +2997,27 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, } const SMDS_MeshNode* aNodes [8]; - const SMDS_MeshNode* inFaceNode = 0; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - int i = 0; + for ( int i = 0; itN->more(); ++i ) + aNodes[ i ] = static_cast( itN->next() ); + + const SMDS_MeshNode* inFaceNode = 0; if ( helper.GetNodeUVneedInFaceNode() ) - while ( itN->more() && !inFaceNode ) { - aNodes[ i++ ] = static_cast( itN->next() ); - if ( aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) - { - inFaceNode = aNodes[ i-1 ]; - } - } + for ( int i = 0; i < 8 && !inFaceNode; ++i ) + if ( aNodes[ i ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) + inFaceNode = aNodes[ i ]; // find middle point for (0,1,2,3) // and create a node in this point; gp_XYZ p( 0,0,0 ); if ( surface.IsNull() ) { - for(i=0; i<4; i++) - p += gp_XYZ(aNodes[i]->X(), aNodes[i]->Y(), aNodes[i]->Z() ); + for ( int i = 0; i < 4; i++ ) p += SMESH_TNodeXYZ( aNodes[i] ); p /= 4; } else { TopoDS_Face geomFace = TopoDS::Face( helper.GetSubShape() ); gp_XY uv( 0,0 ); - for(i=0; i<4; i++) + for ( int i = 0; i < 4; i++ ) uv += helper.GetNodeUV( geomFace, aNodes[i], inFaceNode ); uv /= 4.; p = surface->Value( uv.X(), uv.Y() ).XYZ(); From 5b3023e6cb8002da05c9cbd36fac7ce1b67bc461 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 3 Feb 2016 14:43:37 +0300 Subject: [PATCH 072/147] Enable splitting bi-quad quadrangles by QuadToTri() --- src/Controls/SMESH_Controls.cxx | 13 +++++----- src/SMESH/SMESH_MeshEditor.cxx | 41 ++++++++++-------------------- src/SMESH_I/SMESH_MeshEditor_i.cxx | 2 +- 3 files changed, 20 insertions(+), 36 deletions(-) diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 3f612a24f..0623399e9 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -3212,14 +3212,13 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) myIds.Clear(); TCollection_AsciiString aStr = theStr; - //aStr.RemoveAll( ' ' ); - //aStr.RemoveAll( '\t' ); for ( int i = 1; i <= aStr.Length(); ++i ) - if ( isspace( aStr.Value( i ))) - aStr.SetValue( i, ','); - - for ( int aPos = aStr.Search( ",," ); aPos != -1; aPos = aStr.Search( ",," ) ) - aStr.Remove( aPos, 1 ); + { + char c = aStr.Value( i ); + if ( !isdigit( c ) && c != ',' && c != '-' ) + aStr.SetValue( i, ' '); + } + aStr.RemoveAll( ' ' ); TCollection_AsciiString tmpStr = aStr.Token( ",", 1 ); int i = 1; diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 79ecf615d..0f2f1ad71 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -2979,7 +2979,7 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, // Quadratic quadrangle - else if ( elem->NbNodes() == 8 ) + else if ( elem->NbNodes() >= 8 ) { // get surface elem is on int aShapeId = FindShape( elem ); @@ -2996,49 +2996,34 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems, } } - const SMDS_MeshNode* aNodes [8]; + const SMDS_MeshNode* aNodes [9]; aNodes[8] = 0; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); for ( int i = 0; itN->more(); ++i ) aNodes[ i ] = static_cast( itN->next() ); - const SMDS_MeshNode* inFaceNode = 0; - if ( helper.GetNodeUVneedInFaceNode() ) - for ( int i = 0; i < 8 && !inFaceNode; ++i ) - if ( aNodes[ i ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) - inFaceNode = aNodes[ i ]; - - // find middle point for (0,1,2,3) - // and create a node in this point; - gp_XYZ p( 0,0,0 ); - if ( surface.IsNull() ) { - for ( int i = 0; i < 4; i++ ) p += SMESH_TNodeXYZ( aNodes[i] ); - p /= 4; + const SMDS_MeshNode* centrNode = aNodes[8]; + if ( centrNode == 0 ) + { + centrNode = helper.GetCentralNode( aNodes[0], aNodes[1], aNodes[2], aNodes[3], + aNodes[4], aNodes[5], aNodes[6], aNodes[7], + surface.IsNull() ); + myLastCreatedNodes.Append(centrNode); } - else { - TopoDS_Face geomFace = TopoDS::Face( helper.GetSubShape() ); - gp_XY uv( 0,0 ); - for ( int i = 0; i < 4; i++ ) - uv += helper.GetNodeUV( geomFace, aNodes[i], inFaceNode ); - uv /= 4.; - p = surface->Value( uv.X(), uv.Y() ).XYZ(); - } - const SMDS_MeshNode* newN = aMesh->AddNode( p.X(), p.Y(), p.Z() ); - myLastCreatedNodes.Append(newN); // create a new element const SMDS_MeshElement* newElem1 = 0; const SMDS_MeshElement* newElem2 = 0; if ( the13Diag ) { newElem1 = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0], - aNodes[6], aNodes[7], newN ); + aNodes[6], aNodes[7], centrNode ); newElem2 = aMesh->AddFace(aNodes[2], aNodes[0], aNodes[1], - newN, aNodes[4], aNodes[5] ); + centrNode, aNodes[4], aNodes[5] ); } else { newElem1 = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1], - aNodes[7], aNodes[4], newN ); + aNodes[7], aNodes[4], centrNode ); newElem2 = aMesh->AddFace(aNodes[3], aNodes[1], aNodes[2], - newN, aNodes[5], aNodes[6] ); + centrNode, aNodes[5], aNodes[6] ); } myLastCreatedElems.Append(newElem1); myLastCreatedElems.Append(newElem2); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index f31e583eb..bd08f9d67 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -5304,7 +5304,7 @@ bool SMESH_MeshEditor_i::idSourceToSet(SMESH::SMESH_IDSource_ptr theIDSource, { if ( error ) *error = IDSource_OK; - if ( CORBA::is_nil( theIDSource ) ) + if ( CORBA::is_nil( theIDSource )) { if ( error ) *error = IDSource_INVALID; return false; From 1c80375f7ab3c8d56326c7391b91d77789fd3b54 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 4 Feb 2016 12:22:57 +0300 Subject: [PATCH 073/147] 0023224: [CEA 1709] Error with numpy with Windows version of SALOME Each mesh plug-in is added in a separate try/except block, to prevent blocking of plug-ins due to error in some of them (e.g. if import failed) --- src/Tools/smesh_plugins.py | 68 ++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/src/Tools/smesh_plugins.py b/src/Tools/smesh_plugins.py index 3fedbd281..c82bb172d 100644 --- a/src/Tools/smesh_plugins.py +++ b/src/Tools/smesh_plugins.py @@ -21,43 +21,61 @@ # import salome_pluginsmanager -from spadderPlugin import runSpadderPlugin -from meshcut_plugin import MeshCut -from yamsplug_plugin import YamsLct -from MGCleanerplug_plugin import MGCleanerLct -from blocFissure.ihm.fissureCoude_plugin import fissureCoudeDlg +try: + from spadderPlugin import runSpadderPlugin + salome_pluginsmanager.AddFunction('PADDER mesher', + 'Create a mesh with PADDER', + runSpadderPlugin) +except: + salome_pluginsmanager.logger.info('ERROR: PADDER mesher plug-in is unavailable') + pass -salome_pluginsmanager.AddFunction('PADDER mesher', - 'Create a mesh with PADDER', - runSpadderPlugin) +try: + from meshcut_plugin import MeshCut + salome_pluginsmanager.AddFunction('MeshCut', + 'Cut a tetrahedron mesh by a plane', + MeshCut) -salome_pluginsmanager.AddFunction('MeshCut', - 'Cut a tetrahedron mesh by a plane', - MeshCut) +except: + salome_pluginsmanager.logger.info('ERROR: MeshCut plug-in is unavailable') + pass -salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt ( formerly Yams )', - 'Run Yams', - YamsLct) +try: + from yamsplug_plugin import YamsLct + salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt ( formerly Yams )', + 'Run Yams', + YamsLct) +except: + salome_pluginsmanager.logger.info('ERROR: MGSurfOpt (Yams) plug-in is unavailable') + pass -salome_pluginsmanager.AddFunction('ReMesh with MGCleaner', - 'Run MGCleaner', - MGCleanerLct) +try: + from MGCleanerplug_plugin import MGCleanerLct + salome_pluginsmanager.AddFunction('ReMesh with MGCleaner', + 'Run MGCleaner', + MGCleanerLct) +except: + salome_pluginsmanager.logger.info('ERROR: MGCleaner plug-in is unavailable') + pass -salome_pluginsmanager.AddFunction('Meshed Pipe with a crack', - 'Create a mesh with blocFissure tool', - fissureCoudeDlg) +try: + from blocFissure.ihm.fissureCoude_plugin import fissureCoudeDlg + salome_pluginsmanager.AddFunction('Meshed Pipe with a crack', + 'Create a mesh with blocFissure tool', + fissureCoudeDlg) +except: + salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable') + pass # ZCracks plugin requires the module EFICAS to be installed # thus it is first tested if this module is available before # adding the plugin to salome_pluginsmanager -enable_zcracks = True try: import eficasSalome -except: - enable_zcracks = False - -if enable_zcracks: from zcracks_plugin import ZcracksLct salome_pluginsmanager.AddFunction('Run Zcrack', 'Run Zcrack', ZcracksLct) +except: + salome_pluginsmanager.logger.info('ERROR: Zcrack plug-in is unavailable') + pass From 82a86d922ea23de26a081646419639237faeb1b5 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 5 Feb 2016 16:51:01 +0300 Subject: [PATCH 074/147] 53061: "Clear mesh data" removes too many (if !HasShapeToMesh()) --- doc/salome/gui/SMESH/input/about_meshes.doc | 5 +++-- src/SMESH_I/SMESH_Mesh_i.cxx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc index 9d92487c5..621a47e99 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.doc +++ b/doc/salome/gui/SMESH/input/about_meshes.doc @@ -110,9 +110,10 @@ SALOME supports elements of second order, without a central node (quadratic triangle, quadrangle, polygon, tetrahedron, hexahedron, pentahedron and pyramid) and with central nodes (bi-quadratic triangle and quadrangle and tri-quadratic hexahedron).
      -Quadratic mesh can be obtained in two ways: +Quadratic mesh can be obtained in three ways: - Using a global \ref quadratic_mesh_anchor "Quadratic Mesh" hypothesis. (Elements with the central node are not generated in this way). - Using \ref convert_to_from_quadratic_mesh_page operation. - +- Using an appropriate option of some meshing algorithms, which +generate elements of several dimensions starting from mesh segments. */ diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 728a75ddb..b025573b9 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -293,7 +293,7 @@ void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) - _preMeshInfo->ForgetAllData(); + _preMeshInfo->ForgetOrLoad(); // load in case if !HasShapeToMesh() try { _impl->Clear(); From db1bdbcddcfce75757ac8b446feef6d78b2f2a17 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 11 Feb 2016 18:11:47 +0300 Subject: [PATCH 075/147] 53068: Create Mesh dialog box is frozen --- .../SMESH/input/selection_filter_library.doc | 32 ++++++++++++------- src/SMESHGUI/SMESHGUI_Hypotheses.cxx | 20 ++++++++---- src/StdMeshers/StdMeshers_NumberOfLayers.cxx | 2 +- .../StdMeshersGUI_StdHypothesisCreator.cxx | 12 +++++-- 4 files changed, 45 insertions(+), 21 deletions(-) diff --git a/doc/salome/gui/SMESH/input/selection_filter_library.doc b/doc/salome/gui/SMESH/input/selection_filter_library.doc index 7189ccc43..c87d928e8 100644 --- a/doc/salome/gui/SMESH/input/selection_filter_library.doc +++ b/doc/salome/gui/SMESH/input/selection_filter_library.doc @@ -5,8 +5,8 @@ \n Selection filter library allows creating and storing in files the filters that can be later reused for operations on meshes. You can access it from the Main Menu via Tools / Selection filter library. -It is also possible to save any filter by invoking the filter library -from \a Filter dialog launched from any mesh operation. +It is also possible to save/load a filter by invoking the filter library +from \ref filtering_elements "Filter dialog" launched from any mesh operation. \image html selectionfilterlibrary.png @@ -19,6 +19,7 @@ the current study. You can \b Add or \b Delete filters. filter. By default it is prefixed with the corresponding entity type. \anchor filtering_elements +

      Filter Dialog

      When we use filters during group creation or another operation (by clicking Set Filter button in the corresponding dialog), the @@ -66,15 +67,22 @@ created. You have to select the mesh and the button will be enabled. Some criteria are applicable to all Entity types:
      • Belong to Geom selects entities whose all nodes lie on the -shape defined by Threshold Value. If the threshold shape is a -sub-shape of the main shape of the mesh the algorithm works faster, if -this is any other shape the algorithm works slower. +shape defined by Threshold Value. +If the threshold shape is a sub-shape of the main shape of the mesh, +the filtering algorithm works faster because node-to-shape association +is used instead of measuring distance between nodes and the shape, and +\b Tolerance is not used. If the threshold shape is any other shape, +the algorithm works slower because distance between nodes and the +shape is measured and is compared with \b Tolerance.
      • Lying on Geom selects entities whose at least one node lies on the shape defined by the Threshold Value. -If the threshold shape is a sub-shape of the main shape of the mesh the -algorithm works faster, if this is any other -shape, the algorithm works slower. +If the threshold shape is a sub-shape of the main shape of the mesh, +the filtering algorithm works faster because node-to-shape association +is used instead of measuring distance between nodes and the shape, and +\b Tolerance is not used. If the threshold shape is any other shape, +the algorithm works slower because distance between nodes and the +shape is measured and is compared with \b Tolerance.
      • Belong to Mesh Group selects entities included into the mesh group defined by the Threshold Value. @@ -97,7 +105,7 @@ other parts. Threshold Value locating any element of the domain can be ei
      -Some criteria are applicable to all Entity types of dimension +Some criteria are applicable to entities of dimension more than zero, i.e. to \b Edges, \b Faces and \b Volumes:
      • Linear allows selection of Linear or Quadratic elements (if Unary is set to "Not") @@ -111,8 +119,8 @@ as a combination of geometry type and the number of nodes.
      -The following criteria are applicable to all Entity types -except for Volumes: +The following criteria are applicable to Entities of \b all types +except for \a Volumes:
      • Belong to Plane selects entities whose all nodes belong to a specified plane within a given Tolerance. @@ -222,7 +230,7 @@ diagonals with a value of length, which is more, less or equal
      -The following criteria allow selecting mesh Volumes: +The following criteria allow selecting mesh Volumes:
      • Aspect ratio 3D selects 3D mesh elements with an aspect ratio (see also an \ref aspect_ratio_3d_page "Aspect Ratio 3D quality control"), which is more, less or equal diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 7d1495845..504607da5 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -41,6 +41,7 @@ #include #include #include +#include // Qt includes #include @@ -273,13 +274,20 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) bool res = result==QDialog::Accepted; if( res ) { - SUIT_OverrideCursor wc; - /*QString paramValues = */storeParams(); + try + { + SUIT_OverrideCursor wc; + storeParams(); // No longer needed since NoteBook appears and "Value" OB field shows names of variable -// if ( !paramValues.isEmpty() ) { -// if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo )) -// SMESH::SetValue( SHyp, paramValues ); -// } + // QString paramValues = storeParams(); + // if ( !paramValues.isEmpty() ) { + // if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo )) + // SMESH::SetValue( SHyp, paramValues ); + // } + } + catch ( const SALOME::SALOME_Exception& S_ex ) { + SalomeApp_Tools::QtCatchCorbaException( S_ex ); + } } changeWidgets().clear(); diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx index f3fa3104c..0e245845d 100644 --- a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx @@ -77,7 +77,7 @@ void StdMeshers_NumberOfLayers::SetNumberOfLayers(int numberOfLayers) { if ( _nbLayers != numberOfLayers ) { if ( numberOfLayers <= 0 ) - throw SALOME_Exception(LOCALIZED("numberOfLayers must be positive")); + throw SALOME_Exception(LOCALIZED("numberOfLayers must be more than zero")); _nbLayers = numberOfLayers; NotifySubMeshesHypothesisModification(); diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index ea722142c..a9b778282 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -30,7 +30,6 @@ #include #include #include - #include #include @@ -47,8 +46,9 @@ #include // SALOME GUI includes -#include #include +#include +#include // IDL includes #include @@ -1383,6 +1383,14 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int) sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" ); } } + else if ( SalomeApp_IntSpinBox* sb = qobject_cast< SalomeApp_IntSpinBox* >( w )) + { + if ( hypType().startsWith( "NumberOfLayers" ) || + hypType().startsWith( "ViscousLayers" )) + { + sb->setMinimum( 1 ); + } + } } //================================================================================ From 7807a4244d9f114bca7123b743cebe837ffbf7bd Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 12 Feb 2016 19:16:28 +0300 Subject: [PATCH 076/147] 23236: EDF 12346 - Problem with Local Size --- src/PluginUtils/GeomSelectionTools.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/PluginUtils/GeomSelectionTools.cxx b/src/PluginUtils/GeomSelectionTools.cxx index 03151a640..9faf99ec3 100644 --- a/src/PluginUtils/GeomSelectionTools.cxx +++ b/src/PluginUtils/GeomSelectionTools.cxx @@ -28,17 +28,15 @@ #include #include -#include -#include -#include -#include #include +#include #include +#include +#include -#include -#include -#include #include +#include +#include #include "utilities.h" @@ -237,6 +235,12 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){ // MESSAGE("GEOM client is OK and GEOM engine is not null"); S = aClient->GetShape( _geomEngine, aShape ); ShapeType=S.ShapeType(); + if ( ShapeType == TopAbs_COMPOUND ) + { + TopoDS_Iterator it( S ); + if ( it.More() ) + ShapeType = it.Value().ShapeType(); + } } } } @@ -275,7 +279,6 @@ GeomAbs_SurfaceType GeomSelectionTools::getFaceInformation(TopoDS_Shape S) GeomAbs_SurfaceType surf_type=GeomAbs_OtherSurface ; if (!S.IsNull() && S.ShapeType()==TopAbs_FACE){ TopoDS_Face f=TopoDS::Face(S); - Handle(Geom_Surface) surf = BRep_Tool::Surface(f); BRepAdaptor_Surface surf_adap(f); /* Global Information */ From 330463b25243ae3f9339edb4d4009d403931bde1 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 12 Feb 2016 23:21:05 +0100 Subject: [PATCH 077/147] plugin dialog blocFissure general --- src/Tools/blocFissure/ihm/CMakeLists.txt | 1 + src/Tools/blocFissure/ihm/fissureGenerale.ui | 190 ++++++++--- .../blocFissure/ihm/fissureGenerale_plugin.py | 297 ++++++++++++++++++ src/Tools/smesh_plugins.py | 8 + 4 files changed, 451 insertions(+), 45 deletions(-) create mode 100644 src/Tools/blocFissure/ihm/fissureGenerale_plugin.py diff --git a/src/Tools/blocFissure/ihm/CMakeLists.txt b/src/Tools/blocFissure/ihm/CMakeLists.txt index 0ee274979..24e80f8ea 100644 --- a/src/Tools/blocFissure/ihm/CMakeLists.txt +++ b/src/Tools/blocFissure/ihm/CMakeLists.txt @@ -26,6 +26,7 @@ SET(plugin_SCRIPTS __init__.py fissureCoude_ihm.py fissureCoude_plugin.py + fissureGenerale_plugin.py dialogFissureCoude.dic ) diff --git a/src/Tools/blocFissure/ihm/fissureGenerale.ui b/src/Tools/blocFissure/ihm/fissureGenerale.ui index 3f1528ff0..3f2cf9c3d 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale.ui +++ b/src/Tools/blocFissure/ihm/fissureGenerale.ui @@ -7,7 +7,7 @@ 0 0 631 - 490 + 560 @@ -16,51 +16,13 @@ <html><head/><body><p>Insertion d'un maillage de fissure dans un maillage hexaédrique sain.</p><p>Le maillage sain est fourni sous forme de fichier Med.</p><p>La face de fissure est décrite par une géométrie dans un fichier brep.</p><p>La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.</p><p>La procédure identfie des mailles saines à enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone à remailler en tétraèdres.</p></body></html> - - + + maillage sain et géometries de fissure - - - - - - <html><head/><body><p>sélection du fichier med du maillage sain (hexaèdres)</p></body></html> - - - maillage sain - - - - - - - <html><head/><body><p>fichier med du maillage sain (hexaèdres)</p></body></html> - - - - - - - <html><head/><body><p>sélection du fichier brep (géométrie) décrivant la face de fissure.</p></body></html> - - - face fissure - - - - - - - <html><head/><body><p>fichier brep (géométrie) décrivant la face de fissure.</p></body></html> - - - - - @@ -92,12 +54,50 @@ + + + + + + <html><head/><body><p>fichier med du maillage sain (hexaèdres)</p></body></html> + + + + + + + <html><head/><body><p>sélection du fichier brep (géométrie) décrivant la face de fissure.</p></body></html> + + + face fissure + + + + + + + <html><head/><body><p>fichier brep (géométrie) décrivant la face de fissure.</p></body></html> + + + + + + + <html><head/><body><p>sélection du fichier med du maillage sain (hexaèdres)</p></body></html> + + + maillage sain + + + + + - + @@ -119,6 +119,9 @@ <html><head/><body><p>La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.</p></body></html> + + 5 + @@ -156,6 +159,9 @@ <html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html> + + 5 + 1000000.000000000000000 @@ -173,6 +179,9 @@ <html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html> + + 5 + 1000000.000000000000000 @@ -225,6 +234,9 @@ <html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>Rayon du pipe.</p></body></html> + + 5 + 1000000.000000000000000 @@ -242,6 +254,9 @@ <html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>Longueur des mailles le long de la ligne de fond de fissure.</p></body></html> + + 5 + 1000000.000000000000000 @@ -329,6 +344,9 @@ <html><head/><body><p>Faces externes de la zone à remailler.</p><p>Mailage en triangles : valeur cible des arêtes.</p></body></html> + + 5 + 1000000.000000000000000 @@ -368,7 +386,7 @@ - + Qt::Vertical @@ -381,8 +399,90 @@ - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 24 + + + + --- Calcul en cours --- + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + réinitialisation de tous les paramètres à leur valeur par défaut + + + Reset + + + + + + + réinitialisation de tous les paramètres à leur valeur de la précédente éxécution + + + Précédent + + + + + + + réinitialisation des paramètres à partir d'un fichier préalablement sauvegardé + + + Recharger + + + + + + + sauvegarde des paramètres dans un fichier à choisir + + + Sauver + + + diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py new file mode 100644 index 000000000..c0a208059 --- /dev/null +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -0,0 +1,297 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2006-2015 EDF R&D +# +# 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. +# +# 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 +# + +# if you already have plugins defined in a salome_plugins.py file, add this file at the end. +# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py + +import sys, traceback +import math +from blocFissure import gmu +from blocFissure.gmu import initLog +#initLog.setDebug() +initLog.setVerbose() + +from blocFissure.gmu import geomsmesh +from blocFissure.gmu.casStandard import casStandard + +def fissureGeneraleDlg(context): + # get context study, studyId, salomeGui + study = context.study + studyId = context.studyId + sg = context.sg + + import os + #import subprocess + #import tempfile + from PyQt4 import QtCore + from PyQt4 import QtGui + from PyQt4.QtGui import QFileDialog + from PyQt4.QtGui import QMessageBox + from PyQt4.QtGui import QPalette + from PyQt4.QtGui import QColor + from fissureGenerale_ui import Ui_Dialog + + class fissureGeneraleDialog(QtGui.QDialog): + + def __init__(self): + QtGui.QDialog.__init__(self) + # Set up the user interface from Designer. + self.ui = Ui_Dialog() + self.ui.setupUi(self) + + self.blackPalette = self.ui.dsb_influence.palette() + self.redPalette = QPalette() + self.redPalette.setColor(QPalette.Text, QColor(255,0,0)) + self.NOK = False + + self.initDefaut() + self.initDialog(self.defaut) + self.ui.lb_calcul.hide() + + # Connect up the buttons. + self.connect(self.ui.pb_valPrec, QtCore.SIGNAL("clicked()"), + self.readValPrec) + self.connect(self.ui.pb_reset, QtCore.SIGNAL("clicked()"), + self.resetVal) + self.connect(self.ui.pb_recharger, QtCore.SIGNAL("clicked()"), + self.recharger) + self.connect(self.ui.pb_sauver, QtCore.SIGNAL("clicked()"), + self.sauver) + self.connect(self.ui.pb_maillage, QtCore.SIGNAL("clicked()"), + self.selectMaillage) + self.connect(self.ui.pb_facefiss, QtCore.SIGNAL("clicked()"), + self.selectFacefiss) + self.disconnect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"), self.accept) + self.connect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"), + self.execute) + + def initDefaut(self): + self.defaut = dict( + nomCas = 'angleCube', + maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/CubeAngle.med'), + brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), + edgeFissIds = [4], + lgInfluence = 20, + meshBrep = (5,10), + rayonPipe = 5, + lenSegPipe = 2.5, + nbSegRad = 5, + nbSegCercle = 32, + areteFaceFissure = 10) + + + def initDialog(self, dico): + self.ui.le_maillage.setText(dico['maillageSain']) + self.ui.le_facefiss.setText(dico['brepFaceFissure']) + self.ui.le_fondfiss.setText(str(dico['edgeFissIds'])) + self.ui.dsb_influence.setValue(dico['lgInfluence']) + self.ui.dsb_meshBrepMin.setValue(dico['meshBrep'][0]) + self.ui.dsb_meshBrepMax.setValue(dico['meshBrep'][1]) + self.ui.dsb_rayonPipe.setValue(dico['rayonPipe']) + self.ui.dsb_lenSegPipe.setValue(dico['lenSegPipe']) + self.ui.sb_couronnes.setValue(dico['nbSegRad']) + self.ui.sb_secteurs.setValue(dico['nbSegCercle']) + self.ui.dsb_areteFaceFissure.setValue(dico['areteFaceFissure']) + incomplet = self.testval(dico) + pass + + def testval(self, dico): + incomplet = False + if not os.path.lexists(dico['maillageSain']): + self.ui.le_maillage.setPalette(self.redPalette) + incomplet = True + else: + self.ui.le_maillage.setPalette(self.blackPalette) + if not os.path.lexists(dico['brepFaceFissure']): + self.ui.le_facefiss.setPalette(self.redPalette) + incomplet = True + else: + self.ui.le_facefiss.setPalette(self.blackPalette) + edgeFissIdsOK=True + try: + l = dico['edgeFissIds'] + for i in l: + if not isinstance(i, int): + print"not isinstance(i, int)" + incomplet = True + edgeFissIdsOK=False + break + except: + print "except eval" + incomplet = True + edgeFissIdsOK=False + if edgeFissIdsOK: + self.ui.le_fondfiss.setPalette(self.blackPalette) + else: + self.ui.le_fondfiss.setPalette(self.redPalette) + if dico['meshBrep'][0] == 0: + self.ui.dsb_meshBrepMin.setPalette(self.redPalette) + incomplet = True + else: + self.ui.dsb_meshBrepMin.setPalette(self.blackPalette) + if dico['meshBrep'][1] == 0: + self.ui.dsb_meshBrepMax.setPalette(self.redPalette) + incomplet = True + else: + self.ui.dsb_meshBrepMax.setPalette(self.blackPalette) + if dico['rayonPipe'] == 0: + self.ui.dsb_rayonPipe.setPalette(self.redPalette) + incomplet = True + else: + self.ui.dsb_rayonPipe.setPalette(self.blackPalette) + if dico['lenSegPipe'] == 0: + self.ui.dsb_lenSegPipe.setPalette(self.redPalette) + incomplet = True + else: + self.ui.dsb_lenSegPipe.setPalette(self.blackPalette) + if dico['areteFaceFissure'] == 0: + self.ui.dsb_areteFaceFissure.setPalette(self.redPalette) + incomplet = True + else: + self.ui.dsb_areteFaceFissure.setPalette(self.blackPalette) + + print "incomplet: ", incomplet + return incomplet + + def fileDefault(self): + filedef = os.path.expanduser("~/.config/salome/dialogFissureGenerale.dic") + print filedef + return filedef + + def writeDefault(self, dico): + filedef = self.fileDefault() + f = open(filedef, 'w') + f.write(str(dico)) + f.close() + + def readValPrec(self): + filedef = self.fileDefault() + if os.path.exists(filedef): + f = open(filedef, 'r') + txt = f.read() + dico = eval(txt) + print dico + self.initDialog(dico) + + def resetVal(self): + #self.initDefaut() + self.initDialog(self.defaut) + + def sauver(self): + print "sauver" + fileDiag = QFileDialog(self) + fileDiag.setFileMode(QFileDialog.AnyFile) + fileDiag.setNameFilter("Parametres *.dic (*.dic)") + fileDiag.setViewMode(QFileDialog.List) + if fileDiag.exec_() : + fileNames = fileDiag.selectedFiles() + filedef = fileNames[0] + dico = self.creeDico() + f = open(filedef, 'w') + f.write(str(dico)) + f.close() + + def recharger(self): + print "recharger" + fileDiag = QFileDialog(self) + fileDiag.setFileMode(QFileDialog.ExistingFile) + fileDiag.setNameFilter("Parametres *.dic (*.dic)") + fileDiag.setViewMode(QFileDialog.Detail) + if fileDiag.exec_() : + fileNames = fileDiag.selectedFiles() + filedef = fileNames[0] + print filedef + if os.path.exists(filedef): + f = open(filedef, 'r') + txt = f.read() + dico = eval(txt) + print dico + self.initDialog(dico) + + def selectMaillage(self): + fileDiag = QFileDialog(self) + fileDiag.setFileMode(QFileDialog.ExistingFile) + fileDiag.setNameFilter("Maillage *.med (*.med)") + fileDiag.setViewMode(QFileDialog.Detail) + if fileDiag.exec_() : + fileNames = fileDiag.selectedFiles() + filedef = fileNames[0] + print filedef + self.ui.le_maillage.setText(filedef) + + def selectFacefiss(self): + fileDiag = QFileDialog(self) + fileDiag.setFileMode(QFileDialog.ExistingFile) + fileDiag.setNameFilter("Face fissure *.brep (*.brep)") + fileDiag.setViewMode(QFileDialog.Detail) + if fileDiag.exec_() : + fileNames = fileDiag.selectedFiles() + filedef = fileNames[0] + print filedef + self.ui.le_facefiss.setText(filedef) + + def creeDico(self): + dico = dict( + maillageSain = str(self.ui.le_maillage.text()), + brepFaceFissure = str(self.ui.le_facefiss.text()), + edgeFissIds = eval(str(self.ui.le_fondfiss.text())), + lgInfluence = self.ui.dsb_influence.value(), + meshBrep = [self.ui.dsb_meshBrepMin.value(),self.ui.dsb_meshBrepMax.value()], + rayonPipe = self.ui.dsb_rayonPipe.value(), + lenSegPipe = self.ui.dsb_lenSegPipe.value(), + nbSegRad = self.ui.sb_couronnes.value(), + nbSegCercle = self.ui.sb_secteurs.value(), + areteFaceFissure = self.ui.dsb_areteFaceFissure.value() + ) + print dico + return dico + + def checkValues(self): + return self.NOK + + def execute(self): + dico = self.creeDico() + NOK = self.testval(dico) + if not(NOK): + self.writeDefault(dico) + self.ui.lb_calcul.show() + execInstance = casStandard(dico) + self.NOK = NOK + self.accept() + + pass + +# ---------------------------------------------------------------------------- + + window = fissureGeneraleDialog() + retry = True + while(retry): + retry = False + window.exec_() + result = window.result() + if result: + # dialog accepted + print "dialog accepted, check" + retry = window.checkValues() + else: + print "dialog rejected, exit" + pass + diff --git a/src/Tools/smesh_plugins.py b/src/Tools/smesh_plugins.py index c82bb172d..330f4482d 100644 --- a/src/Tools/smesh_plugins.py +++ b/src/Tools/smesh_plugins.py @@ -66,6 +66,14 @@ try: except: salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable') pass +try: + from blocFissure.ihm.fissureGenerale_plugin import fissureGeneraleDlg + salome_pluginsmanager.AddFunction('Add a crack in a mesh', + 'Insert a crack in an hexahedral mesh with blocFissure tool', + fissureGeneraleDlg) +except: + salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable') + pass # ZCracks plugin requires the module EFICAS to be installed # thus it is first tested if this module is available before From 20248b6e76a67595f7f449a71ebbf18c13429389 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 15 Feb 2016 15:08:20 +0300 Subject: [PATCH 078/147] 23237: EDF 12367 - SIGSEGV with Remove group (SMESH_Gen_i_1.cxx) IPAL53059: Not all solids are highlighted by magenta (SMESHGUI_ComputeDlg.cxx) + remove "using namespace std" from headers --- src/Controls/SMESH_Controls.cxx | 56 +++++---- src/DriverGMF/DriverGMF_Write.cxx | 8 +- src/DriverMED/DriverMED_W_Field.cxx | 10 +- src/SMDS/SMDS_Mesh.hxx | 2 +- src/SMDS/SMDS_MeshInfo.hxx | 1 - src/SMDS/SMDS_VtkVolume.cxx | 4 +- src/SMESH/SMESH_Algo.hxx | 2 +- src/SMESH/SMESH_MeshEditor.hxx | 8 +- src/SMESH/SMESH_ProxyMesh.cxx | 26 ++-- src/SMESHClient/SMESH_Client.cxx | 3 +- .../SMESHGUI_AddQuadraticElementDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 115 +++++++++++------- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 2 +- src/SMESHUtils/SMESH_Comment.hxx | 18 ++- src/SMESHUtils/SMESH_FreeBorders.cxx | 8 +- src/SMESH_I/SMESH_DumpPython.cxx | 2 +- src/SMESH_I/SMESH_Filter_i.cxx | 2 +- src/SMESH_I/SMESH_Gen_i.hxx | 32 ++--- src/SMESH_I/SMESH_Gen_i_1.cxx | 27 ++-- src/SMESH_I/SMESH_Group_i.cxx | 12 +- src/SMESH_I/SMESH_Measurements_i.cxx | 12 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 18 +-- src/SMESH_I/SMESH_MeshEditor_i.hxx | 3 +- src/SMESH_I/SMESH_Pattern_i.cxx | 2 + src/SMESH_I/SMESH_PreMeshInfo.cxx | 55 +++++---- .../StdMeshers_CompositeHexa_3D.cxx | 1 + .../StdMeshers_CompositeHexa_3D.hxx | 18 +-- src/StdMeshers/StdMeshers_FaceSide.cxx | 22 ++-- src/StdMeshers/StdMeshers_Geometric1D.cxx | 2 +- src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx | 2 + src/StdMeshers/StdMeshers_Prism_3D.hxx | 2 +- src/StdMeshers/StdMeshers_Projection_3D.cxx | 1 + .../StdMeshers_QuadFromMedialAxis_1D2D.cxx | 2 + src/StdMeshers/StdMeshers_Quadrangle_2D.hxx | 2 +- .../StdMeshers_SegmentAroundVertex_0D.cxx | 17 +-- .../StdMeshers_CartesianParameters3D_i.cxx | 12 +- src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx | 2 +- .../StdMeshers_Reversible1D_i.cxx | 2 +- 38 files changed, 282 insertions(+), 235 deletions(-) diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 0623399e9..bc79e1fc7 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -175,7 +175,7 @@ namespace { n += q2 ^ q3; } double len = n.Modulus(); - bool zeroLen = ( len <= numeric_limits::min()); + bool zeroLen = ( len <= std::numeric_limits::min()); if ( !zeroLen ) n /= len; @@ -312,12 +312,12 @@ double NumericalFunctor::Round( const double & aVal ) */ //================================================================================ -void NumericalFunctor::GetHistogram(int nbIntervals, - std::vector& nbEvents, - std::vector& funValues, - const vector& elements, - const double* minmax, - const bool isLogarithmic) +void NumericalFunctor::GetHistogram(int nbIntervals, + std::vector& nbEvents, + std::vector& funValues, + const std::vector& elements, + const double* minmax, + const bool isLogarithmic) { if ( nbIntervals < 1 || !myMesh || @@ -336,7 +336,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals, } else { - vector::const_iterator id = elements.begin(); + std::vector::const_iterator id = elements.begin(); for ( ; id != elements.end(); ++id ) values.insert( GetValue( *id )); } @@ -2163,7 +2163,7 @@ bool BareBorderVolume::IsSatisfy(long theElementId ) if ( myTool.IsFreeFace( iF )) { const SMDS_MeshNode** n = myTool.GetFaceNodes(iF); - vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF)); + std::vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF)); if ( !myMesh->FindElement( nodes, SMDSAbs_Face, /*Nomedium=*/false)) return true; } @@ -2302,15 +2302,15 @@ void CoincidentNodes::SetMesh( const SMDS_Mesh* theMesh ) while ( nIt->more() ) nodesToCheck.insert( nodesToCheck.end(), nIt->next() ); - list< list< const SMDS_MeshNode*> > nodeGroups; + std::list< std::list< const SMDS_MeshNode*> > nodeGroups; SMESH_OctreeNode::FindCoincidentNodes ( nodesToCheck, &nodeGroups, myToler ); myCoincidentIDs.Clear(); - list< list< const SMDS_MeshNode*> >::iterator groupIt = nodeGroups.begin(); + std::list< std::list< const SMDS_MeshNode*> >::iterator groupIt = nodeGroups.begin(); for ( ; groupIt != nodeGroups.end(); ++groupIt ) { - list< const SMDS_MeshNode*>& coincNodes = *groupIt; - list< const SMDS_MeshNode*>::iterator n = coincNodes.begin(); + std::list< const SMDS_MeshNode*>& coincNodes = *groupIt; + std::list< const SMDS_MeshNode*>::iterator n = coincNodes.begin(); for ( ; n != coincNodes.end(); ++n ) myCoincidentIDs.Add( (*n)->GetID() ); } @@ -2342,7 +2342,7 @@ bool CoincidentElements::IsSatisfy( long theElementId ) if ( const SMDS_MeshElement* e = myMesh->FindElement( theElementId )) { if ( e->GetType() != GetType() ) return false; - set< const SMDS_MeshNode* > elemNodes( e->begin_nodes(), e->end_nodes() ); + std::set< const SMDS_MeshNode* > elemNodes( e->begin_nodes(), e->end_nodes() ); const int nbNodes = e->NbNodes(); SMDS_ElemIteratorPtr invIt = (*elemNodes.begin())->GetInverseElementIterator( GetType() ); while ( invIt->more() ) @@ -2589,18 +2589,20 @@ bool FreeFaces::IsSatisfy( long theId ) int nbNode = aFace->NbNodes(); // collect volumes to check that number of volumes with count equal nbNode not less than 2 - typedef map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters - typedef map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator + typedef std::map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters + typedef std::map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator TMapOfVolume mapOfVol; SMDS_ElemIteratorPtr nodeItr = aFace->nodesIterator(); - while ( nodeItr->more() ) { + while ( nodeItr->more() ) + { const SMDS_MeshNode* aNode = static_cast(nodeItr->next()); if ( !aNode ) continue; SMDS_ElemIteratorPtr volItr = aNode->GetInverseElementIterator(SMDSAbs_Volume); - while ( volItr->more() ) { + while ( volItr->more() ) + { SMDS_MeshElement* aVol = (SMDS_MeshElement*)volItr->next(); - TItrMapOfVolume itr = mapOfVol.insert(make_pair(aVol, 0)).first; + TItrMapOfVolume itr = mapOfVol.insert( std::make_pair( aVol, 0 )).first; (*itr).second++; } } @@ -2704,8 +2706,8 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh ) return; // iterates on groups and find necessary elements ids - const std::set& aGroups = aMesh->GetGroups(); - set::const_iterator GrIt = aGroups.begin(); + const std::set& aGroups = aMesh->GetGroups(); + std::set::const_iterator GrIt = aGroups.begin(); for (; GrIt != aGroups.end(); GrIt++) { SMESHDS_GroupBase* aGrp = (*GrIt); @@ -2932,10 +2934,10 @@ void ConnectedElements::SetPoint( double x, double y, double z ) // find myNodeID by myXYZ if possible if ( myMeshModifTracer.GetMesh() ) { - auto_ptr searcher + SMESHUtils::Deleter searcher ( SMESH_MeshAlgos::GetElementSearcher( (SMDS_Mesh&) *myMeshModifTracer.GetMesh() )); - vector< const SMDS_MeshElement* > foundElems; + std::vector< const SMDS_MeshElement* > foundElems; searcher->FindElementsByPoint( gp_Pnt(x,y,z), SMDSAbs_All, foundElems ); if ( !foundElems.empty() ) @@ -2961,7 +2963,7 @@ bool ConnectedElements::IsSatisfy( long theElementId ) if ( !node0 ) return false; - list< const SMDS_MeshNode* > nodeQueue( 1, node0 ); + std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 ); std::set< int > checkedNodeIDs; // algo: // foreach node in nodeQueue: @@ -3050,8 +3052,8 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) const double cosTol = Cos( myToler * M_PI / 180. ); NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks; - std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue; - faceQueue.push_back( make_pair( face, myNorm )); + std::list< std::pair< const SMDS_MeshElement*, gp_Vec > > faceQueue; + faceQueue.push_back( std::make_pair( face, myNorm )); while ( !faceQueue.empty() ) { face = faceQueue.front().first; @@ -3074,7 +3076,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh ) if (!normOK || isLessAngle( myNorm, norm, cosTol)) { myCoplanarIDs.Add( f->GetID() ); - faceQueue.push_back( make_pair( f, norm )); + faceQueue.push_back( std::make_pair( f, norm )); } } } diff --git a/src/DriverGMF/DriverGMF_Write.cxx b/src/DriverGMF/DriverGMF_Write.cxx index 963f1bc17..5beadcd17 100644 --- a/src/DriverGMF/DriverGMF_Write.cxx +++ b/src/DriverGMF/DriverGMF_Write.cxx @@ -70,9 +70,9 @@ extern "C" elem->getshapeId() ); \ }} -#define END_ELEM_WRITE_ADD_TO_MAP( elem, e2id ) \ - elem->getshapeId() ); \ - e2id.insert( e2id.end(), make_pair( elem, gmfID )); \ +#define END_ELEM_WRITE_ADD_TO_MAP( elem, e2id ) \ + elem->getshapeId() ); \ + e2id.insert( e2id.end(), std::make_pair( elem, gmfID )); \ }} #define END_EXTRA_VERTICES_WRITE() \ @@ -145,7 +145,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform() const SMDS_MeshNode* n = nodeIt->next(); n->GetXYZ( xyz ); GmfSetLin( meshID, GmfVertices, xyz[0], xyz[1], xyz[2], n->getshapeId() ); - node2IdMap.insert( node2IdMap.end(), make_pair( n, ++iN )); + node2IdMap.insert( node2IdMap.end(), std::make_pair( n, ++iN )); } if ( iN != nbNodes ) return addMessage("Wrong nb of nodes returned by nodesIterator", /*fatal=*/true); diff --git a/src/DriverMED/DriverMED_W_Field.cxx b/src/DriverMED/DriverMED_W_Field.cxx index e40aac434..5fa6a6317 100644 --- a/src/DriverMED/DriverMED_W_Field.cxx +++ b/src/DriverMED/DriverMED_W_Field.cxx @@ -95,7 +95,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh, if ( _nbElemsByGeom.empty() || _elemType != type ) { _elemType = type; - _nbElemsByGeom.resize( 1, make_pair( SMDSEntity_Last, 0 )); + _nbElemsByGeom.resize( 1, std::make_pair( SMDSEntity_Last, 0 )); // count nb of elems of each geometry for ( int iG = 0; iG < SMDSEntity_Last; ++iG ) @@ -107,7 +107,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh, nbElems = mesh->GetMeshInfo().NbElements( geom ); if ( nbElems < 1 ) continue; - _nbElemsByGeom.push_back( make_pair( geom, nbElems + _nbElemsByGeom.back().second )); + _nbElemsByGeom.push_back( std::make_pair( geom, nbElems + _nbElemsByGeom.back().second )); } // add nodes of missing 0D elements on VERTEXes if ( _addODOnVertices && _elemType == SMDSAbs_0DElement ) @@ -118,8 +118,8 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh, if ( !nodes.empty() ) { if ( _nbElemsByGeom.size() == 1 ) - _nbElemsByGeom.push_back( make_pair( SMDSEntity_0D, 0)); - _nbElemsByGeom.push_back( make_pair( SMDSEntity_Node, + _nbElemsByGeom.push_back( std::make_pair( SMDSEntity_0D, 0)); + _nbElemsByGeom.push_back( std::make_pair( SMDSEntity_Node, nodes.size() + _nbElemsByGeom.back().second )); } } @@ -314,7 +314,7 @@ Driver_Mesh::Status DriverMED_W_Field::Perform() SMDSAbs_EntityType smdsType = _nbElemsByGeom[iG].first; MED::EGeometrieElement medType = (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType ); int nbElems = _nbElemsByGeom[iG].second - _nbElemsByGeom[iG-1].second; - type2nb.insert( make_pair( medType, nbElems )); + type2nb.insert( std::make_pair( medType, nbElems )); } MED::EEntiteMaillage entity = ( _elemType == SMDSAbs_Node ? MED::eNOEUD : MED::eMAILLE ); diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index b561d7571..d233a00a3 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -747,7 +747,7 @@ public: void incrementNodesCapacity(int nbNodes); void incrementCellsCapacity(int nbCells); void adjustStructure(); - void dumpGrid(string ficdump="dumpGrid"); + void dumpGrid(std::string ficdump="dumpGrid"); static int chunkSize; //! low level modification: add, change or remove node or element diff --git a/src/SMDS/SMDS_MeshInfo.hxx b/src/SMDS/SMDS_MeshInfo.hxx index 4c6dba726..b0ccc82fa 100644 --- a/src/SMDS/SMDS_MeshInfo.hxx +++ b/src/SMDS/SMDS_MeshInfo.hxx @@ -25,7 +25,6 @@ #define SMDS_MeshInfo_HeaderFile #include -using namespace std; #include "SMESH_SMDS.hxx" diff --git a/src/SMDS/SMDS_VtkVolume.cxx b/src/SMDS/SMDS_VtkVolume.cxx index d6da43579..efc0f786c 100644 --- a/src/SMDS/SMDS_VtkVolume.cxx +++ b/src/SMDS/SMDS_VtkVolume.cxx @@ -95,7 +95,7 @@ void SMDS_VtkVolume::initPoly(const std::vector& nodeIds, SMDS_UnstructuredGrid* grid = mesh->getGrid(); //double center[3]; //this->gravityCenter(grid, &nodeIds[0], nodeIds.size(), ¢er[0]); - vector ptIds; + std::vector ptIds; vtkIdType nbFaces = nbNodesPerFace.size(); int k = 0; for (int i = 0; i < nbFaces; i++) @@ -365,7 +365,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetFaceNode(const int face_ind, const int n */ std::vector SMDS_VtkVolume::GetQuantities() const { - vector quantities; + std::vector quantities; SMDS_Mesh *mesh = SMDS_Mesh::_meshList[myMeshId]; vtkUnstructuredGrid* grid = mesh->getGrid(); vtkIdType aVtkType = grid->GetCellType(this->myVtkID); diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 6363dc469..a362ed290 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -215,7 +215,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis * have a name (type) listed in the algorithm. Hypothesis associated to * father shape -are not- taken into account (see GetUsedHypothesis) */ - const list & + const std::list & GetAppliedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool ignoreAuxiliary=true) const; diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index a2039ac8a..f9695c9a1 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -93,11 +93,11 @@ public: SMESH_EXPORT ElemFeatures& Init( double diameter ) { myType = SMDSAbs_Ball; myBallDiameter = diameter; return *this; } - SMESH_EXPORT ElemFeatures& Init( vector& quanities, bool isQuad=false ) + SMESH_EXPORT ElemFeatures& Init( std::vector& quanities, bool isQuad=false ) { myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad; myPolyhedQuantities.swap( quanities ); return *this; } - SMESH_EXPORT ElemFeatures& Init( const vector& quanities, bool isQuad=false ) + SMESH_EXPORT ElemFeatures& Init( const std::vector& quanities, bool isQuad=false ) { myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad; myPolyhedQuantities = quanities; return *this; } @@ -777,8 +777,8 @@ public: const bool theHasRefPoint, const gp_Pnt& theRefPoint, const bool theMakeGroups); - void LinearAngleVariation(const int NbSteps, - list& theAngles); + void LinearAngleVariation(const int NbSteps, + std::list& theAngles); bool doubleNodes( SMESHDS_Mesh* theMeshDS, const TIDSortedElemSet& theElems, diff --git a/src/SMESH/SMESH_ProxyMesh.cxx b/src/SMESH/SMESH_ProxyMesh.cxx index 962ba92a5..5271a6c17 100644 --- a/src/SMESH/SMESH_ProxyMesh.cxx +++ b/src/SMESH/SMESH_ProxyMesh.cxx @@ -45,7 +45,7 @@ SMESH_ProxyMesh::SMESH_ProxyMesh():_mesh(0) */ //================================================================================ -SMESH_ProxyMesh::SMESH_ProxyMesh(vector& components): +SMESH_ProxyMesh::SMESH_ProxyMesh(std::vector& components): _mesh(0) { if ( components.empty() ) return; @@ -68,8 +68,8 @@ SMESH_ProxyMesh::SMESH_ProxyMesh(vector& components): if ( _subMeshes[j] ) { // unite 2 sub-meshes - set< const SMDS_MeshElement * > elems( _subMeshes[j]->_elements.begin(), - _subMeshes[j]->_elements.end()); + std::set< const SMDS_MeshElement * > elems( _subMeshes[j]->_elements.begin(), + _subMeshes[j]->_elements.end()); elems.insert( m->_subMeshes[j]->_elements.begin(), m->_subMeshes[j]->_elements.end()); _subMeshes[j]->_elements.assign( elems.begin(), elems.end() ); @@ -103,7 +103,7 @@ SMESH_ProxyMesh::~SMESH_ProxyMesh() delete _subMeshes[i]; _subMeshes.clear(); - set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.begin(); + std::set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.begin(); for ( ; i != _elemsInMesh.end(); ++i ) GetMeshDS()->RemoveFreeElement( *i, 0 ); _elemsInMesh.clear(); @@ -203,12 +203,12 @@ namespace class TFilteringIterator : public SMDS_ElemIterator { - SMDS_ElemIteratorPtr _iter; - const SMDS_MeshElement * _curElem; - vector< SMDSAbs_EntityType> _okTypes; + SMDS_ElemIteratorPtr _iter; + const SMDS_MeshElement * _curElem; + std::vector< SMDSAbs_EntityType> _okTypes; public: - TFilteringIterator( const vector< SMDSAbs_EntityType>& okTypes, - const SMDS_ElemIteratorPtr& elemIterator) + TFilteringIterator( const std::vector< SMDSAbs_EntityType>& okTypes, + const SMDS_ElemIteratorPtr& elemIterator) :_iter(elemIterator), _curElem(0), _okTypes(okTypes) { next(); @@ -282,11 +282,11 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetFaces() const // ... else elements filtered using allowedTypes are additionally returned SMDS_ElemIteratorPtr facesIter = GetMeshDS()->elementsIterator(SMDSAbs_Face); SMDS_ElemIteratorPtr filterIter( new TFilteringIterator( _allowedTypes, facesIter )); - vector< SMDS_ElemIteratorPtr > iters(2); + std::vector< SMDS_ElemIteratorPtr > iters(2); iters[0] = proxyIter; iters[1] = filterIter; - typedef vector< SMDS_ElemIteratorPtr > TElemIterVector; + typedef std::vector< SMDS_ElemIteratorPtr > TElemIterVector; typedef SMDS_IteratorOnIterators TItersIter; return SMDS_ElemIteratorPtr( new TItersIter( iters )); } @@ -431,7 +431,7 @@ void SMESH_ProxyMesh::removeTmpElement( const SMDS_MeshElement* elem ) { if ( elem && elem->GetID() > 0 ) { - set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( elem ); + std::set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( elem ); if ( i != _elemsInMesh.end() ) { GetMeshDS()->RemoveFreeElement( elem, 0 ); @@ -468,7 +468,7 @@ void SMESH_ProxyMesh::setNode2Node(const SMDS_MeshNode* srcNode, SubMesh* sm = const_cast( subMesh ); if ( !subMesh->_n2n ) sm->_n2n = new TN2NMap; - sm->_n2n->insert( make_pair( srcNode, proxyNode )); + sm->_n2n->insert( std::make_pair( srcNode, proxyNode )); } //================================================================================ diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index 4c9cac353..a1cee8e4e 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -61,6 +61,7 @@ static int MYDEBUG = 0; namespace { + using std::runtime_error; //======================================================================= //function : FindNode @@ -972,7 +973,7 @@ SMESH_Client::Update(bool theIsClear) int nbNodes = anIndexes[i++]; // nodes //ASSERT( nbNodes < 9 ); - vector aNodes( nbNodes ); + std::vector aNodes( nbNodes ); for ( int iNode = 0; iNode < nbNodes; iNode++ ) aNodes[ iNode ] = FindNode( mySMDSMesh, anIndexes[i++] ); // change diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index deacb22f0..f28b8c95c 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -118,8 +118,8 @@ namespace static int FirstHexahedronIds[] = {0,1,2,3,4,5,6,7,0,1,2,3}; static int LastHexahedronIds[] = {1,2,3,0,5,6,7,4,4,5,6,7}; - static vector FirstPolygonIds; - static vector LastPolygonIds; + static std::vector FirstPolygonIds; + static std::vector LastPolygonIds; void ReverseConnectivity( std::vector & ids, SMDSAbs_EntityType type, bool toReverse, // inverse element diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 001416791..4cf85c89f 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -108,6 +108,7 @@ #define MARGIN 11 #define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" ) +#define __SHAPE_RGB__ 250, 0, 250 enum TCol { COL_ALGO = 0, COL_SHAPE, COL_ERROR, COL_SHAPEID, COL_PUBLISHED, COL_BAD_MESH, NB_COLUMNS @@ -147,10 +148,10 @@ namespace SMESH { myProperty = vtkProperty::New(); myProperty->SetRepresentationToWireframe(); - myProperty->SetColor( 250, 0, 250 ); - myProperty->SetAmbientColor( 250, 0, 250 ); - myProperty->SetDiffuseColor( 250, 0, 250 ); - //myProperty->SetSpecularColor( 250, 0, 250 ); + myProperty->SetColor( __SHAPE_RGB__ ); + myProperty->SetAmbientColor( __SHAPE_RGB__ ); + myProperty->SetDiffuseColor( __SHAPE_RGB__ ); + //myProperty->SetSpecularColor( __SHAPE_RGB__ ); myProperty->SetLineWidth( 5 ); } // ----------------------------------------------------------------------- @@ -278,13 +279,18 @@ namespace SMESH actor = GEOM_Actor::New(); if ( actor ) { actor->SetShape(shape,0,0); - actor->SetProperty(myProperty); - actor->SetShadingProperty(myProperty); - actor->SetWireframeProperty(myProperty); - actor->SetPreviewProperty(myProperty); + // actor->SetProperty(myProperty); + // actor->SetShadingProperty(myProperty); + // actor->SetWireframeProperty(myProperty); + // actor->SetPreviewProperty(myProperty); actor->PickableOff(); - // if ( shape.ShapeType() == TopAbs_EDGE ) - // actor->SubShapeOn(); + // + actor->SetWidth( myProperty->GetLineWidth() ); + actor->SetIsosWidth( myProperty->GetLineWidth() ); + actor->SetIsosColor( __SHAPE_RGB__ ); + actor->SetColor( __SHAPE_RGB__ ); + // if ( shape.ShapeType() == TopAbs_EDGE ) + // actor->SubShapeOn(); myViewWindow->AddActor( actor ); } } @@ -732,10 +738,11 @@ void SMESHGUI_ComputeDlg_QThread::cancel() //================================================================================ //================================================================================ -SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget * parent, - SMESH::SMESH_Gen_var gen, - SMESH::SMESH_Mesh_var mesh, - GEOM::GEOM_Object_var mainShape) +SMESHGUI_ComputeDlg_QThreadQDialog:: +SMESHGUI_ComputeDlg_QThreadQDialog(QWidget * parent, + SMESH::SMESH_Gen_var gen, + SMESH::SMESH_Mesh_var mesh, + GEOM::GEOM_Object_var mainShape) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | @@ -916,23 +923,28 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( !memoryLack ) { // List of objects that will be updated automatically - QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > aListToUpdate; - SMESH::SMESH_IDSource_var aMeshObj = SMESH::SObjectToInterface( aMeshSObj ); + typedef QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > TListOf_IDSrc_SObj; + TListOf_IDSrc_SObj aListToUpdate; + SMESH::SMESH_IDSource_var aMeshObj = + SMESH::SObjectToInterface( aMeshSObj ); // put Mesh into list - aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) ); + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aMeshObj, aMeshSObj )); SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes(); // put SubMeshes into list - for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ ) { + for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ ) + { SMESH::SMESH_subMesh_var sm = aSubMeshes[i]; if ( CORBA::is_nil( sm ) ) continue; _PTR(SObject) smSObj = SMESH::ObjectToSObject( sm ); if ( !smSObj ) continue; - SMESH::SMESH_IDSource_var aSubMeshObj = SMESH::SObjectToInterface( smSObj ); - aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aSubMeshObj, smSObj) ); + SMESH::SMESH_IDSource_var aSubMeshObj = + SMESH::SObjectToInterface( smSObj ); + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj )); } // put Groups into list - SMESH::ListOfGroups_var aGroups = myMesh->GetGroups(); - for ( size_t i = 0; i < aGroups->length(); ++i ) { + SMESH::ListOfGroups_var aGroups = myMesh->GetGroups(); + for ( size_t i = 0; i < aGroups->length(); ++i ) + { SMESH::SMESH_GroupBase_var aGrp = aGroups[i]; if ( CORBA::is_nil( aGrp ) ) continue; SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp ); @@ -941,26 +953,31 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( !aStdGroup->_is_nil() ) continue; // don't update the standalone groups _PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp ); if ( !aGroupSO ) continue; - SMESH::SMESH_IDSource_var aGroupObj = SMESH::SObjectToInterface( aGroupSO ); - aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aGroupObj, aGroupSO) ); + SMESH::SMESH_IDSource_var aGroupObj = + SMESH::SObjectToInterface( aGroupSO ); + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO )); } // update mesh, sub-mesh and groups, if it's possible - QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > >::iterator anIter; - for( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ ) { - SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second )); - if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, &hidden, &nbElements ) ) + TListOf_IDSrc_SObj::iterator anIter; + for ( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ ) + { + SMESH::SMESH_Mesh_var aMesh = + SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second )); + + if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, + &hidden, &nbElements ) ) { try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif bool toDisplay = false; - - if ( !aMesh->_is_nil() ) { // display a mesh only + if ( !aMesh->_is_nil() ) // display only a mesh + { toDisplay = true; SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh ); - if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(), (*anIter).second->GetID().c_str(), true ); + if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(), + (*anIter).second->GetID().c_str(), + /*clearLog =*/ true ); if ( anActor ) // actor is not created for an empty mesh { anActor->SetEntityMode( entities ); @@ -981,7 +998,10 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" ); SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ).arg( hiddenMsg.join(", ") ) ); + tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ). + arg( nbElements ). + arg( limitSize ). + arg( hiddenMsg.join(", "))); } } catch (...) { @@ -1000,12 +1020,12 @@ void SMESHGUI_BaseComputeOp::computeMesh() { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ) ); + tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ). + arg( nbElements ).arg( limitSize ) ); } } } - LightApp_SelectionMgr *Sel = selectionMgr(); - if ( Sel ) + if ( LightApp_SelectionMgr *Sel = selectionMgr() ) { SALOME_ListIO selected; selected.Append( myIObject ); @@ -1017,10 +1037,11 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( memoryLack ) aMemoryReserve.release(); - myCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED")); + myCompDlg->setWindowTitle + ( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" )); // SHOW ERRORS - + bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 ); bool noHypoError = ( aHypErrors.isEmpty() ); @@ -1234,8 +1255,9 @@ void SMESHGUI_BaseComputeOp::onPublishShape() if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published { QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" )); - SALOMEDS::SObject_wrap so = - geomGen->AddInStudy( study, myMainShape, name.toLatin1().data(), GEOM::GEOM_Object::_nil()); + SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, myMainShape, + name.toLatin1().data(), + GEOM::GEOM_Object::_nil()); // look for myMainShape in the table for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) { if ( table()->item( r, COL_SHAPEID )->text() == "1" ) { @@ -1252,7 +1274,8 @@ void SMESHGUI_BaseComputeOp::onPublishShape() if ( curSub == 1 ) continue; } QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" )); - SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape, name.toLatin1().data(), myMainShape); + SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape, + name.toLatin1().data(), myMainShape); if ( !so->_is_nil() ) { CORBA::String_var name = so->GetName(); CORBA::String_var entry = so->GetID(); @@ -1995,7 +2018,8 @@ void SMESHGUI_PrecomputeOp::onPreview() if ( isShowError ) { myDlg->hide(); - aCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED")); + aCompDlg->setWindowTitle + ( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" )); showComputeResult( memoryLack, noCompError, aCompErrors, noHypoError, aHypErrors ); } } @@ -2198,10 +2222,11 @@ void SMESHGUI_BaseComputeOp::evaluateMesh() aMemoryReserve.release(); evaluateFailed = ( aCompErrors->length() > 0 ); - myCompDlg->setWindowTitle(tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED")); + myCompDlg->setWindowTitle + ( tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED" )); // SHOW ERRORS - + bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 ); bool noHypoError = ( aHypErrors.isEmpty() ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index d598d95e9..ffae8359b 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -1852,7 +1852,7 @@ void SMESHGUI_SplitVolumesDlg::showFacetByElement( int elemID ) gp_XYZ bc( 0,0,0 ); Bnd_B3d bbox; SMDS_NodeIteratorPtr nIt = elem->nodeIterator(); - vector< const SMDS_MeshNode* > nodes; + std::vector< const SMDS_MeshNode* > nodes; nodes.reserve( elem->NbNodes() ); while ( nIt->more() ) { diff --git a/src/SMESHUtils/SMESH_Comment.hxx b/src/SMESHUtils/SMESH_Comment.hxx index 5e6420fda..bb4c9b487 100644 --- a/src/SMESHUtils/SMESH_Comment.hxx +++ b/src/SMESHUtils/SMESH_Comment.hxx @@ -30,40 +30,38 @@ # include # include -using namespace std; - /*! * \brief Class to generate string from any type */ -class SMESH_Comment : public string +class SMESH_Comment : public std::string { - ostringstream _s ; + std::ostringstream _s ; public : - SMESH_Comment():string("") {} + SMESH_Comment():std::string("") {} - SMESH_Comment(const SMESH_Comment& c):string() { + SMESH_Comment(const SMESH_Comment& c):std::string() { _s << c.c_str() ; - this->string::operator=( _s.str() ); + this->std::string::operator=( _s.str() ); } SMESH_Comment & operator=(const SMESH_Comment& c) { _s << c.c_str() ; - this->string::operator=( _s.str() ); + this->std::string::operator=( _s.str() ); return *this; } template SMESH_Comment( const T &anything ) { _s << anything ; - this->string::operator=( _s.str() ); + this->std::string::operator=( _s.str() ); } template SMESH_Comment & operator<<( const T &anything ) { _s << anything ; - this->string::operator=( _s.str() ); + this->std::string::operator=( _s.str() ); return *this ; } diff --git a/src/SMESHUtils/SMESH_FreeBorders.cxx b/src/SMESHUtils/SMESH_FreeBorders.cxx index 52018179e..87951012c 100644 --- a/src/SMESHUtils/SMESH_FreeBorders.cxx +++ b/src/SMESHUtils/SMESH_FreeBorders.cxx @@ -290,7 +290,7 @@ namespace void BNode::AddClose ( const BEdge* e, double u ) const { if ( ! e->Contains( this )) - myCloseEdges.push_back( make_pair( const_cast< BEdge* >( e ), u )); + myCloseEdges.push_back( std::make_pair( const_cast< BEdge* >( e ), u )); } BEdge* BNode::GetCloseEdgeOfBorder( int borderID, double * uPtr ) const { @@ -569,9 +569,9 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh, // form groups of coincident parts of free borders - TFreeBorderPart part; - TCoincidentGroup group; - vector< BEdge* > ranges; // couples of edges delimiting parts + TFreeBorderPart part; + TCoincidentGroup group; + std::vector< BEdge* > ranges; // couples of edges delimiting parts BEdge* be = 0; // a current edge int skipGroup = bEdges.size(); // a group ID used to avoid repeating treatment of edges diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index 187055df5..8b589ce00 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -1297,7 +1297,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl TCollection_AsciiString aLongString, aFunctionType; int where = 1; - set< string > functionNameSet; + std::set< std::string > functionNameSet; while ( SMESH::TPythonDump::CutoutLongString( anUpdatedScript, where, aLongString, aFunctionType )) { // make a python string literal diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 36808eed4..42db79ef4 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -1628,7 +1628,7 @@ void ConnectedElements_i::SetThreshold ( const char* { case SMESH::ConnectedElements::POINT: // read 3 node coordinates /////////////////// { - vector< double > xyz; + std::vector< double > xyz; char* endptr; do { diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index e2be6042d..b60ef8d24 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -71,16 +71,16 @@ public: mapIdToId.clear(); } // register object in the internal map and return its id - int addObject( string theIOR ) + int addObject( std::string theIOR ) { int nextId = getNextId(); mapIdToIOR[ nextId ] = theIOR; return nextId; } // find the object id in the internal map by the IOR - int findId( string theIOR ) + int findId( std::string theIOR ) { - map::iterator imap; + std::map::iterator imap; for ( imap = mapIdToIOR.begin(); imap != mapIdToIOR.end(); ++imap ) { if ( imap->second == theIOR ) return imap->first; @@ -88,18 +88,18 @@ public: return 0; } // get object's IOR by id - string getIORbyId( const int theId ) + std::string getIORbyId( const int theId ) { if ( mapIdToIOR.find( theId ) != mapIdToIOR.end() ) return mapIdToIOR[ theId ]; - return string( "" ); + return std::string( "" ); } // get object's IOR by old id - string getIORbyOldId( const int theOldId ) + std::string getIORbyOldId( const int theOldId ) { if ( mapIdToId.find( theOldId ) != mapIdToId.end() ) return getIORbyId( mapIdToId[ theOldId ] ); - return string( "" ); + return std::string( "" ); } // maps old object id to the new one (used when restoring data) void mapOldToNew( const int oldId, const int newId ) { @@ -107,7 +107,7 @@ public: } // get old id by a new one int getOldId( const int newId ) { - map::iterator imap; + std::map::iterator imap; for ( imap = mapIdToId.begin(); imap != mapIdToId.end(); ++imap ) { if ( imap->second == newId ) return imap->first; @@ -125,8 +125,8 @@ private: return id; } - map mapIdToIOR; // persistent-to-transient map - map mapIdToId; // used to translate object from persistent to transient form + std::map mapIdToIOR; // persistent-to-transient map + std::map mapIdToId; // to translate object from persistent to transient form }; // =========================================================== @@ -568,7 +568,7 @@ public: typename TInterface::_var_type GetObjectByOldId( const int oldID ) { if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) { - string ior = myStudyContext->getIORbyOldId( oldID ); + std::string ior = myStudyContext->getIORbyOldId( oldID ); if ( !ior.empty() ) return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() )); } @@ -671,13 +671,13 @@ private: ::SMESH_Gen myGen; // SMESH_Gen local implementation // hypotheses managing - map myHypCreatorMap; + std::map myHypCreatorMap; - map myStudyContextMap; // Map of study context objects + std::map myStudyContextMap; // Map of study context objects - GEOM_Client* myShapeReader; // Shape reader - SALOMEDS::Study_var myCurrentStudy; // Current study - CORBA::Boolean myIsEmbeddedMode; // Current mode + GEOM_Client* myShapeReader; // Shape reader + SALOMEDS::Study_var myCurrentStudy; // Current study + CORBA::Boolean myIsEmbeddedMode; // Current mode // Default color of groups std::string myDefaultGroupColor; diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 66422047d..322b13d58 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -47,12 +47,12 @@ #ifdef _DEBUG_ static int MYDEBUG = 0; -//static int VARIABLE_DEBUG = 0; #else static int MYDEBUG = 0; -//static int VARIABLE_DEBUG = 0; #endif +using namespace std; + //============================================================================= /*! * Get...Tag [ static ] @@ -281,7 +281,8 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_wrap curObj; if ( theFatherObject->GetLastChildTag() > theTag ) { - SALOMEDS::UseCaseIterator_wrap anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject); + SALOMEDS::UseCaseIterator_wrap + anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject); for ( ; anUseCaseIter->More(); anUseCaseIter->Next() ) { curObj = anUseCaseIter->Value(); if ( curObj->Tag() > theTag ) { @@ -294,21 +295,29 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, } SALOMEDS::GenericAttribute_wrap anAttr; - if ( !CORBA::is_nil( theIOR )) { + if ( !CORBA::is_nil( theIOR )) + { anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeIOR" ); CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR ); SALOMEDS::AttributeIOR_wrap iorAttr = anAttr; - iorAttr->SetValue( objStr.in() ); - // UnRegister() !!! - SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); - if ( !genObj->_is_nil() ) - genObj->UnRegister(); + CORBA::String_var objStrCur = iorAttr->Value(); + bool sameIOR = ( objStrCur.in() && strcmp( objStr.in(), objStrCur.in() ) == 0 ); + if ( !sameIOR ) + { + iorAttr->SetValue( objStr.in() ); + // UnRegister() !!! + SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); + if ( !genObj->_is_nil() ) + genObj->UnRegister(); + } } + if ( thePixMap ) { anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" ); SALOMEDS::AttributePixMap_wrap pm = anAttr; pm->SetPixMap( thePixMap ); } + if ( !theSelectable ) { anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeSelectable" ); SALOMEDS::AttributeSelectable_wrap selAttr = anAttr; diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 9d3b3ee02..8bae7fb5b 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -502,8 +502,8 @@ namespace */ //================================================================================ - void getNodesOfElements(SMDS_ElemIteratorPtr elemIt, - set& nodes) + void getNodesOfElements(SMDS_ElemIteratorPtr elemIt, + std::set& nodes) { while ( elemIt->more() ) { @@ -531,7 +531,7 @@ CORBA::Long SMESH_GroupBase_i::GetNumberOfNodes() { if ( myNbNodes < 0 || g->GetTic() != myGroupDSTic ) { - set nodes; + std::set nodes; getNodesOfElements( g->GetElements(), nodes ); myNbNodes = nodes.size(); myGroupDSTic = g->GetTic(); @@ -574,10 +574,10 @@ SMESH::long_array* SMESH_GroupBase_i::GetNodeIDs() SMESH::long_array_var aRes = new SMESH::long_array(); if ( SMESHDS_GroupBase* g = GetGroupDS()) { - set nodes; + std::set nodes; getNodesOfElements( g->GetElements(), nodes ); aRes->length( nodes.size() ); - set::iterator nIt = nodes.begin(), nEnd = nodes.end(); + std::set::iterator nIt = nodes.begin(), nEnd = nodes.end(); for ( int i = 0; nIt != nEnd; ++nIt, ++i ) aRes[i] = (*nIt)->GetID(); } @@ -918,7 +918,7 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetMeshInfo() if ( g->GetType() != SMDSAbs_Node ) { - vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); + std::vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) if ( i < nbElems.size() ) aRes[i] = nbElems[ i ]; diff --git a/src/SMESH_I/SMESH_Measurements_i.cxx b/src/SMESH_I/SMESH_Measurements_i.cxx index b17fc6c4a..8da1cd7cf 100644 --- a/src/SMESH_I/SMESH_Measurements_i.cxx +++ b/src/SMESH_I/SMESH_Measurements_i.cxx @@ -221,12 +221,12 @@ static void enlargeBoundingBox(const SMDS_MeshNode* theNode, theMeasure.node1 = theNode->GetID(); } else { - theMeasure.minX = min( theMeasure.minX, theNode->X() ); - theMeasure.maxX = max( theMeasure.maxX, theNode->X() ); - theMeasure.minY = min( theMeasure.minY, theNode->Y() ); - theMeasure.maxY = max( theMeasure.maxY, theNode->Y() ); - theMeasure.minZ = min( theMeasure.minZ, theNode->Z() ); - theMeasure.maxZ = max( theMeasure.maxZ, theNode->Z() ); + theMeasure.minX = std::min( theMeasure.minX, theNode->X() ); + theMeasure.maxX = std::max( theMeasure.maxX, theNode->X() ); + theMeasure.minY = std::min( theMeasure.minY, theNode->Y() ); + theMeasure.maxY = std::max( theMeasure.maxY, theNode->Y() ); + theMeasure.minZ = std::min( theMeasure.minZ, theNode->Z() ); + theMeasure.maxZ = std::max( theMeasure.maxZ, theNode->Z() ); } } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index bd08f9d67..76a5d6d16 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -5249,10 +5249,10 @@ void SMESH_MeshEditor_i::dumpGroupsList(TPythonDump & theDumpPytho */ //================================================================================ -string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix) +std::string SMESH_MeshEditor_i::generateGroupName(const std::string& thePrefix) { SMESH::ListOfGroups_var groups = myMesh_i->GetGroups(); - set groupNames; + set groupNames; // Get existing group names for (int i = 0, nbGroups = groups->length(); i < nbGroups; i++ ) { @@ -5265,7 +5265,7 @@ string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix) } // Find new name - string name = thePrefix; + std::string name = thePrefix; int index = 0; while (!groupNames.insert(name).second) @@ -5573,8 +5573,8 @@ SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes, // Create group with newly created nodes SMESH::long_array_var anIds = GetLastCreatedNodes(); if (anIds->length() > 0) { - string anUnindexedName (theNodes->GetName()); - string aNewName = generateGroupName(anUnindexedName + "_double"); + std::string anUnindexedName (theNodes->GetName()); + std::string aNewName = generateGroupName(anUnindexedName + "_double"); aNewGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str()); aNewGroup->Add(anIds); pyDump << aNewGroup << " = "; @@ -5672,8 +5672,8 @@ SMESH_MeshEditor_i::DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes, // Create group with newly created nodes SMESH::long_array_var anIds = GetLastCreatedNodes(); if (anIds->length() > 0) { - string anUnindexedName (theNodes[0]->GetName()); - string aNewName = generateGroupName(anUnindexedName + "_double"); + std::string anUnindexedName (theNodes[0]->GetName()); + std::string aNewName = generateGroupName(anUnindexedName + "_double"); aNewGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str()); aNewGroup->Add(anIds); pyDump << aNewGroup << " = "; @@ -5897,7 +5897,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems, { // Create group with newly created elements CORBA::String_var elemGroupName = theElems->GetName(); - string aNewName = generateGroupName( string(elemGroupName.in()) + "_double"); + std::string aNewName = generateGroupName( std::string(elemGroupName.in()) + "_double"); if ( !getEditor().GetLastCreatedElems().IsEmpty() && theElemGroupNeeded ) { SMESH::long_array_var anIds = GetLastCreatedElems(); @@ -6129,7 +6129,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems { // Create group with newly created elements CORBA::String_var elemGroupName = theElems[0]->GetName(); - string aNewName = generateGroupName( string(elemGroupName.in()) + "_double"); + std::string aNewName = generateGroupName( std::string(elemGroupName.in()) + "_double"); if ( !getEditor().GetLastCreatedElems().IsEmpty() && theElemGroupNeeded ) { SMESH::long_array_var anIds = GetLastCreatedElems(); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index 3c36508b8..e657c5f61 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -37,6 +37,7 @@ #include "SMESH_PythonDump.hxx" #include "SMESH_MeshEditor.hxx" #include +#include class SMESH_Mesh_i; @@ -897,7 +898,7 @@ private: //!< private methods void dumpGroupsList(SMESH::TPythonDump & theDumpPython, const SMESH::ListOfGroups * theGroupList); - string generateGroupName(const string& thePrefix); + std::string generateGroupName(const std::string& thePrefix); void prepareIdSource(SMESH::SMESH_IDSource_ptr theObject); diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index 511433f6f..40d68e5b9 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -45,6 +45,8 @@ #include #include +using namespace std; + using SMESH::TPythonDump; using SMESH::TVar; diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 21fe1513e..0621ed9f1 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -54,6 +54,7 @@ #include CORBA_SERVER_HEADER(SALOME_Session) +using namespace std; #define MYDEBUGOUT(msg) //std::cout << msg << std::endl; @@ -62,7 +63,7 @@ namespace enum { GroupOnFilter_OutOfDate = -1 }; // a map to count not yet loaded meshes - static map< int, int > theStudyIDToMeshCounter; + static std::map< int, int > theStudyIDToMeshCounter; //================================================================================ /*! @@ -72,8 +73,8 @@ namespace void meshInfoLoaded( SMESH_Mesh_i* mesh ) { - map< int, int >::iterator id2counter = - theStudyIDToMeshCounter.insert( make_pair( (int) mesh->GetStudyId(), 0 )).first; + std::map< int, int >::iterator id2counter = + theStudyIDToMeshCounter.insert( std::make_pair( (int) mesh->GetStudyId(), 0 )).first; id2counter->second++; } //================================================================================ @@ -88,7 +89,7 @@ namespace { if ( --theStudyIDToMeshCounter[ (int) mesh->GetStudyId() ] == 0 ) { - string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile ); + std::string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile ); SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames; aFiles->length(2); @@ -109,7 +110,7 @@ namespace class SignalToGUI { - string _messagePrefix; + std::string _messagePrefix; SALOME::Session_var _session; public: SignalToGUI( SMESH_Mesh_i* mesh ) @@ -127,7 +128,7 @@ namespace _messagePrefix = "SMESH/mesh_loading/"; _messagePrefix += meshEntry.in(); - string msgToGUI = _messagePrefix + "/"; + std::string msgToGUI = _messagePrefix + "/"; msgToGUI += SMESH_Comment( mesh->NbNodes() ); msgToGUI += "/"; msgToGUI += SMESH_Comment( mesh->NbElements() ); @@ -140,7 +141,7 @@ namespace { if ( !_messagePrefix.empty() ) { - string msgToGUI = _messagePrefix + "/stop"; + std::string msgToGUI = _messagePrefix + "/stop"; _session->emitMessageOneWay( msgToGUI.c_str()); _messagePrefix.clear(); } @@ -173,7 +174,7 @@ namespace SMDS_PositionPtr vertexPosition() const { return SMDS_PositionPtr( new SMDS_VertexPosition); } SMDS_PositionPtr defaultPosition() const { return SMDS_SpacePosition::originSpacePosition(); } typedef SMDS_PositionPtr (PositionCreator:: * FmakePos)() const; - vector myFuncTable; + std::vector myFuncTable; }; //================================================================================ @@ -182,12 +183,12 @@ namespace */ //================================================================================ - vector getSimpleSubMeshIds( SMESHDS_Mesh* meshDS, int shapeId ) + std::vector getSimpleSubMeshIds( SMESHDS_Mesh* meshDS, int shapeId ) { - vector ids; + std::vector ids; - list shapeQueue( 1, meshDS->IndexToShape( shapeId )); - list::iterator shape = shapeQueue.begin(); + std::list shapeQueue( 1, meshDS->IndexToShape( shapeId )); + std::list::iterator shape = shapeQueue.begin(); for ( ; shape != shapeQueue.end(); ++shape ) { if ( shape->IsNull() ) continue; @@ -222,10 +223,10 @@ namespace */ //================================================================================ - typedef map< MED::EGeometrieElement, SMDSAbs_EntityType > Tmed2smeshElemTypeMap; + typedef std::map< MED::EGeometrieElement, SMDSAbs_EntityType > Tmed2smeshElemTypeMap; const Tmed2smeshElemTypeMap& med2smeshElemTypeMap() { - static map< MED::EGeometrieElement, SMDSAbs_EntityType> med2smeshTypes; + static Tmed2smeshElemTypeMap med2smeshTypes; if ( med2smeshTypes.empty() ) { for ( int iG = 0; iG < SMDSEntity_Last; ++iG ) @@ -233,7 +234,7 @@ namespace SMDSAbs_EntityType smdsType = (SMDSAbs_EntityType) iG; MED::EGeometrieElement medType = (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType ); - med2smeshTypes.insert( make_pair( medType, smdsType )); + med2smeshTypes.insert( std::make_pair( medType, smdsType )); } } return med2smeshTypes; @@ -254,7 +255,7 @@ namespace // change at insertion of new items in the middle. //const vector& medTypes = mesh2medElemType(); - vector data; + std::vector data; for ( size_t i = 0; i < meshInfo->length(); ++i ) if ( meshInfo[i] > 0 ) @@ -298,7 +299,7 @@ void SMESH_PreMeshInfo::hdf2meshInfo( const std::string& name, // // array->GetDim( datasetSize ); // int size = dataset->GetSize(); - vector info( SMDSEntity_Last * 2, 0 ); + std::vector info( SMDSEntity_Last * 2, 0 ); dataset->ReadFromDisk( &info[0] ); dataset->CloseOnDisk(); @@ -429,7 +430,7 @@ bool SMESH_PreMeshInfo::readPreInfoFromHDF() group_i->changePreMeshInfo() = newInstance(); if ( SMESHDS_GroupBase* group = group_i->GetGroupDS() ) { - const string name = group->GetStoreName(); + const std::string name = group->GetStoreName(); group_i->changePreMeshInfo()->hdf2meshInfo( name, infoHdfGroup ); } } @@ -499,7 +500,7 @@ void SMESH_PreMeshInfo::readGroupInfo() if ( _mesh->_mapGroups.empty() ) return; // make SMESH_PreMeshInfo of groups - map< string, SMESH_PreMeshInfo* > name2GroupInfo; + map< std::string, SMESH_PreMeshInfo* > name2GroupInfo; map::const_iterator i2group = _mesh->_mapGroups.begin(); for ( ; i2group != _mesh->_mapGroups.end(); ++i2group ) { @@ -510,8 +511,8 @@ void SMESH_PreMeshInfo::readGroupInfo() group_i->changePreMeshInfo() = info; if ( SMESHDS_Group* group = dynamic_cast< SMESHDS_Group* >( group_i->GetGroupDS() )) { - string name = group->GetStoreName(); - name2GroupInfo.insert( make_pair( name, info )); + std::string name = group->GetStoreName(); + name2GroupInfo.insert( std::make_pair( name, info )); info->_isInfoOk = true; } } @@ -534,8 +535,8 @@ void SMESH_PreMeshInfo::readGroupInfo() vector< SMESH_PreMeshInfo* >& grInfoVec = famId2grInfo[ medFamInfo->GetId() ]; for ( int iG = 0; iG < nbGroups; ++iG ) { - const string grName = medFamInfo->GetGroupName( iG ); - map< string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.find( grName ); + const std::string grName = medFamInfo->GetGroupName( iG ); + map< std::string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.find( grName ); if ( n2i != name2GroupInfo.end() ) grInfoVec.push_back( n2i->second ); } @@ -560,14 +561,14 @@ void SMESH_PreMeshInfo::readGroupInfo() f2infos = famId2grInfo.find( famNums[i] ); if ( f2infos == famId2grInfo.end() ) f2infos = famId2grInfo.insert - ( make_pair( famNums[i], vector< SMESH_PreMeshInfo*>())).first; + ( std::make_pair( famNums[i], vector< SMESH_PreMeshInfo*>())).first; } vector< SMESH_PreMeshInfo* >& infoVec = f2infos->second ; for ( size_t j = 0; j < infoVec.size(); ++j ) infoVec[j]->_elemCounter++; } // pass _elemCounter to a real elem type - map< string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.begin(); + map< std::string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.begin(); for ( ; n2i != name2GroupInfo.end(); ++n2i ) { SMESH_PreMeshInfo* info = n2i->second; @@ -618,7 +619,7 @@ void SMESH_PreMeshInfo::readSubMeshInfo() for ( int isNode = 0; isNode < 2; ++isNode ) { - string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); + std::string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() )) { // read sub-mesh id of all nodes or elems @@ -893,7 +894,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const SMDS_ElemIteratorPtr eIt = meshDS->elementsIterator(); for ( int isNode = 0; isNode < 2; ++isNode ) { - string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); + std::string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() )) { HDFdataset* aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup ); diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 20e7048b9..e59c60886 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -58,6 +58,7 @@ #include #include +using namespace std; #ifdef _DEBUG_ // #define DEB_FACES diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx index 5545f781a..ac251c03d 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx @@ -57,15 +57,15 @@ public: private: - bool findBoxFaces( const TopoDS_Shape& shape, - list< _QuadFaceGrid >& boxFaceContainer, - SMESH_Mesh& mesh, - _QuadFaceGrid * & fBottom, - _QuadFaceGrid * & fTop, - _QuadFaceGrid * & fFront, - _QuadFaceGrid * & fBack, - _QuadFaceGrid * & fLeft, - _QuadFaceGrid * & fRight); + bool findBoxFaces( const TopoDS_Shape& shape, + std::list< _QuadFaceGrid >& boxFaceContainer, + SMESH_Mesh& mesh, + _QuadFaceGrid * & fBottom, + _QuadFaceGrid * & fTop, + _QuadFaceGrid * & fFront, + _QuadFaceGrid * & fBack, + _QuadFaceGrid * & fLeft, + _QuadFaceGrid * & fRight); }; #endif diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 3849040e9..d0c258936 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -56,6 +56,8 @@ #include "utilities.h" +using namespace std; + //================================================================================ /*! * \brief Constructor of a side of one edge @@ -71,7 +73,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, const bool theIgnoreMediumNodes, SMESH_ProxyMesh::Ptr theProxyMesh) { - list edges(1,theEdge); + std::list edges(1,theEdge); *this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward, theIgnoreMediumNodes, theProxyMesh ); } @@ -82,12 +84,12 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, */ //================================================================================ -StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, - list& theEdges, - SMESH_Mesh* theMesh, - const bool theIsForward, - const bool theIgnoreMediumNodes, - SMESH_ProxyMesh::Ptr theProxyMesh) +StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, + std::list& theEdges, + SMESH_Mesh* theMesh, + const bool theIsForward, + const bool theIgnoreMediumNodes, + SMESH_ProxyMesh::Ptr theProxyMesh) { int nbEdges = theEdges.size(); myEdge.resize ( nbEdges ); @@ -112,7 +114,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); int nbDegen = 0; - list::iterator edge = theEdges.begin(); + std::list::iterator edge = theEdges.begin(); for ( int index = 0; edge != theEdges.end(); ++index, ++edge ) { int i = theIsForward ? index : nbEdges-index-1; @@ -302,8 +304,8 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes, */ //================================================================================ -const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, - double constValue) const +const std::vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, + double constValue) const { if ( myPoints.empty() ) { diff --git a/src/StdMeshers/StdMeshers_Geometric1D.cxx b/src/StdMeshers/StdMeshers_Geometric1D.cxx index dd77350f7..031fd7ea1 100644 --- a/src/StdMeshers/StdMeshers_Geometric1D.cxx +++ b/src/StdMeshers/StdMeshers_Geometric1D.cxx @@ -166,7 +166,7 @@ bool StdMeshers_Geometric1D::SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i )); BRepAdaptor_Curve C( edge ); - vector< double > params; + std::vector< double > params; if ( SMESH_Algo::GetNodeParamOnEdge( theMesh->GetMeshDS(), edge, params )) { nbEdges++; diff --git a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx index 6f87ebf4a..5cd779b75 100644 --- a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx +++ b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx @@ -33,6 +33,8 @@ #include +using namespace std; + // Define error message and _MYDEBUG_ if needed #ifdef _DEBUG_ #define BAD_MESH_ERR \ diff --git a/src/StdMeshers/StdMeshers_Prism_3D.hxx b/src/StdMeshers/StdMeshers_Prism_3D.hxx index 0a2428401..9788b64a1 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.hxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.hxx @@ -270,7 +270,7 @@ private: TParam2ColumnMap* myParamToColumnMap; PSurface mySurface; TopoDS_Edge myBaseEdge; - map< int, PSurface > myShapeID2Surf; + std::map< int, PSurface > myShapeID2Surf; // first and last normalized params and orientaion for each component or it-self std::vector< std::pair< double, double> > myParams; // select my columns in myParamToColumnMap bool myIsForward; diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx index d8bce83cd..f260a2d6f 100644 --- a/src/StdMeshers/StdMeshers_Projection_3D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx @@ -57,6 +57,7 @@ namespace TAssocTool = StdMeshers_ProjectionUtils; +using namespace std; //======================================================================= //function : StdMeshers_Projection_3D diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index 55e0d19ab..acd202846 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -61,6 +61,8 @@ #include #include +using namespace std; + //================================================================================ /*! * \brief 1D algo diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx index 460a5e4ab..936a5e1c2 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx @@ -82,7 +82,7 @@ struct FaceQuadStruct return GetUVPtStruct()[ to-nbNodeOut-(IsReversed() ? -1 : +1)]; } // some sortcuts - const vector& GetUVPtStruct(bool isXConst=0, double constValue=0) const + const std::vector& GetUVPtStruct(bool isXConst=0, double constValue=0) const { return nbNodeOut ? grid->SimulateUVPtStruct( NbPoints()-nbNodeOut-1, isXConst, constValue ) : grid->GetUVPtStruct( isXConst, constValue ); diff --git a/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx b/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx index 9036dc18b..decbc2a62 100644 --- a/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx +++ b/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx @@ -38,7 +38,7 @@ StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D :SMESH_0D_Algo(hypId, studyId, gen) { _name = "SegmentAroundVertex_0D"; - // it is assigned to vertices but influence a state of EDGE submeshes + // it is assigned to vertices but influence a state of EDGE submeshes _shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type _compatibleHypothesis.push_back("SegmentLengthAroundVertex"); @@ -55,16 +55,17 @@ StdMeshers_SegmentAroundVertex_0D::~StdMeshers_SegmentAroundVertex_0D() //======================================================================= //function : CheckHypothesis -//purpose : +//purpose : //======================================================================= -bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape, - SMESH_Hypothesis::Hypothesis_Status& aStatus) +bool StdMeshers_SegmentAroundVertex_0D:: +CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus) { - list ::const_iterator itl; + std::list ::const_iterator itl; - const list &hyps = GetUsedHypothesis(aMesh, aShape); + const std::list &hyps = GetUsedHypothesis(aMesh, aShape); if ( hyps.size() == 0 ) { aStatus = SMESH_Hypothesis::HYP_MISSING; @@ -84,7 +85,7 @@ bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh& //======================================================================= //function : Compute -//purpose : +//purpose : //======================================================================= bool StdMeshers_SegmentAroundVertex_0D::Compute(SMESH_Mesh&, const TopoDS_Shape&) diff --git a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx index 9ca0a8ee8..0ea622706 100644 --- a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx @@ -178,8 +178,8 @@ void StdMeshers_CartesianParameters3D_i::SetGridSpacing(const SMESH::string_arra CORBA::Short axis) throw (SALOME::SALOME_Exception) { - vector funVec; - vector pointVec; + std::vector funVec; + std::vector pointVec; _array2vec( spaceFunctions, funVec, (const char*) ); _array2vec( internalPoints, pointVec, ); @@ -209,8 +209,8 @@ void StdMeshers_CartesianParameters3D_i::GetGridSpacing(SMESH::string_array_out { ASSERT( myBaseImpl ); try { - vector funVec; - vector pointVec; + std::vector funVec; + std::vector pointVec; this->GetImpl()->GetGridSpacing( funVec, pointVec, axis ); xSpaceFunctions = new SMESH::string_array(); @@ -394,8 +394,8 @@ StdMeshers_CartesianParameters3D_i::ComputeCoordinates(CORBA::Double const char* axisName ) throw (SALOME::SALOME_Exception) { - vector xFuns; - vector xPoints, coords; + std::vector xFuns; + std::vector xPoints, coords; _array2vec( spaceFuns, xFuns, (const char*) ); _array2vec( points, xPoints, ); diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx index ed0ce004c..8120ca384 100644 --- a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx @@ -111,7 +111,7 @@ public: std::string str; if (stream >> str) { if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) { - string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() )); + std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() )); if ( !ior.empty() ) return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() )); } diff --git a/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx b/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx index 13e86c06a..a059ff39e 100644 --- a/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx @@ -79,7 +79,7 @@ void StdMeshers_Reversible1D_i::SetReversedEdges( const SMESH::long_array& theId void StdMeshers_Reversible1D_i::SetObjectEntry( const char* theEntry ) { - string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping + std::string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping try { this->GetImpl()->SetObjectEntry( entry.c_str() ); // Update Python script From e1b9f3df7a331d038ee378607a2b0e01d9481801 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 15 Feb 2016 15:49:45 +0300 Subject: [PATCH 079/147] CMake: simplifying Python detection mechanism. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03e0f5357..33efb9f10 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,8 @@ MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB) # Various # Python -FIND_PACKAGE(SalomePython REQUIRED) +FIND_PACKAGE(SalomePythonInterp REQUIRED) +FIND_PACKAGE(SalomePythonLibs REQUIRED) # PThread FIND_PACKAGE(SalomePThread REQUIRED) # SWIG From 971a1433b37f071c05729600d2d64bbb44616734 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 12 Feb 2016 09:32:57 +0300 Subject: [PATCH 080/147] Merge relevant changes from V8_0_0_BR branch --- SalomeSMESHConfig.cmake.in | 48 ++++++++++--------- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx | 8 ++-- src/SMESHGUI/SMESHGUI_MergeDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 4 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx | 8 ++-- .../StdMeshersGUI_CartesianParamCreator.cxx | 8 ++-- .../StdMeshersGUI_NbSegmentsCreator.cxx | 20 ++++---- 9 files changed, 53 insertions(+), 51 deletions(-) diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 8a8827406..3ec182cbe 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -75,32 +75,34 @@ IF(SALOME_SMESH_USE_TBB) SET_AND_CHECK(TBB_ROOT_DIR_EXP "@PACKAGE_TBB_ROOT_DIR@") ENDIF() -# For all prerequisites, load the corresponding targets if the package was used +# For all prerequisites, load the corresponding targets if the package was used # in CONFIG mode. This ensures dependent projects link correctly # without having to set LD_LIBRARY_PATH: -SET(_PREREQ @_PREREQ_LIST@) -SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@) -SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@") -LIST(LENGTH _PREREQ_CONFIG_DIR _list_len) -IF(NOT _list_len EQUAL 0) +SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@) +SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@) +SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@") +LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@) +IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0) # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... - MATH(EXPR _range "${_list_len}-1") - FOREACH(_p RANGE ${_range}) - LIST(GET _PREREQ ${_p} _pkg ) - LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir) - LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo) - MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...") - IF(NOT _pkg_compo) - FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE - PATHS "${_pkg_dir}" - NO_DEFAULT_PATH) - ELSE() - STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}") - MESSAGE(STATUS "===> (components: ${_pkg_compo})") - FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE - COMPONENTS ${_compo_lst} - PATHS "${_pkg_dir}" - NO_DEFAULT_PATH) + MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1") + FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@}) + LIST(GET _PREREQ_@PROJECT_NAME@ ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@ ) + LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@) + LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@) + IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@}) + MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...") + IF(NOT _pkg_compo_@PROJECT_NAME@) + FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE + PATHS "${_pkg_dir_@PROJECT_NAME@}" + NO_DEFAULT_PATH) + ELSE() + STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}") + MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})") + FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE + COMPONENTS ${_compo_lst_@PROJECT_NAME@} + PATHS "${_pkg_dir_@PROJECT_NAME@}" + NO_DEFAULT_PATH) + ENDIF() ENDIF() ENDFOREACH() ENDIF() diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 4cf85c89f..ad1a5c5cd 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1733,7 +1733,7 @@ void SMESHGUI_PrecomputeOp::initDialog() myOrderMgr = new SMESHGUI_MeshOrderMgr( myDlg->getMeshOrderBox() ); myOrderMgr->SetMesh( myMesh ); bool isOrder = myOrderMgr->GetMeshOrder(myPrevOrder); - myDlg->getMeshOrderBox()->setShown(isOrder); + myDlg->getMeshOrderBox()->setVisible(isOrder); if ( !isOrder ) { delete myOrderMgr; myOrderMgr = 0; diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index 47c2f8eec..da805271a 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -378,7 +378,7 @@ void SMESHGUI_CreatePatternDlg::onSave() SUIT_FileDlg* aDlg = new SUIT_FileDlg( this, false ); aDlg->setWindowTitle( tr( "SAVE_PATTERN" ) ); aDlg->setFileMode( QFileDialog::AnyFile ); - aDlg->setFilter( tr( "PATTERN_FILT" ) ); + aDlg->setNameFilter( tr( "PATTERN_FILT" ) ); if ( myName->text() != "" ) aDlg->selectFile( myName->text() ); @@ -392,7 +392,7 @@ void SMESHGUI_CreatePatternDlg::onSave() if ( QFileInfo( fName ).suffix().isEmpty() ) fName = autoExtension( fName ); - fName = QDir::convertSeparators( fName ); + fName = QDir::toNativeSeparators( fName ); QString aData( myPattern->GetString() ); long aLen = aData.length(); diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index c4b0465de..e7a519e03 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -611,7 +611,7 @@ void SMESHGUI_FilterLibraryDlg::onBrowse() //aDlg->setMode(myMode == COPY_FROM ? QFileDialogP::ExistingFile : QFileDialogP::AnyFile); aDlg->setFileMode(myMode == COPY_FROM ? QFileDialog::ExistingFile : QFileDialog::AnyFile); - aDlg->setFilters(prepareFilters()); + aDlg->setNameFilters(prepareFilters()); aDlg->selectFile(getFileName()); QPushButton* anOkBtn = (QPushButton*)aDlg->findChild("OK"); @@ -629,8 +629,8 @@ void SMESHGUI_FilterLibraryDlg::onBrowse() if (QFileInfo(fName).suffix().isEmpty()) fName = autoExtension(fName); - fName = QDir::convertSeparators(fName); - QString prev = QDir::convertSeparators(getFileName()); + fName = QDir::toNativeSeparators(fName); + QString prev = QDir::toNativeSeparators(getFileName()); if (prev == fName) return; @@ -756,7 +756,7 @@ bool SMESHGUI_FilterLibraryDlg::isPermissionValid(const bool theIsExistingOnly) if (QFileInfo(fName).suffix().isEmpty()) fName = autoExtension(fName); - fName = QDir::convertSeparators(fName); + fName = QDir::toNativeSeparators(fName); if (QFileInfo(fName).exists()) { isWritable = QFileInfo(fName).isWritable(); diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index 46e68d346..e1df393fa 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -102,7 +102,7 @@ QPixmap SMESHGUI_MergeDlg::IconFirst() " .. ... ... ", " .. .. .. ", " . . "}; - return iconFirst; + return QPixmap( iconFirst ); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 7957b4fdd..f16d08d87 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -3147,7 +3147,7 @@ void SMESHGUI_MeshInfoDlg::dump() DumpFileDlg fd( this ); fd.setWindowTitle( tr( "SAVE_INFO" ) ); - fd.setFilters( aFilters ); + fd.setNameFilters( aFilters ); fd.myBaseChk->setChecked( anIsBase ); fd.myElemChk->setChecked( anIsElem ); fd.myAddChk ->setChecked( anIsAdd ); @@ -3858,7 +3858,7 @@ void SMESHGUI_CtrlInfoDlg::dump() DumpFileDlg fd( this ); fd.setWindowTitle( tr( "SAVE_INFO" ) ); - fd.setFilters( aFilters ); + fd.setNameFilters( aFilters ); fd.myBaseChk->hide(); fd.myElemChk->hide(); fd.myAddChk ->hide(); diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index dd4d75337..654e6d6ce 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -809,10 +809,10 @@ void SMESHGUI_MeshPatternDlg::onOpen() SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, true); aDlg->setWindowTitle(tr("LOAD_PATTERN")); aDlg->setFileMode(QFileDialog::ExistingFile); - aDlg->setFilters(prepareFilters()); + aDlg->setNameFilters(prepareFilters()); if (!myName->text().isEmpty()) aDlg->selectFile(myName->text() + ".smp"); - QPushButton* anOkBtn = qFindChild( aDlg, "OK" ); + QPushButton* anOkBtn = aDlg->findChild( "OK" ); if (anOkBtn != 0) anOkBtn->setText(tr("SMESH_BUT_OK")); @@ -826,9 +826,9 @@ void SMESHGUI_MeshPatternDlg::onOpen() if (QFileInfo(fName).suffix().isEmpty()) fName = autoExtension(fName); - fName = QDir::convertSeparators(fName); + fName = QDir::toNativeSeparators(fName); - QString prev = QDir::convertSeparators(myName->text()); + QString prev = QDir::toNativeSeparators(myName->text()); if (prev == fName) return; diff --git a/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx index 762bccdec..21f64ed4f 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx @@ -319,10 +319,10 @@ namespace StdMeshersGUI void GridAxisTab::onMode(int isSpacing) { - mySpacingTreeWdg->setShown( isSpacing ); - myCoordList->setShown( !isSpacing ); - myStepSpin->setShown( !isSpacing ); - myStepLabel->setShown( !isSpacing ); + mySpacingTreeWdg->setVisible( isSpacing ); + myCoordList->setVisible( !isSpacing ); + myStepSpin->setVisible( !isSpacing ); + myStepLabel->setVisible( !isSpacing ); if ( isSpacing ) { if ( mySpacingTreeWdg->topLevelItemCount() == 0 ) diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index 9a9f2756b..e7f35d1f3 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -447,25 +447,25 @@ void StdMeshersGUI_NbSegmentsCreator::onValueChanged() myTable->setData( arr ); //update data in table } - myScale->setShown( distr==1 ); - myLScale->setShown( distr==1 ); - myReversedEdgesBox->setShown( distr!=0 ); + myScale->setVisible( distr==1 ); + myLScale->setVisible( distr==1 ); + myReversedEdgesBox->setVisible( distr!=0 ); if ( myReversedEdgesHelper ) { myReversedEdgesHelper->Clear(); - myReversedEdgesHelper->setShown( distr!=0 ); + myReversedEdgesHelper->setVisible( distr!=0 ); } myDirectionWidget->ShowPreview( distr!=0 ); bool isFunc = distr==2 || distr==3; #ifndef DISABLE_PLOT2DVIEWER - myPreview->setShown( isFunc ); + myPreview->setVisible( isFunc ); #endif - myConvBox->setShown( isFunc ); + myConvBox->setVisible( isFunc ); - myTable->setShown( distr==2 ); - myExpr->setShown( distr==3 ); - myLExpr->setShown( distr==3 ); - myInfo->setShown( distr==3); + myTable->setVisible( distr==2 ); + myExpr->setVisible( distr==3 ); + myLExpr->setVisible( distr==3 ); + myInfo->setVisible( distr==3); #ifndef DISABLE_PLOT2DVIEWER //change of preview From 3da8fefe9c957f4538e9eacf013ce678df4d6c91 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 17 Feb 2016 20:36:53 +0300 Subject: [PATCH 081/147] 23239: [CEA 1739] Regression : crash trying to create mesh (StdMesher_Prism_3D.cxx) + minor changes --- .../gui/SMESH/images/quad_from_ma_mesh.png | Bin 10961 -> 6101 bytes src/SMESH/SMESH_Mesh.hxx | 2 +- src/SMESHUtils/SMESH_MAT2d.cxx | 10 +++++--- src/SMESHUtils/SMESH_MAT2d.hxx | 6 ++--- src/StdMeshers/StdMeshers_Prism_3D.cxx | 23 +++++++++++------- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/doc/salome/gui/SMESH/images/quad_from_ma_mesh.png b/doc/salome/gui/SMESH/images/quad_from_ma_mesh.png index f233cc640783dea9f48b8889bf27a8d5e9920fc7..3e3c63b23bd8d64dddc806f68f5bb70b7a974ffc 100644 GIT binary patch literal 6101 zcmV;`7b@t9P)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01m_e01m_fl`9S#00007bV*G`2j2<^ z5(o?65fF+102ftBL_t(|+U=cfa_hFTMIpzPDcnDqmM0m{F?v6gr%*t5qXB{-KGv>V zw;UfI9f>9vHZ~fKM?k&wd_Et);ra9Le?ETy|NB4T_5Ig(-e3It_2a>%Lugxla|ya) z`X@&73)aW)M?d_0KEX6XFdAL1$K&yQK2s1!n0|Zhl-dZP-SovJ=#A+^*74$U#Nx

        LgUG@>#U>YG9je29+pFXpGh!BiMz4bQE zk$rws`&g5Q5Q5RDpOrp>ICaetwg3G|tTaM9iMozEF`e4yccsUh+EEfhnFm69fr3kL zqoT#bsOs*+K7Ve0i4czvT2*8nH(TlB2Jv*mVVZaZLJx#sH0qD(*kb?4d&HyA156{d zI3l7C{ia!v@Jn?Z|o9*rG)oDY)a+MRE^x0hG0< z%}C+o<2n=8bGyRm`7r%{B+`f@giPoGrco0vr*pVAcX--}=J=0t-@@pLF#W!#g`*CC z;+`I{-6oz!r_tQ$hW{1b3AZkco;dW-e00id3^nqgIjZ}-`R4xx)-ZaB&?7noKsz)5 zLyfX%_Hfg#{=CjyZwqS}y-w&MJcOS~2&6_I19mNNHJ5F;@AOQ#ld#_B9){7&h91Xf zBL+I8-k#29pe+9NqPmXb3p&qSj_v$5_b`l}JM=g{GsY3);?V(+8ag|<+`P0yGZUV7 z^^xgqa1X=i=|hj$U;HRUmO3;A3Z9^IyEx)JwU2K`?9(f=erZy}=;=cb?ThICe&bt+ zJ|td4?Um^4Ns8@FQa9Y{znOO!Ta!ge4Wp+IJ;anFeJr(krFMeid$Z#CcgwHrEN%e!p12HAIn8_|+-2=Xth zl%(13h<{W)DjW+>wbxm1IT1#$5PGCMjh9w_EdCm{y2*@HL^iPQZ=WkFC=3?+vk|c= zScRPz?`p9WbtOX$qZe`0M#_POZ(o zO8=E3snefd<{pF5(_>nEIK^`5$T(|T7{t0LXVxL2+)fW6b#wbH7RcMtR{HxYW%0=^ zi0OUhj7RJMWP#3NFnYDzBi$pOH6TJF@srOh{d_lyy4GHizc=3ymyyN2B)6Avc&P3C zdC{6ojcFLYVD6FT8zP9)btEy|X#TJntBYW|F5k%RTGCvzyf8fHFPMASrAwZPs$ql;j%TxJt+Zg7Y3U&L*_cArEgL#Rk`NmFyY>L!yqQxsFz-Sl zj9!-1qTlhyeAs8H-vQHpKx-=m>7ZNm8_!}_e8FriW|!-g#@~^L5Z{UL zN3-2vFnXitL%X@Jo}U`7M{W)Urri!&>!qa`*lbMUsjn!?I#M&My-2#?T;w6N$yxdy z=DNXP^!kR{xZTsFIGbtMU)#HN#Ulvh=1^eT9dY=3X&F#1^2OH;>Y=dFl8|PYg{L## zU@&?MQU~90&UKkaI<@pfU0d&wS;!|5XCXS1coxMZS^kd$dJQ%&Htxlb_U8GTwZ-gZK&K^OK zPTL7RqTiQMx^9Oab{dc!ar1BQr|iXB1tW&J7C-NFM}5L*c-@R0nkzr!j>)D|2b~_o zlcnbw<80S;WPxrhO&e`w>ONPtFO7H_#^5&?j7FERJ~e&8*kABtHP{2w+9ILGEb*xL zIu?g;wyq${c+xPbw&gf z-E1F0$Ir(#$48^BNiCl8Wf;SF`Ei@XuXjB0|f7ai8Xs;8BFbYy5A?>PqHh|ckx5GF6J)=FZsqJS8+MyQ1+++A?baU=u zJY)8GG5Y{obJoUz!a?7H7|be;ajvu7C`ue`ijHm(XK4ejAHryKGp5xkr*VeqW_5Vk z7+Ry!n?$LnUMveTY`D0`(rE8B+V!EX1C0Wpcj@?xKeW3=a@xVu;ffA35eg0Xzd8xQL)5D`+t}aHN@mPyCPdpp*b_SQVp<{aTzo=HelYM#IhVt%Hu%#k6s@ zw?+^@vg23SD$V~a^wfqxt2g?smy4_e4eEMqDlI%jWl?*6n!m3V$Q>&_pkOo_gUg2+ z4`YrW!eq^Vub8k`@ABA|)agvZ&O?T(!-LUiI7~+dC$-fZn&=d@K{F_?wG$m0e^J7@w% zqd}h*R zl*@NnX&8-WvegqEpHVqPwT_q@7VxdX<#28Z5g(0EOq1-!=w(c_7FmSkFxG0U?77=e zw9KVL=3RyWMx&wQju7(8?khpZ*)lYBg~&PDm2&xZD*&U>WVSl>L>rzOPSstv`zky5W7mP*|KrITOwJ>p_QAhlM z;y4t@kzq7KW8zFhu(*)8#*|zenM5ZJyZcXo;@`#fku;1(qciIjbnMKdQg(yy^DNdz z#Qw{$FdB_$qQfE95OV-x*$}Kf@t)c;D4e}SoH>h-KxfgjM2E1%yq>o3?jj0k?Y8$U zlJQeG{mI)gP3;{T2++skuylFwT{uMxi}Tidw@-bny_-w;Xf%+0PR+|3)1vp82-8J7 z3_F`{G_vr~=uT|C6d9bzK}R@_0+0~cVTf8f?xKPJwc8LMjn;I{5qw3<9L&QE=SrfD z-76##2u7oU&}^(_rTcWn9=?-$G!f8ZPf?BOr11R*RJ#rYMxzzDY}-Szm7TWv`@>f6 z(Jk@95jjZ5dPXaOL2qP}7I?&~h{Vt*O!~GLCncbvL5tm{$$5SuO{&2ro^X0W`u#qx%i-7527*xyC!Md-Kk=nMM<(1pr-C@7(13 ztgL1q1kVp-e;!7U$Xq9I&-^Ym^D71mSsGSk&qq^>D^T@K{0vdwRMr+Euz}gUJJ>i=+!Y^9)^RHND zS)2mGUMk#^&R`S`&1k#H&eiv{SUFIKv(T~VEeqeEG>R)7ATt_?V0{J+eA~^q(Xiua(XXk)vdV>wP93!7BQ#?>*Sxi&)S+!8;;e}V zwf6w}@i3NTI=BQhsjg!5>vq)6sY?%pZpfgbiTTODa`lF6V<(7U!+|eCFuKS=AGf_} z=RF%sC`C~~MGK4bfBhm?u8j&%c*y|dQfo}@UC=jqHIF{#V6>P)r%q67LFtKQCw+vn zl_Ve-HMy^%8yIS*Hp{b3ck!$vy&`GQ5$|aDo$>~9ZqCL9qm$-9n`RlMtC;94wZ)0D zr`&c{Mn^GpdZ?&acqHCl#+AA^gU0-#N-p@84eiQH)(r0@c>hY%mW+;K=;aqtI9kj;DxC=FU2dh(imV;WF9>&2_~;l;5@eU5tMvn=x9P#HEH>T|xxSXg?!% zuXzW`_MhI;Q8Lw6+s`kaeiS~JJEEZZ@pu4ev@$8nmGA%UX~5qfzu_p= zZ7r&ek3O1cqu=}+*()9PjL=Xp8p^hhHh0m=Hb%Zm-xpnxG<17?^TT2TXoL<=M=2?? zg}v0?d5|5Xy2f#+-GI?r68)ZHhy~FA8lh^NY`4BSiT-V=ot7|+Fvxwkx^;}rf#R|u zLYv~i-CQZf1Z8=bj(^c5O-mbYX#?4Y(KdFYl!JXA2zjy#HmwZkwY4eBxQrItC#4@L zuuh0j$V3z2;uw_qt8JVM{$fXnwO=zlCeh(D5hLY5DClv=MV%BQ+qB^`D0a~F&+v7aY#MGvpPX_IggjQd8mV(ZXAoqI zwbCw&-4|ltO+IaqIzowd03p2#8D`1&%{YKN~aw~1?FPU~ z*^WE1w7N8k=^0-*hp}wyH!%#kH>z#3W~eP5f^3AUF)f0|v+5Nk9!LLFT7Nbpk+Uxn z+y!YP?2fKvv~j|$xHX;yLxie2yYqd95b{`Q zyT`9T7)clK4JY2gS+`0=)6=cePc3F0TK*#%>JbXkzE55wq6~x@%Cmb#-v6f0Vm}TM z&7B1`$a8JKy^ve>%sNG}iaZRN|I{8x=UJ!1&oj_t-@Oo?U;C#65; z`MbtiXz50tXy6fFLABTegtQI%-f3qTvI`uci!d#^-87P}&N1u`_kMbw{N|bPB;C4c zBTJ~y8)Fsio2LSy>B10a+f2W?pF)L>j1gBbmd>rPL%JKJfA$C&LoVKhQRTWKxa2tmju9R&To2Z zGm1>N5$uRnb21u36maqg9a)>m$iJ5Sk3rq7%wa-o=xWrt9V4 z@5-NkaP6CepArS55t<3pS_U1YrLgR3;VpCAQp@aV{%8CZ`;W#y#;+Np)3RtH4uq}_ zJ=B@|uebMRYOZaI-5~(UzLTOJCh4g(9}|w@m&%&$VM+V_lSd=e2h%~Xn@*S4G{TB2 zjZSd4!m)9DjPs@ZL(41&VSk^$S2%11p?fhcCL8H$VUab~TEPW#+nzsmFpgoYqr5S7 zkU!ug#b)Hu2(5tW5L~N;XaDKn2Bmwgj9p53ZJ?SigT9v0|9GUn%jAzkGTLHTAd3nUbSV~xF9qvrb9^=X>IGr6!IU>sQK%;B91nU2FD29j%j1H z&~}>RS4@{yL)#yD(%sJF(Fo0r>5%Lf7xzFrGmYC1_tPfjemc)v!qJb>MA8WLH`Lj4 z!7C=mmp;PIMt5ht^T>@jdN5jR?Jtx_KcBQ!Lg;Et2Yu_a-L5l>?BkQ(s`jo)qr1!$ zVSem1&ZF_p2o05ch@Lu}%boA7y~`Fv|F>$ogfAqIMrb2L9m1*Q{Y&eePsSQ6&_kn z)<~b*Gg>}XH+MQZLa1}};e3|gPjUZ>>5AUa3)|;rjJ9Vk2%#yW55K=|_@s+X^(tCR zuU#{C;hG_lG(uyNx(?RCESmPW)fZp64(>Zt^tNGigk$kMc}k=a8idppw%TT^VSbHL zkc!FrK4@;nXc@=k9tbUJt8dYsbZ)@tq7#b|LQ~l4dp%ZEsmG>!fo=QPK;gBQ*A%t#YG&n{Gp)2&&^B;Ts z2I3Bc5Gugt`Ik7hzVj>$QvHq)LR}dhndLXH<Z>Q~H~>N(dozlaH2{2kG5`#?#l=*FXRK!*xJ&+^$>#w446;;}0$Zg3+qoChkDD z`)Do#+Dp$uamCP$`rrTl$3;N1s8b#teT~qadW6U0fmc9tO#8S5XgB@!*I$4B`6t%_ bO`-n-fYnPZbu_J800000NkvXXu0mjft!w{X literal 10961 zcmX9kby!s0)0gf}>8_E`EV^0EEW+V#> zH!F)Z924qhNgk#+r@qC@SIV6EB)CcgmIX^oKjf*6G>-s-jV8NGASR(sk`%7%#c=uhG)N{Vff~I_Ar%AD1Vz6A zOEx5#k$;eci_N*f25XkR8Mf68gav_@UBO<;*^_(xB&8mSXd(^p0>k+MJJJt9^}q#@ z)=uh)&{&L+VE9ohf9O20`AI7LTBn0im%k4}GY}97AtWT{>0Iv{rGP5?E{kevI{W?2( zQ9&R-NH>6{&c3GhZ=kPi6k`{(6#vHBnSDezf(P z#y_jOL?LUoIZPIQK6hP*?^(DJ#=w1T80dty$gG4#H#ED`AY!9-fx$HsUuajfFfo=? zB+1OIEXQo|l#~kgBH1-AJwc_cf8JV`jnlUKINHJla0eg(ddM|S&Oa1|yf;$mA`&{X zVLu1#io6*Huq>X#im)0t&Vm<5mq!<*vUg4Sw`N>P|CG!9kg~c$jdrpx8jM5>OLE|^ zAlc-ZwANx`pL%T8OFR@S0fMiZhHQ&1Jni)t^}fVJ7kDxw_lGDaG#IuP)>UD;YaEQa zz)r1nUipK5&Vs5ab1s%3l~lSX#M+*zu#@3jzwBEd$)y};0ah-GA)3q7(cEz=-oa4j zTdheq;R1R!lM>bhYeMo&vrIgWUx`+pk>7Fsuy#?&lQeID9@SQm?zHqyr$E=3;XM~E z4M3!X)zamM4gX#+bc=5R+SM}R98w|Z!puWwBvWm=#f1 z4Z9^A3FGB;IbAF6vy0psujU6{sEW8ooBPSMFP1h+t#&j&=^sS6Ao!*v^c6HDIOkO3 zd_OoLJhxs$fJ&?r{5*6FVf9EM`ZUM46#~Q|6LdDiECL95QYzYz!L7Ind)1$Ibz~<| z4;FPQkS>0Kef$+1C9GF3#y9-L7adkNE$R*j@shDlFxwek^$%~1&WJzW+RO!t7hqKq zX<@zUPn#ugA}eGJr_HsP(vZiU7H$@Ib!bLEfO;ERvzOb9Mn&qXT=^2b3jhV`27qFd zLj@+<%f>Ha%HR$&5`8*y{FKR9mAHB63#hH$el@DVI!A4^rr>UA5T;DdcbiYll zS8hojudjO58%y0xC`HxGveRpnD7mrH+FZ#g3LcQhMM=PXpcT~GHL~7Ywo*6B?oWuX z^Fhu3uOI{(f)C*|!ribx-a~QTfBE!LsYwvP)o5+enm6*SdUJ*cD5# zi^Mhu=yLks`tUp)Z|=j;0)CQ~*v$p!$l$|8T|xz!dh)StBH9Hi;2f0a8jwea8Okmx z<0OST5ewH;v^1IcD~U@D&~y|rpYUN|pHQYmbD>m^szE zc@q_}4U{5iicnz9g`{j$*NFFa#dZ;UXhy&ls}gNP$p5Jwm${>%`n0yteeA-@t1mI_ z=OTUG7Cg;(=u;(faOcPGj&H!d_a%vAk)IX67NbL9)$uUzbf0glP+nK8SN@s!3Rr%e zA`Op=>C-wAoV(9r%>xu!iqT1})S6U8c+d044IXL|)TRl-I+u-ak``LG4RSvs#!JTV;U$%cLbTzp(OI;6D_HO3lP12<874G=PO$?o6Oi-u3#XnjkS);6cZ|) zRankFLG9I@-vvX&U?3Rk%*p=NTy1h0B(huR=h7qifI*QPDtkJ$sVwVpHc$t^fW1n# z{@TV=^=Z)w2SvDHz|60{zFcF(IKUmd`>R;sl9uMcixv%K1D>_#CpVpkvcmRR5rt61 zM+^k9A?a9*)3XCF)MBZ<4h1HPO)8ru9wxl5r|`n?yPl1a3BQYS8ppqoORUkS?K(r) zV<714F!}FvO_OvSqjUp^*H5r>3Do|v4t!@t^TLLpNl_G!l&OL}#)Mtb^Ux7osU*#` z{5~WAkP%>rE%jxb8BgPyKr8e&O;=j|IHFumF1{W=lL!?-E<7non9TsH*LO0Ves5;j zObDgLyWag)ploKku<@r*d1HP+=!uE_DwK(EiptikmV5V9;!d-nLgSs2yz( zb!>fkiHdD4taVIkTisHUFia^LX|}GfiA$8KY^G=X`Zn;Po0r^ESZL7$X>&-q+Kv^h zT;tSYbOb|!=9w;g-Cmb_R~QQ)fD?z+F`|rHJhmKE-vxWkgO0#F%;UFX0$1Fno6V-6 z=U)&^gk-Sz2ffx*y?QS=*sOA9a=SV~Y4PlHC*ZEESvYn}mZKui__=`Kf-sBR!h8g( zcC)>1XfR7^*w<=dl1mZRg?>CF?kNXjHaUz~o>}IRDIk#cNBPA}3Q{HNEb+ly_bfP1 zfn}8#g~mO z7Pm?*ee!qMIKj4{=L*uPJmMT6|NF;y&h2zAuqNhX4et~YO3V3kZ@D0f-MZKmY3)Kv zl5AW&jBX<0i=lhkvUuN^Kg{9R!9filu16_S8 zKU?&sl8+;8lJq&jCOxryr;eloB=;pLl~kYx-eyuQ=fsMFUg##9ILTDD_RMDvBJHGn zzne<8-O}yEP&P*r*&t+BbRx+czYp>V>!|H6^D6t8=q7BR%b;59xQ}x(o$2PD50RPy zj|xzWPcze=poi2yKMvhhnG|ZTw>DdgxpgaSfS;W3Btr%ly%Ny^17xTX58}@Db)~%6;Zr z9)86vg-5R=u?7|gOpTmyax>mCI+41^_nNN8@vmil8`_uo?PC-J0=h~R=<5`n*dP@S zER35Kh^fZwKj3otGJTDRQwPRw$7IGQ;D7)HXfE1dZW|q~{TC$H%bu6NL(DB@yS;>M ze_sD1aYpY|ObI5P8{E_%oae8n;+@x#-*ipibkw1IRrX=#%MczR5hKmv^^?Sd{@U#T zF`g9iT1zc>@s-Zo;@gTjMyzK6>Qns{%okC&sj&;jXSIdN>03qqGY7~W+q0H!66T=H zuIs7rZVm#^XGvOTqMLTEZv))kK3e^-oZt#ip=0Mj2q5@!bwk?9M>s*l{FOoBPwTGK zwE2BL#vqcvTP(fH=S1j{QoXK@=h0^CpNKiSf7kEq}s361EI&CP$Q zB@tdLwK$hPmvZF~6QZ(G!CgrbtW?+!UCNhburZ!;&iA!_Oy8VV&NQB~9~%L8^SY%xM?=4gO)0O;z( z8X{z`_QtK1wx+y(=b|S~^Ty6U79b=rIIV#E;nBAkSz_Y77x+6~_wW|4>pE8Vn~*+J zA=O+utiR982J0DGGk(~JW}2*;eQKFoL!a8=e<*5`nUB_GGHS`M!?m*qa{&{o%EKQu zdQ62YOf>Y{nCqpak1aHFduV>*lGNsDFk$xd;jMYJN@9cSFR2C*lyAOyj9OwIh4>h= z(^C4=cY%G`buu>h)H6BRvsC%koD+udx@6aNItdP~;>dlyTN-3JBzf?=K3JqB8oq| zFj$O}Gu|BK-^uOpi_dL9SE%BKG;(q^f`77sMUD%FQ3!I{U^|XeKBLR$0dl+lKr4qg zWg_hC&wugY1GK`@CTMQEZFTV@rJTmEDS>KBf7Zw za1_l;oe3BI{x@DVHfsMFQbGDi7bBjuiP>=Blac&h5d!3rz4~%iZBvLersiJ~ZC8K* z7HEVFK^tQ(lpo~UVwKVSF)WX1!=1C=eD}V-e>-3P38h$a&u4HR)&X<`y`t(bf55J~aDuX{jao1G7r^L|S4R2l$A6`(BxBVqiw!SGL(x_|`|1(pBg^v;9qlI{;Etjf>21sEm z71ESL)s9-sbT}-kc>x6N%A|Wli$_YKv>kd#aRJbEwhnEv7@555H@y+eDSe|yg^CXZ zN0^!r=AS=y7`kq#UZkj%cD&Qi|BTl11HfQc*72~EI@z7NZ@5Ux&V!&N7C;zCC?%lY$@4a=~2v87(B2oo#l^Y(0mpw7oSrlr+@|I;^6wZ1>DAZiX_)g(p#X& zQAfv6QTf2fOIyq5ItzL6Kj={2_Chaq7C*JMeF7<;Z9v|5j?M!>Cb8Cz)b9I;mcaHM zqf87d6z|jKAF>Hy_LimWsDyyl4of-jh2BCBR2iVf9VjvTZK^IuL!N;SnD#8XVkT&& zN#vUxj2d36zl%amiK=yIG`m@Y-gpB5T;Sz7qmwP<@sXmuCyfJH%5pZP?rs3Oz=}}f z{gyFM&dmCBFRHHIRYx9L z0<;t;3DBIVyhe@gBA^Sl4t4*kF|B=bbBGbN_eD927wAeB_Fz;p5th6Ek3R$*vcz;W z%`3K+-$cF;XpZK;!E)a~FmIiBykwG;j8dAG=p^`Kx7zfb02=TLr?^(cUgsk2<_Z90 zd#@XwYf6~%s}KS&gOKlsxp=(*e<#-a29adO8l4Lb4@`ehfbJ6QXe3ggn1%xatcwa~ zei&f5BreEPGA1_==kMyDw?Iz4_bA;azgwW^oQ8!gS0)lUCgzCc7z!27>{tWfUQ%6 zoIG)jkW`G0O8F%V+v9WJ=TsZ)6yaTj=y|n5a9=rJAN1o;xLUzHSa*qsQ)xWcdOZ0i zJBGfwDnZ#)8WUm&Mlf#1AVuo-H)Pg&ojlN5z9rb+ypX`FV(R`^j&&J(ssbF&Fo%u2 z7+Fl|E69tAa+2*@lj=}}KI3 zz$@A>Y<_ztSWQtXF&y$(+ zAQ$0lbfKqW&|qY*$|=CvJ!nzJK@6sZ-3912V@$cm8epE2MykIj6| z^eq`Bnl80>{!g;qMw?eKL5&bh(I(~3NBh5z(LTH+Y{p2H&l+GhW^1@^ZHdLiG(zB$ zKTU&P~tbrYS?wC|?)8=(jaw)N@Q)r3= z&m_fYEh`}cQcl^voRmfRQ1W;vB~r>c!v3$y+eN2Cd)IXUaf4P09Mo|DtJi7@QstM z5&Kmasc*zuI97sUK>syWubxP?U6YX*XmEx5hVD)OPT)ZQXwlmqRq^*kVQLuq5pplT z!2R0PwS(z)e8vV_Ptf9I`MFC{>54~_ucuXO0(1sUnIAra&NPdu_E*k zwv-q~lP07RMbMYlnwfKZrM!4E=`8$((x;@m{%>np=zddR<#xsto6ezzPTSt`Hz17 zUuxKS=?+-8@IvKHpvO+0>UlTa;Gx3k3)6H+uRTQWs5I_<@g)>n<1d7Ez>fGvOsr)TX zo+%*@hVv>yU1!QmX4PI7G*fUGkm!{U^BBV9Yui_@A1S#xUBaiQo(kGYf**dWf2?Ud z8u?P`ecrpoJ@q^$$5-(5W9HOnLylKXL6~l$5wv($hgbYf_qVuBDP~nK<(OhpK2B$5 zx_M4Gmf)q<))a#1y#vbpbs>nJl}+j#SemSVB9rq~+N zEYzP}Qv2=@gmg+1h_koa7BqE7xfzt9u0K=y;Z+LG8I`GO>JjNQp1+B-dT9z-j`AmtFlrEk`YYj9T(ObD`NpD15il=|v$yK(TfkQ{*}OS((iBGI;gZ0}q8%(oUeY7V6Zc zM&H__wl&z7WpN~O4m$gVY{TB)OYNE={A2Cz7@8${5J!z z54KM(MZZjB-Q(w3>1f7!E42(wzU=Y!O!P$RG$tq+_GQA;nqVT8DzlOI_@=M>1aH&- zCH^*1QG`0gEN2;&edEv%=b%meRsF(pX~1GuJ;r-&-8N5)SBZ<>4rAjyB>9GC{_1A+ zI&@}7a^uV+(KqitZDg9|!yDdlAC~*e4p|83!wjjC#Depr9Hy977<;ymlUI5NBY24z zMA<0Xc`i3W6lf7P64@xKnB0sLl*=S_6MrtX=6?Hwc&uf!xM5T6k5gvZ5x(p>yICBk z3jc!WKVHMiV9@=~0q`^WOoYq$4wKeg=NCV=Bhs!1!(Ok)O7z_(E903rMV(i-M{6;xhm(&VC$G?bV~^oPf_uI}|8(BrDYHcjWY zquOQ4(8A<#q8nU*6Oy9tP7p?#8DFc)6zt$GI48Yjq3Yzj2%-*JeOgSeJzdtTv_$9- z+*xlh)e)9znIKain3p-8X%5*@WF*ottvTVVOsO9%*)PD_J-9m7Qo=?2jK7{SdmM1R zletq|(qcXeI#%T0aZGUw{~I0R69-z$VB=$J6cY$C1>%$o+KlYLif7l0_Rk|`p6VZ@ z+!~h=2~uOW9-yYb^v;&R(?z!%4*F}=d=n8$sSI z=TTFG@boHgo_`hGtK(;Nlz3d!Iz7y=lkmKW)D|koc20U8o)OXs-IXI7&NW$Y3YD6B zhrc<{&CzB?5FsiU7dEf=(v0^bp&xkukLoGc(9F*?)Mgc>F2!2q@rDvkIgZM$+A-@Z{A-)%j^*@mM2_&f-QI14exJj@h7{3} z2%D~lz-Et}6Q43~wj_+&9y_M!*67=+j!J{T1HF%nq?T%V;(B<4PY-__Kn%X7`!%c# zCpDWo>PLo;%FE*Pk|IpgUzp{szSmCx-MF`WzrH4!j(wq?nF?F>o$3(TR;}tLPs;5g zycK)-`I1$r=A2XiP0M%A-=K+#Xv@`-q4lJlCIUb3>;ByycdFUgl*Iu49bADj2aT=% z+?Uvi)&yIVGT-Og(c@|c7fKWFGIteMoUmU}gXGUNa&bnm*hcr~Tb(LQq(1QKui`j6 zW8B|GiMC{a0moRT^f8}C8Ek&;%xn+yH;+FTsj2$akm|9_Z)Ppys)12zJvu8*=7y(j z`J|=^k@Gk(++gvxGE}+-vhpJ`>>e3$?jW;Hi{>c65HrRn!KtqD|wyZjRokBUdI*Un7FG>v2^eNqeXdYK+g zci<6_w~}Tj;xr-=$kyu@&@biWvL_KW8t9r%x6IcR$%sR77;>s+o&CoB&(}s~L3H=l zjTuPf;XTzX{B`E%wzr+FIrc>E7?e991!UD8V=|GgC!T@I!uK?9`_q1T%slCi9&^^w zjOh3%;#_eMRjA`z&_<)Eb)wdnZmoJ(+uc#z%>9>9HAvo!+L(DFVvQO^FVsjzCLd7< zH<{f4z~96UULF_j+f3eAZf{%}QHuYrmpqgw#1#Pm|LuRZ0B)_#b0+hG zvqUdrW9W4&IJVW;3G>beRBH<82V3l$sU|2AX8GSX^r=TpCBJ=x=8XPCtBRm>D9rNa zY~s3Kh)v$EioS*|V@JGDd^4cZ6)gQMx0Gndc!qAdHX{6h{CBV(2Kh=2ztY+c|6j`j zmxuL1C3Pc8PAlbdM)_A1u7wzC_VG`vUlPH2i`__%-kxI2P_VG7mtDj7L>&~~!ysgF zo#Z!QrDdf;JLMVqx{u!(r;}VD6xI^tR7OYvL;$repSIC}+^ENOlHJIX z88Tg;hhr)X+!j_TT9fHfwuS zGHPUZ(9D$7*Q{=)si+da??3>Ceed~SJwH%|C~Y?xGmN$OCM7S;p2iWsGgM6Tje#Yo z} z9a-%bf5y6=J6!rT+I&_S<)j2>2gm(Bo|id+w7G|{78FLvzY%d{sNi63HrL`?++P?vj0b;7~_Pup}M)GadTI@W6>d!r4yt^oqWFjnH&zPH8gF z`E%Yj^E(o8c&eOz(VD2O#K`yL(K7X$f|H?!#GRH*(^CDJCZP%5IK_Ypn4zAG;HsI7 zxm9fp(puhKkECxZV@ROUZ_M@Q*FjNk3W(J<*l z9jN$Rne89gn7SnoW$c=8CJn0Q{oH=6&&jgI!ea4I^7*4bs^b||yXVW4a^WazzUZQeI zVDs$H`;WFX|ANw&NsrN`LVT5WNWi`V=bdc-c+V-*sNg9CzW5*2n%iLVDsdYI=j}O7 z8<8Y}jY(_X8shRpjLl_phNykuXaB!bqZ~s;EkLpu)p^p;(>P`&U(U%v5lEFv*Z_X2 zhTrYeo+TXFPQS>#yfW_0@sK4_@Z_>~LzDv+sH5Pu)!q<1Bg_YtI=ae73E+jE>oAlB?b zmwO|Mxu9DzDzclqUYQXkJ%ia_(JfM@eNTwK`!;q_WP;6FsMX5~?gS~Aicy|JvDILn zZqKxi)pxV*HH*k*UDQNut{}T zEFimNAQOi?HCyXqKP{Rq#1Kz99_vzlNg4J$!kvaa)Rlj)F4^tOqu*fOSJQ^`Lr^Bb zpsJn6b}r>*7oqYMWJta?GO5nO)S`#o&qs|+-?5N+`tV)bL3zlUH}%^)d_iSV(4^Dh z?FMnVknfY=4kd7hD>ynS+0fvAOgYUbuBy9z*%bPN>{RbjWDfg|^RS<3us@meh-K+x zjW2pRUR1wKL0eO^n70u7v(@kj@8RLIrmYN*i~(Pp^R}(3o@7ufun%v#a_om~&JR1K z^4>=5zEaVsykx{gJ^|_X5zS>3nvEC0%KF$2_(sYz}A6k&$M#>5zq6 z7}rke=$uZ>AE}~Y;7fMn)T@1Oyz0aB_OH~38a2dbURaC2VjDovJ+<73X?0hN^1vNl3$YeQp#E(aC2LE2k#K*&DXZLhVknWF|r-u#0jV}Tbt`|?z|FEU|Ks0sQwJ0CH$?58rFcE_7dqn$mGwqs zkiWUjvz1HHQsn)s?Md(>WIIM%_RDOu_^MN4kTbVvopPSpK$|2$P4VrsZn3DzX5R+> z!p*6Y@4sW0RFz(?l zC*v!z+&;#V;n_sXx@cZSV?~MGmFw};`IGx}=LKj$3tI-xY71AknY~yMlJpTBfc3xE zEw@+*ER4d|qeK<-0F8O?md_i%&G;&yfaLrM&G5GadZUp-mv8`x<{ll^uF4Q+uM%LA zyy6VQ2fD0g-ba`}l_@qZjTxq0ZI1FmrMPY5usd{?uHXK7XL2#zzc5nrU;QEgL@B4K zrNMif=o0Q>A3`ec(ouyA06%MOeG0|F;lBg#QCeeiG$6V-Gu28~K-I`riP%9Gvltzi zQc6}MV{gb7Xsz{qwapW&iw1;Q$%=p@3XOC(!exq&M4hT5-?9T;YZ?(cnuStzj9J(V zVLo_yDAv#UL~|`0_Qm_$l`K)HRC&IjgOGczQkG55FHrcHNpBIVh6{KN)+|K2^~UvB zwG*L01kP^gmYyyz3KoePg)0ST;sgGwSKBv-)&t&u^Qy0xBiK-;`-7=3BlzETDtHKD z|3UeRvK*&y|4XM|#%_Lr`lk}~gmJ@fshVUcW(Ck=RKlUv_2Wst3vVzcu=v?CJHPqa zRjrqlkG%!19LJ8=jpH#j<}$x)#4XI{T;6p;D_I_?H<~lnSVVwUjDf HSOoqb3W$dn diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 5221ab7d2..fc00be6a7 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -344,7 +344,7 @@ class SMESH_EXPORT SMESH_Mesh bool IsOrderOK( const SMESH_subMesh* smBefore, const SMESH_subMesh* smAfter ) const; - ostream& Dump(ostream & save); + std::ostream& Dump(ostream & save); private: diff --git a/src/SMESHUtils/SMESH_MAT2d.cxx b/src/SMESHUtils/SMESH_MAT2d.cxx index c9fcd8501..7b9eac3c2 100644 --- a/src/SMESHUtils/SMESH_MAT2d.cxx +++ b/src/SMESHUtils/SMESH_MAT2d.cxx @@ -47,7 +47,7 @@ #include #ifdef _DEBUG_ -#define _MYDEBUG_ +//#define _MYDEBUG_ #include "SMESH_File.hxx" #include "SMESH_Comment.hxx" #endif @@ -162,6 +162,8 @@ namespace if ( inSegments.size() > 1000 ) return; const char* fileName = "/misc/dn25/salome/eap/salome/misc/Code/C++/MAdebug.txt"; + const char* user = getenv("USER"); + if ( !user || strcmp( user, "eap" )) return; SMESH_File file(fileName, false ); file.remove(); file.openForWriting(); @@ -1518,9 +1520,9 @@ Adaptor3d_Curve* SMESH_MAT2d::MedialAxis::make3DCurve(const Branch& branch) cons */ //================================================================================ -void SMESH_MAT2d::Branch::init( vector& maEdges, - const Boundary* boundary, - map< const TVDVertex*, BranchEndType > endType ) +void SMESH_MAT2d::Branch::init( vector& maEdges, + const Boundary* boundary, + map< const TVDVertex*, BranchEndType >& endType ) { if ( maEdges.empty() ) return; diff --git a/src/SMESHUtils/SMESH_MAT2d.hxx b/src/SMESHUtils/SMESH_MAT2d.hxx index 618608e07..328366cce 100644 --- a/src/SMESHUtils/SMESH_MAT2d.hxx +++ b/src/SMESHUtils/SMESH_MAT2d.hxx @@ -120,9 +120,9 @@ namespace SMESH_MAT2d public: // internal: construction - void init( std::vector& maEdges, - const Boundary* boundary, - std::map< const TVDVertex*, BranchEndType > endType); + void init( std::vector& maEdges, + const Boundary* boundary, + std::map< const TVDVertex*, BranchEndType >& endType); void setBranchesToEnds( const std::vector< Branch >& branches); BranchPoint getPoint( const TVDVertex* vertex ) const; void setRemoved( const BranchPoint& proxyPoint ); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 645bad1e2..8b7347d7b 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -2512,16 +2512,17 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() } EdgeWithNeighbors() {} }; - struct PrismSide + // PrismSide contains all FACEs linking a bottom EDGE with a top one. + struct PrismSide { - TopoDS_Face _face; - TopTools_IndexedMapOfShape *_faces; // pointer because its copy constructor is private - TopoDS_Edge _topEdge; - vector< EdgeWithNeighbors >*_edges; - int _iBotEdge; - vector< bool > _isCheckedEdge; + TopoDS_Face _face; // a currently treated upper FACE + TopTools_IndexedMapOfShape *_faces; // all FACEs (pointer because of a private copy constructor) + TopoDS_Edge _topEdge; // a current top EDGE + vector< EdgeWithNeighbors >*_edges; // all EDGEs of _face + int _iBotEdge; // index of _topEdge within _edges + vector< bool > _isCheckedEdge; // mark EDGEs whose two owner FACEs found int _nbCheckedEdges; // nb of EDGEs whose location is defined - PrismSide *_leftSide; + PrismSide *_leftSide; // neighbor sides PrismSide *_rightSide; void SetExcluded() { _leftSide = _rightSide = NULL; } bool IsExcluded() const { return !_leftSide; } @@ -2679,7 +2680,7 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA typedef vector< EdgeWithNeighbors > TEdgeWithNeighborsVec; vector< TEdgeWithNeighborsVec > faceEdgesVec( allFaces.Extent() + 1 ); - const size_t nbEdgesMax = facesOfEdge.Extent() * 2; // there can be seam EDGES + const size_t nbEdgesMax = facesOfEdge.Extent() * 2; // there can be seam EDGEs TopTools_IndexedMapOfShape* facesOfSide = new TopTools_IndexedMapOfShape[ nbEdgesMax ]; SMESHUtils::ArrayDeleter delFacesOfSide( facesOfSide ); @@ -2815,6 +2816,10 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA side._isCheckedEdge[ side._iBotEdge ] = true; side._nbCheckedEdges = 1; // bottom EDGE is known } + else // probably a triangular top face found + { + side._face.Nullify(); + } side._topEdge.Nullify(); isOK = ( !side._edges->empty() || side._faces->Extent() > 1 ); From 5218291db413b71dd88a5590a40a961703ceb826 Mon Sep 17 00:00:00 2001 From: imn Date: Fri, 19 Feb 2016 15:40:34 +0300 Subject: [PATCH 082/147] INT PAL 0053058: '2D Quadratic' item is shown in VTK context menu for non-quadratic mesh --- src/SMESHGUI/SMESHGUI.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_ConvToQuadOp.h | 4 ++-- src/SMESHGUI/SMESHGUI_Selection.cxx | 20 ++++++++++++++++++++ src/SMESHGUI/SMESHGUI_Selection.h | 1 + 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d72312ddb..2b367eb97 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4487,11 +4487,11 @@ void SMESHGUI::initialize( CAM_Application* app ) //------------------------------------------------- anId = popupMgr()->insert( tr( "MEN_QUADRATIC_REPRESENT" ), -1, -1 ); popupMgr()->insert( action( SMESHOp::OpRepresentationLines ), anId, -1 ); - popupMgr()->setRule( action( SMESHOp::OpRepresentationLines ), aMeshInVTK + "and isVisible",QtxPopupMgr::VisibleRule ); + popupMgr()->setRule( action( SMESHOp::OpRepresentationLines ), aMeshInVTK + "&& isVisible && isQuadratic",QtxPopupMgr::VisibleRule ); popupMgr()->setRule( action( SMESHOp::OpRepresentationLines ), "quadratic2DMode = 'eLines'", QtxPopupMgr::ToggleRule ); popupMgr()->insert( action( SMESHOp::OpRepresentationArcs ), anId, -1 ); - popupMgr()->setRule( action( SMESHOp::OpRepresentationArcs ), aMeshInVTK + "and isVisible", QtxPopupMgr::VisibleRule ); + popupMgr()->setRule( action( SMESHOp::OpRepresentationArcs ), aMeshInVTK + "&& isVisible && isQuadratic", QtxPopupMgr::VisibleRule ); popupMgr()->setRule( action( SMESHOp::OpRepresentationArcs ), "quadratic2DMode = 'eArcs'", QtxPopupMgr::ToggleRule ); //------------------------------------------------- diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx index cc60fc471..b79102f05 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx @@ -326,7 +326,7 @@ void SMESHGUI_ConvToQuadOp::onWarningWinFinished() SMESHGUI_ConvToQuadOp::MeshDestinationType SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSource, - bool* isMixOrder) const + bool* isMixOrder) { SMESH::long_array_var nbElemOfType = idSource->GetMeshInfo(); diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.h b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.h index e700c8f09..305ded865 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.h +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.h @@ -52,12 +52,12 @@ public: virtual LightApp_Dialog* dlg() const; + static MeshDestinationType DestinationMesh( const SMESH::SMESH_IDSource_var& , + bool* isMixOrder = 0); protected: virtual void startOperation(); virtual void selectionDone(); virtual SUIT_SelectionFilter* createFilter( const int ) const; - MeshDestinationType DestinationMesh( const SMESH::SMESH_IDSource_var& , - bool* isMixOrder = 0) const; protected slots: virtual bool onApply(); diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 3d446d96d..8c12c817b 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -32,6 +32,7 @@ #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_GEOMGenUtils.h" #include "SMESHGUI_ComputeDlg.h" +#include "SMESHGUI_ConvToQuadOp.h" #include #include @@ -133,6 +134,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const else if ( p=="isImported" ) val = QVariant( isImported( ind ) ); else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) ); else if ( p=="groupType" ) val = QVariant( groupType( ind ) ); + else if ( p=="isQuadratic" ) val = QVariant( isQuadratic( ind ) ); else if ( p=="quadratic2DMode") val = QVariant( quadratic2DMode( ind ) ); else if ( p=="isDistributionVisible") val = QVariant( isDistributionVisible( ind ) ); else if ( p=="isScalarBarVisible") val = QVariant( isScalarBarVisible( ind ) ); @@ -231,6 +233,24 @@ QString SMESHGUI_Selection::displayMode( int ind ) const return "Unknown"; } +//======================================================================= +//function : isQuadratic +//purpose : return true if the mesh has quadratic/bi-quadratic type +//======================================================================= + +bool SMESHGUI_Selection::isQuadratic( int ind ) const +{ + _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); + if ( !so ) + return false; + SMESH::SMESH_IDSource_var idSource = SMESH::SObjectToInterface( so ); + if ( idSource->_is_nil() ) + return false; + SMESHGUI_ConvToQuadOp::MeshDestinationType meshTgtType = SMESHGUI_ConvToQuadOp::DestinationMesh( idSource ); + if ( meshTgtType & SMESHGUI_ConvToQuadOp::MeshDestinationType::Linear ) + return true; + return false; +} //======================================================================= //function : quadratic2DMode diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index e3146cad3..c62f14a5d 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -62,6 +62,7 @@ public: virtual bool isEditableHyp( int ) const; virtual bool isVisible( int ) const; + virtual bool isQuadratic( int ) const; virtual QString quadratic2DMode( int ) const; virtual bool isDistributionVisible( int ) const; From c31ad1186e5aa32ebb853f01bf4b1ff6c2af06a5 Mon Sep 17 00:00:00 2001 From: vsr Date: Sat, 20 Feb 2016 10:20:57 +0300 Subject: [PATCH 083/147] C++98 compatibility (remove C++11 staff) --- src/SMESHGUI/SMESHGUI_Selection.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 8c12c817b..9895612c3 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -247,7 +247,7 @@ bool SMESHGUI_Selection::isQuadratic( int ind ) const if ( idSource->_is_nil() ) return false; SMESHGUI_ConvToQuadOp::MeshDestinationType meshTgtType = SMESHGUI_ConvToQuadOp::DestinationMesh( idSource ); - if ( meshTgtType & SMESHGUI_ConvToQuadOp::MeshDestinationType::Linear ) + if ( meshTgtType & SMESHGUI_ConvToQuadOp::Linear ) return true; return false; } From 27d9294f19e0a124d6d4c1949e1e3cdc749578ad Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 24 Feb 2016 12:51:57 +0300 Subject: [PATCH 084/147] Windows compatibility. --- src/SMESH_I/SMESH_Measurements_i.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SMESH_I/SMESH_Measurements_i.cxx b/src/SMESH_I/SMESH_Measurements_i.cxx index 8da1cd7cf..b3e832b45 100644 --- a/src/SMESH_I/SMESH_Measurements_i.cxx +++ b/src/SMESH_I/SMESH_Measurements_i.cxx @@ -22,6 +22,10 @@ // File : SMESH_Measurements_i.cxx // Author : Pavel TELKOV, Open CASCADE S.A.S. (pavel.telkov@opencascade.com) +#ifdef WIN32 +#define NOMINMAX +#endif + #include "SMESH_Measurements_i.hxx" #include "SMESH_Gen_i.hxx" From 15a305400b400768e8de3632ae2623d9280d2e76 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 25 Feb 2016 11:27:34 +0100 Subject: [PATCH 085/147] set log verbosity, general crack dialog --- src/Tools/blocFissure/gmu/geomsmesh.py | 4 +- .../blocFissure/ihm/fissureCoude_plugin.py | 15 +- src/Tools/blocFissure/ihm/fissureGenerale.ui | 287 +++++++++++------- .../blocFissure/ihm/fissureGenerale_plugin.py | 27 +- 4 files changed, 210 insertions(+), 123 deletions(-) diff --git a/src/Tools/blocFissure/gmu/geomsmesh.py b/src/Tools/blocFissure/gmu/geomsmesh.py index aa8f02c93..4c61d1b92 100644 --- a/src/Tools/blocFissure/gmu/geomsmesh.py +++ b/src/Tools/blocFissure/gmu/geomsmesh.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import logging -logging.info('start') +#logging.info('start') import initLog import salome @@ -13,7 +13,7 @@ geompy = geomBuilder.New(salome.myStudy) from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -logging.debug("initialisation de geompy et smesh OK") +# logging.debug("initialisation de geompy et smesh OK") def geomPublish(level,aShape, aName): if initLog.getLogLevel() <= level: diff --git a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py index d88841900..b50905f82 100644 --- a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py @@ -25,14 +25,6 @@ import sys, traceback import math from blocFissure import gmu -from blocFissure.gmu import initLog -#initLog.setDebug() -initLog.setVerbose() - -from blocFissure.gmu import geomsmesh -from blocFissure.gmu.casStandard import casStandard - -from blocFissure.ihm.fissureCoude_ihm import fissureCoude_ihm def fissureCoudeDlg(context): # get context study, studyId, salomeGui @@ -363,6 +355,13 @@ def fissureCoudeDlg(context): return self.NOK def execute(self): + from blocFissure.gmu import initLog + #initLog.setDebug() + initLog.setVerbose() # don't set the level too early, to be able to modify it + from blocFissure.gmu import geomsmesh + from blocFissure.gmu.casStandard import casStandard + from blocFissure.ihm.fissureCoude_ihm import fissureCoude_ihm + dico = self.creeDico() NOK = self.testval(dico) if not(NOK): diff --git a/src/Tools/blocFissure/ihm/fissureGenerale.ui b/src/Tools/blocFissure/ihm/fissureGenerale.ui index 3f2cf9c3d..503b56e6c 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale.ui +++ b/src/Tools/blocFissure/ihm/fissureGenerale.ui @@ -6,8 +6,8 @@ 0 0 - 631 - 560 + 629 + 536 @@ -16,7 +16,7 @@ <html><head/><body><p>Insertion d'un maillage de fissure dans un maillage hexaédrique sain.</p><p>Le maillage sain est fourni sous forme de fichier Med.</p><p>La face de fissure est décrite par une géométrie dans un fichier brep.</p><p>La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.</p><p>La procédure identfie des mailles saines à enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone à remailler en tétraèdres.</p></body></html> - + @@ -35,7 +35,7 @@ - <html><head/><body><p>Index des edges décrivant le fond de fissure, dans la face de fissure.</p><p>Sous forme d'une liste Python.</p><p>Exemples :<span style=" color:#00ffff;"/><span style=" font-style:italic; color:#00ffff;">[5,9]</span> ou <span style=" font-style:italic; color:#00ffff;">[3]</span></p><p>(on peut récupérer ces valeurs à l'aide du dialogue de création de groupes d'edges, dans GEOM)</p></body></html> + <html><head/><body><p>Index des edges décrivant le fond de fissure, dans la face de fissure.</p><p>Sous forme d'une liste Python.</p><p>Exemples :<span style=" color:#00ffff;"/><span style=" font-style:italic; color:#000080;">[5,9]</span> ou <span style=" font-style:italic; color:#000080;">[3]</span></p><p>(on peut récupérer ces valeurs à l'aide du dialogue de création de groupes d'edges, dans GEOM)</p></body></html> @@ -98,23 +98,23 @@ - - + + identification zone à remailler - - - - + + + + distance influence - + <html><head/><body><p>La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.</p></body></html> @@ -126,101 +126,189 @@ - - + + + + + + prémaillage face fissure + + + + + + + + min + + + + + + + <html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html> + + + 5 + + + 1000000.000000000000000 + + + + + + + max + + + + + + + <html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html> + + + 5 + + + 1000000.000000000000000 + + + + + + + + + + + + Qt::Horizontal + + + + 13 + 17 + + + + + + + + + + + + messages + + + + + + + + mode + + + + + + + <html><head/><body><p>L'affichage de messages pendant le calcul peut aider à la mise au point du maillage.</p><p>- Le mode <span style=" font-weight:600;">silencieux</span> donne très peu d'information,</p><p>- Le mode <span style=" font-weight:600;">verbeux</span> liste les principales étapes du calcul,</p><p>- Le mode <span style=" font-weight:600;">debug</span> donne un maximum de détail, et publie des objets intermédiaires dans l'étude.</p><p><br/></p></body></html> + + + + silencieux + + + + + verbeux + + + + + debug + + + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + - Qt::Horizontal + Qt::Vertical - 0 - 20 + 20 + 17 - - - - prémaillage face fissure - - - - - - - - min - - - - - - - <html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html> - - - 5 - - - 1000000.000000000000000 - - - - - - - max - - - - - - - <html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html> - - - 5 - - - 1000000.000000000000000 - - - - - - - - - Qt::Horizontal - - - - 34 - 20 - - - - - - - + groupBox_3 + groupBox_7 + horizontalSpacer_3 + verticalSpacer + horizontalSpacer_3 + horizontalSpacer_9 - + + + + Qt::Horizontal + + + + 17 + 20 + + + + + + + + 0 + 0 + + maillage zone de fissure - - + + pipe rayonnant - - + + @@ -310,7 +398,7 @@ - + Qt::Horizontal @@ -326,20 +414,20 @@ - + faces externes - - + + aretes face fissure - + <html><head/><body><p>Faces externes de la zone à remailler.</p><p>Mailage en triangles : valeur cible des arêtes.</p></body></html> @@ -352,7 +440,7 @@ - + Qt::Horizontal @@ -371,19 +459,6 @@ - - - - Qt::Vertical - - - - 20 - 112 - - - - diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py index c0a208059..e7c0ef357 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -25,12 +25,6 @@ import sys, traceback import math from blocFissure import gmu -from blocFissure.gmu import initLog -#initLog.setDebug() -initLog.setVerbose() - -from blocFissure.gmu import geomsmesh -from blocFissure.gmu.casStandard import casStandard def fissureGeneraleDlg(context): # get context study, studyId, salomeGui @@ -52,6 +46,7 @@ def fissureGeneraleDlg(context): class fissureGeneraleDialog(QtGui.QDialog): def __init__(self): + print "__init__" QtGui.QDialog.__init__(self) # Set up the user interface from Designer. self.ui = Ui_Dialog() @@ -195,6 +190,19 @@ def fissureGeneraleDlg(context): #self.initDefaut() self.initDialog(self.defaut) + def setLogVerbosity(self): + from blocFissure.gmu import initLog # le mode de log s'initialise une seule fois + print "setLogVerbosity" + index = self.ui.cb_log.currentIndex() + print index + if index == 0: + initLog.setRelease() + elif index == 1: + initLog.setVerbose() + elif index == 2: + initLog.setDebug() + + def sauver(self): print "sauver" fileDiag = QFileDialog(self) @@ -268,11 +276,15 @@ def fissureGeneraleDlg(context): return self.NOK def execute(self): + print "execute" dico = self.creeDico() NOK = self.testval(dico) if not(NOK): self.writeDefault(dico) self.ui.lb_calcul.show() + self.setLogVerbosity() + from blocFissure.gmu import geomsmesh # après intialisation log dans setLogVerbosity + from blocFissure.gmu.casStandard import casStandard # après intialisation log dans setLogVerbosity execInstance = casStandard(dico) self.NOK = NOK self.accept() @@ -280,7 +292,8 @@ def fissureGeneraleDlg(context): pass # ---------------------------------------------------------------------------- - + + print "main" window = fissureGeneraleDialog() retry = True while(retry): From a7e3aa2650e5bb26454aa314fa11e658fd49e6e1 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 25 Feb 2016 17:57:05 +0100 Subject: [PATCH 086/147] general crack dialog, working dir and result file --- src/Tools/blocFissure/ihm/fissureGenerale.ui | 41 +++++++++++++++--- .../blocFissure/ihm/fissureGenerale_plugin.py | 43 ++++++++++++++++++- 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/Tools/blocFissure/ihm/fissureGenerale.ui b/src/Tools/blocFissure/ihm/fissureGenerale.ui index 503b56e6c..cbe389c62 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale.ui +++ b/src/Tools/blocFissure/ihm/fissureGenerale.ui @@ -6,8 +6,8 @@ 0 0 - 629 - 536 + 666 + 589 @@ -269,12 +269,7 @@ - groupBox_3 - groupBox_7 - horizontalSpacer_3 verticalSpacer - horizontalSpacer_3 - horizontalSpacer_9 @@ -461,6 +456,38 @@ + + + + + + répertoire de travail + + + + + + + <html><head/><body><p>Répertoire dans lequel seront rangés le maillage final, les objets intermédiaires, la log d'exécution.</p></body></html> + + + + + + + nom résultat + + + + + + + <html><head/><body><p>nom du fichier maillage résultat</p></body></html> + + + + + diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py index e7c0ef357..c8c495abe 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -74,6 +74,10 @@ def fissureGeneraleDlg(context): self.selectMaillage) self.connect(self.ui.pb_facefiss, QtCore.SIGNAL("clicked()"), self.selectFacefiss) + self.connect(self.ui.pb_reptrav, QtCore.SIGNAL("clicked()"), + self.selectReptrav) + self.connect(self.ui.pb_nomres, QtCore.SIGNAL("clicked()"), + self.selectNomres) self.disconnect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"), self.accept) self.connect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"), self.execute) @@ -90,7 +94,9 @@ def fissureGeneraleDlg(context): lenSegPipe = 2.5, nbSegRad = 5, nbSegCercle = 32, - areteFaceFissure = 10) + areteFaceFissure = 10, + reptrav = '.', + nomres = 'casStandard_fissure.med') def initDialog(self, dico): @@ -105,6 +111,8 @@ def fissureGeneraleDlg(context): self.ui.sb_couronnes.setValue(dico['nbSegRad']) self.ui.sb_secteurs.setValue(dico['nbSegCercle']) self.ui.dsb_areteFaceFissure.setValue(dico['areteFaceFissure']) + self.ui.le_reptrav.setText(os.path.abspath(dico['reptrav'])) + self.ui.le_nomres.setText(os.path.split(dico['nomres'])[1]) incomplet = self.testval(dico) pass @@ -256,6 +264,35 @@ def fissureGeneraleDlg(context): print filedef self.ui.le_facefiss.setText(filedef) + def selectReptrav(self): + fileDiag = QFileDialog(self) + fileDiag.setFileMode(QFileDialog.Directory) + fileDiag.setViewMode(QFileDialog.Detail) + fileDiag.setDirectory(self.ui.le_reptrav.text()) + if fileDiag.exec_() : + fileNames = fileDiag.selectedFiles() + reptrav = str(fileNames[0]) + print "reptrav ", reptrav + self.ui.le_reptrav.setText(os.path.abspath(reptrav)) + + + def selectNomres(self): + fileDiag = QFileDialog(self) + fileDiag.setFileMode(QFileDialog.AnyFile) + fileDiag.setViewMode(QFileDialog.Detail) + nomres=str(os.path.split(str(self.ui.le_nomres.text()))[1]) + fileDiag.setDirectory(self.ui.le_reptrav.text()) + fileDiag.selectFile(nomres) + fileDiag.setNameFilter("Maillage *.med (*.med)") + self.ui.le_nomres.setText(nomres) + if fileDiag.exec_() : + fileNames = fileDiag.selectedFiles() + tempnom = os.path.split(str(fileNames[0]))[1] + print "nomres ", tempnom + self.ui.le_nomres.setText(tempnom) + else: + self.ui.le_nomres.setText(nomres) + def creeDico(self): dico = dict( maillageSain = str(self.ui.le_maillage.text()), @@ -267,7 +304,9 @@ def fissureGeneraleDlg(context): lenSegPipe = self.ui.dsb_lenSegPipe.value(), nbSegRad = self.ui.sb_couronnes.value(), nbSegCercle = self.ui.sb_secteurs.value(), - areteFaceFissure = self.ui.dsb_areteFaceFissure.value() + areteFaceFissure = self.ui.dsb_areteFaceFissure.value(), + reptrav = str(self.ui.le_reptrav.text()), + nomres = str(self.ui.le_nomres.text()), ) print dico return dico From e144839c8819a7671d4e4a7d0bd8a044a4526862 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 26 Feb 2016 09:15:52 +0100 Subject: [PATCH 087/147] general crack dialog, use working dir and result file name --- src/Tools/blocFissure/gmu/casStandard.py | 10 ++++++++-- src/Tools/blocFissure/ihm/fissureGenerale.ui | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index b0bca4ec1..e03027fea 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -41,8 +41,14 @@ class casStandard(fissureGenerique): self.dicoParams = dicoParams if self.dicoParams.has_key('nomCas'): self.nomCas = self.dicoParams['nomCas'] + elif self.dicoParams.has_key('nomres'): + self.nomCas = os.path.splitext(os.path.split(self.dicoParams['nomres'])[1])[0] else: - self.nomCas = 'casStandard' + self.nomCas = 'casStandard' + if self.dicoParams.has_key('reptrav'): + self.reptrav = self.dicoParams['reptrav'] + else: + reptrav = '.' self.numeroCas = numeroCas if self.numeroCas != 0: self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas) @@ -110,7 +116,7 @@ class casStandard(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): - self.maillageFissureParams = dict(nomRep = '.', + self.maillageFissureParams = dict(nomRep = self.reptrav, nomFicSain = self.nomCas, nomFicFissure = 'fissure_' + self.nomCas, nbsegRad = self.dicoParams['nbSegRad'], diff --git a/src/Tools/blocFissure/ihm/fissureGenerale.ui b/src/Tools/blocFissure/ihm/fissureGenerale.ui index cbe389c62..32deb75fa 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale.ui +++ b/src/Tools/blocFissure/ihm/fissureGenerale.ui @@ -35,7 +35,7 @@ - <html><head/><body><p>Index des edges décrivant le fond de fissure, dans la face de fissure.</p><p>Sous forme d'une liste Python.</p><p>Exemples :<span style=" color:#00ffff;"/><span style=" font-style:italic; color:#000080;">[5,9]</span> ou <span style=" font-style:italic; color:#000080;">[3]</span></p><p>(on peut récupérer ces valeurs à l'aide du dialogue de création de groupes d'edges, dans GEOM)</p></body></html> + <html><head/><body><p>Index des edges décrivant le fond de fissure, dans la face de fissure.</p><p>Sous forme d'une liste Python.</p><p>Exemples : <span style=" font-weight:600; font-style:italic; color:#000080;">[5,9]</span> ou<span style=" font-weight:600;"/><span style=" font-weight:600; font-style:italic; color:#000080;">[3]</span></p><p>(on peut récupérer ces valeurs à l'aide du dialogue de création de groupes d'edges, dans GEOM)</p></body></html> @@ -216,7 +216,7 @@ - <html><head/><body><p>L'affichage de messages pendant le calcul peut aider à la mise au point du maillage.</p><p>- Le mode <span style=" font-weight:600;">silencieux</span> donne très peu d'information,</p><p>- Le mode <span style=" font-weight:600;">verbeux</span> liste les principales étapes du calcul,</p><p>- Le mode <span style=" font-weight:600;">debug</span> donne un maximum de détail, et publie des objets intermédiaires dans l'étude.</p><p><br/></p></body></html> + <html><head/><body><p>L'affichage de messages pendant le calcul peut aider à la mise au point du maillage. Les messages sont écrits dans un fichier de log, dans le répertoire d'exécution.</p><p>- Le mode <span style=" font-weight:600;">silencieux</span> donne très peu d'information,</p><p>- Le mode <span style=" font-weight:600;">verbeux</span> liste les principales étapes du calcul,</p><p>- Le mode <span style=" font-weight:600;">debug</span> donne un maximum de détail, et publie des objets intermédiaires dans l'étude.</p><p><br/></p></body></html> @@ -482,7 +482,7 @@ - <html><head/><body><p>nom du fichier maillage résultat</p></body></html> + <html><head/><body><p>Nom des résultats.</p><p>Le fichier maillage résultat sera rangé dans le répertoire de travail, sous le nom fissure_<span style=" font-weight:600; font-style:italic; color:#0055ff;">Nom</span>.med</p><p><br/></p></body></html> From 4370e1798b3d94dde48a7b878ea73f29d9782c49 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 26 Feb 2016 21:05:40 +0100 Subject: [PATCH 088/147] general crack dialog, save log in file --- src/Tools/blocFissure/gmu/initLog.py | 55 ++++++++++++++----- .../blocFissure/ihm/fissureGenerale_plugin.py | 11 ++-- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/src/Tools/blocFissure/gmu/initLog.py b/src/Tools/blocFissure/gmu/initLog.py index 07c0c3640..c9c78b30c 100644 --- a/src/Tools/blocFissure/gmu/initLog.py +++ b/src/Tools/blocFissure/gmu/initLog.py @@ -10,38 +10,63 @@ critical = 50 loglevel = warning -def setDebug(): +def setDebug(logfile=None): global loglevel - logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', - level=logging.DEBUG) + if logfile: + logging.basicConfig(filename=logfile, + format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.DEBUG) + else: + logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.DEBUG) loglevel = debug logging.info('start Debug %s', loglevel) -def setVerbose(): +def setVerbose(logfile=None): global loglevel - logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', - level=logging.INFO) + if logfile: + logging.basicConfig(filename=logfile, + format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.INFO) + else: + logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.INFO) loglevel = info logging.info('start Verbose %s', loglevel) -def setRelease(): +def setRelease(logfile=None): global loglevel - logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', - level=logging.WARNING) + if logfile: + logging.basicConfig(filename=logfile, + format='%(funcName)s[%(lineno)d] %(message)s', + level=logging.WARNING) + else: + logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', + level=logging.WARNING) loglevel = warning logging.warning('start Release %s', loglevel) -def setUnitTests(): +def setUnitTests(logfile=None): global loglevel - logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', - level=logging.CRITICAL) + if logfile: + logging.basicConfig(filename=logfile, + format='%(funcName)s[%(lineno)d] %(message)s', + level=logging.CRITICAL) + else: + logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', + level=logging.CRITICAL) loglevel = critical logging.critical('start UnitTests %s', loglevel) -def setPerfTests(): +def setPerfTests(logfile=None): global loglevel - logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', - level=logging.CRITICAL) + if logfile: + logging.basicConfig(filename=logfile, + format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.CRITICAL) + else: + logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', + level=logging.CRITICAL) loglevel = critical logging.info('start PerfTests %s', loglevel) diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py index c8c495abe..9e602ed68 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -198,17 +198,17 @@ def fissureGeneraleDlg(context): #self.initDefaut() self.initDialog(self.defaut) - def setLogVerbosity(self): + def setLogVerbosity(self, logfile): from blocFissure.gmu import initLog # le mode de log s'initialise une seule fois print "setLogVerbosity" index = self.ui.cb_log.currentIndex() print index if index == 0: - initLog.setRelease() + initLog.setRelease(logfile) elif index == 1: - initLog.setVerbose() + initLog.setVerbose(logfile) elif index == 2: - initLog.setDebug() + initLog.setDebug(logfile) def sauver(self): @@ -321,7 +321,8 @@ def fissureGeneraleDlg(context): if not(NOK): self.writeDefault(dico) self.ui.lb_calcul.show() - self.setLogVerbosity() + logfile=os.path.join(dico['reptrav'], dico['nomres']+".log") + self.setLogVerbosity(logfile) from blocFissure.gmu import geomsmesh # après intialisation log dans setLogVerbosity from blocFissure.gmu.casStandard import casStandard # après intialisation log dans setLogVerbosity execInstance = casStandard(dico) From fe678b8dc0f994b3bfc0dc7ee681edcec466dbb0 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 29 Feb 2016 15:12:14 +0100 Subject: [PATCH 089/147] general crack dialog, user message mecanism for some errors --- src/Tools/blocFissure/gmu/CMakeLists.txt | 1 + src/Tools/blocFissure/gmu/fissError.py | 17 +++++++++++++ .../gmu/partitionneFissureParPipe.py | 9 ++++++- .../blocFissure/ihm/fissureGenerale_plugin.py | 25 ++++++++++++++++++- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/Tools/blocFissure/gmu/fissError.py diff --git a/src/Tools/blocFissure/gmu/CMakeLists.txt b/src/Tools/blocFissure/gmu/CMakeLists.txt index c0afb86be..64c18760a 100644 --- a/src/Tools/blocFissure/gmu/CMakeLists.txt +++ b/src/Tools/blocFissure/gmu/CMakeLists.txt @@ -51,6 +51,7 @@ SET(plugin_SCRIPTS facesVolumesToriques.py findWireEndVertices.py findWireIntermediateVertices.py + fissError.py fissureCoude.py fissureGenerique.py fusionMaillageAttributionDefaut.py diff --git a/src/Tools/blocFissure/gmu/fissError.py b/src/Tools/blocFissure/gmu/fissError.py new file mode 100644 index 000000000..74b058740 --- /dev/null +++ b/src/Tools/blocFissure/gmu/fissError.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- + +class fissError(Exception): + """ + usage: + try: + instructions() + except: + raise fissError(traceback.extract_stack(),"mon message") + """ + def __init__(self, pile, msg): + self.pile = pile + self.msg = msg + + def __str__(self): + return 'msg=%s\npile=%s\n'%(self.msg, repr(self.pile)) + diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py index 7d6289797..9ad26b854 100644 --- a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py +++ b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py @@ -6,8 +6,10 @@ from geomsmesh import geompy from geomsmesh import geomPublish from geomsmesh import geomPublishInFather import initLog +import traceback from findWireEndVertices import findWireEndVertices from prolongeWire import prolongeWire +from fissError import fissError def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): """ @@ -33,7 +35,12 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure geomPublish(initLog.debug, cercle, 'cercle') fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe) - pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) + try: + pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) + except: + texte = "génération du pipe le long de la ligne de fond de fissure prolongée impossible. " + texte += "Cause éventuelle : la ligne s'autointersecte lorsqu'on la prolonge." + raise fissError(traceback.extract_stack(),texte) geomPublish(initLog.debug, pipeFiss, 'pipeFiss') partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) geomPublish(initLog.debug, partFissPipe, 'partFissPipe') diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py index 9e602ed68..e2d5d9dc1 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -41,6 +41,7 @@ def fissureGeneraleDlg(context): from PyQt4.QtGui import QMessageBox from PyQt4.QtGui import QPalette from PyQt4.QtGui import QColor + from PyQt4.QtCore import QString from fissureGenerale_ui import Ui_Dialog class fissureGeneraleDialog(QtGui.QDialog): @@ -307,6 +308,7 @@ def fissureGeneraleDlg(context): areteFaceFissure = self.ui.dsb_areteFaceFissure.value(), reptrav = str(self.ui.le_reptrav.text()), nomres = str(self.ui.le_nomres.text()), + verbosite = self.ui.cb_log.currentIndex() ) print dico return dico @@ -325,7 +327,28 @@ def fissureGeneraleDlg(context): self.setLogVerbosity(logfile) from blocFissure.gmu import geomsmesh # après intialisation log dans setLogVerbosity from blocFissure.gmu.casStandard import casStandard # après intialisation log dans setLogVerbosity - execInstance = casStandard(dico) + from blocFissure.gmu.fissError import fissError + try: + execInstance = casStandard(dico) + except fissError as erreur: + print '-'*60 + print type(erreur) + print '-'*60 + print erreur.msg + print '-'*60 + for ligne in erreur.pile: + print repr(ligne) + print '-'*60 + texte = erreur.msg +# texte += +"
        " +'-'*60 +"
        " +# for ligne in erreur.pile: +# texte += repr(ligne) +"
        " + mbox = QMessageBox(self) + mbox.setWindowTitle("erreur blocFissure") + mbox.setText(QString.fromUtf8(texte)) + mbox.exec_() +# except Exception as erreur: +# print "exception non répertoriée" self.NOK = NOK self.accept() From 049440912bd213f954a50d4b20e9a468dec33635 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 29 Feb 2016 16:56:48 +0100 Subject: [PATCH 090/147] general crack dilalog, completion of save parameters --- src/Tools/blocFissure/ihm/fissureGenerale_plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py index e2d5d9dc1..a5001d361 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -97,7 +97,8 @@ def fissureGeneraleDlg(context): nbSegCercle = 32, areteFaceFissure = 10, reptrav = '.', - nomres = 'casStandard_fissure.med') + nomres = 'casStandard_fissure.med', + verbosite = 0) def initDialog(self, dico): @@ -114,6 +115,7 @@ def fissureGeneraleDlg(context): self.ui.dsb_areteFaceFissure.setValue(dico['areteFaceFissure']) self.ui.le_reptrav.setText(os.path.abspath(dico['reptrav'])) self.ui.le_nomres.setText(os.path.split(dico['nomres'])[1]) + self.ui.cb_log.setCurrentIndex(dico['verbosite']) incomplet = self.testval(dico) pass From c754537e9f78cd30b7dba7fd9a5d41c4b0d4d87a Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 29 Feb 2016 17:34:41 +0100 Subject: [PATCH 091/147] general crack dialog, an error detection --- .../blocFissure/gmu/identifieElementsDebouchants.py | 10 +++++++++- src/Tools/blocFissure/gmu/partitionneFissureParPipe.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py index af485444e..20c38e937 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py +++ b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py @@ -7,6 +7,8 @@ from geomsmesh import geompy from geomsmesh import geomPublish from geomsmesh import geomPublishInFather import initLog +import traceback +from fissError import fissError from produitMixte import produitMixte from whichSide import whichSide @@ -94,7 +96,13 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, edgesLoc = geompy.ExtractShapes(locEdgePart, geompy.ShapeType["EDGE"], False) edgesLocSorted =[(geompy.MinDistance(edge, locPt0), kk, edge) for kk, edge in enumerate(edgesLoc)] edgesLocSorted.sort() - ofp = geompy.BasicProperties(edgesLocSorted[0][2])[0] # distance curviligne centre locPt0 + try: + ofp = geompy.BasicProperties(edgesLocSorted[0][2])[0] # distance curviligne centre locPt0 + except: + texte = "Identification des éléments au débouché du pipe sur la face externe impossible. " + texte += "Cause éventuelle : la ligne de fond de fissure comprend un point géométrique coincidant avec la face externe. " + texte += "La ligne de fond de fissure doit déboucher franchement de la face externe, et ne doit pas être coupée au niveau de la face" + raise fissError(traceback.extract_stack(),texte) logging.debug("distance curviligne centre extremite0: %s", ofp) p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0) p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0) diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py index 9ad26b854..ca6829f3d 100644 --- a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py +++ b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py @@ -6,9 +6,9 @@ from geomsmesh import geompy from geomsmesh import geomPublish from geomsmesh import geomPublishInFather import initLog -import traceback from findWireEndVertices import findWireEndVertices from prolongeWire import prolongeWire +import traceback from fissError import fissError def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): From cc583a4ffa28ca9ae502d862fa29b8343b727aa9 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 29 Feb 2016 18:09:50 +0100 Subject: [PATCH 092/147] general crack dialog, another error detection --- .../blocFissure/gmu/identifieElementsDebouchants.py | 4 ++-- src/Tools/blocFissure/gmu/partitionneFissureParPipe.py | 2 +- src/Tools/blocFissure/gmu/restreintFaceFissure.py | 10 +++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py index 20c38e937..fb03f94b7 100644 --- a/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py +++ b/src/Tools/blocFissure/gmu/identifieElementsDebouchants.py @@ -100,8 +100,8 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond, ofp = geompy.BasicProperties(edgesLocSorted[0][2])[0] # distance curviligne centre locPt0 except: texte = "Identification des éléments au débouché du pipe sur la face externe impossible. " - texte += "Cause éventuelle : la ligne de fond de fissure comprend un point géométrique coincidant avec la face externe. " - texte += "La ligne de fond de fissure doit déboucher franchement de la face externe, et ne doit pas être coupée au niveau de la face" + texte += "Cause possible : la ligne de fond de fissure comprend un point géométrique coincidant avec la face externe. " + texte += "La ligne de fond de fissure doit déboucher franchement de la face externe, et ne doit pas être coupée au niveau de la face." raise fissError(traceback.extract_stack(),texte) logging.debug("distance curviligne centre extremite0: %s", ofp) p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0) diff --git a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py index ca6829f3d..32ae8b3f0 100644 --- a/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py +++ b/src/Tools/blocFissure/gmu/partitionneFissureParPipe.py @@ -39,7 +39,7 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe): pipeFiss = geompy.MakePipe(cercle, fondFissProlonge) except: texte = "génération du pipe le long de la ligne de fond de fissure prolongée impossible. " - texte += "Cause éventuelle : la ligne s'autointersecte lorsqu'on la prolonge." + texte += "Cause possible : la ligne s'autointersecte lorsqu'on la prolonge." raise fissError(traceback.extract_stack(),texte) geomPublish(initLog.debug, pipeFiss, 'pipeFiss') partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1) diff --git a/src/Tools/blocFissure/gmu/restreintFaceFissure.py b/src/Tools/blocFissure/gmu/restreintFaceFissure.py index 50e867e0c..c2a055f8f 100644 --- a/src/Tools/blocFissure/gmu/restreintFaceFissure.py +++ b/src/Tools/blocFissure/gmu/restreintFaceFissure.py @@ -6,6 +6,8 @@ from geomsmesh import geomPublish from geomsmesh import geomPublishInFather import initLog from sortFaces import sortFaces +import traceback +from fissError import fissError def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): """ @@ -22,7 +24,13 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): logging.debug("selection de la face la plus proche du point interne, distance=%s",distfaces[0][0]) facesPortFissure = distfaces[0][2] else: - facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande + try: + facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande + except: + texte = "Restriction de la face de fissure au domaine solide impossible. " + texte += "Cause possible : la face de fissure est tangente à la paroi solide. " + texte += "Elle doit déboucher franchement, sans que la surface dehors ne devienne plus grande que la surface dans le solide. " + raise fissError(traceback.extract_stack(),texte) logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf) facesPortFissure = facesPartShapeDefautSorted[-1] From 43f41f0c11ce8e843ca6b0abac6f6f36c11d72b3 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 3 Mar 2016 15:42:23 +0300 Subject: [PATCH 093/147] 23250: [CEA 1766] 3D tab is empty when editing mesh + minor changes in docs + fix other problems with Mesh Dialog: 1) at mesh edition, old hypothesis remain assigned after playing with Mesh Type and Hypo Sets (change is in isSelectedHyp()) 2) When a 3D algo is unset due to change of Mesh Type, its hypotheses remain assigned and a new hyp can be created --- doc/salome/examples/filters_ex01.py | 1 + doc/salome/examples/filters_ex09.py | 10 +- doc/salome/examples/filters_ex10.py | 10 +- doc/salome/examples/filters_ex13.py | 2 +- doc/salome/examples/filters_ex17.py | 10 +- doc/salome/examples/filters_ex18.py | 27 +++++- .../SMESH/images/bare_border_volumes_smpl.png | Bin 7555 -> 8103 bytes doc/salome/gui/SMESH/input/about_filters.doc | 10 +- doc/salome/gui/SMESH/input/about_meshes.doc | 3 +- .../SMESH/input/selection_filter_library.doc | 8 +- doc/salome/gui/SMESH/input/tui_filters.doc | 91 +++++++++--------- src/SMESHGUI/SMESHGUI_MeshDlg.cxx | 21 ++-- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 32 ++++-- src/SMESHGUI/SMESHGUI_MeshOp.h | 2 +- src/SMESH_PY/smeshstudytools.py | 4 +- src/SMESH_SWIG/smeshBuilder.py | 2 +- 16 files changed, 138 insertions(+), 95 deletions(-) diff --git a/doc/salome/examples/filters_ex01.py b/doc/salome/examples/filters_ex01.py index 88305c97f..8af735e71 100644 --- a/doc/salome/examples/filters_ex01.py +++ b/doc/salome/examples/filters_ex01.py @@ -1,4 +1,5 @@ # Aspect ratio +# This script demonstrates various usages of filters # create mesh from SMESH_mechanic import * diff --git a/doc/salome/examples/filters_ex09.py b/doc/salome/examples/filters_ex09.py index 9efa00871..dd6415930 100644 --- a/doc/salome/examples/filters_ex09.py +++ b/doc/salome/examples/filters_ex09.py @@ -1,23 +1,21 @@ # Free borders -# create mesh - -import salome +# initialize SALOME and modules +import salome, SMESH salome.salome_init() -import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) - -import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +# create mesh face = geompy.MakeFaceHW(100, 100, 1) geompy.addToStudy( face, "quadrangle" ) mesh = smesh.Mesh(face) mesh.Segment().NumberOfSegments(10) mesh.Triangle().MaxElementArea(25) mesh.Compute() + # get all free borders filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders) ids = mesh.GetIdsFromFilter(filter) diff --git a/doc/salome/examples/filters_ex10.py b/doc/salome/examples/filters_ex10.py index 423b91029..bf6f7419b 100644 --- a/doc/salome/examples/filters_ex10.py +++ b/doc/salome/examples/filters_ex10.py @@ -1,23 +1,21 @@ # Free edges -# create mesh - -import salome +# initialize SALOME and modules +import salome, SMESH salome.salome_init() -import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) - -import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) +# create mesh face = geompy.MakeFaceHW(100, 100, 1) geompy.addToStudy( face, "quadrangle" ) mesh = smesh.Mesh(face) mesh.Segment().NumberOfSegments(10) mesh.Triangle().MaxElementArea(25) mesh.Compute() + # get all faces with free edges filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeEdges) ids = mesh.GetIdsFromFilter(filter) diff --git a/doc/salome/examples/filters_ex13.py b/doc/salome/examples/filters_ex13.py index f56d39f84..8d8077083 100644 --- a/doc/salome/examples/filters_ex13.py +++ b/doc/salome/examples/filters_ex13.py @@ -4,7 +4,7 @@ from SMESH_mechanic import * # remove some faces to have faces with bare borders mesh.RemoveElements( mesh.GetElementsByType(SMESH.FACE)[0:5] ) -# get all faces bare borders +# get all faces with bare borders filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BareBorderFace) ids = mesh.GetIdsFromFilter(filter) print "Faces with bare borders:", ids diff --git a/doc/salome/examples/filters_ex17.py b/doc/salome/examples/filters_ex17.py index c3f80d65a..9dc01b49c 100644 --- a/doc/salome/examples/filters_ex17.py +++ b/doc/salome/examples/filters_ex17.py @@ -1,16 +1,12 @@ # Double nodes - import salome salome.salome_init() -import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) - -import SMESH, SALOMEDS +import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook # make a mesh on a box box = geompy.MakeBoxDXDYDZ(100,100,100) @@ -20,8 +16,8 @@ mesh.Quadrangle() mesh.Hexahedron() mesh.Compute() # copy all elements with translation -mesh.TranslateObject( mesh, smesh.MakeDirStruct( 10,0,0), Copy=True ) -# create filters to find nodes equal within tolerance of 1e-5 +mesh.TranslateObject( mesh, [10,0,0], Copy=True ) +# create a filter to find nodes equal within tolerance of 1e-5 filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_EqualNodes, Tolerance=1e-5) # get equal nodes print "Number of equal nodes:", len( mesh.GetIdsFromFilter( filter )) diff --git a/doc/salome/examples/filters_ex18.py b/doc/salome/examples/filters_ex18.py index 805f54e06..32950cc50 100644 --- a/doc/salome/examples/filters_ex18.py +++ b/doc/salome/examples/filters_ex18.py @@ -1,8 +1,25 @@ # Borders at multi-connection -# create mesh -from SMESH_mechanic import * -# get border edges with number of connected faces = 5 -filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, 5) +import salome +salome.salome_init() +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) +import SMESH +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) + +# make a mesh on a box +box = geompy.MakeBoxDXDYDZ(100,100,100) +mesh = smesh.Mesh( box, "Box" ) +mesh.Segment().NumberOfSegments(10) +mesh.Quadrangle() +mesh.Hexahedron() +mesh.Compute() +# copy all elements with translation and merge nodes +mesh.TranslateObject( mesh, [10,0,0], Copy=True ) +mesh.MergeNodes( mesh.FindCoincidentNodes( 1e-5 )) + +# get mesh edges with number of connected elements (faces and volumes) == 3 +filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, 3) ids = mesh.GetIdsFromFilter(filter) -print "Number of border edges with 5 faces connected:", len(ids) +print "Number of border edges with 3 faces connected:", len(ids) diff --git a/doc/salome/gui/SMESH/images/bare_border_volumes_smpl.png b/doc/salome/gui/SMESH/images/bare_border_volumes_smpl.png index a1e799aa24f7f6356cafff6064981c648eb1c6a8..3508518fd1d8db83f741a7d3defd952539cbe4ff 100644 GIT binary patch literal 8103 zcmXAudpy(MAIFoV6wBA8CYe-{Tw*RWOd*%tm3t|~hU7NMWg#)SP2}1}nkESe2}#JM zWST8WF3qJixtrUB-_h@nJ@(l7>~qfNT;8wO^ZowZx3)AE6p#?uv15mzsfnTOjvYKq z@X_0|6SQnfPVEL?djm|If_Ll?`mp`s$viD|c*hQyld0jkOSg&BLwZ4yAHVLJ`zHMI z`VEtK%SzvmEWSO#!t+c~j@$m^7@jCA9*@gYe3*|9&gbh3+ul>MF0g^ewVQ91%!J!z zR>((*pD#C2x`lj@F+|suoY)$#ij5F?z+#?DKQiQf`?lp4Zjk*u>hVHtVj%XUa2PD# ze(Phz$|Pvdq{z5yJV>s`AoIviS7ujO}0FF8P|VpzFtJnE9^6D5ML18$6;KsH8RBSm?!0tpIL9 zAc-awq~)F+<2nCt0bV#hbFe^H<8O7&W18`Qhj1eHG3hyseOao`XDARU#a}tw^Y&qK zRJ>1+8=WT-jy?9q%(iA#3P@iod>7&{WfcyU8uS0stVEAyGQZbpny${wY!T{|pL>YC z4}8~?7u-_xPOdWKvXh+gqx$58!3GB@#no%Y5PP2MMAX~w$cL0l zG&{8lSi)38an;Z&^DSj=_(rBbkhijz7edaB6Kz{V8GuRuZ{x|Rtyk(! zC_gqA;o8!(nv-P|N?@;tBwIE0Tlf@EN8&3sqc-g}N4FXW8L=0<@gG_I8f&QJxcd6Q zz;_#VTNxIzOTD_8)fB=!YwteE#<5WanW)UB%Nx8$OTs#*U(aE`wGZRNh$#7bMQX6V zZLKK%&q|}2)_5e6aFu>vQ{Uy53-RD4lf{eyC+mx6mY!B``}#{4B1$01idET8Av}x7 zxT(k}M2x(9sO(VK#Fnam)T{NABkW&@=t-d$)(^r--;dIQ%jNTD$M9>oraO~>) zF{*QFgWA%JARQyG2^14NwR^)}JY|nP7nl>RuAfhu{%uJ;a;u}dS{0|@$)Q-$jVQqf z1VYC3nr>W05(2qz{?qdPU|oQ+Z@61t2bcUiQ|`IYwmd&!k>FjahcicGBazCVB~+A5 zH}V!}u@+Xho!+xs%@nA?mnZ~lzE}DEd)zhD?u1%Za^2Tg7kos0RB{*vs^RoTq1WOp zzSh<%J&$+VCE5NJRi?EQCY1=~eofqKm;?5T!zS$SoROm=IQb{bad2NL(!WpgET&GRpu zh|0>$RlmFQ@W5KbI{S9Pvfw7rN65;_riMSgWjmeecrmkYA(tYH4i^*5<;7WcY&7D` z2;M2Gdn&6&fCC4Mqt=-MRe@;ntbV#-_Xc716)uS>ew^~o%T}~>r>;4yKviPVsS|@I z=Exh{C02f4Jm(`=^ z63U-X^~k{!qj5`VJ^c1zm4%HE-pKBv=(3&NZ{RD==d{OnQ6!JT6hlgPfNuL|XC6sA z#Izd@tq66mru`_(W%I5@N;9BBpI6-WT+OveD}67Y1nE=FrMbR2t}&shqKlI*fZQAU z@?{wBbc)ew_t-BUK5$qne?w6wG)kg>l*9AG^Ks&$q$O;-V>{;VBe#^PhsQ%BG@-dg z3)Yjd5f{T0r4}WFIoO^eObgxcxDTV zgf9*i4y;&VI*_#c2ap3FF+HSId8@02W}str|gx!0Ct$OydnzT3 z=o-C@dhz)nv`*jyqDh)X|BfZx)FA6t8(7Lb5e(aP13}^~o1JlYW1sf8K1%v`$SxK zQYC)gXoR?YHAlL1Bs$8L5QBK zTYsdE{(YY>xpo~hzh&G}6ps%OsLyaBt9qg_IOiM&pPg1~VaUzcHmJoIw2@tSuF%?yY}%be{ltL^iK896y*M+*^);F};v?Gn z!BDP}0t1>{(RXI$m0RHMZ_Y-(y1ivF>@hM_cPo6eSuaXVIFx(J+~>sRlK8t8nbAS3 z(-lxk)!ymr)!eEyv0}*9sbS8@Nn1JULeJLV=5vT>DEDK|u;QhdKqS5(aHe=iROoDQ z-=X|rlJ-49>|u8lIaqI>mM3=)O|tjQJlv}bmD-q#l{%aswr{;uXSk#$dB(R@;UUt5@^iBDS2yU+@AwEwoH+TSd_u1Yqe zR3)QC4_^w?yUv2|{lPJVkxklL@@R5xa2YAIp~8%_m5J-|6< ze-@2pjw-nHY6bNrsOadd6L!v6PBJGng=rR(LLSbg|3>T-_>x?1OFYr@LipIWU9@ui zgG_xgYgrqjljdz<)VaT<+M7C<0!@m2v!~kB3uX`X$e_zRAZ#{{F{6Lk1no_Z-l5^9 zH|w*Wo7S&{PLLmcnE5)dd(fqOSZNJ$a3GquLA_3#T^ zNAeRRyop*{ZY*SSB}&Q5l7(T=|;5UPZ=zU^$PH%~qa;hUypKybg$B{IKqc(i@7 zw#0+`AwAA<+h7YOQ72fy2Qd{~J@im0X_4r)-8Q-UMj=UKq=J0*>|*3KWCNYwKf+MW ze(PPR2T>jSJr5A*{hQ~mtD#dO=ZYcukmJtQT4X0;*Ov=EOYCDCp-CN1u?qFtSxA0F z`{?EKT$3^s?qTz&`K_VG{REVXnQK||VvN|SRK|(mTX>-)I4t{XzIL6C5h}Fs*NYfl zA8uz%TW;Qbr7>EbK~%qX&I0C~LuKSxvGyAjil-EL1!@$gu*t1Xu}GD`E5=+-r8)`P z9g+(Oomk>m^=)`M2h2Lh>n8Ua@**UwoRC@oeyj0Daeuxzcg1OIe^(2qvIId;dHkT+ z5|$!{Mkyt^f4D=P^WpYma~E^Anh-)q<^m`XarET(_@29jV#0@{aRXa8rTHrfC2^X1 ziPYBNIbC-Z-&dUTcj!i3oP-Pan26^(rx`1|AU|^PKAr!~;)cFRuU0}X7};9IUMjmr ziyS<7AezpfM_7;ZDO&6w1X;`F-LN)y>QHlI4AJQqC*~}`tv&RPj-E55`;0Y?58WrK&+CZ?kt7% zih3`w%a4{o>3%=Sj_#{wGv>!bHj+2xsG1=1*LA!THI=9t@vN&(&q_2`4;q^dCFh@} z2DkTQc-eO30Ki1x4)8qBpt;b)lIh0DUq^NDbbjH70#MwnD}C1CBin;I15y~yxm`~z z3HEhWXNn1x7F9<3En$XxCa+hI8e}4H&qP^TL{!4$^DwIQeBp&7maxgTFd#SfCnFxf*N{K&jD$;;XF zr;+uhnk6psj1%aT#e&WTEfKdbQ?%BxB)XZ8CCt{pPcDnv+U5UN_Z01}F0?VgAiB%X z@~Vjc!N(}uABo=L=qKibe{j=HEgDYCm?3>dT?<(ELG<(TA03`+SdD7Kh&n1XUSE-j z8fEChOc-a#?5T;y@>qI@JXOLl_nuQL1{nc^PQz~Gj0J^T!ZHxP2Rz;D5m!%Pah%&+ z6E1Gb3dn$AZnX`uLUdz)msZJ$&;p_9W7B5C)=H%o&QY1#3e0J>nGienXU;}JQH*t3 z424GMyn9nS8&rT@OT@6qw~8PMZ5u-E!LBaK)g`@>9L8&R2~D!@d-k!3Eh#WA zHy3pi$X6QUl#1f+VhAT${4M)f0SahKn`+4#`xuJUfdpFagUmmQoBE!b)AtMZN#t zh3T0A!A=>vVF6=e84z>om02k7}N*(#Ry~jmD!CbkE z#Di*DxSSpgBmm$QWiWt3SO5kd5m)~pdHF1b5WlU4e3&4v;~V5MYOV5#2ZB8nw;q8A z#T=tN`h+Rb#iOLrYPYz{A3$PRSrZ3-!ncsygF{XZ3Fjm|lY(6ny2^lpkI(~yr2XddK61wCeilmyvDl3)+ZU3D|TN}_Tn}JS-jQ`rOLIr=eyVY!xe&T}akuUiN*E%Hpj#L-sz5N<2aHLq;gKl6%zYrrnD%lQ}fQ6Zf1v+)Ox4 z*VTZ#UvEj4{p4GY=-F%PCqoHCoze7Cvk_MT(zN+c#NpxaI{~>_exQ&5Dms*4(@#)A zV4+Xkt9!%tqk-$#@I|QEJpTYn0YhN9>twvtXm_+g>}=O;;5)rIxlI##%Ii-L@qsqg z?KUCskKHGd7Vk#VjrG_!z=8aXc_N1*fjY^{9gL^iAPb0YOP1a9(m^fW>Dc(S1oot# zvl@kP2jn~B#+AoC)nIM4Pede)s4N@DQ|`IIPq@Q^Eh}|7n8r@B>T? z*+5cvKa_{cp@QY}hJ>yjmFd3x{E!oo6}_zk=8rltsKhw?wb&7@9}W*^f#icZilgcM zWbY;xvso)64hd{4IuB)d?6DK^kGs*ubRY>Pwk$K&4nJ;xN*lEKh7k-A`X!mUkrX`A zp@P@L{iaH&9H0<}96D4bmgqjp*X#u-DPJzF9799V`)iqLdU)V%3;kkEg-X=s(3<Zjp>BzO!pElLhyEFxq8XRyW`-9KtMcb!lu7>cu^w@` zw=egRBD53sD7QXtktrs4d8GiLmYT;34b?Y1%oFj*6KKdom6s#^8xVhnl^^ytqm=%< z4bg!>sHA&wd5Pd+y*$;h6t(=@`q`fi&u3TNxES?3K2=gr0b;DfG5SgYTn#rbncL@s z4DNd@O8*v89bSDPv&e-Q_SLxHHX%yJv%YQZ=WuV7$g3o%MUhb>qU(1mc4oAv0$T`%= zJJMzDMzbF}JeQ0@`+kZ%m$S`EUM^5zb$lujoIndciPp`-IH!&(n4<@N&-}K0dpA*I zZ>_G6SQ4E1CITw8aXQ^pG4gVsL;-cP_pYqoR{LViy*7_>cu{A(-RicRZEK=3H5j-cW$`#Fk#7(nGZBS+07^6% zK+b}yej9LwL_AT?dGNjrBO}*%#vFnYeg&kj_ufb*@>= zzpxKK*hfAg>f>gMwtlK@^+^T9Z$fj2XYOmj)DHN|qqG*bfkVQtw0Pst=Th`1nmCRV zaZN5uXy{1qW(MBCasmTV6l(FJ-_H11@*d;WneFEZ57yLqhggw4gfGv@Lw%8IQ_ZHv zY@J9e8b)s4e}88Dzc}mJLImyu2=T1ABBRxwBXHaqQVALsq2^pDZVB_XPg>mhuh9PB zG6}vPqy$1&RMc^zRW<*jLPs1ell!)uya)9y_6qenPbRnSJGI!TLC>(}P6B!5z32fG5a|B_VFmE(mUNNQ1*O| zN?8VNQgas|lUnES7PB%?jSBOZyS3o>~?^XgZZ(8EUivDzfG%k zIH#8R2R37MF8oay!CRPi!N&m1|0nP@jfddP3SPd%9G3mY%EBjUn@}N7+@nIN+pjGU}jim7@9!1+moS62$Yy)>`dP0!ttdz$Jn z85MuR9Cj+`a>2LbL!(5tirn9yswFS;srk-E#gY!$`WwYXB=_D8jJt;@J(qCq==HHG z={{cP1L4>J(@928oxCMX@C!-(wK)1t!1qLra?D#%7GcqJbL}1_Lqd+MyLFAnMxN0d zX!|HfJ)t*+%I{h*y`txVEMclT8^r;-xRFgp?4##O4~er(kCrI5b1oPijJVu44g;|M z8nD+LL&{?RnYWG#j0D|qkh1Kjz(d^K`V!m%xo3Moyr~eXb}zLS2j8}I5pXf}lP2q0 z!aNkH)tR(XszIO-|5Pzy*Q^gcKl8zWxlsgZ8}W`0U8WsMTpX{sGbpHdl+xB>;-^4< z`fWQ{xs^n!2Q1WpF2~rJ%UD(&_=Da~Pfy-NryT0Gf`!46I*BLfvm^iTEvtrOxV$>5 zQ_N(y`VfQ$9)Zl(p=Q2$!jLJz-(cEUfl&UEhaze}`-{5-Sh6B!dxX~u6}@Eb+$1(< zRL9tt`<`ZE6k)V&)fe1Kt$`b>02n=Y5vtfnfl%Njd*Ym}Gn{dK35BY-OQ6^l@pD@h zKk@uyRF>KqTy-u@>LpnQI^DPns(1#--J-pb-kbgIe>i~!e_z&D0)g!9 zbBSC%J$F{AiT)YWKlXeS+&K7=Kbxn`9JVPY=GsFg*}7iAup_^wV4K9m=(h<{r*(i7 z?QI_C2=`t%VO8iQXtnaYw3M8jCA0k?`tW>Id19~(V8$eNSpl&^?@tu{0WU}aZsbsR zm9A}{Wf+cmRa^khHTUH9->cev)ZjEV9Zq_nLe`VBgmpO*PtoQ$Gp~lscPo;DyCsZ- z&U$fbUTmxR`?_xt)!3Q8&LvY&(z=a8?v47?S2_^u9MrSy8L+PJiOxt zEliEy2HI^Ee0-EY+w^>bSJWta;eK9RU|(m7ZeHh(0_s@4=vD$(5|pzJd8rAP2L|T< zBX^7i3EDOIw}GQ?)T4 TP&VMr`wr9dmWJi}*Y5rgGiEg( literal 7555 zcmXY0dpy(s_kV9=A6s+TntI!ZVw*C=rdC378#7`ymHH?flITJzDtv}v)`p2fa-B=% zQ@V++LxyxwDcy4``OrnW@QM1p*7x_v9^3o%eqGKvuXCQ~oaeH*eqOp*5*C6WU2nDr z4}y^05QG@fL4uK%@yuZGg^6Krhy(BYG#`YU#jykkGGTgqxCSPaynneSJN)SebpPBV zBexAu%LP6Sx;Ya!m(EiWE^ED9K=l!*aF~=RUf99#kBF{AE~aOpcipDvs?L!ql)+b% z-;c+YdL7xcX6+Uh|NF?bkKec4q#+>wlk2k`594o)O*-8D`#{I)KcP;%B`;V(hXmAJ zd{!MhmemT0ddTw)}3aaPlFBU=#WEN`&nB-$X zBORtgg@@VqkBSj0r+WTPGa*E$vsgjkEd@{W1dj&AY=#8}C5ox%`?|D3<*QlkiBufq z@Px;Ce#Gz0B{M~+Gnl>P#dccb(U9ZLv)8-FDjLhaCnF%=Zin_;dtitdCphjVXIPn_ zp^m3L!xRS`w66|N>xKDwbSR;`#UVYHv5-%IP8TKR`e!0sBll0@@(8GWD8R*6-^ra&F9j&{+L&EH0akI1Gf8U)@D>O3UjqBNpkQ>fZfy zXdiv}@uity9RbbF+l$>u;870KMb<@%Rug2z7Jbx{T2CLd@Z7eExrg;o3AeBC4T=_7 zFT$XjDkdD#9kp(IwL-je6pochob`&!w>xSR|)=BkH5%d136P;Wp ztYE|Rg8LM(&ey$FbXLBAR&H&^)We|EbN@b0&UDn0?L0WW_S`7OJ*c71z^-#(YTLLm z&F1c}dwoI|k2#)Lf%Pta`yHp+Hj#mc^t)3=UfTr!#huDQJrnevN#@$^$9&B4w^S^C z{Yn!CqJ7TRmcd%PVlzc*J4(AD24#8RIZyepYa9jCESrcqK1e?Za~~Yp+;($%AxoP0 z!C*LM=IZ*!x+Wl9@EKP6kxJ4E%x?SSVwNT{#v89~qgiiT-mm9c^GL5^^Y6&YxweCr z_tZ=O)Jrpq=>LWmvo*n_(tX}oo&R7ozi~}#y{J8n` zd(Ktpz@Mvl!S{vqrAyiqGY;a+^FuiQg;txeK?l zT;`tP8`rd%l9y=fV~mD7S0@t<^+)NF!S{JJafWsOy3Ad~8?SCFuf4P>{b9kiUU)bm zVManM+5_)7Kb^rVFFVG}*egxdJnnd28&bOYXZWJl*eKlY;EP1>lNOvzS6eWQZ5sZZ zWIk@bb{R$3^At>5&O~$XwC%;3T_j*o@G(-__jJ50&xpX)!*EM_P2LmZq4KUpYW`s+Kv9g4jJ&T20{~~->Iw@^5i>SaD9rT7( zmZ7iA>iKjlOd1C}AKn^;TU1^LufLs3IwEcnh;h63G`mZP^<5)*+_uIYqYrJPO*T2# zi+wM;XRsM7nCioOV40WP)#Wkmv2fjIDh3tgr*ITkB0n6aTkQ1tdvf&4*oE0`r&d@5 zg!PoNThd8GMg;W5lH}PFQJo^=doRp9u$^W??&Bjr-|~;G_LjTqKBgt)k%r7LY0{`Z z*bTk%ZoK6CuMQhq^jnG$idI-!u;j62Mk}>nE>LU_*?e+mSi(WvhbuSy2J~DPW%hXO zfdjX`IsC0Or1lex1zwW>U}wjqbO$c)YQJ z;jb(#1Y+2C_@{N}i(3xgrR3%J!V4Sx5KdL=J0pJ$Q-m=d?{gVitoCz*P8qExFV6%J z(D$Y`3NGN!tKTJGM#k06=eZZ0AfW&Fhi-+ZO-V>;rsR+sDsIZNZZSljYu6b&HI-$o zDS({53`oMWNkjkX>n2`CF5Pbzjw5Qu!;1uO;>sTuME1hH^qm?Ej|mwwxo5RDT6T2x z4%b(2<_0}9SNg3iE1-8W|Et&9UB|G0yF*#{)gX`FR27$UKZAsd?7urc^lvSwC%7sJ zQ{8>c)*?LDUEZ?hVLjh?kq{at*x5Ta`Z2~PD8f&QBud`dDB02Y5RM#S%sp9GXcx|g ziA&dYiq6$sb^lcQv}2Nr+qp3mcrXc-aAt$D&=%Zd{xT2wM6$&_Blu5>H4tqhP-|dAPQcV?u*NWUS#IF12CI(@Qmp?QKT_mKm z-=yMB;~IwcH>neXG$10-OFPZ?oy#-Foz!u*+RyGZ?N}Bs8L+T)Q_vHlMMzYC=wmj+ zi(NpkGv6qm7?upX$$vu);tq*cLlr`SX5smE?;Kb)m~7xshdxvC?3wCUzae##h2>pO zeGvV7+c8ExuinK=B0QutZ@A>?#ML!&1XDuvCpiG^0{gD1?U$3ALF#9GF{!L)_R-b> z!}VU=-pLIlGClyq<&tDSI+93`pg?W z3w=(Fa1rykQA#kMk-G?r9n4U|G*BK*<&4tjO82fOL zThe-Ag1XpE#l0S@1GZ4Kf|kYRdJIL=wW z7DP)l4wH8G)?@f6zN_!du61tgqwLt9DejVKpxTlbMM=T4L?_$bax-E5qCtr=P(E>8 zl`#8X6z)KSpX;AOcOaC`#r4h=@~|^#IS*6QF7g$(IOe28VB;@nzsYs8{ zU&rPc<#TDgn^)akK(W@pV2QT74$L!`?Zwf_D}%$Ftm&I?TqmWC?AaeL6~*fSREIoh zmH<>e9FwUs7LF?@F{xve{{OUmULhN?B^?X=VPL9(5Cxm_#FsTYhiSJF;W%#C&4D)O zAZ|&nrO@F1BvXC*e+t^20QK>Y!53zxnPLQPd-iWY%{J}G5i_m@cv0{5!W~#y-y?6jIs%8&)wD92h~EMd35;EIjb@$Hjk9%v^J-#o5^V{RJ&<={s{^-1=8a5_Rgsq-`P96 z?yUx8#gljE^Kv9aCwIB4SKrYSWxV#k2%zL{R0Eh^)@Y@4o~uF8xS)6sJ6CzE^R8;F z9yg48FXeX~{_};Iy)Ov8M-y>zpytMeA;&E&Xk|8nWyPskOg-XWJfvdi}-MqUax=c@4W0 zLIhWJjKaBLF%vTmtZPWhC>?q$Sa zSt__wTw*qD={&N3yNTSXi7@*>F%ZxVPBHO}{rbv}Rfb1ZtTHWo{{o?pup* zbCeSAR?+401j0?=tn9PvhwxqBrhfoo-BJQTo>Ol*PCgf>Y_k8Q?G4vg#{!)UZUupC zUzyL*RzDAnogDLl=>#Tv?p#{x70})cj9NNV@;*OH9ErMyY>PjgNAUyRyeyY57?%^* zgZ4Ul)Y0m!AAUoGCh=<3s_H85EcdLoExpZwrIqBS%-@uS^~n~ElGOT>Kq!329lZBb z(D-2}cG~JECzB~zq%?aEX}_jb+bK|Z!;jXUWHj2^j@TX?Y2!#6K6_`EklGwr;n&FR zh9+oL<-R){qG8LmklM&!0bAEoWer4lNy1V8DG3`NoU7S5?UA9r(NR3+=J!Um0WI~p zA?@;f*t=E2Nnz+S(Td~z_URi}UgtIuZd5nO07)eVw9_YqpkTr}5nZ!!K#6 zGsihF-HC~gFHF)}aX{0Q;dAlcf2?yZQlDnyhlTO9ixgJL4L$}XJv-!W`wCb#>o4gK zsw|QSzpP`xY{gTrlFXOWy+0aqQrPgPwSJumHL8ZsUBbt-)H%FBF-J~7-*%TX4nI?n zd;f{_a3!NB53Xq9`dzmq92a5ke%=pX#8y5QGm2zJ2kS;Q8aC8^U} ze&sPu?=by9fFNcKXgold?ch5$tF6sH^P3?sxy{+g3-nmT`|_2}+?PdMPsN#H6=Zv0 zZk7Z*$!uh7bdB1At&A-1z2H1OM_PO5H?!80zgOA`eD&2&?Hy$|^b0LtVP^*yRjUeJ zACV~47n1g$_|JLJRyP{QVtHMu{rYoXD#rdtLa81q8%|osD`4YG!1|1A&4EDyPj}$J znJiXJOCL?|*vRW}15YY{!~S)l$H{gIa#N91>bM71@rj0tmolPzV&T8!c|g=7Q%7;` zDU6D&Xt28J#~5*t6%q|>;DGDo9ei`%9Bg?$r$1s-t-WunsOQ;LMBiB1n{30|1MCV_ zqc|E)FrGKa=Q&^Qr^Gue?Ge6#+tH&H?q?~O#qZN zCV2jdm38Tcgw4Fo{4)Iq)AP@Zhp?19-^VnLf?h7euXhfagR@-vL&q;5AWM8-giJ#M z=4%wD5#f6Vv}d{W^1^|w=HU&RtG%BtMjX1#0I6(T_)TMt4^-JR8T+waqTDPz(K=Zf zl;}}eC-H0*89tpz^qgUzwFe4esw}nD(q7p8&-mk^=}31ad`OIVqr1>w1~$d_`yt(mjBoi>X>b$*TrZ`x5PHWW=R-T7<^DM3#8a*hv`^5@<7T!v}}c$yYk)GfW$*t z?ubDxS|8I9_hV+3HXCz&Zx->sgy=yL=2xovX4AtjG`bv$Sm;n4`^wk%E&VIliH8p))m4p~kX(NyT--Ci7H=BQA?f(9Ka)Sq&vGJsLMgjLFoaWG1*G+WKHC z4XS@~!k{9;I?kIakRW{Z_yVqsMA1_qfuos<2i(=2pkvm(Tivz?Ca$9jzZffI{4fj4 za)gPRF{u3pT((wefrQvoDn?9#1_@BH@dPyji;D^f0~r`m!G;aG2XfB}QYz|1om5V2!Nj7?8p@k=kw+$kZRy0xCoLWs8+O+4PUXKM~0suxd$KsSuIFtGla?7^)9Um zrO33Jh?5KtY*4Nk5vyxr2g;qY2l^x1L8+HY#le4-;JX01dExk;zZ(`|hP*wgU+~T9 zgs5+^yT7R_!Gxe8WSfIFP|JO!Vs2*KoS;G<)81iR+SA$k z?{gq1D80j~?%sYhAJFg6vcad=;+T^NtJphf86`1v8X)UM|2p}*#`!rGDnM0L?x4@_ zNn5I4SbWHM&)_hs<}LY;S^Hli@8+wnyY9LbO4j&8qK!@tuDH9b!gS4odH2>BWIV(d zrjHqE4JpMFMR^dEKe7SiwmYh|ACwi)oBiC>x{~9nhG3QH@(~MMcfJ->PSy9KBez=0 z0EG^5WgTQVbJ7qE_@_o9PhV_?%9xmZWm|rBN%g~cT6O-gd1f_jmOpkBl@CH8VXpIqU9W$ReEGWi`Ly&)&gxmt1k!WMo4KvW z259|BJ`*ixiU&gGCA=xgc;fl;OX4xh;BW!!`Ux$IUGa`5{nEWxHk+Nqf2S{}1VQCZ z?>~n)CaQn1K|geP0Uhl8u?Zjn!#~ z2K0zSt`LlOr4-l?ndJ#rtg@|7L_$U%-b$XYrX5g)mV7Z#OH9-`_h#)rF2+GlG5hJ$ z_M3xOUr9KUV!raLSq9!ww$*|zSiA4MXw}{MGOtO+dv%WJO%nv=%-B@FUiGK#-Ns!% z7tc<8_`a&S9f4cZDSG8ulsD5fQhnV>5je#!z1=@0s80alwpl zgXn8XeVFUkmR(nWHU7Gk*dzaGu~ijXpXj!J!cq3O|7gg!+3fH4Y@%>bzx>9_>9I?v ze$C!WU0m-iN8~poO}72=8_l83x^qAkyw)4;=~5m}`^6dk#ryAk{?C)&tq}j6lOvAb z&Zob!4w>=d{F;34fA@Q_S2zywem{{ZFU#u@9}S`BH$u$L8&jf6NJJ-|nYS=};8H z>5ew)NgESY{AoEJg8H0f(2wTbE=k}IFi~`=hsZtHNtDy<1{nprl`qo7)ETEF=xH#! zoCN+VQ>|aHN<;|u5v>R&h}?qxet+){4iM$%9YSzR$FTVk59dOr=J!Z0hBiwYmiIyB zdh6#09gBvz@;SKrTTk@^-`b(lpM24Rj=b$cMz*%2IXxhleI|nt7X}ZYx??V*beo4& zb|oKN{sLYBEq3Thi`EZs7{x%=x8k&VvbyzecTekn8NzB!?oLK+YSw9yl{|HUY*-Ct nAf5$FN=YJmaIT>C*B_h4i`TH?_2R+5s*pF!&*QY4Aoc$M1H!$y diff --git a/doc/salome/gui/SMESH/input/about_filters.doc b/doc/salome/gui/SMESH/input/about_filters.doc index f331fa4be..7468931a1 100644 --- a/doc/salome/gui/SMESH/input/about_filters.doc +++ b/doc/salome/gui/SMESH/input/about_filters.doc @@ -4,11 +4,11 @@ \b Filters allow picking only the mesh elements satisfying to a specific condition or a set of conditions. Filters can be used to create -or edit mesh groups, remove elements from the mesh object, control +or edit mesh groups, remove elements from the mesh, control mesh quality by different parameters, etc. Several criteria can be combined together by using logical operators \a -AND and \a OR. In addition, applied filter criterion can be reverted +AND and \a OR. In addition, a filter criterion can be reverted using logical operator \a NOT. Some filtering criteria use the functionality of \ref quality_page "mesh quality controls" @@ -27,6 +27,8 @@ about selection filters and their usage in GUI. entities (nodes or elements) for the operations, which require the list of entities as input parameter (create/modify group, remove nodes/elements, etc) and for the operations, which accept objects - as input parameter. The page \ref tui_filters_page provides - examples of the filters usage in Python scripts. + (groups, sub-meshes) as input parameter. The page \ref + tui_filters_page provides examples of the filters usage in Python + scripts. + */ diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc index 621a47e99..1490bce12 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.doc +++ b/doc/salome/gui/SMESH/input/about_meshes.doc @@ -100,7 +100,8 @@ The mesh can include the following entities: Every mesh entity has an attribute associating it to a sub-shape it is generated on (if any). The node generated on the geometrical edge or surface in addition stores its position in parametric space of the -associated geometrical entity. +associated geometrical entity. This attribute is set up by meshing +algorithms generating elements and nodes. Mesh entities are identified by integer IDs starting from 1. Nodes and elements are counted separately, i.e. there can be a node diff --git a/doc/salome/gui/SMESH/input/selection_filter_library.doc b/doc/salome/gui/SMESH/input/selection_filter_library.doc index c87d928e8..145c48fec 100644 --- a/doc/salome/gui/SMESH/input/selection_filter_library.doc +++ b/doc/salome/gui/SMESH/input/selection_filter_library.doc @@ -73,7 +73,9 @@ the filtering algorithm works faster because node-to-shape association is used instead of measuring distance between nodes and the shape, and \b Tolerance is not used. If the threshold shape is any other shape, the algorithm works slower because distance between nodes and the -shape is measured and is compared with \b Tolerance. +shape is measured and is compared with \b Tolerance. The latter +approach (distance measurement) is also used if an element is not +associated to any shape.

      • Lying on Geom selects entities whose at least one node lies on the shape defined by the Threshold Value. @@ -82,7 +84,9 @@ the filtering algorithm works faster because node-to-shape association is used instead of measuring distance between nodes and the shape, and \b Tolerance is not used. If the threshold shape is any other shape, the algorithm works slower because distance between nodes and the -shape is measured and is compared with \b Tolerance. +shape is measured and is compared with \b Tolerance. The latter +approach (distance measurement) is also used if an element is not +associated to any shape.
      • Belong to Mesh Group selects entities included into the mesh group defined by the Threshold Value. diff --git a/doc/salome/gui/SMESH/input/tui_filters.doc b/doc/salome/gui/SMESH/input/tui_filters.doc index cfe65fff5..7356103dc 100755 --- a/doc/salome/gui/SMESH/input/tui_filters.doc +++ b/doc/salome/gui/SMESH/input/tui_filters.doc @@ -6,7 +6,7 @@ Filters allow picking only the mesh elements satisfying to a specific condition or a set of conditions. Filters can be used to create -or edit mesh groups, remove elements from the mesh object, control +or edit mesh groups, remove elements from the mesh, control mesh quality by different parameters, etc. Several filtering criteria can be combined together by using logical @@ -24,7 +24,7 @@ Python scripts. \section filter_aspect_ratio Aspect ratio -Filter 2D mesh elements (faces) according to the aspect ratio value: +filters 2D mesh elements (faces) according to the aspect ratio value: - element type should be \a SMESH.FACE - functor type should be \a SMESH.FT_AspectRatio - threshold is floating point value (aspect ratio) @@ -35,7 +35,7 @@ Filter 2D mesh elements (faces) according to the aspect ratio value: \section filter_aspect_ratio_3d Aspect ratio 3D -Filter 3D mesh elements (volumes) according to the aspect ratio value: +filters 3D mesh elements (volumes) according to the aspect ratio value: - element type is \a SMESH.VOLUME - functor type is \a SMESH.FT_AspectRatio3D - threshold is floating point value (aspect ratio) @@ -46,7 +46,7 @@ Filter 3D mesh elements (volumes) according to the aspect ratio value: \section filter_warping_angle Warping angle -Filter 2D mesh elements (faces) according to the warping angle value: +filters 2D mesh elements (faces) according to the warping angle value: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_Warping - threshold is floating point value (warping angle) @@ -57,7 +57,7 @@ Filter 2D mesh elements (faces) according to the warping angle value: \section filter_minimum_angle Minimum angle -Filter 2D mesh elements (faces) according to the minimum angle value: +filters 2D mesh elements (faces) according to the minimum angle value: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_MinimumAngle - threshold is floating point value (minimum angle) @@ -68,7 +68,7 @@ Filter 2D mesh elements (faces) according to the minimum angle value: \section filter_taper Taper -Filter 2D mesh elements (faces) according to the taper value: +filters 2D mesh elements (faces) according to the taper value: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_Taper - threshold is floating point value (taper) @@ -79,7 +79,7 @@ Filter 2D mesh elements (faces) according to the taper value: \section filter_skew Skew -Filter 2D mesh elements (faces) according to the skew value: +filters 2D mesh elements (faces) according to the skew value: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_Skew - threshold is floating point value (skew) @@ -90,7 +90,7 @@ Filter 2D mesh elements (faces) according to the skew value: \section filter_area Area -Filter 2D mesh elements (faces) according to the area value: +filters 2D mesh elements (faces) according to the area value: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_Area - threshold is floating point value (area) @@ -101,7 +101,7 @@ Filter 2D mesh elements (faces) according to the area value: \section filter_volume Volume -Filter 3D mesh elements (volumes) according to the volume value: +filters 3D mesh elements (volumes) according to the volume value: - element type is \a SMESH.VOLUME - functor type is \a SMESH.FT_Volume3D - threshold is floating point value (volume) @@ -112,7 +112,7 @@ Filter 3D mesh elements (volumes) according to the volume value: \section filter_free_borders Free borders -Filter 1D mesh elements (edges) which represent free borders of a mesh: +filters 1D mesh elements (edges) which represent free borders of a mesh: - element type is \a SMESH.EDGE - functor type is \a SMESH.FT_FreeBorders - threshold value is not required @@ -123,8 +123,8 @@ Filter 1D mesh elements (edges) which represent free borders of a mesh: \section filter_free_edges Free edges -Filter 2D mesh elements (faces) consisting of edges belonging to one -element of mesh only: +filters 2D mesh elements (faces) having edges (i.e. links between +nodes, not mesh segments) belonging to one face of mesh only: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_FreeEdges - threshold value is not required @@ -135,7 +135,7 @@ element of mesh only: \section filter_free_nodes Free nodes -Filter free nodes: +filters free nodes: - element type is \a SMESH.NODE - functor type is \a SMESH.FT_FreeNodes - threshold value is not required @@ -146,7 +146,7 @@ Filter free nodes: \section filter_free_faces Free faces -Filter free faces: +filters free faces: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_FreeFaces - threshold value is not required @@ -157,7 +157,7 @@ Filter free faces: \section filter_bare_border_faces Bare border faces -Filter faces with bare borders: +filters faces with bare borders: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_BareBorderFace - threshold value is not required @@ -168,7 +168,7 @@ Filter faces with bare borders: \section filter_coplanar_faces Coplanar faces -Filter faces with bare borders: +filters coplanar faces: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_CoplanarFaces - threshold value is the face ID @@ -178,7 +178,7 @@ Filter faces with bare borders: \section filter_over_constrained_faces Over-constrained faces -Filter over-constrained faces: +filters over-constrained faces: - element type is \a SMESH.FACE - functor type is \a SMESH.FT_OverConstrainedFace - threshold value is not required @@ -189,7 +189,7 @@ Filter over-constrained faces: \section filter_double_elements Double edges, Double faces, Double volumes -filter mesh elements basing on the same set of nodes: +filters mesh elements basing on the same set of nodes: - element type is either \a SMESH.EGDE, \a SMESH.FACE or \a SMESH.VOLUME - functor type is either \a SMESH.FT_EqualEdges, \a SMESH.FT_EqualFaces or \a SMESH.FT_EqualVolumes, @@ -211,8 +211,8 @@ filters mesh nodes which are coincident with other nodes (within a given toleran \section filter_borders_multiconnection Borders at multi-connection -Filter border 1D mesh elements (edges) according to the specified number of -connections (faces belonging the border edges) +filters 1D mesh elements (segments) according to the specified number of +connections (faces and volumes on whose border the segment lies): - element type is \a SMESH.EDGE - functor type is \a SMESH.FT_MultiConnection - threshold is integer value (number of connections) @@ -223,8 +223,8 @@ connections (faces belonging the border edges) \section filter_borders_multiconnection_2d Borders at multi-connection 2D -Filter 2D mesh elements (faces) which consist of edges belonging -to the specified number of mesh elements +filters 2D mesh elements (faces) with the specified maximal number of +faces connected to a border (link between nodes, not mesh segment): - element type is \a SMESH.FACE - functor type is \a SMESH.FT_MultiConnection2D - threshold is integer value (number of connections) @@ -235,7 +235,7 @@ to the specified number of mesh elements \section filter_length Length -Filter 1D mesh elements (edges) according to the edge length value: +filters 1D mesh elements (edges) according to the edge length value: - element type should be \a SMESH.EDGE - functor type should be \a SMESH.FT_Length - threshold is floating point value (length) @@ -246,8 +246,8 @@ Filter 1D mesh elements (edges) according to the edge length value: \section filter_length_2d Length 2D -Filter 2D mesh elements (faces) corresponding to the maximum length. -value of its edges: +filters 2D mesh elements (faces) according to the maximum length of its +edges (links between nodes): - element type should be \a SMESH.FACE - functor type should be \a SMESH.FT_Length2D - threshold is floating point value (edge length) @@ -258,11 +258,11 @@ value of its edges: \section filter_max_element_length_2d Element Diameter 2D -Filter 2D mesh elements (faces) corresponding to the maximum length -value of its edges and diagonals: +filters 2D mesh elements (faces) according to the maximum length +of its edges and diagonals: - element type should be \a SMESH.FACE - functor type should be \a SMESH.FT_MaxElementLength2D -- threshold is floating point value (edge/diagonal length) +- threshold is floating point value (length) \tui_script{filters_ex22.py} @@ -270,8 +270,8 @@ value of its edges and diagonals: \section filter_max_element_length_3d Element Diameter 3D -Filter 3D mesh elements (volumes) corresponding to the maximum length -value of its edges and diagonals: +filters 3D mesh elements (volumes) according to the maximum length +of its edges and diagonals: - element type should be \a SMESH.VOLUME - functor type should be \a SMESH.FT_MaxElementLength3D - threshold is floating point value (edge/diagonal length) @@ -282,7 +282,8 @@ value of its edges and diagonals: \section filter_bare_border_volumes Bare border volumes -Filter 3D mesh elements with bare borders: +filters 3D mesh elements with bare borders, i.e. having a facet not +shared with other volumes and without a face on it: - element type is \a SMESH.VOLUME - functor type is \a SMESH.FT_BareBorderVolume - threshold value is not required @@ -293,7 +294,7 @@ Filter 3D mesh elements with bare borders: \section filter_over_constrained_volumes Over-constrained volumes -Filter over-constrained volumes: +filters over-constrained volumes, whose all nodes are on the mesh boundary: - element type is \a SMESH.VOLUME - functor type is \a SMESH.FT_OverConstrainedVolume - threshold value is not required @@ -304,7 +305,7 @@ Filter over-constrained volumes: \section filter_belong_to_group Belong to Mesh Group -Filter mesh entities (nodes or elements) included in a mesh group +filters mesh entities (nodes or elements) included in a mesh group defined by threshold value: - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - functor type should be \a SMESH.FT_BelongToMeshGroup @@ -314,27 +315,31 @@ defined by threshold value: \section filter_belong_to_geom Belong to Geom -Filter mesh entities (nodes or elements) which all nodes lie on the +filters mesh entities (nodes or elements) which all nodes lie on the shape defined by threshold value: - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - functor type should be \a SMESH.FT_BelongToGeom - threshold is geometrical object +- tolerance is a distance between a node and the geometrical object; +it is used if an node is not associated to any geometry. \tui_script{filters_ex26.py} \section filter_lying_on_geom Lying on Geom -Filter mesh entities (nodes or elements) at least one node of which lies on the +filters mesh entities (nodes or elements) at least one node of which lies on the shape defined by threshold value: - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - functor type should be \a SMESH.FT_LyingOnGeom - threshold is geometrical object +- tolerance is a distance between a node and the geometrical object; +it is used if an node is not associated to any geometry. \tui_script{filters_ex27.py} \section filter_belong_to_plane Belong to Plane -Filter mesh entities (nodes or elements) which all nodes belong to the +filters mesh entities (nodes or elements) which all nodes belong to the plane defined by threshold value with the given tolerance: - element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE - functor type should be \a SMESH.FT_BelongToPlane @@ -345,7 +350,7 @@ plane defined by threshold value with the given tolerance: \section filter_belong_to_cylinder Belong to Cylinder -Filter mesh entities (nodes or elements) which all nodes belong to the +filters mesh entities (nodes or elements) which all nodes belong to the cylindrical face defined by threshold value with the given tolerance: - element type can be: \a , \a SMESH.EDGE, \a SMESH.FACE - functor type should be \a SMESH.FT_BelongToCylinder @@ -356,7 +361,7 @@ cylindrical face defined by threshold value with the given tolerance: \section filter_belong_to_surface Belong to Surface -Filter mesh entities (nodes or elements) which all nodes belong to the +filters mesh entities (nodes or elements) which all nodes belong to the arbitrary surface defined by threshold value with the given tolerance: - element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE - functor type should be \a SMESH.FT_BelongToGenSurface @@ -367,7 +372,7 @@ arbitrary surface defined by threshold value with the given tolerance: \section filter_range_of_ids Range of IDs -Filter mesh entities elements (nodes or elements) according to the +filters mesh entities elements (nodes or elements) according to the specified identifiers range: - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - functor type is \a SMESH.FT_RangeOfIds @@ -377,7 +382,7 @@ specified identifiers range: \section filter_bad_oriented_volume Badly oriented volume -Filter 3D mesh elements (volumes), which are incorrectly oriented from +filters 3D mesh elements (volumes), which are incorrectly oriented from the point of view of MED convention. - element type should be \a SMESH.VOLUME - functor type is \a SMESH.FT_BadOrientedVolume @@ -387,7 +392,7 @@ the point of view of MED convention. \section filter_linear_or_quadratic Linear / quadratic -Filter linear / quadratic mesh elements: +filters linear / quadratic mesh elements: - element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME - functor type is \a SMESH.FT_LinearOrQuadratic - threshold is not required @@ -398,7 +403,7 @@ elements are selected, otherwise (by default) linear elements are selected \section filter_group_color Group color -Filter mesh entities, belonging to the group with the color defined by the threshold value. +filters mesh entities, belonging to the group with the color defined by the threshold value. - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - functor type is \a SMESH.FT_GroupColor - threshold should be of SALOMEDS.Color type @@ -407,7 +412,7 @@ Filter mesh entities, belonging to the group with the color defined by the thres \section filter_geom_type Geometry type -Filter mesh elements by the geometric type defined with the threshold +filters mesh elements by the geometric type defined with the threshold value. The list of available geometric types depends on the element entity type. - element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index 4973a5d1e..253ef61b3 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -338,17 +338,24 @@ void SMESHGUI_MeshTab::setCurrentHyp( const int theId, const int theIndex ) } else // more than one additional hyp assigned { - // move a hyp from myHypCombo[ AddHyp ] to myAddHypList - for ( int i = 1, nb = myHypCombo[ AddHyp ]->count(); i < nb; ++i ) + if ( theIndex > 0 ) { - int curIndex = myHypCombo[ AddHyp ]->itemData( i ).toInt(); - if ( theIndex == curIndex ) + // move a hyp from myHypCombo[ AddHyp ] to myAddHypList + for ( int i = 1, nb = myHypCombo[ AddHyp ]->count(); i < nb; ++i ) { - addItem( myHypCombo[ AddHyp ]->itemText( i ), theId, theIndex ); - myHypCombo[ AddHyp ]->removeItem( i ); - break; + int curIndex = myHypCombo[ AddHyp ]->itemData( i ).toInt(); + if ( theIndex == curIndex ) + { + addItem( myHypCombo[ AddHyp ]->itemText( i ), theId, theIndex ); + myHypCombo[ AddHyp ]->removeItem( i ); + break; + } } } + else + { + myAddHypList->clear(); + } } } diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 69053214a..cc873f15b 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -2010,6 +2010,9 @@ int SMESHGUI_MeshOp::currentHyp( const int theDim, const int theHypType ) const bool SMESHGUI_MeshOp::isSelectedHyp( int theDim, int theHypType, int theIndex) const { + if ( theIndex < 0 ) + return false; + if ( theHypType < AddHyp ) // only one hyp can be selected return currentHyp( theDim, theHypType ) == theIndex; @@ -2050,17 +2053,28 @@ bool SMESHGUI_MeshOp::isAccessibleDim( const int theDim ) const * \param theDim - dimension of hypothesis or algorithm * \param theHypType - Type of hypothesis (Algo, MainHyp, AddHyp) * \param theIndex - Index of hypothesis + * \param updateHypsOnAlgoDeselection - to clear and disable hyps if algo deselected * * Gets current hypothesis or algorithms */ //================================================================================ -void SMESHGUI_MeshOp::setCurrentHyp( const int theDim, - const int theHypType, - const int theIndex ) +void SMESHGUI_MeshOp::setCurrentHyp( const int theDim, + const int theHypType, + const int theIndex, + const bool updateHypsOnAlgoDeselection) { myIgnoreAlgoSelection = true; myDlg->tab( theDim )->setCurrentHyp( theHypType, theIndex + 1 ); myIgnoreAlgoSelection = false; + + if ( updateHypsOnAlgoDeselection && theHypType == Algo && theIndex < 0 ) + { + const QStringList noHyps; + myDlg->tab( theDim )->setAvailableHyps( MainHyp, noHyps ); + myDlg->tab( theDim )->setExistingHyps ( MainHyp, noHyps ); + myDlg->tab( theDim )->setAvailableHyps( AddHyp, noHyps ); + myDlg->tab( theDim )->setExistingHyps ( AddHyp, noHyps ); + } } //================================================================================ @@ -2645,7 +2659,7 @@ void SMESHGUI_MeshOp::setAvailableMeshType( const QStringList& theTypeMesh ) * \param theIndex - Index of current type of mesh */ //================================================================================ -void SMESHGUI_MeshOp::onAlgoSetByMeshType( const int theTabIndex, const int theIndex) +void SMESHGUI_MeshOp::onAlgoSetByMeshType( const int theTabIndex, const int theIndex ) { setFilteredAlgoData( theTabIndex, theIndex); } @@ -2705,8 +2719,8 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI } else for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) { - if ( i > myMaxShapeDim || ( isReqDisBound && i != aReqDim ) ) myDlg->disableTab( i ); - else myDlg->enableTab( i ); + if ( i > myMaxShapeDim || ( isReqDisBound && i < aReqDim ) ) myDlg->disableTab( i ); + else myDlg->enableTab( i ); } myDlg->setCurrentTab( theTabIndex ); } @@ -2740,7 +2754,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI //set new algorithm list and select the current algorithm myDlg->tab( dim )->setAvailableHyps( Algo, anAvailableAlgs ); anCurrentCompareType = ( anCompareType == "HEXA" || anCompareType == "QUAD" ) ? "QUAD" : "TRIA"; - setCurrentHyp( dim, Algo, anCurrentAvailableAlgo ); + setCurrentHyp( dim, Algo, anCurrentAvailableAlgo, /*updateHyps=*/true ); } for ( int i = myMaxShapeDim; i >= SMESH::DIM_0D; i-- ) { @@ -2753,7 +2767,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI for (int j = myMaxShapeDim; j >= SMESH::DIM_0D; j--) { if ( currentHyp( j, Algo ) < 0 ) { myDlg->disableTab( j ); - setCurrentHyp( j , Algo, -1 ); + setCurrentHyp( j , Algo, -1, /*updateHyps=*/true ); } } break; @@ -2763,8 +2777,8 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI } } if ( aDim == SMESH::DIM_2D) { + setCurrentHyp( SMESH::DIM_3D, Algo, -1, /*updateHyps=*/true ); myDlg->disableTab( SMESH::DIM_3D ); - setCurrentHyp( SMESH::DIM_3D, Algo, -1); } int currentTab = ( theTabIndex <= aDim ) ? theTabIndex : aDim; diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index 35bd50672..6d26686b4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -128,7 +128,7 @@ private: bool isSelectedHyp( int, int, int ) const; int nbDlgHypTypes( const int ) const; bool isAccessibleDim( const int ) const; - void setCurrentHyp( const int, const int, const int ); + void setCurrentHyp( const int, const int, const int, const bool=false); void setDefaultName( const QString& prefix="" ) const; SMESH::SMESH_Hypothesis_var getAlgo( const int ); void readMesh(); diff --git a/src/SMESH_PY/smeshstudytools.py b/src/SMESH_PY/smeshstudytools.py index 51bcc3567..7d4277211 100644 --- a/src/SMESH_PY/smeshstudytools.py +++ b/src/SMESH_PY/smeshstudytools.py @@ -127,8 +127,8 @@ class SMeshStudyTools: from salome.smesh import smeshBuilder smesh = smeshBuilder.New(self.editor.study) - meshObject=smesh.IDToObject(entry) - return meshObject + meshObject=salome.IDToObject(entry) + return smesh.Mesh( meshObject ) ## Returns the SMESH object associated to the specified \em SObject, # (the SObject is an item in the objects browser). diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 2c98e1653..67e3c71b3 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1970,7 +1970,7 @@ class Mesh: # @param groupName the name of the mesh group # @param elementType the type of elements in the group; either of # (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME). - # @param elemIDs the list of ids + # @param elemIDs either the list of ids, group, sub-mesh, or filter # @return SMESH_Group # @ingroup l2_grps_create def MakeGroupByIds(self, groupName, elementType, elemIDs): From 39ef405afeff484d4a77e1d3604646b05d80eabf Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 4 Mar 2016 15:09:50 +0100 Subject: [PATCH 094/147] general crack dialog, another error detection --- src/Tools/blocFissure/gmu/peauInterne.py | 20 +++++++++++++++++++ .../blocFissure/gmu/restreintFaceFissure.py | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Tools/blocFissure/gmu/peauInterne.py b/src/Tools/blocFissure/gmu/peauInterne.py index b1915042e..8d6643a5c 100644 --- a/src/Tools/blocFissure/gmu/peauInterne.py +++ b/src/Tools/blocFissure/gmu/peauInterne.py @@ -3,6 +3,8 @@ import logging from geomsmesh import smesh import SMESH +import traceback +from fissError import fissError from listOfExtraFunctions import lookForCorner from fusionMaillageAttributionDefaut import fusionMaillageDefaut @@ -40,6 +42,24 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones): if grp.GetName() == nomZones + "_internalEdges": zoneDefaut_internalEdges = grp break + + # --- Le groupe ZoneDefaut ne doit contenir que des Hexaèdres" + + info=maillageSain.GetMeshInfo(zoneDefaut) + keys = info.keys(); keys.sort() + nbelem=0 + nbhexa=0 + for i in keys: + #print " %s : %d" % ( i, info[i] ) + nbelem+=info[i] + if i == "Entity_Hexa": + nbhexa+=info[i] + if (nbelem == 0) or (nbhexa < nbelem) : + texte = "La zone a remailler est incorrecte : " + texte += "Causes possibles :
          " + texte += "
        • Les mailles à enlever dans le maillage sain n'ont pas été détectées.
        • " + texte += "
        • Il n'y a pas que des Hexaèdres linéaires dans la zone à remailler (mailles quadratiques, tetraèdres non traités)
        " + raise fissError(traceback.extract_stack(),texte) nbAdded, maillageSain, DefautBoundary = maillageSain.MakeBoundaryElements( SMESH.BND_2DFROM3D, 'DefBound', '', 0, [ zoneDefaut ]) internal = maillageSain.GetMesh().CutListOfGroups( [ DefautBoundary ], [ zoneDefaut_skin ], 'internal' ) diff --git a/src/Tools/blocFissure/gmu/restreintFaceFissure.py b/src/Tools/blocFissure/gmu/restreintFaceFissure.py index c2a055f8f..7e1d1e0e4 100644 --- a/src/Tools/blocFissure/gmu/restreintFaceFissure.py +++ b/src/Tools/blocFissure/gmu/restreintFaceFissure.py @@ -28,8 +28,11 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande except: texte = "Restriction de la face de fissure au domaine solide impossible. " - texte += "Cause possible : la face de fissure est tangente à la paroi solide. " - texte += "Elle doit déboucher franchement, sans que la surface dehors ne devienne plus grande que la surface dans le solide. " + texte += "Causes possibles :
          " + texte += "
        • La face de fissure est tangente à la paroi solide." + texte += "Elle doit déboucher franchement, sans que la surface dehors ne devienne plus grande que la surface dans le solide.
        • " + texte += "
        • le prémaillage de la face de fissure est trop grossier, les mailles à enlever dans le maillage sain " + texte += "n'ont pas toutes été détectées.
        " raise fissError(traceback.extract_stack(),texte) logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf) facesPortFissure = facesPartShapeDefautSorted[-1] From d54b8e1c78f746d202422ee1ee50ce7a35405c8a Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 4 Mar 2016 16:29:26 +0100 Subject: [PATCH 095/147] general crack dialog, another error detection --- src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py | 9 +++++++++ src/Tools/blocFissure/gmu/peauInterne.py | 5 +++-- src/Tools/blocFissure/gmu/restreintFaceFissure.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py b/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py index dee9bf84f..5225d9834 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautMaillage.py @@ -4,6 +4,8 @@ import logging from geomsmesh import geompy import math from distance2 import distance2 +import traceback +from fissError import fissError # ----------------------------------------------------------------------------- # --- zone de defaut extraite du maillage @@ -60,5 +62,12 @@ def creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, verticesShapes.append(vertices) pass + if (nb == 0) : + texte = "La zone à remailler n'est pas détectée correctement.
        " + texte += "Cause possible :
          " + texte += "
        • La distance d'influence est trop petite. " + texte += "L'ordre de grandeur minimal correspond à la taille des mailles du maillage sain dans la zone à remailler.
        " + raise fissError(traceback.extract_stack(),texte) + dmoyen = math.sqrt(cumul/nb) # ~ taille de l'arête moyenne du maillage global return origShapes, verticesShapes, dmoyen diff --git a/src/Tools/blocFissure/gmu/peauInterne.py b/src/Tools/blocFissure/gmu/peauInterne.py index 8d6643a5c..ae6870c88 100644 --- a/src/Tools/blocFissure/gmu/peauInterne.py +++ b/src/Tools/blocFissure/gmu/peauInterne.py @@ -55,10 +55,11 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones): if i == "Entity_Hexa": nbhexa+=info[i] if (nbelem == 0) or (nbhexa < nbelem) : - texte = "La zone a remailler est incorrecte : " + texte = "La zone a remailler est incorrecte.
        " texte += "Causes possibles :
          " texte += "
        • Les mailles à enlever dans le maillage sain n'ont pas été détectées.
        • " - texte += "
        • Il n'y a pas que des Hexaèdres linéaires dans la zone à remailler (mailles quadratiques, tetraèdres non traités)
        " + texte += "
      • Certaines faces du maillage sain sont à l'envers : les normales aux faces en paroi de volume doivent être sortantes.
      • " + texte += "
      • Il n'y a pas que des Hexaèdres réglés linéaires dans la zone à remailler (notamment mailles quadratiques, tetraèdres non traités)
      " raise fissError(traceback.extract_stack(),texte) nbAdded, maillageSain, DefautBoundary = maillageSain.MakeBoundaryElements( SMESH.BND_2DFROM3D, 'DefBound', '', 0, [ zoneDefaut ]) diff --git a/src/Tools/blocFissure/gmu/restreintFaceFissure.py b/src/Tools/blocFissure/gmu/restreintFaceFissure.py index 7e1d1e0e4..b300ae19f 100644 --- a/src/Tools/blocFissure/gmu/restreintFaceFissure.py +++ b/src/Tools/blocFissure/gmu/restreintFaceFissure.py @@ -27,7 +27,7 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne): try: facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande except: - texte = "Restriction de la face de fissure au domaine solide impossible. " + texte = "Restriction de la face de fissure au domaine solide impossible.
      " texte += "Causes possibles :
        " texte += "
      • La face de fissure est tangente à la paroi solide." texte += "Elle doit déboucher franchement, sans que la surface dehors ne devienne plus grande que la surface dans le solide.
      • " From 5b62e4db7cca70738f4487b2788cc2bae2c2df8f Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 4 Mar 2016 20:54:10 +0300 Subject: [PATCH 096/147] 53099: 3D Extrusion algo refuses to work on an extruded solid with internal faces --- src/SMESH_SWIG/smeshBuilder.py | 2 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 94 ++++++++++++++++++-------- 2 files changed, 67 insertions(+), 29 deletions(-) diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 67e3c71b3..cfd4117f1 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -252,7 +252,7 @@ def TreatHypoStatus(status, hypName, geomName, isAlgo, mesh): if mesh: meshName = GetName( mesh ) if meshName and meshName != NO_NAME: - where = '"%s" in "%s"' % ( geomName, meshName ) + where = '"%s" shape in "%s" mesh ' % ( geomName, meshName ) if status < HYP_UNKNOWN_FATAL and where: print '"%s" was assigned to %s but %s' %( hypName, where, reason ) elif where: diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 8b7347d7b..225da4650 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -2509,8 +2509,10 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() _iL( SMESH_MesherHelper::WrapIndex( iE-1, nbE ) + shift ), _iR( SMESH_MesherHelper::WrapIndex( iE+1, nbE ) + shift ) { + //_edge.Orientation( TopAbs_FORWARD ); // for operator==() to work } EdgeWithNeighbors() {} + bool IsInternal() const { return !_edge.IsNull() && _edge.Orientation() == TopAbs_INTERNAL; } }; // PrismSide contains all FACEs linking a bottom EDGE with a top one. struct PrismSide @@ -2524,6 +2526,7 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() int _nbCheckedEdges; // nb of EDGEs whose location is defined PrismSide *_leftSide; // neighbor sides PrismSide *_rightSide; + bool _isInternal; // whether this side raises from an INTERNAL EDGE void SetExcluded() { _leftSide = _rightSide = NULL; } bool IsExcluded() const { return !_leftSide; } const TopoDS_Edge& Edge( int i ) const @@ -2536,10 +2539,15 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() if ( E.IsSame( Edge( i ))) return i; return -1; } - bool IsSideFace( const TopoDS_Shape& face ) const + bool IsSideFace( const TopoDS_Shape& face, const bool checkNeighbors ) const { if ( _faces->Contains( face )) // avoid returning true for a prism top FACE return ( !_face.IsNull() || !( face.IsSame( _faces->FindKey( _faces->Extent() )))); + + if ( checkNeighbors ) + return (( _leftSide && _leftSide->IsSideFace ( face, false )) || + ( _rightSide && _rightSide->IsSideFace( face, false ))); + return false; } }; @@ -2551,15 +2559,19 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() vector< EdgeWithNeighbors > & edges, const bool noHolesAllowed) { + TopoDS_Face f = face; + if ( f.Orientation() != TopAbs_FORWARD && + f.Orientation() != TopAbs_REVERSED ) + f.Orientation( TopAbs_FORWARD ); list< TopoDS_Edge > ee; list< int > nbEdgesInWires; - int nbW = SMESH_Block::GetOrderedEdges( face, ee, nbEdgesInWires ); + int nbW = SMESH_Block::GetOrderedEdges( f, ee, nbEdgesInWires ); if ( nbW > 1 && noHolesAllowed ) return false; int iE, nbTot = 0; - list< TopoDS_Edge >::iterator e = ee.begin(); - list< int >::iterator nbE = nbEdgesInWires.begin(); + list< TopoDS_Edge >::iterator e = ee.begin(); + list< int >::iterator nbE = nbEdgesInWires.begin(); for ( ; nbE != nbEdgesInWires.end(); ++nbE ) for ( iE = 0; iE < *nbE; ++e, ++iE ) if ( SMESH_Algo::isDegenerated( *e )) @@ -2568,10 +2580,6 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() --(*nbE); --iE; } - else - { - e->Orientation( TopAbs_FORWARD ); // for operator==() to work - } edges.clear(); e = ee.begin(); @@ -2581,6 +2589,35 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable() edges.push_back( EdgeWithNeighbors( *e, iE, *nbE, nbTot )); nbTot += *nbE; } + + // IPAL53099. Set correct neighbors to INTERNAL EDGEs, which can be connected to + // EDGEs of the outer WIRE but this fact can't be detected by their order. + if ( nbW > 1 ) + { + int iFirst = 0, iLast; + for ( nbE = nbEdgesInWires.begin(); nbE != nbEdgesInWires.end(); ++nbE ) + { + iLast = iFirst + *nbE - 1; + TopoDS_Vertex vv[2] = { SMESH_MesherHelper::IthVertex( 0, edges[ iFirst ]._edge ), + SMESH_MesherHelper::IthVertex( 1, edges[ iLast ]._edge ) }; + bool isConnectOk = ( vv[0].IsSame( vv[1] )); + if ( !isConnectOk ) + { + // look for an EDGE of the outer WIRE connected to vv + TopoDS_Vertex v0, v1; + for ( iE = 0; iE < nbEdgesInWires.front(); ++iE ) + { + v0 = SMESH_MesherHelper::IthVertex( 0, edges[ iE ]._edge ); + v1 = SMESH_MesherHelper::IthVertex( 1, edges[ iE ]._edge ); + if ( vv[0].IsSame( v0 ) || vv[0].IsSame( v1 )) + edges[ iFirst ]._iL = iE; + if ( vv[1].IsSame( v0 ) || vv[1].IsSame( v1 )) + edges[ iLast ]._iR = iE; + } + } + iFirst += *nbE; + } + } return edges.size(); } //-------------------------------------------------------------------------------- @@ -2703,11 +2740,12 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA sides.resize( botEdges.size() ); for ( size_t iS = 0; iS < botEdges.size(); ++iS ) { - sides[ iS ]._topEdge = botEdges[ iS ]._edge; - sides[ iS ]._face = botF; - sides[ iS ]._leftSide = & sides[ botEdges[ iS ]._iR ]; - sides[ iS ]._rightSide = & sides[ botEdges[ iS ]._iL ]; - sides[ iS ]._faces = & facesOfSide[ iS ]; + sides[ iS ]._topEdge = botEdges[ iS ]._edge; + sides[ iS ]._face = botF; + sides[ iS ]._leftSide = & sides[ botEdges[ iS ]._iR ]; + sides[ iS ]._rightSide = & sides[ botEdges[ iS ]._iL ]; + sides[ iS ]._isInternal = botEdges[ iS ].IsInternal(); + sides[ iS ]._faces = & facesOfSide[ iS ]; sides[ iS ]._faces->Clear(); } @@ -2736,8 +2774,9 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA if ( side._isCheckedEdge[ iE ] ) continue; const TopoDS_Edge& vertE = side.Edge( iE ); const TopoDS_Shape& neighborF = getAnotherFace( side._face, vertE, facesOfEdge ); - bool isEdgeShared = adjSide->IsSideFace( neighborF ); - if ( isEdgeShared ) // vertE is shared with adjSide + bool isEdgeShared = (( adjSide->IsSideFace( neighborF, side._isInternal )) || + ( adjSide == &side && neighborF.IsSame( side._face )) ); + if ( isEdgeShared ) // vertE is shared with adjSide { isAdvanced = true; side._isCheckedEdge[ iE ] = true; @@ -2778,20 +2817,19 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA { stop = true; } - else if ( side._leftSide != & side ) // not closed side face + else if ( side._leftSide != & side && // not closed side face + side._leftSide->_faces->Contains( f )) { - if ( side._leftSide->_faces->Contains( f )) - { - stop = true; // probably f is the prism top face - side._leftSide->_face.Nullify(); - side._leftSide->_topEdge.Nullify(); - } - if ( side._rightSide->_faces->Contains( f )) - { - stop = true; // probably f is the prism top face - side._rightSide->_face.Nullify(); - side._rightSide->_topEdge.Nullify(); - } + stop = true; // probably f is the prism top face + side._leftSide->_face.Nullify(); + side._leftSide->_topEdge.Nullify(); + } + else if ( side._rightSide != & side && + side._rightSide->_faces->Contains( f )) + { + stop = true; // probably f is the prism top face + side._rightSide->_face.Nullify(); + side._rightSide->_topEdge.Nullify(); } if ( stop ) { From 8eda0c3c6d688da2f74167c046d880e930f0f4b2 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 7 Mar 2016 18:32:29 +0100 Subject: [PATCH 097/147] amorce doc Sphinx blocFissure --- resources/SalomeApp.xml.in | 1 + src/Tools/blocFissure/CMakeLists.txt | 1 + src/Tools/blocFissure/doc/CMakeLists.txt | 63 ++++++++ src/Tools/blocFissure/doc/conf.py.in | 179 +++++++++++++++++++++++ src/Tools/blocFissure/doc/index.rst | 39 +++++ 5 files changed, 283 insertions(+) create mode 100755 src/Tools/blocFissure/doc/CMakeLists.txt create mode 100644 src/Tools/blocFissure/doc/conf.py.in create mode 100644 src/Tools/blocFissure/doc/index.rst diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 94c0d894e..260e2b51c 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -122,6 +122,7 @@ +
        diff --git a/src/Tools/blocFissure/CMakeLists.txt b/src/Tools/blocFissure/CMakeLists.txt index 3b69e0f83..092977b32 100644 --- a/src/Tools/blocFissure/CMakeLists.txt +++ b/src/Tools/blocFissure/CMakeLists.txt @@ -20,6 +20,7 @@ ADD_SUBDIRECTORY(CasTests) ADD_SUBDIRECTORY(gmu) ADD_SUBDIRECTORY(materielCasTests) +ADD_SUBDIRECTORY(doc) IF(SALOME_BUILD_GUI) ADD_SUBDIRECTORY(ihm) diff --git a/src/Tools/blocFissure/doc/CMakeLists.txt b/src/Tools/blocFissure/doc/CMakeLists.txt new file mode 100755 index 000000000..c1b0efe46 --- /dev/null +++ b/src/Tools/blocFissure/doc/CMakeLists.txt @@ -0,0 +1,63 @@ +# Copyright (C) 2012-2015 EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SET(RSTFILES + index.rst +) + +SET(SPHINXOPTS ) +SET(SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET(PAPEROPT_a4 -D latex_paper_size=a4) +SET(ALLSPHINXOPTS -d doctrees ${PAPEROPT_a4} ${SPHINXOPTS} ${SOURCEDIR}) + +SALOME_CONFIGURE_FILE(conf.py.in conf.py) + +ADD_CUSTOM_TARGET(BUILD_HTML ALL + COMMAND ${CMAKE_COMMAND} -E make_directory html + COMMAND ${CMAKE_COMMAND} -E make_directory doctrees + COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} -b html ${ALLSPHINXOPTS} html + DEPENDS ${RSTFILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +ADD_CUSTOM_TARGET(BUILD_PDF ALL + COMMAND ${CMAKE_COMMAND} -E make_directory latex + COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} -b latex ${ALLSPHINXOPTS} latex + COMMAND make -C latex all-pdf + DEPENDS ${RSTFILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ + DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/blocFissure + PATTERN ".buildinfo" EXCLUDE +) + +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/blocFissure.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/blocFissure) + +#SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} docutils) +#SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}") + +#ADD_CUSTOM_TARGET(html_docs_ZCracksPlug COMMAND ${_cmd}) + +#INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs_ZCracksPlug)") +#INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils/ DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/zcracks) + +#SET(make_clean_files docutils doctrees) +#SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}") diff --git a/src/Tools/blocFissure/doc/conf.py.in b/src/Tools/blocFissure/doc/conf.py.in new file mode 100644 index 000000000..47bfec558 --- /dev/null +++ b/src/Tools/blocFissure/doc/conf.py.in @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +# +# Yams PlugIn documentation build configuration file, created by +# sphinx-quickstart on Wed Sep 14 11:40:32 2011. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# The contents of this file are pickled, so don't put values in the namespace +# that aren't pickleable (module imports are okay, they're removed automatically). +# +# All configuration values have a default value; values that are commented out +# serve to show the default value. + +import sys, os + +# If your extensions are in another directory, add it here. If the directory +# is relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. +#sys.path.append(os.path.abspath('some/directory')) + +# General configuration +# --------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc'] + +# Add any paths that contain templates here, relative to this directory. +#templates_path = ['.templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General substitutions. +project = 'Plug-in blocFissure' +copyright = '2010-2016 EDF R&D' + +# The default replacements for |version| and |release|, also used in various +# other places throughout the built documents. +# +# The short X.Y version. +version = '@SALOMESMESH_VERSION@' +# The full version, including alpha/beta/rc tags. +release = '@SALOMESMESH_VERSION@' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directories, that shouldn't be searched +# for source files. +#exclude_dirs = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# Options for HTML output +# ----------------------- + +# The style sheet to use for HTML and HTML Help pages. A file of that name +# must exist either in Sphinx' static/ path, or in one of the custom paths +# given in html_static_path. +html_style = 'default' + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (within the static path) to place at the top of +# the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_use_modindex = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, the reST sources are included in the HTML build as _sources/. +#html_copy_source = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'blocFissure_doc' + + +# Options for LaTeX output +# ------------------------ + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, document class [howto/manual]). +latex_documents = [ + ('index', 'blocFissure.tex', 'Documentation Plug-in blocFissure', + 'EDF', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True diff --git a/src/Tools/blocFissure/doc/index.rst b/src/Tools/blocFissure/doc/index.rst new file mode 100644 index 000000000..4005e6b10 --- /dev/null +++ b/src/Tools/blocFissure/doc/index.rst @@ -0,0 +1,39 @@ +.. + Copyright (C) 2015-2016 EDF + + This file is part of SALOME HYDRO module. + + SALOME HYDRO module 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 3 of the License, or + (at your option) any later version. + + SALOME HYDRO module 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. + + You should have received a copy of the GNU General Public License + along with SALOME HYDRO module. If not, see . + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Documentation du plugin blocFissure +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +Le plugin blocFissure traite l'insertion de fissure dans un maillage sain. + +################### +Outil métier coudes +################### + +Cet outil génère des maillages de tuyaux coudés, avec des fissures de différents types, au niveau du coude. +Cet outil traite un cas particulier de l'outil général d'insertion de fissure dans un maillage sain. + +########################################## +Insertion de fissure dans un maillage sain +########################################## + +Partant d'un maillage sain et d'une face de fissure décrite en CAO, l'outil modifie le maillage sain, +en introduisant un maillage de la fissure, sous la forme d'un tore rayonnant le long de la ligne de fond de fissure. From 635cfb4d85f0a2a39d809381ebfe3fc88f0b10b2 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 8 Mar 2016 11:41:15 +0100 Subject: [PATCH 098/147] general crack dialog, error in hexa detection --- src/Tools/blocFissure/gmu/peauInterne.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/gmu/peauInterne.py b/src/Tools/blocFissure/gmu/peauInterne.py index ae6870c88..6e6915966 100644 --- a/src/Tools/blocFissure/gmu/peauInterne.py +++ b/src/Tools/blocFissure/gmu/peauInterne.py @@ -52,7 +52,7 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones): for i in keys: #print " %s : %d" % ( i, info[i] ) nbelem+=info[i] - if i == "Entity_Hexa": + if "Entity_Hexa" in str(i): nbhexa+=info[i] if (nbelem == 0) or (nbhexa < nbelem) : texte = "La zone a remailler est incorrecte.
        " From 4ae19232e4bac8cec51b008f9f893c50c2cf1117 Mon Sep 17 00:00:00 2001 From: mnt Date: Thu, 10 Mar 2016 11:28:48 +0300 Subject: [PATCH 099/147] Do not generate PDF documentation with latex --- src/Tools/blocFissure/doc/CMakeLists.txt | 45 +++++------------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/src/Tools/blocFissure/doc/CMakeLists.txt b/src/Tools/blocFissure/doc/CMakeLists.txt index c1b0efe46..8605eda97 100755 --- a/src/Tools/blocFissure/doc/CMakeLists.txt +++ b/src/Tools/blocFissure/doc/CMakeLists.txt @@ -17,47 +17,18 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(RSTFILES - index.rst -) - -SET(SPHINXOPTS ) -SET(SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}) -SET(PAPEROPT_a4 -D latex_paper_size=a4) -SET(ALLSPHINXOPTS -d doctrees ${PAPEROPT_a4} ${SPHINXOPTS} ${SOURCEDIR}) - SALOME_CONFIGURE_FILE(conf.py.in conf.py) -ADD_CUSTOM_TARGET(BUILD_HTML ALL - COMMAND ${CMAKE_COMMAND} -E make_directory html - COMMAND ${CMAKE_COMMAND} -E make_directory doctrees - COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} -b html ${ALLSPHINXOPTS} html - DEPENDS ${RSTFILES} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -ADD_CUSTOM_TARGET(BUILD_PDF ALL - COMMAND ${CMAKE_COMMAND} -E make_directory latex - COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} -b latex ${ALLSPHINXOPTS} latex - COMMAND make -C latex all-pdf - DEPENDS ${RSTFILES} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) +SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} docutils) +SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}") -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ +ADD_CUSTOM_TARGET(html_docs_blocFissure COMMAND ${_cmd}) + +INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs_blocFissure)") +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils/ DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/blocFissure PATTERN ".buildinfo" EXCLUDE ) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/blocFissure.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/blocFissure) - -#SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} docutils) -#SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}") - -#ADD_CUSTOM_TARGET(html_docs_ZCracksPlug COMMAND ${_cmd}) - -#INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs_ZCracksPlug)") -#INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils/ DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH/zcracks) - -#SET(make_clean_files docutils doctrees) -#SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}") +SET(make_clean_files docutils doctrees) +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}") From 0224364ee28a7d92b0d28376df5649f6036be4c0 Mon Sep 17 00:00:00 2001 From: akl Date: Thu, 10 Mar 2016 17:55:36 +0300 Subject: [PATCH 100/147] Taking into account SALOME_BUILD_DOC option. --- src/Tools/blocFissure/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/CMakeLists.txt b/src/Tools/blocFissure/CMakeLists.txt index 092977b32..0f0beaf32 100644 --- a/src/Tools/blocFissure/CMakeLists.txt +++ b/src/Tools/blocFissure/CMakeLists.txt @@ -20,7 +20,10 @@ ADD_SUBDIRECTORY(CasTests) ADD_SUBDIRECTORY(gmu) ADD_SUBDIRECTORY(materielCasTests) -ADD_SUBDIRECTORY(doc) + +IF(SALOME_BUILD_DOC) + ADD_SUBDIRECTORY(doc) +ENDIF(SALOME_BUILD_DOC) IF(SALOME_BUILD_GUI) ADD_SUBDIRECTORY(ihm) From a1a6d5ddc111fa237d1164fda37ff823a3fac764 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 11 Mar 2016 16:32:07 +0300 Subject: [PATCH 101/147] 53103: Mesh visualization performance problem Optimize visualization and mesh loading. + fix docs --- doc/salome/examples/3dmesh.py | 23 +++-- doc/salome/examples/grouping_elements_ex01.py | 58 ++++++++++++ doc/salome/examples/prism_3d_algo.py | 4 +- doc/salome/gui/SMESH/CMakeLists.txt | 4 +- .../gui/SMESH/input/smeshpy_interface.doc | 93 +++++++++++-------- .../gui/SMESH/input/tui_creating_meshes.doc | 30 +++--- .../gui/SMESH/input/tui_grouping_elements.doc | 27 ++---- .../gui/SMESH/input/tui_modifying_meshes.doc | 50 ++++------ .../gui/SMESH/input/tui_quality_controls.doc | 2 + .../SMESH/input/tui_transforming_meshes.doc | 43 +++------ .../input/tui_work_on_objects_from_gui.doc | 2 +- idl/SMESH_Group.idl | 2 +- src/DriverMED/DriverMED_Family.cxx | 4 +- src/DriverMED/DriverMED_Family.h | 8 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 19 ++-- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 10 +- src/OBJECT/SMESH_Object.cxx | 84 ++++++++--------- src/SMESHDS/SMESHDS_Mesh.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 1 + src/SMESH_I/SMESH_PreMeshInfo.cxx | 2 +- src/SMESH_SWIG/StdMeshersBuilder.py | 2 +- src/SMESH_SWIG/smeshBuilder.py | 26 +++--- 22 files changed, 265 insertions(+), 231 deletions(-) diff --git a/doc/salome/examples/3dmesh.py b/doc/salome/examples/3dmesh.py index 67a707533..57a1440e0 100644 --- a/doc/salome/examples/3dmesh.py +++ b/doc/salome/examples/3dmesh.py @@ -2,17 +2,16 @@ import salome salome.salome_init() -import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) -import SMESH, SALOMEDS +import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) ### # Geometry: an assembly of a box, a cylinder and a truncated cone -# meshed with tetrahedral +# to be meshed with tetrahedra ### # Define values @@ -44,14 +43,14 @@ piece = geompy.MakeFuse(box_cyl, cone) geompy.addToStudy(piece, name) # Create a group of faces -group = geompy.CreateGroup(piece, geompy.ShapeType["FACE"]) +faces_group = geompy.CreateGroup(piece, geompy.ShapeType["FACE"]) group_name = name + "_grp" -geompy.addToStudy(group, group_name) -group.SetName(group_name) +geompy.addToStudy(faces_group, group_name) +faces_group.SetName(group_name) # Add faces to the group faces = geompy.SubShapeAllIDs(piece, geompy.ShapeType["FACE"]) -geompy.UnionIDs(group, faces) +geompy.UnionIDs(faces_group, faces) ### # Create a mesh @@ -60,20 +59,20 @@ geompy.UnionIDs(group, faces) # Define a mesh on a geometry tetra = smesh.Mesh(piece, name) -# Define 1D hypothesis +# Define 1D algorithm and hypothesis algo1d = tetra.Segment() algo1d.LocalLength(10) -# Define 2D hypothesis +# Define 2D algorithm and hypothesis algo2d = tetra.Triangle() algo2d.LengthFromEdges() -# Define 3D hypothesis +# Define 3D algorithm and hypothesis algo3d = tetra.Tetrahedron() algo3d.MaxElementVolume(100) # Compute the mesh tetra.Compute() -# Create a groupe of faces -tetra.Group(group) +# Create a mesh group of all triangles generated on geom faces present in faces_group +group = tetra.Group(faces_group) diff --git a/doc/salome/examples/grouping_elements_ex01.py b/doc/salome/examples/grouping_elements_ex01.py index 013332766..9181e43df 100644 --- a/doc/salome/examples/grouping_elements_ex01.py +++ b/doc/salome/examples/grouping_elements_ex01.py @@ -19,4 +19,62 @@ aGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds) aGroup2 = mesh.CreateEmptyGroup(SMESH.NODE, "all nodes") aGroup2.AddFrom(mesh.mesh) + +# ==================================== +# Various methods of the Group object +# ==================================== + +aGroup = mesh.CreateEmptyGroup(SMESH.NODE, "aGroup") + +# set/get group name +aGroup.SetName( "new name" ) +print "name", aGroup.GetName() + +# get group type (type of entities in the group, SMESH.NODE in our case) +print "type", aGroup.GetType() + +# get number of entities (nodes in our case) in the group +print "size", aGroup.Size() + +# check of emptiness +print "is empty", aGroup.IsEmpty() + +# check of presence of an entity in the group +aGroup.Add([1,2]) # method specific to the standalone group +print "contains node 2", aGroup.Contains(2) + +# get an entity by index +print "1st node", aGroup.GetID(1) + +# get all entities +print "all", aGroup.GetIDs() + +# get number of nodes (actual for groups of elements) +print "nb nodes", aGroup.GetNumberOfNodes() + +# get underlying nodes (actual for groups of elements) +print "nodes", aGroup.GetNodeIDs() + +# set/get color +import SALOMEDS +aGroup.SetColor( SALOMEDS.Color(1.,1.,0.)); +print "color", aGroup.GetColor() + +# ---------------------------------------------------------------------------- +# methods specific to the standalone group and not present in GroupOnGeometry +# and GroupOnFilter +# ---------------------------------------------------------------------------- + +# clear the group's contents +aGroup.Clear() + +# add contents of other object (group, sub-mesh, filter) +aGroup.AddFrom( aGroup2 ) + +# removes entities +aGroup.Remove( [2,3,4] ) + + + + salome.sg.updateObjBrowser(1) diff --git a/doc/salome/examples/prism_3d_algo.py b/doc/salome/examples/prism_3d_algo.py index 7be0a29d3..e51822561 100644 --- a/doc/salome/examples/prism_3d_algo.py +++ b/doc/salome/examples/prism_3d_algo.py @@ -1,4 +1,4 @@ -# Use 3D extrusion meshing algorithm +# Usage of 3D Extrusion meshing algorithm import salome salome.salome_init() @@ -58,7 +58,7 @@ mesh = smesh.Mesh( prisms ) # assign Global hypotheses -# 1D algorithm and hypothesis for vertical division +# 1D algorithm and hypothesis for division along the pipe mesh.Segment().NumberOfSegments(15) # Extrusion 3D algo diff --git a/doc/salome/gui/SMESH/CMakeLists.txt b/doc/salome/gui/SMESH/CMakeLists.txt index 47c517cff..a221bbfe8 100644 --- a/doc/salome/gui/SMESH/CMakeLists.txt +++ b/doc/salome/gui/SMESH/CMakeLists.txt @@ -30,8 +30,8 @@ SET(kernel_file "${KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py") SALOME_ACCUMULATE_ENVIRONMENT(SMESH_MeshersList NOCHECK ${DOC_SMESH_MeshersList}) -SET(_cmd_options ${smesh_file} -d -o tmp1/smeshBuilder.py StdMeshers) -SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${PYTHON_EXECUTABLE}" "${_cmd_options}") +SET(_cmd_options ${smesh_file} -o tmp1/smeshBuilder.py StdMeshers) +SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${PYTHON_EXECUTABLE}" "${_cmd_options}") ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp1 COMMAND ${CMAKE_COMMAND} -E make_directory tmp2 diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.doc b/doc/salome/gui/SMESH/input/smeshpy_interface.doc index df7e15967..92bd2f41d 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.doc +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.doc @@ -7,49 +7,66 @@ be used for easy mesh creation and edition. Documentation for SALOME %Mesh module Python API is available in two forms: - Structured documentation, where all methods and -classes are grouped by their functionality, like it is done in the GUI documentation +classes are grouped by their functionality. - Linear documentation grouped only by classes, declared in the \ref smeshBuilder and \ref StdMeshersBuilder Python packages. -\n With SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality, +\n With SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality. \n You may have to modify your scripts generated with SALOME 6 or older versions. -\n Please see \ref smesh_migration_page - -The SMESH python package contains helper functions to manipulate mesh elements and -interact with these elements. - -Note that these functions either encapsulate the python programming interface of SMESH core -(the CORBA or SWIG interface for example) or extend existing utilities as the smesh.py module. - -The functions are distributed in the python package \b salome.smesh. - -\note -The main package \b salome contains other sub-packages that are distributed with the other -SALOME modules. For example, the KERNEL module provides the python package \b salome.kernel -and GEOM the package \b salome.geom. +\n Please see \ref smesh_migration_page. Class \ref smeshBuilder.smeshBuilder "smeshBuilder" provides an interface to create and handle meshes. It can be used to create an empty mesh or to import mesh from the data file. -Class \ref smeshstudytools.SMeshStudyTools "SMeshStudyTools" provides several methods to manipulate mesh objects in Salome study. - As soon as mesh is created, it is possible to manage it via its own methods, described in class \ref smeshBuilder.Mesh "Mesh" documentation. -Class \ref smeshBuilder.Mesh "Mesh" allows assigning algorithms to a mesh. -Please note that some algorithms, included in the standard SALOME -distribution are always available. Python package \ref StdMeshersBuilder "StdMeshersBuilder" -provides an interface for standard meshing algorithms included into -the SALOME %Mesh module distribution, like: -- REGULAR (1D) -- COMPOSITE (1D) -- MEFISTO (2D) -- Quadrangle (2D) -- Hexa(3D) -- etc ... +Class \ref smeshstudytools.SMeshStudyTools "SMeshStudyTools" provides several methods to manipulate mesh objects in Salome study. -To add meshing hypotheses, it is possible to use the functions provided by the -algorithms interfaces. +A usual workflow to generate a mesh on geometry is following: +
          +
        1. Create an instance of \ref smeshBuilder.smeshBuilder "smeshBuilder": +
          +      from salome.smesh import smeshBuilder
          +      smesh = smeshBuilder.New( salome.myStudy )
          +    
        2. +
        3. Create a \ref smeshBuilder.Mesh "mesh" object: +
          +      mesh = \ref smeshBuilder.smeshBuilder.Mesh "smesh.Mesh( geometry )" 
          +    
        4. +
        5. Create and assign \ref basic_meshing_algos_page "algorithms" by + calling corresponding methods of the mesh. If a sub-shape is + provided as an argument, a \ref constructing_submeshes_page "sub-mesh" + is implicitly created on this sub-shape: +
          +      regular1D = \ref smeshBuilder.Mesh.Segment "mesh.Segment"()
          +      mefisto   = \ref smeshBuilder.Mesh.Triangle "mesh.Triangle"( smeshBuilder.MEFISTO )
          +      # use other triangle algorithm on a face -- a sub-mesh appears in the mesh
          +      netgen    = \ref smeshBuilder.Mesh.Triangle "mesh.Triangle"( smeshBuilder.NETGEN_1D2D, face )
          +    
        6. +
        7. Create and assign \ref about_hypo_page "hypotheses" by calling + corresponding methods of algorithms: +
          +      segLen10 = \ref StdMeshersBuilder.StdMeshersBuilder_Segment.LocalLength "regular1D.LocalLength"( 10. )
          +      maxArea  = \ref StdMeshersBuilder.StdMeshersBuilder_Segment.LocalLength "mefisto.MaxElementArea"( 100. )
          +      netgen.SetMaxSize( 20. )
          +      netgen.SetFineness( smeshBuilder.VeryCoarse )
          +    
          +
        8. +
        9. \ref compute_anchor "Compute" the mesh (generate mesh nodes and elements): +
          +      \ref Mesh.Compute "mesh.Compute"()
          +    
          +
        10. +
        + +An easiest way to start with Python scripting is to do something in +GUI and then to get a corresponding Python script via + File > Dump Study menu item. Don't forget that you can get +all methods of any object in hand (e.g. a mesh group or a hypothesis) +by calling \a dir() Python built-in function. + +All methods of the Mesh Group can be found in \ref tui_create_standalone_group sample script. An example below demonstrates usage of the Python API for 3d mesh generation. @@ -61,19 +78,19 @@ Examples of Python scripts for Mesh operations are available by the following links: - \subpage tui_creating_meshes_page -- \subpage tui_cartesian_algo -- \subpage tui_use_existing_faces -- \subpage tui_viewing_meshes_page - \subpage tui_defining_hypotheses_page -- \subpage tui_quality_controls_page -- \subpage tui_filters_page - \subpage tui_grouping_elements_page +- \subpage tui_filters_page - \subpage tui_modifying_meshes_page - \subpage tui_transforming_meshes_page -- \subpage tui_notebook_smesh_page +- \subpage tui_viewing_meshes_page +- \subpage tui_quality_controls_page - \subpage tui_measurements_page -- \subpage tui_generate_flat_elements_page - \subpage tui_work_on_objects_from_gui +- \subpage tui_notebook_smesh_page +- \subpage tui_cartesian_algo +- \subpage tui_use_existing_faces - \subpage tui_prism_3d_algo +- \subpage tui_generate_flat_elements_page */ diff --git a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc index 984616457..79b98b49d 100644 --- a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc @@ -2,54 +2,50 @@ \page tui_creating_meshes_page Creating Meshes +\tableofcontents + \n First of all see \ref example_3d_mesh "Example of 3d mesh generation", which is an example of good python script style for Mesh module.
        -

        Construction of a Mesh

        +\section construction_of_a_mesh Construction of a mesh \tui_script{creating_meshes_ex01.py}
        -\anchor tui_construction_submesh -

        Construction of a Submesh

        +\section tui_construction_submesh Construction of a sub-mesh \tui_script{creating_meshes_ex02.py}
        -

        Change priority of submeshes in Mesh

        +\section change_priority_of_submeshes_in_mesh Change priority of sub-meshes in mesh \tui_script{creating_meshes_ex03.py}
        -\anchor tui_editing_while_meshing -

        Intermediate edition while meshing

        +\section tui_editing_while_meshing Intermediate edition while meshing \tui_script{a3DmeshOnModified2Dmesh.py}
        -\anchor tui_editing_mesh -

        Editing a mesh

        +\section tui_editing_mesh Editing a mesh \tui_script{creating_meshes_ex04.py}
        -\anchor tui_export_mesh -

        Export of a Mesh

        +\section tui_export_mesh Export of a Mesh \tui_script{creating_meshes_ex05.py}
        -

        How to mesh a cylinder with hexahedrons?

        +\section how_to_mesh_a_cylinder_with_hexahedrons How to mesh a cylinder with hexahedrons? Here you can see an example of python script, creating a hexahedral -mesh on a cylinder. And a picture below the source code of the script, -demonstrating the resulting mesh. +mesh on a cylinder. A picture below the source code of the script +demonstrates the resulting mesh. \tui_script{creating_meshes_ex06.py} \image html mesh_cylinder_hexa.png
        -\anchor tui_building_compound -

        Building a compound of meshes

        +\section tui_building_compound Building a compound of meshes \tui_script{creating_meshes_ex07.py}
        -\anchor tui_copy_mesh -

        Mesh Copying

        +\section tui_copy_mesh Mesh Copying \tui_script{creating_meshes_ex08.py} */ diff --git a/doc/salome/gui/SMESH/input/tui_grouping_elements.doc b/doc/salome/gui/SMESH/input/tui_grouping_elements.doc index a264f2542..535c47640 100644 --- a/doc/salome/gui/SMESH/input/tui_grouping_elements.doc +++ b/doc/salome/gui/SMESH/input/tui_grouping_elements.doc @@ -2,27 +2,24 @@ \page tui_grouping_elements_page Grouping Elements +\tableofcontents +
        -\anchor tui_create_standalone_group -

        Create a Standalone Group

        +\section tui_create_standalone_group Create a Standalone Group \tui_script{grouping_elements_ex01.py} \image html create_group.png
        -\anchor tui_create_group_on_geometry -

        Create a Group on Geometry

        +\section tui_create_group_on_geometry Create a Group on Geometry \tui_script{grouping_elements_ex02.py}
        -\anchor tui_create_group_on_filter - -

        Create a Group on Filter

        +\section tui_create_group_on_filter Create a Group on Filter \tui_script{grouping_elements_ex03.py}
        -\anchor tui_edit_group -

        Edit a Group

        +\section tui_edit_group Edit a Group \tui_script{grouping_elements_ex04.py} \image html editing_groups1.png @@ -30,8 +27,7 @@ \image html editing_groups2.png
        -\anchor tui_union_of_groups -

        Union of groups

        +\section tui_union_of_groups Union of groups \tui_script{grouping_elements_ex05.py} \image html union_groups1.png @@ -41,8 +37,7 @@ \image html union_groups3.png
        -\anchor tui_intersection_of_groups -

        Intersection of groups

        +\section tui_intersection_of_groups Intersection of groups \tui_script{grouping_elements_ex06.py} \image html intersect_groups1.png @@ -52,8 +47,7 @@ \image html intersect_groups3.png
        -\anchor tui_cut_of_groups -

        Cut of groups

        +\section tui_cut_of_groups Cut of groups \tui_script{grouping_elements_ex07.py} \image html cut_groups1.png @@ -63,8 +57,7 @@ \image html cut_groups3.png
        -\anchor tui_create_dim_group -

        Creating groups of entities from existing groups of superior dimensions

        +\section tui_create_dim_group Creating groups of entities from existing groups of superior dimensions \tui_script{grouping_elements_ex08.py} \image html dimgroup_tui1.png diff --git a/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc b/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc index 107306547..7d0352286 100644 --- a/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc @@ -2,9 +2,10 @@ \page tui_modifying_meshes_page Modifying Meshes +\tableofcontents +
        -\anchor tui_adding_nodes_and_elements -

        Adding Nodes and Elements

        +\section tui_adding_nodes_and_elements Adding Nodes and Elements
        \anchor tui_add_node @@ -57,8 +58,7 @@ \tui_script{modifying_meshes_ex10.py}
        -\anchor tui_removing_nodes_and_elements -

        Removing Nodes and Elements

        +\section tui_removing_nodes_and_elements Removing Nodes and Elements
        \anchor tui_removing_nodes @@ -76,73 +76,59 @@ \tui_script{modifying_meshes_ex13.py}
        -\anchor tui_renumbering_nodes_and_elements -

        Renumbering Nodes and Elements

        +\section tui_renumbering_nodes_and_elements Renumbering Nodes and Elements \tui_script{modifying_meshes_ex14.py}
        -\anchor tui_moving_nodes -

        Moving Nodes

        +\section tui_moving_nodes Moving Nodes \tui_script{modifying_meshes_ex15.py}
        -\anchor tui_diagonal_inversion -

        Diagonal Inversion

        +\section tui_diagonal_inversion Diagonal Inversion \tui_script{modifying_meshes_ex16.py}
        -\anchor tui_uniting_two_triangles -

        Uniting two Triangles

        +\section tui_uniting_two_triangles Uniting two Triangles \tui_script{modifying_meshes_ex17.py}
        -\anchor tui_uniting_set_of_triangles -

        Uniting a Set of Triangles

        +\section tui_uniting_set_of_triangles Uniting a Set of Triangles \tui_script{modifying_meshes_ex18.py}
        -\anchor tui_orientation -

        Orientation

        +\section tui_orientation Orientation \tui_script{modifying_meshes_ex19.py}
        -\anchor tui_cutting_quadrangles -

        Cutting Quadrangles

        +\section tui_cutting_quadrangles Cutting Quadrangles \tui_script{modifying_meshes_ex20.py}
        -\anchor tui_smoothing -

        Smoothing

        +\section tui_smoothing Smoothing \tui_script{modifying_meshes_ex21.py}
        -\anchor tui_extrusion -

        Extrusion

        +\section tui_extrusion Extrusion \tui_script{modifying_meshes_ex22.py}
        -\anchor tui_extrusion_along_path -

        Extrusion along a Path

        +\section tui_extrusion_along_path Extrusion along a Path \tui_script{modifying_meshes_ex23.py}
        -\anchor tui_revolution -

        Revolution

        +\section tui_revolution Revolution \tui_script{modifying_meshes_ex24.py}
        -\anchor tui_pattern_mapping -

        Pattern Mapping

        +\section tui_pattern_mapping Pattern Mapping \tui_script{modifying_meshes_ex25.py}
        -\anchor tui_quadratic -

        Convert mesh to/from quadratic

        +\section tui_quadratic Convert mesh to/from quadratic \tui_script{modifying_meshes_ex26.py}
        -\anchor tui_split_biquad -

        Split bi-quadratic into linear

        +\section tui_split_biquad Split bi-quadratic into linear \tui_script{split_biquad.py} */ diff --git a/doc/salome/gui/SMESH/input/tui_quality_controls.doc b/doc/salome/gui/SMESH/input/tui_quality_controls.doc index be849962c..1434c9b07 100644 --- a/doc/salome/gui/SMESH/input/tui_quality_controls.doc +++ b/doc/salome/gui/SMESH/input/tui_quality_controls.doc @@ -2,6 +2,8 @@ \page tui_quality_controls_page Quality Controls +\tableofcontents + \section tui_free_borders Free Borders \tui_script{quality_controls_ex01.py} diff --git a/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc b/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc index 86ce3dca0..9837176b6 100644 --- a/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc @@ -2,73 +2,58 @@ \page tui_transforming_meshes_page Transforming Meshes -

        Transforming Meshes

        +\tableofcontents
        -\anchor tui_translation -

        Translation

        +\section tui_translation Translation \tui_script{transforming_meshes_ex01.py}
        -\anchor tui_rotation -

        Rotation

        +\section tui_rotation Rotation \tui_script{transforming_meshes_ex02.py}
        -\anchor tui_scale -

        Scale

        +\section tui_scale Scale \tui_script{transforming_meshes_ex03.py}
        -\anchor tui_symmetry -

        Symmetry

        +\section tui_symmetry Symmetry \tui_script{transforming_meshes_ex04.py}
        -\anchor tui_merging_nodes -

        Merging Nodes

        +\section tui_merging_nodes Merging Nodes \tui_script{transforming_meshes_ex05.py}
        -\anchor tui_merging_elements -

        Merging Elements

        +\section tui_merging_elements Merging Elements \tui_script{transforming_meshes_ex06.py} -

        Sewing Meshes

        -
        -\anchor tui_sew_meshes_border_to_side -

        Sew Meshes Border to Side

        +\section tui_sew_meshes_border_to_side Sew Meshes Border to Side \tui_script{transforming_meshes_ex07.py}
        -\anchor tui_sew_conform_free_borders -

        Sew Conform Free Borders

        +\section tui_sew_conform_free_borders Sew Conform Free Borders \tui_script{transforming_meshes_ex08.py}
        -\anchor tui_sew_free_borders -

        Sew Free Borders

        +\section tui_sew_free_borders Sew Free Borders \tui_script{transforming_meshes_ex09.py}
        -\anchor tui_sew_side_elements -

        Sew Side Elements

        +\section tui_sew_side_elements Sew Side Elements \tui_script{transforming_meshes_ex10.py}
        -\anchor tui_duplicate_nodes -

        Duplicate nodes or/and elements

        +\section tui_duplicate_nodes Duplicate nodes or/and elements \tui_script{transforming_meshes_ex11.py}
        -\anchor tui_make_2dmesh_from_3d -

        Create boundary elements

        +\section tui_make_2dmesh_from_3d Create boundary elements \tui_script{transforming_meshes_ex12.py}
        -\anchor tui_reorient_faces -

        Reorient faces

        +\section tui_reorient_faces Reorient faces \tui_script{transforming_meshes_ex13.py} */ diff --git a/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc b/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc index abc51d95b..569d821a9 100644 --- a/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc +++ b/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc @@ -6,7 +6,7 @@ It is sometimes useful to work alternatively in the GUI of SALOME and in the Pyt \code myMesh_ref = salome.IDToObject("ID") -// were ID is the number that appears in the object browser in the Entry column +// were ID is the string looking like "0:1:2:3" that appears in the object browser in the Entry column // ( If hidden show it by right clicking and checking the checkbox Entry) myMesh = smesh.Mesh(myMesh_ref) \endcode diff --git a/idl/SMESH_Group.idl b/idl/SMESH_Group.idl index 4941f14df..bdc3d6312 100644 --- a/idl/SMESH_Group.idl +++ b/idl/SMESH_Group.idl @@ -74,7 +74,7 @@ module SMESH boolean Contains( in long elem_id ); /*! - * Returns ID of an element at position + * Returns ID of an element at position counted from 1 */ long GetID( in long elem_index ); diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx index d682304fe..4b7ac91c4 100644 --- a/src/DriverMED/DriverMED_Family.cxx +++ b/src/DriverMED/DriverMED_Family.cxx @@ -69,7 +69,7 @@ void DriverMED_Family ::AddElement(const SMDS_MeshElement* theElement) { - myElements.insert(theElement); + myElements.insert( myElements.end(), theElement ); } void @@ -414,7 +414,7 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup) SMDS_ElemIteratorPtr elemIt = theGroup->GetElements(); while (elemIt->more()) { - myElements.insert(elemIt->next()); + myElements.insert( myElements.end(), elemIt->next() ); } // Type diff --git a/src/DriverMED/DriverMED_Family.h b/src/DriverMED/DriverMED_Family.h index c83534cf9..28d05a568 100644 --- a/src/DriverMED/DriverMED_Family.h +++ b/src/DriverMED/DriverMED_Family.h @@ -49,10 +49,10 @@ #define REST_BALL_FAMILY -5 #define FIRST_ELEM_FAMILY -6 -typedef std::list DriverMED_FamilyPtrList; -typedef std::map SMESHDS_SubMeshPtrMap; -typedef std::list SMESHDS_GroupBasePtrList; -typedef std::set ElementsSet; +typedef std::list DriverMED_FamilyPtrList; +typedef std::map SMESHDS_SubMeshPtrMap; +typedef std::list SMESHDS_GroupBasePtrList; +typedef std::set ElementsSet; class MESHDRIVERMED_EXPORT DriverMED_Family { diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 58f9c0ca0..c773d9925 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -976,8 +976,8 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() } if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) { // Save reference to this element from its family - myFamilies[aFamNum]->AddElement(anElement); - myFamilies[aFamNum]->SetType(anElement->GetType()); + aFamily->AddElement(anElement); + aFamily->SetType(anElement->GetType()); } } } // loop on aNbElems @@ -1081,8 +1081,8 @@ void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup) DriverMED_FamilyPtr aFamily = (*aFamsIter).second; if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName)) { - const set& anElements = aFamily->GetElements(); - set::const_iterator anElemsIter = anElements.begin(); + const ElementsSet& anElements = aFamily->GetElements(); + ElementsSet::const_iterator anElemsIter = anElements.begin(); for (; anElemsIter != anElements.end(); anElemsIter++) { const SMDS_MeshElement * element = *anElemsIter; @@ -1110,8 +1110,8 @@ void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh, DriverMED_FamilyPtr aFamily = (*aFamsIter).second; if (aFamily->MemberOf(aName)) { - const set& anElements = aFamily->GetElements(); - set::const_iterator anElemsIter = anElements.begin(); + const ElementsSet& anElements = aFamily->GetElements(); + ElementsSet::const_iterator anElemsIter = anElements.begin(); if (aFamily->GetType() == SMDSAbs_Node) { for (; anElemsIter != anElements.end(); anElemsIter++) @@ -1146,14 +1146,13 @@ void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes () if (aName.substr(0, 7) == string("SubMesh")) { int Id = atoi(string(aName).substr(7).c_str()); - set anElements = aFamily->GetElements(); - set::iterator anElemsIter = anElements.begin(); + const ElementsSet& anElements = aFamily->GetElements(); + ElementsSet::const_iterator anElemsIter = anElements.begin(); if (aFamily->GetType() == SMDSAbs_Node) { for (; anElemsIter != anElements.end(); anElemsIter++) { - SMDS_MeshNode* node = const_cast - ( static_cast( *anElemsIter )); + const SMDS_MeshNode* node = static_cast( *anElemsIter ); // find out a shape type TopoDS_Shape aShape = myMesh->IndexToShape( Id ); int aShapeType = ( aShape.IsNull() ? -1 : aShape.ShapeType() ); diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index cee3e1b09..638f4ad5c 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -254,7 +254,6 @@ namespace const SMDSAbs_ElementType anElemType) { anElemFamMap.Clear(); - //anElemFamMap.clear(); list::iterator aFamsIter = aFamilies.begin(); while ( aFamsIter != aFamilies.end() ) { @@ -263,12 +262,11 @@ namespace } else { int aFamId = (*aFamsIter)->GetId(); - const set& anElems = (*aFamsIter)->GetElements(); - set::const_iterator anElemsIter = anElems.begin(); + const ElementsSet& anElems = (*aFamsIter)->GetElements(); + ElementsSet::const_iterator anElemsIter = anElems.begin(); for (; anElemsIter != anElems.end(); anElemsIter++) { anElemFamMap.Bind( (Standard_Address)*anElemsIter, aFamId ); - //anElemFamMap[*anElemsIter] = aFamId; } // remove a family from the list aFamilies.erase( aFamsIter++ ); @@ -288,9 +286,7 @@ namespace { if ( anElemFamMap.IsBound( (Standard_Address) anElement )) return anElemFamMap( (Standard_Address) anElement ); -// TElemFamilyMap::iterator elem_famNum = anElemFamMap.find( anElement ); -// if ( elem_famNum != anElemFamMap.end() ) -// return elem_famNum->second; + return aDefaultFamilyId; } diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 44d70da65..cbb913fe1 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -232,8 +232,8 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints ) { thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() ); int anId = aNode->GetID(); - mySMDS2VTKNodes.insert( TMapOfIds::value_type( anId, nbPoints ) ); - myVTK2SMDSNodes.insert( TMapOfIds::value_type( nbPoints, anId ) ); + mySMDS2VTKNodes.insert( mySMDS2VTKNodes.end(), std::make_pair( anId, nbPoints )); + myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId )); nbPoints++; } } @@ -251,48 +251,48 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid) MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs " << buildGrid); if (buildGrid) { - myLocalGrid = true; - try - { - mySMDS2VTKNodes.clear(); - myVTK2SMDSNodes.clear(); - mySMDS2VTKElems.clear(); - myVTK2SMDSElems.clear(); + myLocalGrid = true; + try + { + mySMDS2VTKNodes.clear(); + myVTK2SMDSNodes.clear(); + mySMDS2VTKElems.clear(); + myVTK2SMDSElems.clear(); - if ( IsNodePrs() ) - buildNodePrs(); - else - buildElemPrs(); - } - catch(...) - { - mySMDS2VTKNodes.clear(); - myVTK2SMDSNodes.clear(); - mySMDS2VTKElems.clear(); - myVTK2SMDSElems.clear(); + if ( IsNodePrs() ) + buildNodePrs(); + else + buildElemPrs(); + } + catch(...) + { + mySMDS2VTKNodes.clear(); + myVTK2SMDSNodes.clear(); + mySMDS2VTKElems.clear(); + myVTK2SMDSElems.clear(); - myGrid->SetPoints( 0 ); - myGrid->SetCells( 0, 0, 0, 0, 0 ); - throw; - } + myGrid->SetPoints( 0 ); + myGrid->SetCells( 0, 0, 0, 0, 0 ); + throw; + } } else { - myLocalGrid = false; - if (!GetMesh()->isCompacted()) - { - MESSAGE("*** buildPrs ==> compactMesh!"); - GetMesh()->compactMesh(); - } - vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); - updateEntitiesFlags(); - myGrid->ShallowCopy(theGrid); - //MESSAGE(myGrid->GetReferenceCount()); - //MESSAGE( "Update - myGrid->GetNumberOfCells() = "<GetNumberOfCells() ); - //MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<GetNumberOfPoints() ); - if( MYDEBUGWITHFILES ) { - SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" ); - } + myLocalGrid = false; + if (!GetMesh()->isCompacted()) + { + MESSAGE("*** buildPrs ==> compactMesh!"); + GetMesh()->compactMesh(); + } + vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); + updateEntitiesFlags(); + myGrid->ShallowCopy(theGrid); + //MESSAGE(myGrid->GetReferenceCount()); + //MESSAGE( "Update - myGrid->GetNumberOfCells() = "<GetNumberOfCells() ); + //MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<GetNumberOfPoints() ); + if( MYDEBUGWITHFILES ) { + SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" ); + } } } @@ -454,8 +454,8 @@ void SMESH_VisualObjDef::buildElemPrs() int anId = anElem->GetID(); - mySMDS2VTKElems.insert( TMapOfIds::value_type( anId, iElem ) ); - myVTK2SMDSElems.insert( TMapOfIds::value_type( iElem, anId ) ); + mySMDS2VTKElems.insert( mySMDS2VTKElems.end(), std::make_pair( anId, iElem )); + myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId )); SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); { @@ -986,7 +986,7 @@ static int getNodesFromElems( SMESH::long_array_var& theElemIds, // function : getPointers // purpose : Get std::list from list of IDs //================================================================================= -static int getPointers( const SMDSAbs_ElementType theRequestType, +static int getPointers( const SMDSAbs_ElementType theRequestType, SMESH::long_array_var& theElemIds, const SMDS_Mesh* theMesh, std::list& theResList ) diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 072fcdac7..ba7d59f37 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -2275,7 +2275,7 @@ void SMESHDS_Mesh::compactMesh() int newSmdsId = 0; for (int i = 0; i < myCellsSize; i++) { - if (myCells[i]) + if ( myCells[i] ) { newSmdsId++; // SMDS id start to 1 assert(newSmdsId <= newCellSize); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index f16d08d87..f71de0320 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -2320,6 +2320,7 @@ GrpComputor::GrpComputor( SMESH::SMESH_GroupBase_ptr grp, void GrpComputor::compute() { if ( !CORBA::is_nil( myGroup ) && myItem ) { + SUIT_OverrideCursor wc; QTreeWidgetItem* item = myItem; myItem = 0; int nb = myToComputeSize ? myGroup->Size() : myGroup->GetNumberOfNodes(); diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 0621ed9f1..eb4181170 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -920,7 +920,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const #endif nbElems = elemSet.size(); } - // add elements to submeshes + // add elements to sub-meshes TIDSortedElemSet::iterator iE = elemSet.begin(); for ( size_t i = 0; i < nbElems; ++i, ++iE ) { diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index 6dd91e288..204e461b1 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -1100,7 +1100,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): pass # end of StdMeshersBuilder_Prism3D class -## Defines a Prism 3D algorithm +## Defines Radial Prism 3D algorithm # # It is created by calling smeshBuilder.Mesh.Prism(geom=0) # diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index cfd4117f1..6e39264b1 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -32,7 +32,6 @@ ## @{ ## @defgroup l3_algos_basic Basic meshing algorithms ## @defgroup l3_algos_proj Projection Algorithms -## @defgroup l3_algos_radialp Radial Prism ## @defgroup l3_algos_segmarv Segments around Vertex ## @defgroup l3_algos_3dextr 3D extrusion meshing algorithm @@ -70,10 +69,9 @@ ## @defgroup l2_modif_trsf Transforming meshes (Translation, Rotation, Symmetry, Sewing, Merging) ## @defgroup l2_modif_movenode Moving nodes ## @defgroup l2_modif_throughp Mesh through point -## @defgroup l2_modif_invdiag Diagonal inversion of elements ## @defgroup l2_modif_unitetri Uniting triangles -## @defgroup l2_modif_changori Changing orientation of elements ## @defgroup l2_modif_cutquadr Cutting elements +## @defgroup l2_modif_changori Changing orientation of elements ## @defgroup l2_modif_smooth Smoothing ## @defgroup l2_modif_extrurev Extrusion and Revolution ## @defgroup l2_modif_patterns Pattern mapping @@ -310,9 +308,9 @@ engine = None doLcc = False created = False -## This class allows to create, load or manipulate meshes -# It has a set of methods to create load or copy meshes, to combine several meshes. -# It also has methods to get infos on meshes. +## This class allows to create, load or manipulate meshes. +# It has a set of methods to create, load or copy meshes, to combine several meshes, etc. +# It also has methods to get infos and measure meshes. class smeshBuilder(object, SMESH._objref_SMESH_Gen): # MirrorType enumeration @@ -614,6 +612,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): # @param allGroups forces creation of groups corresponding to every input mesh # @param name name of a new mesh # @return an instance of Mesh class + # @ingroup l2_compounds def Concatenate( self, meshes, uniteIdenticalGroups, mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False, name = ""): @@ -1162,7 +1161,7 @@ omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder) # import salome # salome.salome_init() # from salome.smesh import smeshBuilder -# smesh = smeshBuilder.New(theStudy) +# smesh = smeshBuilder.New(salome.myStudy) # \endcode # @param study SALOME study, generally obtained by salome.myStudy. # @param instance CORBA proxy of SMESH Engine. If None, the default Engine is used. @@ -1177,7 +1176,7 @@ def New( study, instance=None): import salome salome.salome_init() from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New(salome.myStudy) Parameters: study SALOME study, generally obtained by salome.myStudy. @@ -2153,7 +2152,7 @@ class Mesh: ## # Create a standalone group of entities basing on nodes of other groups. - # \param groups - list of groups, sub-meshes or filters, of any type. + # \param groups - list of reference groups, sub-meshes or filters, of any type. # \param elemType - a type of elements to include to the new group; either of # (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME). # \param name - a name of the new group. @@ -2165,7 +2164,10 @@ class Mesh: # - SMESH.AT_LEAST_ONE - include if one or more node is common, # - SMEHS.MAJORITY - include if half of nodes or more are common. # \param underlyingOnly - if \c True (default), an element is included to the - # new group provided that it is based on nodes of one element of \a groups. + # new group provided that it is based on nodes of an element of \a groups; + # in this case the reference \a groups are supposed to be of higher dimension + # than \a elemType, which can be useful for example to get all faces lying on + # volumes of the reference \a groups. # @return an instance of SMESH_Group # @ingroup l2_grps_operon def CreateDimGroup(self, groups, elemType, name, @@ -2176,7 +2178,7 @@ class Mesh: ## Convert group on geom into standalone group - # @ingroup l2_grps_delete + # @ingroup l2_grps_edit def ConvertToStandalone(self, group): return self.mesh.ConvertToStandalone(group) @@ -3073,7 +3075,7 @@ class Mesh: # @param NodeID1 the ID of the first node # @param NodeID2 the ID of the second node # @return false if proper faces were not found - # @ingroup l2_modif_invdiag + # @ingroup l2_modif_cutquadr def InverseDiag(self, NodeID1, NodeID2): return self.editor.InverseDiag(NodeID1, NodeID2) From 77ab84920942791849f9fdbd567da6701acfca7f Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 11 Mar 2016 18:17:39 +0300 Subject: [PATCH 102/147] IPAL53097: At med export "Automatically define space dimension" does not work --- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 58 +++++++++++++--------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 638f4ad5c..1b3c26bac 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -37,6 +37,10 @@ #include "SMDS_SetIterator.hxx" #include "SMESHDS_Mesh.hxx" +#include +#include +#include + #include @@ -350,17 +354,34 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() aBounds[2] = min(aBounds[2],aNode->Y()); aBounds[3] = max(aBounds[3],aNode->Y()); - + aBounds[4] = min(aBounds[4],aNode->Z()); aBounds[5] = max(aBounds[5],aNode->Z()); } double EPS = 1.0E-7; + TopoDS_Shape mainShape = myMesh->ShapeToMesh(); + bool hasShapeToMesh = ( myMesh->SubMeshIndices().size() > 1 ); + if ( !mainShape.IsNull() && hasShapeToMesh ) + { + // define EPS by max tolerance of the mainShape (IPAL53097) + TopExp_Explorer subShape; + for ( subShape.Init( mainShape, TopAbs_FACE ); subShape.More(); subShape.Next() ) { + EPS = Max( EPS, BRep_Tool::Tolerance( TopoDS::Face( subShape.Current() ))); + } + for ( subShape.Init( mainShape, TopAbs_EDGE ); subShape.More(); subShape.Next() ) { + EPS = Max( EPS, BRep_Tool::Tolerance( TopoDS::Edge( subShape.Current() ))); + } + for ( subShape.Init( mainShape, TopAbs_VERTEX ); subShape.More(); subShape.Next() ) { + EPS = Max( EPS, BRep_Tool::Tolerance( TopoDS::Vertex( subShape.Current() ))); + } + EPS *= 2.; + } anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS; anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS; anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS; aSpaceDimension = anIsXDimension + anIsYDimension + anIsZDimension; - if(!aSpaceDimension) + if ( !aSpaceDimension ) aSpaceDimension = 3; // PAL16857(SMESH not conform to the MED convention): if ( aSpaceDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane @@ -377,7 +398,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() } SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(/*idInceasingOrder=*/true); - switch(aSpaceDimension){ + switch ( aSpaceDimension ) { case 3: aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYZGetCoord,aXYZName)); break; @@ -444,7 +465,8 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() myDoGroupOfVolumes && nbVolumes, myDoGroupOf0DElems && nb0DElements, myDoGroupOfBalls && nbBalls); - } else { + } + else { aFamilies = DriverMED_Family::MakeFamilies (getIterator( mySubMeshes ), myGroups, myDoGroupOfNodes && nbNodes, @@ -477,7 +499,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes, theMode, theSystem, theIsElemNum, theIsElemNames); - //cout << " fillElemFamilyMap( SMDSAbs_Node )" << endl; // find family numbers for nodes TElemFamilyMap anElemFamMap; fillElemFamilyMap( anElemFamMap, aFamilies, SMDSAbs_Node ); @@ -687,21 +708,11 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() int defaultFamilyId = 0; switch ( aElemTypeData->_smdsType ) { - case SMDSAbs_0DElement: - defaultFamilyId = my0DElementsDefaultFamilyId; - break; - case SMDSAbs_Ball: - defaultFamilyId = myBallsDefaultFamilyId; - break; - case SMDSAbs_Edge: - defaultFamilyId = myEdgesDefaultFamilyId; - break; - case SMDSAbs_Face: - defaultFamilyId = myFacesDefaultFamilyId; - break; - case SMDSAbs_Volume: - defaultFamilyId = myVolumesDefaultFamilyId; - break; + case SMDSAbs_0DElement: defaultFamilyId = my0DElementsDefaultFamilyId; break; + case SMDSAbs_Ball: defaultFamilyId = myBallsDefaultFamilyId; break; + case SMDSAbs_Edge: defaultFamilyId = myEdgesDefaultFamilyId; break; + case SMDSAbs_Face: defaultFamilyId = myFacesDefaultFamilyId; break; + case SMDSAbs_Volume: defaultFamilyId = myVolumesDefaultFamilyId; break; default: continue; } @@ -783,7 +794,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() if ( nbPolyhedronNodes == 0 ) { // Count nb of nodes while ( elemIterator->more() ) { - const SMDS_MeshElement* anElem = elemIterator->next(); + const SMDS_MeshElement* anElem = elemIterator->next(); const SMDS_VtkVolume *aPolyedre = dynamic_cast(anElem); if ( !aPolyedre ) continue; nbPolyhedronNodes += aPolyedre->NbNodes(); @@ -812,7 +823,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() TInt iFace = 0, iNode = 0; while ( elemIterator->more() ) { - const SMDS_MeshElement* anElem = elemIterator->next(); + const SMDS_MeshElement* anElem = elemIterator->next(); const SMDS_VtkVolume *aPolyedre = dynamic_cast(anElem); if ( !aPolyedre ) continue; // index @@ -854,8 +865,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() else if (aElemTypeData->_geomType == eBALL ) { // allocate data arrays - PBallInfo aBallInfo = myMed->CrBallInfo( aMeshInfo, - aElemTypeData->_nbElems ); + PBallInfo aBallInfo = myMed->CrBallInfo( aMeshInfo, aElemTypeData->_nbElems ); // build map of family numbers for this type if ( !isElemFamMapBuilt[ aElemTypeData->_smdsType ]) From d45cd9ae88f00b0d4cc3e6746c32a8c16f2fcc71 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 15 Mar 2016 15:59:11 +0300 Subject: [PATCH 103/147] 53057: NETGEN-1D2D3D issues "Ignored" warning for faces of a sub-mesh This case also reveals the following bugs: 1) SMESH_MesherHelper::IsReversedSubMesh() incorrectly works on a coarsely meshed disk 2) Addition of NETGEN-1D2D3D removes already computed faces of a sub-mesh on a group of FACEs (SMESH_subMesh::cleanDependsOn()) 3) Volumes are shown, instead of faces, when displaying a sub-mesh on a SOLID with only a 2D algo assigned to the sub-mesh (SMESH_subMesh_i.cxx) --- src/SMESH/SMESH_MesherHelper.cxx | 4 ++++ src/SMESH/SMESH_subMesh.cxx | 17 +++++++-------- src/SMESH_I/SMESH_subMesh_i.cxx | 37 +++++++++++++++++++++----------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 3703a7215..40016a488 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -2904,6 +2904,10 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace) bool ok = true; double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok ); double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok ); + // check that the 2 nodes are connected with a segment (IPAL53055) + // if ( SMESHDS_SubMesh* sm = GetMeshDS()->MeshElements( E )) + // if ( sm->NbElements() > 0 && !GetMeshDS()->FindEdge( nn[0], nn[1] )) + // ok = false; if ( ok ) { isReversed = ( u0 > u1 ); diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 38a445708..f395b7986 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1217,8 +1217,6 @@ void SMESH_subMesh::cleanDependsOn( SMESH_Algo* algoRequiringCleaning/*=0*/ ) } else if ( algoRequiringCleaning && algoRequiringCleaning->SupportSubmeshes() ) { - SMESHDS_Mesh* meshDS = _father->GetMeshDS(); - // find sub-meshes to keep elements on set< SMESH_subMesh* > smToKeep; TopAbs_ShapeEnum prevShapeType = TopAbs_SHAPE; @@ -1242,13 +1240,14 @@ void SMESH_subMesh::cleanDependsOn( SMESH_Algo* algoRequiringCleaning/*=0*/ ) } if ( !keepSubMeshes ) { - // look for an algo assigned to sm - bool algoFound = false; - const list& hyps = meshDS->GetHypothesis( sm->_subShape ); - list::const_iterator h = hyps.begin(); - for ( ; ( !algoFound && h != hyps.end() ); ++h ) - algoFound = ((*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ); - keepSubMeshes = algoFound; + // look for a local algo used to mesh sm + TopoDS_Shape algoShape = SMESH_MesherHelper::GetShapeOfHypothesis + ( algoRequiringCleaning, _subShape, _father ); + SMESH_HypoFilter moreLocalAlgo; + moreLocalAlgo.Init( SMESH_HypoFilter::IsMoreLocalThan( algoShape, *_father )); + moreLocalAlgo.And ( SMESH_HypoFilter::IsAlgo() ); + bool localAlgoFound = _father->GetHypothesis( sm->_subShape, moreLocalAlgo, true ); + keepSubMeshes = localAlgoFound; } // remember all sub-meshes of sm if ( keepSubMeshes ) diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index ee9117e2c..bc0fa18c8 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -107,9 +107,10 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh, TopAbs_ShapeEnum aShapeType = aShape.ShapeType(); // IPAL18558: Wrong information of the created sub-mesh is shown. (Sub-mesh on a FACE - // with only 1D algo assigned + // with only 1D algo assigned) // Find dimension of sub-meshes to return as highest dimension of the assigned algorithm - if ( theSubMesh->IsEmpty() && !theSubMesh->GetAlgo() ) + if (( theSubMesh->IsEmpty() || ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )) && + ( !theSubMesh->GetAlgo() )) { // on father sub-meshes, check presence of an algo which will mesh this sub-mesh // even if no algo is assigned to this sub-mesh @@ -121,20 +122,22 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh, if ( !topAlgoPresent ) { - // look for a sub-mesh with an algo - SMESH_subMeshIteratorPtr smIt = - theSubMesh->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true); + // find max dimension of an assigned algo TopAbs_ShapeEnum algoShape = TopAbs_SHAPE; - while ( smIt->more() && algoShape == TopAbs_SHAPE ) - { - sm = smIt->next(); - if ( sm->GetAlgo() ) - algoShape = sm->GetSubShape().ShapeType(); - } + const std::list & hyps = aMesh->GetHypothesisList( aShape ); + std::list ::const_iterator hypIt = hyps.begin(); + for ( ; hypIt != hyps.end(); ++hypIt ) + if ( const SMESH_Algo* algo = dynamic_cast< const SMESH_Algo* >( *hypIt )) + switch ( algo->GetDim() ) { + case 1: algoShape = TopAbs_EDGE; break; + case 2: algoShape = TopAbs_FACE; break; + case 3: algoShape = TopAbs_SOLID; break; + case 0: algoShape = TopAbs_VERTEX; break; + } if ( algoShape != TopAbs_SHAPE ) { - // return all sub-meshes on this shape type - smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true); + // return all sub-meshes on this dimension + SMESH_subMeshIteratorPtr smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false); while ( smIt->more() ) { sm = smIt->next(); @@ -209,6 +212,8 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfElements() ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); + if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) + aSubMeshDS = 0; int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0; @@ -244,6 +249,8 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) } ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); + if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) + aSubMeshDS = 0; if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) { @@ -292,6 +299,8 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId() ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); + if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) + aSubMeshDS = 0; int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0; TListOfSubMeshes smList; @@ -342,6 +351,8 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); + if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) + aSubMeshDS = 0; // PAL5440, return all nodes belonging to elements of submesh set nodeIds; From 14497e96c0a3538b6b4cc706dc303b3234f2e822 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 15 Mar 2016 17:14:26 +0300 Subject: [PATCH 104/147] IPAL0053055: Import-1D2D algorithm fails --- src/SMESH/SMESH_MesherHelper.cxx | 6 +++--- src/StdMeshers/StdMeshers_Import_1D2D.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 40016a488..043c0b71b 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -2905,9 +2905,9 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace) double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok ); double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok ); // check that the 2 nodes are connected with a segment (IPAL53055) - // if ( SMESHDS_SubMesh* sm = GetMeshDS()->MeshElements( E )) - // if ( sm->NbElements() > 0 && !GetMeshDS()->FindEdge( nn[0], nn[1] )) - // ok = false; + if ( SMESHDS_SubMesh* sm = GetMeshDS()->MeshElements( E )) + if ( sm->NbElements() > 0 && !GetMeshDS()->FindEdge( nn[0], nn[1] )) + ok = false; if ( ok ) { isReversed = ( u0 > u1 ); diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.cxx b/src/StdMeshers/StdMeshers_Import_1D2D.cxx index df7f8c065..8b0318391 100644 --- a/src/StdMeshers/StdMeshers_Import_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D2D.cxx @@ -219,7 +219,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & bndBox2d.Enlarge( 1e-2 * Sqrt( bndBox2d.SquareExtent() )); BRepBndLib::Add( geomFace, bndBox3d ); - bndBox3d.Enlarge( 1e-5 * sqrt( bndBox3d.SquareExtent() )); + bndBox3d.Enlarge( 1e-2 * sqrt( bndBox3d.SquareExtent() )); } set subShapeIDs; From 14534b55573063b254a2c3a6108bb2e0ca85b9fd Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 15 Mar 2016 18:52:11 +0300 Subject: [PATCH 105/147] IPAL53053: Mesh compute with 3D Extrusion algo crashes SALOME --- src/StdMeshers/StdMeshers_Prism_3D.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 225da4650..d2413b564 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -3298,6 +3298,9 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS )) return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ") << "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face )); + + if ( !faceColumns.empty() && (int)faceColumns.begin()->second.size() != VerticalSize() ) + return error(COMPERR_BAD_INPUT_MESH, "Different 'vertical' discretization"); } // edge columns int id = MeshDS()->ShapeToIndex( *edgeIt ); From a695ce3aeecb27a023e248ccb9433d62916308cd Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 16 Mar 2016 19:59:08 +0300 Subject: [PATCH 106/147] IPAL53051: 3D Extrusion fails + minor doc modifs --- doc/salome/examples/creating_meshes_ex02.py | 26 +++++++++------- doc/salome/examples/creating_meshes_ex03.py | 29 ++++++++---------- .../gui/SMESH/images/prism_needs_hyps.png | Bin 19373 -> 33626 bytes doc/salome/gui/SMESH/input/prism_3d_algo.doc | 9 +++--- doc/salome/gui/SMESH/input/quad_ijk_algo.doc | 4 +-- src/StdMeshers/StdMeshers_Prism_3D.cxx | 2 +- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 4 +-- src/StdMeshers/StdMeshers_Projection_2D.cxx | 19 +++++++++--- 8 files changed, 52 insertions(+), 41 deletions(-) diff --git a/doc/salome/examples/creating_meshes_ex02.py b/doc/salome/examples/creating_meshes_ex02.py index fe9f72f08..3980d4d74 100644 --- a/doc/salome/examples/creating_meshes_ex02.py +++ b/doc/salome/examples/creating_meshes_ex02.py @@ -1,4 +1,4 @@ -# Construction of a Submesh +# Construction of a Sub-mesh import salome salome.salome_init() @@ -20,27 +20,31 @@ EdgeX = geompy.GetEdgeNearPoint(box, p5) geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]") # create a hexahedral mesh on the box -quadra = smesh.Mesh(box, "Box : quadrangle 2D mesh") +mesh = smesh.Mesh(box, "Box : hexahedral 3D mesh") -# create a regular 1D algorithm for the faces -algo1D = quadra.Segment() +# create a Regular_1D algorithm for discretization of edges +algo1D = mesh.Segment() # define "NumberOfSegments" hypothesis to cut # all the edges in a fixed number of segments algo1D.NumberOfSegments(4) # create a quadrangle 2D algorithm for the faces -quadra.Quadrangle() +mesh.Quadrangle() -# construct a submesh on the edge with a local hypothesis -algo_local = quadra.Segment(EdgeX) +# construct a sub-mesh on the edge with a local Regular_1D algorithm +algo_local = mesh.Segment(EdgeX) -# define "Arithmetic1D" hypothesis to cut the edge in several segments with increasing arithmetic length +# define "Arithmetic1D" hypothesis to cut EdgeX in several segments with length arithmetically +# increasing from 1.0 to 4.0 algo_local.Arithmetic1D(1, 4) -# define "Propagation" hypothesis that propagates all other hypotheses -# on all edges of the opposite side in case of quadrangular faces +# define "Propagation" hypothesis that propagates algo_local and "Arithmetic1D" hypothesis +# on all parallel edges of the box algo_local.Propagation() +# assign a hexahedral algorithm +mesh.Hexahedron() + # compute the mesh -quadra.Compute() +mesh.Compute() diff --git a/doc/salome/examples/creating_meshes_ex03.py b/doc/salome/examples/creating_meshes_ex03.py index 7cf85b786..8687b8971 100644 --- a/doc/salome/examples/creating_meshes_ex03.py +++ b/doc/salome/examples/creating_meshes_ex03.py @@ -1,4 +1,4 @@ -# Change priority of submeshes in Mesh +# Change priority of sub-meshes in Mesh import salome salome.salome_init() @@ -16,47 +16,44 @@ Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) # create Mesh object on Box shape Mesh_1 = smesh.Mesh(Box_1) -# assign mesh algorithms +# assign mesh algorithms and hypotheses Regular_1D = Mesh_1.Segment() Nb_Segments_1 = Regular_1D.NumberOfSegments(20) -Nb_Segments_1.SetDistrType( 0 ) MEFISTO_2D = Mesh_1.Triangle() Max_Element_Area_1 = MEFISTO_2D.MaxElementArea(1200) Tetrahedron = Mesh_1.Tetrahedron() Max_Element_Volume_1 = Tetrahedron.MaxElementVolume(40000) -# create submesh and assign algorithms on Face_1 +# create sub-mesh and assign algorithms on Face_1 Regular_1D_1 = Mesh_1.Segment(geom=Face_1) Nb_Segments_2 = Regular_1D_1.NumberOfSegments(4) -Nb_Segments_2.SetDistrType( 0 ) MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1) -Length_From_Edges_2D = MEFISTO_2D_1.LengthFromEdges() SubMesh_1 = MEFISTO_2D_1.GetSubMesh() -# create submesh and assign algorithms on Face_2 +# create sub-mesh and assign algorithms on Face_2 Regular_1D_2 = Mesh_1.Segment(geom=Face_2) Nb_Segments_3 = Regular_1D_2.NumberOfSegments(8) -Nb_Segments_3.SetDistrType( 0 ) MEFISTO_2D_2 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_2) -Length_From_Edges_2D_1 = MEFISTO_2D_2.LengthFromEdges() SubMesh_2 = MEFISTO_2D_2.GetSubMesh() -# create submesh and assign algorithms on Face_3 +# create sub-mesh and assign algorithms on Face_3 Regular_1D_3 = Mesh_1.Segment(geom=Face_3) Nb_Segments_4 = Regular_1D_3.NumberOfSegments(12) -Nb_Segments_4.SetDistrType( 0 ) MEFISTO_2D_3 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_3) -Length_From_Edges_2D_2 = MEFISTO_2D_3.LengthFromEdges() SubMesh_3 = MEFISTO_2D_3.GetSubMesh() -# check exisiting submesh priority order +# check exisiting sub-mesh priority order [ [ SubMesh_1, SubMesh_3, SubMesh_2 ] ] = Mesh_1.GetMeshOrder() -# set new submesh order +isDone = Mesh_1.Compute() +print "Nb elements at initial order of sub-meshes:", Mesh_1.NbElements() + +# set new sub-mesh order isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_1, SubMesh_2, SubMesh_3 ] ]) # compute mesh isDone = Mesh_1.Compute() +print "Nb elements at new order of sub-meshes:", Mesh_1.NbElements() -# clear mesh result and compute with other submesh order -Mesh_1.Clear() +# compute with other sub-mesh order isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_2, SubMesh_1, SubMesh_3 ] ]) isDone = Mesh_1.Compute() +print "Nb elements at another order of sub-meshes:", Mesh_1.NbElements() diff --git a/doc/salome/gui/SMESH/images/prism_needs_hyps.png b/doc/salome/gui/SMESH/images/prism_needs_hyps.png index 8c567809df180b98afe8c1ebf95f78bfffd5b275..d56d4309994ece8cc91152d868f6b85e47898f55 100644 GIT binary patch literal 33626 zcmZsD1yq&Wx9n z|NHJ8Z@h88arB5B_TJyO)|~TK>wHpCdWwrhfrUUIaAluKsUZ+3E$~Yp6BYjEQ4i`2 z{OgwEGhHVH0ReYg*Wp5;NwG=2U%D&rLY8;HOM~LyV8YQQhITQMYcwlq?g{Z4r>~NxEGsV` z8XRnnwNbb$S)5{2{f5=lT;k1}it=(76_wtZ`~GN_bSr%|t>2e=9(Y!Ktaf+a^2Ouf z>uP3V@)P6XT1u^6JxX$6?pe=%q zgoK2enp#x);%jd1Ed(wuZX*9nkyqzZ&z~>QUP;3um6VsD`E-XRqaY?bZ{&q1B#bAG zIaOR#;UkDH0)T7Hy@9C3?=H>_7+O&2MnsreTQ6^IUHOmPrp@cxd+g>( z#8K*l+^IEh#Y@4Fm6f%i-k*D~#LB|bCRABjiK^Zl*k#)J>n=(r3+6}VR3Wd@7emau z&VS-KtKV)gD8HPna``ulhQKr+{ONgin3i^Lbpu}H?bejA`+81FijkC*)NFQhn`Q)} z*nXno>}Zol(CeFIAl|K8w_s~MseD4kDzG@eh?!5$TwGeZTkm^A_}$@yM~+*m@0Plg zxj8vee3}(Mkr#1wU%5~tP)RZDrYnRWKX5(X{&#d)Ia2Ag^hmofCpXuy+TA{(r_B5E z#H#rt0lc)huQ(?sCtV%&$>qhF;;lrF?6Z$Kd_8jrccF8@6FGfy)_vPZwAY%4gd{p6BO@}BP+q?CICLk6(sXFijZ!8;JoGIFMj*pp zJ(5Ofmxqqd{~jh=Y;Y7Y0@JUpt?hG$B%&3$K~8e{fQabJ?5x>?1cZu#fkJ5aw}OH` z-_TG+FOjW~Ur9+x>5?B%5wV>Mj*q`$E-o$5agwC|Iu}CZ6ci{bDP7tODL+(75nCCo z&=D6$(WTMX*VmwV`}SzNcpDzO_tnMGh<)9m)0(!r`rh`xrsl3sh~l@?Q}07>?d7mEme;<-&qLz={&L$J zDX6P`chueA|N37>zzuYqd+d|7p6@1#CZ>M5ncJDI^LK7dY}Jw^PgP;|s#{qt1>a%s zPI^L=Z1mHyVQeh^S3+{~#`5wXvO&cpdBV zZR@I;$j<6eeq3A}JTfCTXqz5nR8$w8>~(2xe&=f!!Ct9(y&$KpJra4F{@vlGcoh>% z%@9HFUn9!m$0BT({aNzRPGZ@Or^xF1yh}vgTr}tN{Qh%kM&t_#3%hM5bDGOMd)5Xo zro*D8r#B9dQRVcux)()|P9^Ug9T#NiVV zM5JC{G~@(NOdD@TiFh1uv+7sikPF;Ie83?uecnk*9Ee(fezG?(FmRWG0^yTJkdYs% zN~^;X^YP>EG{)8C*^F_D&^P7JW^(v9#{#bJ-{J#lj(7F*=~_=G%O3K_)@d;@!%*v1 zJt;LWr)z)9zdPzm7JS?G`92PMQ%0t=l+^oWXXc~L$-RREDk1Cb_d7)0DNlk4$L!vy zsrAEGwbUmE@R3z$1DnR6{T>n3Ub)YYaQ1QX^71m)r0Umwd8n*JCThB!*6`gsDLFo# zNkCNPAZqVZp<(qU<19U4ZX#}=<82?0n~(OI4i66ppWlgC zSvFbx7Ef*b?tJ;k{9&LH_8k^VQ7<96RDN%xEs+}Gx})`_;hw*Zl=N%{Wsd7_&AYn( zJn=yIRK{0U#=HF}ob-ZP2)%XJjrzR~W$|c3gXw-wU*^-$&H2%GST;Et0lVeaa2gC; zispZg=(rU7J9Dk+O&>DkuP4Rn#qwzTE6Mc_@aR7lUiU35Yy?j+g_QH#jC>2~Rn{6q z_oj#RHSgddRlk+h+}P;XcP@!r+?zcK_Vq`PMEaxSy6>Dz&t=_V&#}Mi`GF~mBs@?b z{HFU|O--$0YxHtmcTVW&YU0W}oLXeO%4Mxx{b6uWkjiXC(^G08*W!bb0_ak9Cj6gk zBoU5B-IMkcKMa4mrq{i@8XeW?J2|U7p!zgtRO;gQ-6anK>@a<+&M8y5c4Kjs2 z=&6-1XQT)mN)8p14~ahXzwxh$137BMXM;HhO28OMvnz>KPii(Q-^bUmHdS5@DbM>kZ zS~rR�@|1ZT&1G zVY90ibOrxf&oeK^lVZS2Jo^t=lI2`okHbYTM@!6~`rX6SGY>p|JMDRghK7ckx-dV# z+IFO{zFrIw_xROpRr#8qq#q!KDa$(8gD?LikZEA{{2)xm>fBmfWw;^SVxpJ)?r7^i zwg{(bi4Nf;*X!nIoKF2V&UT(m1n?8#1|*fw_hR6t^>lR$^vd&KGcT+CaG3N8I$eon zt$Y9BLqbAAcMA7i&x*$WTpSt^kCt5$H#fI8Z{FAre-kISJn70SDoPc7>7}UHmGs0( zCF6+aC5dMALTAjqBzh{*m{M7PDde-9QFh6#SflU8xI4IHGs>ijn_Aua|5HsqCo`y+eJ`PA(i+9e2DKA1WnT7hJ!p55tjI zOPRgvMb_^ystM+6tR6pmyJgmbo4ZA;a)ZK1`1$v-0=3&X*|KOaAkV%>f`=668s zA3=Uz@-S3p?j$+#t%n@4FS^7rB^)ieVsy>|ZFoSdesJ)511fOf$mRDAi1zcYI{rSoQ>vEoi z{B=HOpQCT^c$7cAF5DTu+(Kw+Y2CknA7JO|>gw7^k+QP#bcuOj zcDALNSw>>wU4-M~BxA3W1pp)PPMI>HdNuCl@ZCqXCU+$R7)&0Tpxk>xFLG4~@TEJ6 zS6xvPw^l>{L>$@qy@vhQ_Q~Gj%ZXaW(~L?~rG;ZQkLiFE;dgR+zo%;6b#-+?A+{5L zLl*e^`%Bh&T^w#sp3Q}eW)SbU_aySOb8&Hrh@`ZbwY0PV0C%`JJz$hHHT?&F2Ewqk zwIyoP|Mf1vLz3WIhlAB2n1*ORuvQlrN7I3LRQ*Fk7c0nA*l&%Eje2VvhHD|p{yy0R(LPBkG0DLkA;5RvqA*~SQ#69bV4bNIsPvn`L-fL^? zob-tMm4QL^t@rr?7w~xml4TxR^Z2C=SUXdMiU?{v>S2-zkU{45E<2M5gvw~EruSKg ztYOm#xz;bd&OK8%6}G1uwRez|fAgoT7ik>k;b{IZ|mb8>P*=#-eXz)NU<)9Dk~8V*apjA3~A@J4+I zId?BmQi^e(XK^WE6ufzf1KJ1@r$*U^IaNQbZ{)u;&&|k3?$j!H%VrMb zksdkyg-0vmb&iQ}7Dzr1vtG02FTSgCTiDIO*f^YPesM93oEshS(|~Q94#)eEKJ_JO z4GfB+qM{EU&_CCCHQqgEPZ3E^d9(TV2|xcG#OH2WnNW&@k$^g>L2;?iqhlp|{usCI z?CgwcJ#4J4b+ol(Q&YEQX3}!$9Y#LaH+l>1-xYZL`WO?TaFD`mX`?Ye;tl93G;N2N z{OE#zh* z>rb#3Un-0Oq&L*nU74DOJ5s6RJ#V$Nv=oedqobpP`N!YpKE*;5Hevv&Y{fx_DE7Yc zavq?oI==raGB_#lC_P^Ef%R!N;*x=A*jULl#k)Z zE*BOSn3;L_5}V9;|5m>(`t~ivdqnvY*3r&RrSnQ;czBQR4UDfz^AC!zG)VWdKF95n z(mzvzTL?|-!=w=Jtv;B(I#qq9IVOon8?bTKGuM&J9EiyFVhdCw9v&D*@$7~TxVP9N zKN=^N4P4mz#f!Y$+=cmhyT3mP7^eyP+y$O@M74cvBYC8)qo-Hvwr6S8-;FE!(z@YJ zBf?{BU(gZco#W%1XIoeyan--^;Obqb*tcAsBZX!+;3y0$h|`^a5i#mXu-T_#W|S)j(_1lY!4eQ#QO z)ef=9ByuObIZHlvMtuogz#;NVaNB!OePvNTtL5z~#krg__3W3lAXiF1nO++n0r6gV z1c4^~`-{uHN2o$+1Ix|=q1h7J>A64wDMFQyePf8f%Ae^?pfcNf+(47SxJ~&$UF)KZ zS%gjG!Q=vum6|YO2RyQE zY+m?|&Yi^<^|zbTOp_yeZJaU`ji&Z8Q|}nlcCC&S(OhjbnhEfbSCp1UcG@uJn^4uZ zZ7k?;y(wM{jO_5bI2Cr?_DOHZDJr^S$e+@9n+oUx%=2Vk+n66ej?yIqdpYCND=H5E zRyvKm{0ofzq+=yt_6vjB)27^K{Hdvu96ju_At%!FjPYs58Xr^oF;Nc^`@ff#dW8w% zlh=-RI~=GBBr9pBNBm<-R%&w3d;It6NaVn2D)!fH5zpO=vm;Tj*~e}+yHV|o$?n0$ zbM5L3$|+p&zwTUDW1gA2^4{=pKRROnsQ+EUkH_>vRd0W&Bb9zLFnmBqZwkD98xs=~ z2hXki@r>|*&v@&}al1JyE9(z0hjV(&;FVsZRs*&ld3k!;Ukvq)Q#8M-s_m*ieX9NR zX=_uHIe^0NRy|6{oXX>X%=U_9V=iTP_tVSys{tOa-Gm=1lInYXHScWA&0&Q&o_7#m z65c#Y*%HX_BGLY501+z1lGy{y_+M_xkPi*_7k>M8Gh$9PwmS*o1H-z;{eYR1 zvu|*axGMq6_<%^cJFg?puMySMe-IV>>54ViC-TtaX(`7148g~v%Pz}4ANrn#QM!Q& z)@>*d>?-aX&=W6+fnYPNdXI;HaBu+Mq}rbxEvmb#57e}N(RppC`syRWeJ}3629tIh zc5YY%PPN3hHHOXvHVf*7nvp0>1mU(G5gb&z$3Ld6$H!&(9j@+tx9m(fnbNOVKL@oA z#Rs<@{ay?4PukX_k`yzJeo69h32R$h==kAp5tm;kh#l^E03acNS|? z0DoAl;1_BS`g{|%96wqG`s^8dKv_`nON$|fVm_#6rYW9wjDG*2h z=<@RO$0+d$$bR8%aVnVA7q55V{`(C9dnZD02K1L__dbl(X-BQ&+QC>xJP?d$DT z(bw-ZD)+ob=$LINwT}#pQwT$Iz^bYG!2z(Sf|aea{@C@3fZJi||r*wtS6lj4njf32aQd!4JQgOsFzZ@&!ul&E;H^aR2tv~Yi6bwWM^ck z9@g4T*VfR;VT}|Rnmd?w&tZm5oRNhX%v`Y!4GbmjHbvpNQ{6NoX@mLFJ_q|84LvYz z4vjlIqOM(UT<`bq-+pJx0nN@Z$%XJ>zCF|)C;(FCxlp%E1w4SyIO z843P~)e^2;cXF60e0EqP_s-P8MpIK2hCq9sIdAb@wiJO95e7Xm59T2cCf~fbrW*;W zcSWysS65g}Ol$FlFNAucnie#)epxvU`3{&kI6SfV_&p)v8ii5`xa1WUT4L+6_+R5| zs;J8W=tygCdoe&449ifD3cw$o!9e(Mdne5)D|`%>#274YYaVUR4g4Z?fmBjbdb{}- z)C}MS)&$8xK|z3xf?M)(au``zrR8^}qVAm%_6+UEt_V<2d?GL=bH8MBbG~-0Ji5)qlk^2{{7TC(CVa*#>ykv*wp#M^kwecw41TF*ngB z#`O9y9SrRYic@T7Mg~AelBz?X58yp{rS`30Fd{Nzbm_Qc4#8ow`@mVY&fiPc=9bUQ z`7BWI=g*%@OH1Dr=ODwu z#SH~m1VFvCl#4jNbZi~q5x58hnX6`}>3>0nh;5dl5=fp9-)bpX8|n7w-RMnUH9wgz zF-IyTcMRA1JS?5JM4=q*B8?%I!-oKr158VB|a~IoNN)N*{`3_6>eDP)zDB8QT^L<3u8{C zo6*+Rm#+>~4~LmHHa?DJyA{kqPcH1f-~Qzx#%=1P#Kg{jjsS%X4XIunZX(Ndrci3`&$!7fp~XKY)ln=ayE!toLp`qd_I5v41{fG z&zxf;^!KzH8{!&=b9k&@ly)r+RyRcAXw4K~wAR@3$Gq{uEQpFgE~N zj@?+9Y~a1o7ccfME({F}5Qr1fAepKYdyJ(a#jtR#zkOE}_UoM_VewgTGf* z35eqZMr6`{S<}v*%=IQNKKIk|)?XkLKztmge(4$;PlJ>>Gh?#*u=M#oOw^aium~Kv ztCe=5hbZ+X`Lj=Kzu=j3iWq(A zL_;@Esk^F2xskxK&5e4dj3ylR%JaV4dHVeLrJ+9gNKetPOWgw&!LW8Eiax326Onr0 zc)%9ogn-MvJLHQwbXr0cL$W2?ZTy+KLo!tQQ!g*WNWy4mrB?D`EV}lkL?+80|Nu> zYbk(f@KXJKy6?ZEleeYHi(QV$2jp zMWZOM0)N zO~lQQH#RrDb}cf=Zw5B$R=?Q*owKvE^PxgqF(}Z36xZXb*5d>|AWD5_=OaEoEhtEE zIzEPlg@uQY^!9>+)w;LTGdDY1R#t{b`Iy6X+r$(tgYCiVc5Z)|>%xs=H`>)_?Ut!ZTrJ}z`0^@qyo0}L;L1bG^s9lC5hD%Rn&X}LK5 zfJ>vbvy&NG(3K|ss}ny#>d%Q9DHW?LVQ8p(rvGjv>R0zFy%%N*WwRI0z&C98&4*DJCtK^B9`_yP&BWLPmN!$?BW^2K zA!M_KnVJ5lajrjKFJS4hHTGmHCKeji0CFD(VBHdYCv#F9VbYbr3q=jirU>Hr^b~|{ zK4xaD$w-j$laoEyM>$`<+|vDS3B8y~@C^$iBj$5boqOQ&yxcPWucy1XxOjPa2{KB0 zdU_7bu0kCJ&h4y}lqa6(h~LU&;cVo0$?uTfN=Rb2)w8Wzh6aJCzgq12QfR@sw5K1Z zuM?*)_B}#fJLRT#hg8Vvj*71C3E##2{EE`x&R&%1ZW9Xq;UTR7Yo68=fA`zuJu2Fr zogR8dTBl$oNceV&BIM-co*A>x5-mG}^#^hZOpc+Ek?`PP!B-itXgeGHF^GtW1mCP* zuWVN$KWG!5Sy%-G^Z<^wwj%TLnBjh@MBg1MIQyPIU|`6=l}5dB1NN0K={9IkLHj?O zO=iA?-WA~E7!<1gLQCrlo(lP)$VHny!0@#NVs8;KIhjvdf|@sr&CNfSsLB|6iHd((m6v z6~l`P6;^RKGD=BKrV@DL=qPqq`g0Zv;>G2cR%>n=0<>N8=g$N1pz|6S8is@Cx3J){ z&_QBx9@3yPH&8P7J0U(HU47O0k(>Mr+l`mw3T@%fS4y)i?oFeHe_=I~cQal9A~TQ%6s?+r_VK!{4p_8Tof2zmH}8*%Y?rEt5JgAQN)k zhTe!~1RhsMTbs4DwOFT68=4_(fO(0UkPw{JZkh}Nt$W@=N{Zmq$|@+FpKaBh9c_hI zl-HZM()OPFd0c+VH*iCZI!v+?kB&9Ietxe{&*{g|jyf-;28-k_V*mW@`x9bs*0XG4 zvbgTP*LI2byCPt#A2&p?BWN#wU!&mN&$R@Xc`a?n$CQPi>j()52*CFMZxrfsps%me z^Ni2U=JNamyz#MLZr^KaE;?h`N51L$|4z$RN~XZa_o1}Efr{FjtuTALwhu5e!vsG3Hb%Rd%TdO2fE%RVQ#xj6`UVAjX`y$AcJQ=JOrUN+ zg?uR|hgCJdwWXZd2d*1XRZ1$V%*;$xcaYG*CWAS01EHR+K;V7kW{Os*Q_?s&S@Z3i z!YI2Kcyk%j!C=}mA7c31%sH?8%_`6Lu~B@`tIl~h!X(y|RtNnCK*5~Dp=zR4&CK$R8?Q=rs$b%hS9F!NA!OljwfAjp#KOV4z6f2}X+=e+Cnod@Cnv}jBt~5k*~z_SDM2X|^!VuhJISrj3La^1 zrU;tk=jXn(H?_AffHte5vTf#M(H=- zWu|g-jq?Lls6()I=$?i__T%DsCo>`fB#&dd%nZULu$DlMl9l*DPvz#m_Ui(hR(jL@ z0ov!~wG9;q1sMbqbC88Z(iR<@-4xHs%X_oj>zj}RMlJ|&NF)XV1QYyszKH9=<3s!Vnw=!-P5p=tR3nRd!c-AYSn&ZQ9v&VkDJlDOOj51mBOxJ! z{sek@dR1*@`_W?YenNo2+4K>AloNt5-2kJU&YfpPGzB`Z4YO|TE&v!iY`UniVspIA zTN~x1v$wNr=ENuGvS_=emfyAkWR8G*1Xw6TzL6zMT}>^9%`hP*283=xYHAVKol)Lr zhd{TA*jZSd-@KWsbg}}|C&5DiZv2_tz>ZDQJ*nyb-d+>C>7!|F8dxZZhG^<-XMZjG zGx;bZsgGC4;VNvhz42FO4vWE0Kn$c^`yoL=SeTgi*dy?IkgGi{W zI|fmdh-%i^#sF-fVytXz)ZCVTglsMxILUBicwXziGt$=9*44Bfw5d;y&4RAUKVb9I zi?$>qp}=&ovh(AW{okbhx~q$qVCM5X{KZ%OSWr-qoID9w8*aHUVS)c}VGUpw<7#-)^%+(Ha zUR9ZFQL~b7<2OLC#o9j4FrTo^iHIN&#|Jw=KtQ0eW9R6|7^Gftd~mn2vay|fU@4v9 z($FCO(ypMOK*?>1Bloc263k`W7cb^_I$$@_`KIy=g_7LwRiHpDJG<|k`DH|Qgu6KV zchmJupMuNo(Cm{^kv$&sfud;om!SK;wVBzhvG;|hfdR{GB@_pwE(&sU|BZ#I#@#3j z4(`lVM^4pwr+)rCv$XWEJ0JFA$Txg>vU@9(MrCgMH?K*|B zlDS8CEGr)bMod_k5{z7QWTd*<%IfM1d;3YC5@6SubGCpNce}Fe2xTVmWvwY!JT%Oy zsg$OF#CPsMsOR=wzHd*%sXJ`xLZLCxevVD4s;q=T0`40uyNKIvb9;L(m^2_K&{`&% z!2+q#u?zEZa_;Q!OSL*UIJ|bpy6!M|Si-W9TzWN>r&(Z#4S73)VA6i|6^2`&dIApy zQ&Md4z(!;=gv7sLyH~=Uc~S`FtFCp;m*W#@FXjdD1)I<>mLr)|H+-d7Z-o@5yuLy}CHr z+qCMTpnB5yOt#PCTxV%xVy(P9ayT6n>9)3yJVs#3f?V<+W^OlH+|b4)L#PUn*0+*fN+kt_kb(l%FYWt# zd--{J5-UthOl)jy5ajs%`@=qA6eBnEM@PM!8g^Cl_`UV9zV&qw=`(F?o?>I+ag*Ir zu>6`rjS#y0>OPxURJ66Q07<*|N<{{hv#@q{b~uPwHbeLAnFdI7fHzX}SBn&&@s1(UDhMo6@<^oyfoSW7d@suJLwFn%HLBF`$7@h48} z0lR3p(98*Vdbltk@bJ1jdu&UL^+U{PkB+14=z>?0jq#K~3q-=Bcx;d^v zS7dwL*ODDxyg1#Q6pZqMsRR!k^x!7~0x6>2MnQj|SQ;X#QzENmNFL*FCd*0hbtSGE z)i4l~T%5?NWidQ>@BlXTR^8R+be(AB-I;5t?FKeBwzHjsgHpDYg~jI;vp2fW=3PQV zOE}{y-b?f>6#>-9$$Js)-^3pf(8bd6-yqBx-rd5?#00dl>&wJsrp#tQWp*%E9l+b` z|6Hi3sDS8#`XLoL(BGfn@mb1fWR&c#zm0s`t6E}`!ui6?gN6oCVqybxF5b;4G@n*d z(&v;)PXf7>^z3nO-O??y?gQPUJ&J%%=I76!#X2nP>_s4|Mv+ld*V>JhLNiCyM=_~` zn4oeBaml}vlbszMQgy-q^FH{xCs_hGLoR*!vvYG-dm2Cx;SGYmH)EUuim~Sf4`%%lZcQ|Ox;2vF5&&4B1;+>&WF^Py|v7gAUy4(tlB;eWPZO5y3+KzYqAT!Mla)+F)2n_UDdkTTW6i7c;UvV#_s3 zY|@TP%hOQjWV=@m#wcGR2ukM=WIaFsE$dywAdUFgKQKQ(PtI-WSowE;-oi^*+Qh zx;-4UTVb`%**^lGUXCI0j71maH^%luJJKpyd1~1S;?Xq6C7UjT$hplHo+Ni*1r|-k zlh)1OaBEY_w8)+C%6?9pYPwD%*<#br6VEx2c!?Focf;xM4NMe=52(B zrziMGcS%SB*kGhy%N>i0sY^C=vJ0OyBi^P)M5uaroI{Wg1hG&3dwY9;p2MjG7dJM9 zAqxYSd21L5-sx6~(4YWJPkSC2Lev2C6mVAN!^BpS47N{><8pbJ#}sZdvWPbFYMXx5 zA~@JLNxO^i(1+o+iy}$7Rd=~&hbZ1yviY~Js;$W|`Gr(%)VbghXTq2 z&QG7I&<=f5*4exIn`df1^7m)O*oeIhCBkCzN&McnM0X}OZAt*e*|ICxpY84KLgc%< zyAb2-f z3w;01sr#Bg*7z<$V6JW@iJ@fv_X+V}5l!eDtCydbF-S;BuTfTy=+*wtjyMzGX~=~$ z5EqF$IqkvQfOm#y`F2~xZ67chZtec^jr)=(r4-XoYdxTkU;otJ9$ob(PBK-MmW%?q zug=zm=N^A4#PcQIH53R&#CTcv{p96OBvwZ}cHO>ioH>^Lz#n$}7#UexUEh+>; z^8Bc>XR3e1s;2lHo)WC{*KE*@c6m;knwr4+e7C>c2TTLy20HMm$d&6o304nmE?90Q z_x)Qp+>Urf<)mvp+}+)QypP7-rbAHU(nk~1i9FLJcpal5y}uSLd}3^PV@YB*iA|lK zBuYcev#p?r#dJt>TJ&dW>u5dFiofHlJH+tgIZRQ@hr$~$Go>$1bL#dohPWrS+3x2V z1RkUH#72_xP}7SHt<8_0zr0^3^65OQe~s>N+fLPquza!t@B z($dmy5i#(5=fRP&{LB?Zr?PW$TGAZJtW4Zzyy_xzs!c@498{VYG(Du{@sHZ@M5H>N z7wozfp!A-ez*y(Z&CC*XDbNR4nr};UcKFbqrW%d$D0=bU0+SdM^Rw{@S;)_OoGo1A zA5^TpnQ*eZW>G#b439_Gw~$YxM9f4PFsB$lm)n6ZtthlZz5b=o?6B z^_AJ|%EoDv3hH~y^hTB|){~R=`ua5EIxi4gK&Xn$pnM{(75+3jGAJ$kaZE3RtXu55m+L<6c$x~xXFcc92J_3~^xddfEcsQor;`HPMT6DS) z%nw;N_hxHudL7wedQUS5{8tv5EBc^#!VcL|VOi#Tn0i|9(S%zgm^18l*M= z2tj<`pw`39*}06E-bBwYhIqg{8?|=4KI5{8X3q=7XHhQ4XykY(kFiX&Zt#fjshYf; z9G~6j%>4XKL?WMkmHPoG5HBn(8G>7aAZq0HY`P9yny+8Kel$LwZ~p>$p|~$!_6|4n zA^aWvNc2io`nOLK`;k+06!fv_Dwq5x^d|Gc8a1!1*oXVtv5}4A z6yxK=r^>Qlt&hL_`x+ll{$hO#RB@pBZIR4uY~5X5tRf=R@6RrI+vi$CSt-!{ODwx6 zRzuAwZUp`Q`}fy3g{Z9i+0hZQ9&*t$6$O!MV)n;hBFEKgP~?bGvCgz_M#|(Gu))}} zu&@}Nm=N_i#z*{@a#)y=A%PqK>^)ucF7P$h-i2-CwE#!P>DO*ScoR~7PkEyV2gp=- zK!t%5AzkbknT}u2ye=EDPg>rKT1Rus4R|xJ8}~h9&b=uPFAZX;V}lGaiQtMO}1&1lfCVq&!3yt$5rB<>k$fUyh;&q#s(9k>Vx?&q6v z7Tmy-jwa3eq@3ta94TPco%HqV18?su(C^*c-GN3bCGv&tOOq^~{qQ_Hgm;H*Al_X* zJLq2LEt{~#TY|1h{&h;2%i`nl!Tq=VX%0?eMxcU_@mTi)Gb}Wy?9bO`|1?FM$vC5; zaT1YfOhY2ALqmV?OQX+Zy6(`&?)>y-cP#DG^DGtRCnpEu6XolYhB>eGX@=Nl)!*B- z@NjSx!_gN(!MkUdre85WG2uy1VAESTJkuK?ly)d9KLFF4FwNSG+0n30Y$Zw-`GT8O zRqWOCAFQp&bJpjSr>1%|J%xJS|u-e>&#tH`zR*zMXaT{mbPmpT%GS-+hw3sbHyv%z8wz9ZjjjP-+0)E z$9z&~8BwGUc>1Of-#fU7Z2?)(f<%obZYEN{N!S6QM6kxdmjmd9*-0k}U&pZMa@mb? z2qdR~gt4)qIR4EJGSCyxUqh)GJ$$zDoyhJ z!lf@_Djst726Upr)Yv(o*}WVqU8vrweZ<0I0I?ZJ%Bs41d5Huu*3{HM!Vttu7f}CT zsz3<_dpSV3jlJ&t`euE#A1bGW;1qIf5cF#W3Fwx`zwx%G_7%_nTOnkVc!B)*lIZSS zgAOC5GgiUPyHwh>cts5oAj_X7Vz?#2oY$Y0&iOHX8<}m#Ej`95-yeix?GFh4FH)5iS3DxEuuw_3 zFyGd!KB{xU>-_lI@AC5ULKVa)rZRpfZo(L(>Kc`OrGa&&K1S=99Qpq#P$TEa<<(Vm zG&G2HiOp!*wIcr-%y0`?!4^|(N2@c=G#&reOpQRn}95hNqXvN8%nx3DLW z)YwEaB`Rg~=NS>vxL70v@(0lskJ4~qB_Qy6%kLgimMJREte}-KDUNR?kan;9JmX9` zdYB{&%HRRkBQ-32P6h0~AhWz}IeL@DNcjT0ODUb`uUV%1-NUo}`22H2*IW;cvl8xUz5c>dj;v(*_^SKLy zwtL;Qz(Y`+^0PrJ=1tul7@k!p4!op3a9(GAm?Cek{p3^1*%&l-)20vhlU14tdS0`j znLs=>YM(7$D4_#j0os4e0XSKqouSXc>N}XuI39UBldNp)Qr$Ol`~l!zkhSKI>_|tq zm_EZvJ9TySlH9XYT>5e-y(u^^g595MR=)9 zYiwoCE=ily>jIOGWR55X&;@Zs!Q&H|I8qprPa;sF0nR`ZKg+#MY`5Y8Lp(SLMRRntLGoFxtMuwmtlwl?(6 zzwIQu8kB*EVYFu!p^uP|b$h=8{1}z}Q!T;2#YLH+UWQJB9qSb=8(5Af{itT+O6My0 z&)$$gO+rNzmTz*#kuK2s1S()leb;iksj=gt?xp{%Jda)urou#IC;dfPcWa?;=hA(!Op>T2RIf8e=GN=kxG@=@uQ-?L}Wip$Er_F0R4 zq6EVT;vyjKgobv3SK9Um&J_W8gkpl_GW_9?3`jjXdI&rn)ejJa0eKyUEu7$hN+rE> z=gafmpHi9rA3l6&YkOvEYkN(Vj$M68sQ<4&71on1_|&is4zrn=nE~I9SIACHH3pFP zvExQPlp2gO5FW2CFCb6Pu<|qzsuv!mc8CwZm$)=x8Yzn zNoi358~|U&<;@!gb@pjq*9bAM?ula`SQDm;f*g8+t}fq{_apE$R@#ZOo1 zrg|t7)j{R4r#KA%odwvA!Wx&rqPxWk^pyY@5~xfvT&8AbT#x6=CT8bwSxB$2(+CL!ht(kDnA7EQWI)Uu{-pmiJ*L6fF}i-e@bf(uY&YY4f2f4l+%A}2pzJ$!AI zqUJux$#uZcft<#~#Gt}Cj5~%|NlBE~hn8(Ox3=o+#<=|M4Hp{9E5bs`M0P=@j}mXS z6kpY?-&0dv{X6)%?Mr5Q7y*RpzH90a@6>Y+XjMp|lo+ZK->6*6<-ow_q0^lCH3(xa zO1tEg<#CARRhz}}vl++A|AIF^4K`D~FISe9;BW=Ik}7B?;7zxNQ9+XU5j#7uSNt7J z1eD94wl;9m0+-Do^sK9|kBy+FHfDKNR$6+xR#XRvG%VEILL}0Ny%@3ljtdzJs$SFF ze=AIq{ef0U0c7${X4|`~dF{k`8tsnGUU1?9K2XnOyxp{fu01Wl_cXW3ff#Vnt z$-uan7@6`{5`U7O3`|dZ!*NciNSHsQ!}AzEVB&2*>;?}4PBcS*t@!c78+dyHuPuxW z7MBH1ER;jZ2#oXKG(7_yl9C!IHcf5a*KYm~BbEH_ou1K`>bhK=Pjihaxlo9D{Q?FK zy8%Q-IG1s6(eOH-f`yg9^*ks(UiaBE%u1^L|53+Xnc-+gKcI>Gk{>iQHQ_++Gd)>v zZ*PiFh*HK!M=vZd!015fWut1GqowK2|ur~kW5PQDd~LUSvs528FMdt!UozLHd$kB6R_G*f$C8DS66JxqK)&Y2$3 z`#i+`{q_BXjZLPD3M;{pL|vXqKnIq45)AO8?eyBCrBu_gC) za*uNV2Lsh8F=hIX%9)ucE_m5jehuPkDYKgNHF(7%*9#{)>`9 z!G~2}Og_IPDfF)CoJ?C+0DG4X=SHv=fx4-PT2Odg!o+wCBRr%2^-yMxS~$q5ZE2X0xCOdh20kP05L04t%nYbTb&cj%$m(>rCK( z9s+`Qn)y>BPBa8Jx9e33e_uDAf#JX7S2M5wb&!yW8d(dAobdQ(Gkg~5s;o4z8gW(N z4ejp!usJC%jkfH}!5i>)OT?IP-Y&G^8G0oV^AlT_*9}YTIG+|fdW?tGDC*`v08nha zB=IR0|61$$uSe8$(_m`yNuN5f)D!r`=^iWY>e{~*_3horu16;0_l43Kr&Ov=+6w*^0l~sq z9wRzj_w7}Q<3juP?Viv%oX*16DZ~7L7ya{3F^5j+&7>qTO%e%-ncaoo&feZ>ef0xG zrKRUfy}*`Q%sqx=0)YIY|Kn!!m7uEao=qHd+2`+hUZz zs?wB~=TzvX%}jL{?T}v4vTX69_apP-A)dTJ5MFd{#E5v{)$(jaWG@Z#nq%nMV7Y8$BHAZ69r zfg3~5SGoJNuIBOG5o(DHu>~f7!~UFS`KCeGh(Mi@WDe%#1C7QL;?0O2_7zdatw=EXGPnCbz>WQ8tczJ402U*h-cn`q0w4C^Z$4C5nLT^w6JLKO0@(^j=>V ztDHP6(Y{7j5qeEmSD*AkFJ;i&wWpiFaU1T*YtDj*3$Ppm__Cj)`rWU~RTjK=Cd-$h zRU@rBvwQhSg4dnw|IZ?jy$wAd>0Bm3K)bwt&7CZJy93xW@WJ5V;E=NEX&4xA2!8Z1 zF^PYamXt&e{U0#DtgL8jY6gx#VGb~^;E*!}^?83#47+6fe@uQ*M`3Mhs`31J_@_!8 zRuhv&uqGQF7JBZtrgB_x;u zzH_YWUA_5InBg%X|NnC%nZXAgtK>ccfrYY2E7Z>TeN_34!{== z!_rsJ)7Q{zqnN*60d{z}7sK2EGjgR)DGa`GO>Z`*U^s@qn`!pB26)`|s@Y+oZM;M~ zEG!I$9v=HSVJ|N)(4gT!ay|s)2_z@@EZWwq%==S-9i4}#fp6i4n1D7U&(Mzz&)NCj zFS|#r_P_`w!paKM)IX3$ApjD6pC`XzhgI^HW%CGA3Td_Ue|JG`WNUYJb+ITBY3gJY zC3zLmYiXfv&&~4lZGtC3&3ttgMAXap__kM%Jq}i3Xl8%;6$1fez#-7Au;DmhtO5D+ zD|l=XJMbUC4ggXAz0y;f2kt{PHWNVG!kbedu&}XbXJ){fg@OR49x#FoJy;<7y1SqK zcGK|oZYnBbLTG4f1LLZttqtjCk6#r=z%AdzF;@m@fNo7pOsqHq_8B<3?Z4{KF4Cf| zOn^_Q>dwMa0#d6|5+`T@F|6Q_=#lxqj|9oTl)|Y!?-g&(=CACB>4?W~v5?WnAG;Ah z?%*Km$l#EXD^@sHCJ_{+Z$hQ#H=0C8Ao}X;OG?XTv9Sh{k}~7|hGG#IV`coe95}|% zJp1se=-apFz^O2dx&t)@9Pt-$xPiNnkI(D4`wIu?$gHh?>xakm`5B(b|K<4_a(eL} zhwi}AYjCD;gMT-(JjPM!q*D9F;2lRvVX;@x96S`+U3udx(Z zA@B>qfqQuNcXkDM--L>H>xU1~!0Z9X0T{tXnWzJhH+aCPoO=`)Rh$e*dPy!urIOoKpT0sl^04%m(0U zAbRnQX4yQm5hvIq1{4>_1rHxSgwIu_dNl5bGxf#gWmg2%3XqB=B|@;tYQtdv0L>lV z9Uw5I@#ws|AXC%V*Ox^cDdBgBiH{EzTQ(qX-k3N+tf;8qjB7IP#DZoch8zu}c$)tV z&;|dgwCcDCEdK~!xK$S4Mp@j)xaAgCA)noqvrfwDJ2kbyVeoSKwQfU$E~^$nuzKr) zg6FkpbocX%g@9Z>0{-o9<16g|)I?ZVZc+;p>!Y>N=WfIe?+mQzI~P@HyWNOADPyeh z_fLzmnTF382XdZz9B)_YuqrmmE6WTds$5kw{heuk!q&d)-uXvTo2u!){=KBflXf;$KNOpEs#WA_cZH0o_*17(cYJA zM!$49;tau+rN_MoYi*RnWxwi4Pb_DCY0D8yD5O50nCDJlq`b}yc>_l%R9SdY`KUtmabUt2xfH_@Yh9AX7xK#`Tm z%}_VGjFH`Oyw|IuMwpx168+%o;{pZ0=m#(ch4jW{jS!&LH@3}wG02tGc9TG2)kjNY zm#|`jpH-Ue%(_+!Dx8c-S&M{MuWIyK_ecDe|?@r_ySc*p+VLL8iVBq^x-mjd4oT@$Nsme>d;o%Hd z+s+@6=AlKLV#GLNY-SC#K5is7RQY;4$OXTV#Jbwt4g;APDV!II4}!&_wXb$@h)}=OkWC92{|F zd|{D=SdNVM0`J~q+~J79(B)Q>$!=Evxb@*%L4>c(#P6*aza1!ZRN1w~bttK@1zw3;Gk^8Q%^g1c z+g;&s@9*E1={f)%EUDJ12dhZ!L9IW_km25nicj4V`*3HE9;1%PHrLf212-@nXU^GZ zo16$`a&qT@N!Sg+#AGlNlYu`ud7B7jZZ0YjU01ilngsP0pDHcl`3;tkbmR)BK>5KL zbv>FYdbh1DvlQo(LGY2uWiVM*X!k@Uy~?x4ycZyyO`auDiR`?wa0f;la|o7m;za z9eH`q<;H2BNG^szm1r8<5A z=({Ie`AVHrH4aWFE$4T?eRWv9jfRKnTcW+NF+BtPsDp#=b3CflWs|pWRlMhr1yaWsvel?5nzc$7Qt z9}d<#33!6u84lbrt8v|~EmZgYrQ>-mk~=~gqR8*X$R4yTROE5c5=!!;Uo(Br>#2Z1 zTwDd!2&!M|cg&5g(^I2s@0o@GmyIFzvg`LjDLm$x1!o-vL3HeR$;m(ZP-ioK$Vy9R zW+Gf%>OCnGkDP7O(puKS1zg#)b5x&)pC1!Yl_X=_LHxu|n494G4Q$-f;w8zK2GB3_^VENbSp3rBotDntE-)TDK8O8 z$zN(Ea;9`KvAfgut5YP4-;JjE`R2KpFpas;@Ppz>NZH>l53o|s@lyVr#l{dv3{)uzOp(>k%Lo3;kc(A%^wbj$>Q z8j_U4Xw22|r*;cfBJfRqYUA*e1V;EI8#@btQ*H)V8w~Fe!}Q3l)rNZ6&Wy7f@*8^D zH^&-jhMvCu%^=9kyskd*E$NBW%JCyB&7oiRVfXEGxKT6&R4A-`G|qjCvc7Xk`RT3} zz1n3ud}(Ya(>gs(B@UI6wf#lLq%qR2Bdi|s2y$+@pBEcA7DLt;3L46~HYdpiZBu71 z0}<>$6SNXYKS<@!?sl6Q1eb686_ZsKQ0p15L>wXwp=od)L!uJ+=29E(rbT%R(p)^~L<2kqa}va4 zZ&OpV+q?#fw*<=LUPETW(eVb=SR?{=n0H^f`}FBk7|K98XC^rpZFo*iLGes8COutA zfH|=jTvjlP!2|Syzlzf~xGa}^xirL6eI6R-_f>Z)pL4i644DpAhXC`gGWducrN=e74- z$Q87eT^7&mCJkOH0ft%QHQ(har#r^Ju+-V9lqi=$a#QhE%*=ewJ`ZkIsI~#+|8U#q zI+c_b0a&r#ZPyrjb^#szljXep{NcX8gRKICeq%v;vmQAuHfuLJfBn)WKsk{O~J2!;&*90 zojfjC5neAbiW7S?#nH>!Fa)jZTkXW?^|6LFuyi9Tx#*S2x8vn(gr{+Rz($-}4$2DTq?M zg{+hL5>W48W2AiKKnwS)a-h6N)^2QDEciG$xnEr2Q=e0O>F>E%a6h^*JG-s3^Om@x zVnl4Lx}qX(yf;Wd=;-JT&tI9CNYPABPfz^(i3~MS?*TsH;QSkJ^!E7vz5YDMvT*5A z5W8@9Ij8SOrE;#n%YujT4A~-=gDd8-Ghsr!MB^D|3?~H3+GY!#g zbzYHw>Rk{#G!orAw%g0u-`it0A)nvPtBR7#1OFv>^q|!Tj`W7{zbe{VT2Cg1l*jAw z5mBkB8{6AZ+C)nj@^5pKMdRN&jOypSr^|vZCTqolFFh8gvK)fCtS(*lAgTIS-H&7*^o4MTCZh6^WPE*Z=xxW`k^%gb77YLcA=o#A&60LeKo zK}w`=E2N$^{}GW(%iy3rFc?^Yf1s3WVPT=z2Z1qDO~o~Cm#gWrU+CVLom8E^-k#!h zD^Q56Dfw)EJF%&dfB(Z>ArQ-U`P!eHeLJ3;hHM&mTYPWQ`l$ly=scE-LRZeDpvQn( z0y5{$-d^LIO+82o0e^vb7Z^Cq2WqrKLVUL=h=4U!Rk3n;Z~|%d-=?Hwj+QMom6D~pirX%bI*a;j1#MO_AejUS8LOTCI;#pr;mkok=1>FK1OiWhL zgY)1?ID!*EYDb6kg3!@IFb(vM01n{zwJB$&9I< z1jeC3xItd1D7cD-ZpZ9+YD~HM{Gg(YEQ=&3Kil1W8)@d+yG}h{k~r~qONZM{@81%N z?$psc`>ZdR?7oA&z1TQ7tgj}T-0cECFXy!I(VNlrih3O#rVe`&Ye;M9=;I2~m}T!W zsq@xM(P-*iS*HH&gndzEkzw(|LqoSsw__#*3WjB6qk5MJL+GMTmI>a|V7a|Xq!hE{ zQx!4G9ycHTliikO|4{6#N?OaMqUPS77v67E zQ9kR#)wnAsz$Z~g-(wn}E0^k*ZcUPrewO6=QdZ!EdR=kF$N-XxA@(oP-#HO6^F+6_ zo&4wC-fHW63!D7qSY{e;Z26WK|Oj*tgBzRd8*B|6rrsFzMf#qywk-m2NpD z#*@7MV>yC@fbb0d=ro9v!z5l~6P<+d{iQd3^+03epMScDlRwy|76Fy6JwI9sRbgWG z{V3$PdV6LD0lWC*%z7&Lnh*Eh8kyF^jd+svfK;mDlEbohhID;;3Wow|%QKIy zUj-E3jBDS-LUj|iEy7CmYZ>u9j{d?0JVKR}%w+5N#g&k-$h~-GdgUx}6O;XRH}}UW z!UruoL+Z+}*a-=D&bRA*Xb`MysT@}3l?6e2ubsDF`FdcWb&YjsxWvX+7_T=_#oLSa z%sjstEe|7=PrYB$ew8zz^G_su^AEN>=@F#XA9)ZnKk;;Ml6r;-_zSW8%7cn(Y%Eir zY$MKH`G0!>5cT~vA@p>py$MF!FMmxhwxV#(p5j#ITMtr)-?f1^4a&3YjC1l~wu#l; zIL}g9{TDj&U*qUmS3%GwzOXRo8`d{l(x!Cx?^hV1eEsUMNvWp(*@g`9E=ck|(%}(Z zP%w26{?jLDq-<>&KK`Sb$_!EypDL;XG_crRMekZ!`f7xVyp4)RVkcvf)E}`np89Zn zSY?`6xwnSF z(>_K=`J$lz8uvaVp(9ktz|+?5=#=RE7)kb%5ZOGAjj(luP{iYRUZTS~aS-148a7cM zy2&cTp60FzVJd~tgmNM$FqX<{iNXJ%$R(;NZ_7$Z zNSi2iA8B{!0XgP4t_Iln$sg$7jP5DYp2ckG>Ew?IU0g6QZcp9KL@6dxr^DD(ahQ@L zaBji)&sD;lA|teuGbWf?b@0P8^vPcP<)}+lRR5yvfHLAkIZ;U}i9hPdtp}Oes)V8I z-*c~-5*2C$=|t@?=PTW#WltSnONt}p++NCX&vZmZ-JsseLz?4L0)Vq-cldttJUKw_g2>x{?R$et~Y)PWMB%MO+Q7 zKRJ{S>DL}iK>Z;UtE|LqxQ2y}aAy|XxZ|l|cE~M*rmZaNN0KLQH$wB6GJm^sc#jq# zArU3Fuo$p8?NV+r#ry8v??|!V|H7HncW@V7!^w9E9v$xy$rBreTZI^-c~}z~7iZn0 z_M#;8kGh@J=h?;TA3$)YRK^EmlNydfaYnmM6>mm3@(D450#CA%P~g&fS4JU(fX43@ zrc6IB&(P=x!VJPgI!>lBZ@JK+pVj+^1*ra~5^!D-kFn%p_`~N%IoPgY>L65DYw17q ziL)l6;4V^oSqgW+idX;QD8y?ZlzsxmRma=&uu{Vc*jp~XQ`xT$Wy{i?fvXcPE30u3 zjaNwKmN8n6{LAVna9lo$$3@1)rlk4s6{7%ioBV^Unw-sVO@+!#64X&{@bA@wK5{PV9F zt$_~FV5+)l=YTBx)YMI`{U%>EqU%Vp&nqG_3qKtmc3fx+1j*3(46;GZmq+^RCy;bN zLC4GG;N$1d&&`F|t*f>59<)6$#Hz0SA1E|t!LJhPy`hv?Uw;}h6b22iW$NTC|GsvI z+%zbLVPW#{%~z}KW?8yFwz5eeQ@GB#cfs&DHz&%-2-&MpIeRFCt+myK>TmGuq)+~R z-Z^36k7UWhwKOv}SXWNd^4wj&G23$Q@ouS_yT0SJXvErj5#CK-_S#4uOztUUj~)MX zKu-`L8JMPP%@y}&BSS;w4MQ z#Gro%6eIXDB%7pk2!iyj3^WKqn^@fLuui5uzj^(x<1VP$Z8G>1>+Y zx5cfv;_uPY8p4kC{>G+(*={Xx(e7a6Gxp%Y&ultR+~jaQ+41{SCQ2P7l_jBB9; zaN*A%L+0sIP$1z*z7L(I$?WlRph63|teaX{t^N5UiFw=izvM5V^xWUR zr7?0lP^CoAyaA!l&XKhJv8z zc!I#3+aeG<&?^N-IoKqyaTkn$8!;UgEr{)g`l+jR2ld_dAE++Q7Sh=DZAXPxJefYQ@r zCJh5CF5lP3X+KOW;nbU&oP3ryatoVuXbr645g$H)Fxv#p%C@$p4jGtbxIDypVyJgB zA83&;$9po|&9Ih-WZ3K1d(i*#6R0P!WWy>t5pwhOjwaI59bg1Z`}h$OxKM8Bj z1FA%xhLa;10;v}g5|VO|99iCUCU-wtAwzU_e4LM+{S{OhXn1&fepO(g0wq*|L0(CT zbc-j8k2b6Dv0>xBs%PSlBX!9QlbKV-@m+NfQ8@wqqPEE=6g+&#r;JF2=sw>Haus+* z>9e1$GTuRFa4Jj8hMtFP^T3dGCchy^E=4h76COZLw`<0&wD)1ynv^QruB8&thd~ z_jz^`SX7(enzi#eFJl$CT%qx1R-%7L$bMa`FI;C#UsvZ6?73(TU>v*3;$GI-rp<-o7$%aoNP? zIC%c`L?*j{A>wnV2Ft81y2=yv;&KkY%Gz2fk#UR7_3~zqh&!h~UR{Ik2df!y#0tC$ zA1+>d8oBW&Nanj|OiGtrrHLTCIZI=Zx|-VC)?)7uJ7MZ1IN}@HE z!>dzMLCu$&=mzu6-#a6syVorSF189Xa!b?0DMncsEsqzwTo40k(dmzK`e<)c!X5cf zwoHzYOXbPYGz($(=f=i@Qo->zEp3w3&TI19-vs*R<`{&|BUe}3xphSl&^Bi?p>(wC zSX>&HmwR!rlt@;DHSgoo0mOvMo7ykVYj31GT3NKO#@1gEy)(qLd^@hFXlPyNOCNgA zGS~x)dRF6nE-w1P_4dW-)ym+p&&du^c}VmjZUp{ODP&7xyODWqkCQC~pUQ}2r0Oeu zWMKHPe|X74QsTYeuP>k2RPA|cB`0M?V)Ah>KAXLv@hZ=CJ2D^ueRJmYD1oi{c&$qG zk(-Lv&ywPWoj~lR676&QUpqFc!y>psVpeJfV$F((rYk{*?wHRk+UctO4`x8%C41>T zxgW1xtED~h>etTMQyN8`>eWZScGLdZIr!H*Qdw2|1_^9b${TAXLSYRA3z>XqFq_TPi48Yz=r@sKxDd_L7AqY_woSOWUX3`Q(3A{qQ z2s6uDVj?H!pR8M|J_~r#(kC)9cbS=rntYo1*|$!n?eVimz{oQ@lfE|GzO~$szP|$9 z6A|IU&WlfK6tps;9e)lEYR0BY8A=`PZJ_nq^oUo(Vh;kQ+`8A@s`2qmnwqgR!bxZQ z2`Bk1>t5G|h|!<5>ZX5xl$L74>I*iASFZ+%$>s~ViAiRiT(vo@+w!(%-y-{ZTogot z8(ov7s5DOI33X_=@K{dp3(2-HA=f5FmuHB^;f;yy(TEXsyD>82Epc!;fln0iUK;E% zeEiIH9O!6Ua!S;7o~OOXTOzQp?mW)sy?`}MxLj1!)$MKMuUM>c0Kkdktn-b(x+dCp zhw_4}wEZi{CKX2u9Aq@sTW=WCDiBea?f!k%p0C)z#8j?Qu(T8j_g3iJxeGk@MUa@YN-D9>N;xLgU|CCkoQ7XRWkr(OL{iEKxy41%yCMTufY zQ&Zcfo?|99(^glW&0<$7>2G>({^Dpy9N{Z7@P96>C=@fY8 zRsRX5Y5N|zZD%qH(~7+DpL%SvIH^W5c8!kCh|g73>!StJ`HE~Wwd!BZmTYYe)_)PJ zg71Xh{9PMbwaEB*{U^*yR8;AskUk#82-KOorZf#t2cTV!_w*1V?p71>`U?-Fl5Fye zj{8kbO`T0WO*|@l6{_HhmsXwmIjd=BjI`!6^WpOg*n^#6B>T%|>LE-_VtED1J^e2b zhJ)!BV`JAUYu6`TK7;9A<@y3t%x5>}>qzLJs8F-@ILn~e_SH_-1zeV@%r^^0ApR1} z(Ueqc+Wo6XPFHWrXWr8Z@#62_?wByLYiO`+u$hP-FLALth*kEsvDNTAp8WzTNDkJo zscC6ac`$<2Y&X5FbG1MB_b*Q7X&%j5#>29!Rpum87%Nw%;q^Hto@oE4q^I!B0F$FH z%RH^dd*@*_58PJBd&}{kCwQIdXW#A>wX~m{czJntAiX)l=<*L$C8;Wzktqu|^GHrL zW-40cj{19UX9`R1yHi=|>vgTX;k&WomM#j`WX)KiCf~i@X?9pu=MR~h)!l^~oZ+XW z@FeDCA*cMXvooepj!LxyyONXa+QW*omf+QQ2``dM%VordfmGnN#O5Ly>L;BHLrDQlvABJJ-~Z zzi}7WzOfX^6S%&O(N?Imk;)yaY>rfw#3b0^+juL|dMQ5nK5a^)$kl$lalU{Bzkdb% zHOY6wxuW|73ZC~;f<$;PIgIn~2(GqTZCzpl6E<+&x81g2LfE!E%qwv5tew^%hcU#&v6u zm}t^)nU2cQXg%Wp%?mK-brkF`8;vsqLn`x{yVjP=x+@%mK;6lghj<({3zGV=^;y*I zy0})N7`>BHv)mZGxqF8s+1fJC1FL;knK!W#+$IZFV6Tcia5gp1&O*w{`q3k~ zGJv2>d~gp5R=yFJ#TXeew8QQB9(Y!yQlWe*r|Pa%CTY%KYg=JOw6`A}jU*&wJO9CP z@z-ThiIgqtn@xWZv)Qbb3KmCW9}>_+`XfIQdccIazf#BOy#RGZw`uS{>x}A44^b_s z#C>`H{k6%Crb=JRp{fx>-0H@pz(*5(MOu%ZFm}+d(wprcD*gT=gGdr0v-xRw`Whjt zDB~^q+6l?<$hP!lL_AA8rCe7?sd|$dF$qbO+-FxHd%#^JCs*OhK}Tq2&QPMAQ*qnf zU4@Y|b>mw{mH9%f^3Hdv!qSeXG&Mt`G~VKFkD5-9ky55?iJXHdLirzBm&OPx&r`|0 zlRxgEc)t-~|5aCOP=>oK=Ij$QZa9uua4&+MOK*>@M7IFzV} z(^Cu#aa96@oBP6V3A3|!77QGXeC)^!thmOvWO#T{y+$UZp0@UpQ+jWL&kx)EQ2OI> zD6(z+U-h=5?CxUVNCWiq*aNEP(Aw0(K6D6ZS5S2&S*dg?XBGJ6trI=yWu`m(?N^s7j1DK9ZSAVV#Bm=V2VfEneG~e#_*jkr z2T5Kb>lO90QR_qfTb+__OTO0Gt>Y018Z~8>LKb=W@Mc`U&eRc~KmYow>&|Hs#LdM^ zZ2XzKmL!aTvRJ|OwWI`+r)NDJqE<3GI!=kk#*et)1>JwFOVOyusnGTIs3V!jZHa`J z*YMfKx1V1ZGnw;?F%;CCCW=a8*7K#)T63bMBQ)78Sgf1ey4?_1oq~m5$E48Tr|%ha za^3p9jV~rPHt~QCRX&vz{~^86t})E~u)xa$F4g3#gi;eWjTXemq@j<$MvK%AFpgN-p^<{xIs4Q4|L#roJ?-q)4?p>KH8kqW98U zY3lgy1oQpYV(EXFIVLcXn;R6PN=cZpC)p7mB|^P9?)lI^%8#+LoT=m z^~{!TiQR^mJ`c_`>=0$lvLIQy>~y?CilwmuTm}5XU}xOCY>G+kdTI>p5WLDrAXvQ)wmDbH0RigJnJ0~=-& zg|dN5u!L%T8v9doh>9G+;8!dW_kqJwbDYUUq2Gp^gG0gTT3*yb`xE)_{eoSyxFEPV zfr|uiE!3Mpf9Bc2s50&xJ<{sDR1WD_0|`;lyviM6hubaH0tFN~d!&BW*YmqR?S;;E zW*X?x+;ekp22xyXm6$U7p<)KP$N#@x4%9?MHOVc|h7pjxo8m7B)s?r;}oV~1f8X(7>lX{+B3zI5PlLBQfX!V7LQ@xeGMJ`=7EOc&Z&`} zkv7L4as3bFJ(MrRD^EvepSm2=Oo+IMlBb!10l?|-t^E=VN8|v??z30VknCyxA zvSX1I-a1j%c=i+y`4!8Zy?paibjsb;`cYtBbAKT;#CRjo5_Tgo5-a9OzgDPi-QDk* zQee2yz#dlTPiyQR(bWuPp}B5ydInKgu-obZ6bB2)aP?ECUqao!QR%OM&4aibR-iFx ztWZrWoei7^_;ew63SI5sjfWOg?A*~IM@0w^0N8InTQ33Y04f@q_g?oy2)H32JOJfj zuA5WPbzSq`>StGGMTG;<58!}?*72R=qPK?pIgyLejNZTlYT?cs;1C)p%HBfRkVis|)SYT%SAz`Q2$yZKHWWR#BVZ1O0@*SZW1gT1XduQ2pF_TRrrA$D=DT? zZ`KaQ8-ya^YPkZ;UO}>$U3nm(=9JD)YyReN$ar(Hx=m(IWFrpl^1R42gf8EloW+}E z$YvWMzNe$FFQ113>-gQQiUAZ6u(GfwR~G+Am#F0Awe4+#=g&QXa0DBS933IE7x+pv zaN(&bP}H>2d=B)d)9cp|-3N#UfsaQ}Os};B)#2sMS04Y_Rg)01Ups(CH=uXa3@qB- zVM4e+2OA9)71rL^JxmaVXgDhqlRMC@V6rms+?5f$1hdUK5PMA*d-AZ5F+^CoGc3fSj zJ?EqATYe%vgQf`0@B`+LV*lhAPzrBZQ>@i^(%^18>CcJ>NF2n440y%8{3wi@)fN6HYp%oL$5NvwA6bh+^Dd(T9P|I|EvWUNa z0tpwmI^=(Vs+(0xc7vwUqxnma?x8T+RC5lzM6e|D`XhL9@<3_YQs?IY^TMNF$j%>8xFm95_8 zx^2ap{dQhrdf3?o3XHR+v-g=lHg-UZSM}I6!p-|g4_7}8RxpF@Dp~}-Nb#d!ydc`n z-)^Gy6KKSM(p>9NU37RKNa4a`j5s+k@K!vSY1&Ku_UA7l5K{hiPY#l(MM8#FR^7!j zP~?f1mmFWgZ1JZ2^XKSK1~qkU1%1u~i(m_b^A75Dj<)Bo!3@>Bs)NaBwYbdTk95e=k*w9P^DJ!@Dfd7e^I269BL122z8F%7w|JluH3Pp=5op7|u zC+0aiIk7M?865`86)1xxEopY~&Mls?p`?tAc?jJ=dlLYk#+@C9fU%+kt)v)kCh6zZ zE(Hp(C(+FNoBZ28V$UmFZa1(I)+9r9JeSFLocuR%CA?XUdTbo}ajbp0`T5_VZSHkt z4BUr4>ihSz!QJ-h(-y4K44sV{(2Gp|LJFrqmxeaB8yqaw78VcV<;YldGE?q>JLP_K z92`E0iSl%W=8Zb6`9ZFo#*T%8LJ~lT!*Q}8oC1Cpu)vLGCj-&ZT{K*T=Yf zckk<<^x*Dj>2~?e0l%<9Ry68}T^H_c-~OJ$=49_i3V~M5zBmY?h@Jnd!U{wd2Lcjc zF7&m5?XEkm;E%k;T?l_W!+{0bMRjd0B==?Cyy1_3sjq(y2^}yzeuJJuF#V-nZ{4`F zI1PP)1qE*%#J@CHeD?l!``^MYloLH$eE{JFK`8SBJ`)~LESlndggzMH2{9?SNN8-V zoU3_u&3m730>ut_X?T7@Y;4Y1#KAk^Z6aR3lfxQu!xwQoXQS2IS5X4I)cQ1BoCk~3 z$JD)B3F9J7+8pKGv!6|Os(st%-g^8eCUfrh zW`Dme6!;kI^;riDC)15&b|I=z5!y#^gVBCQt#~0nH2oH*s^WjocN&2}o_QuMq48xt z!*EMu<`Zozli#gj^_Lw?Z=NDE%)$tMYt9355EbS80u8@G^p zA^-7tH*2q4U8VmQp*b(IM0P#{K@Z}qtBRVyRI25{uGuf^VYe~zac^Ex##0b5ggjDa zHSzwkqv`70-7l_AiJFXho=Hrlix-|>&zSR-WF(Nb=D{)W=HKn&r*@-hA`AbgC53Uc zsuHl3kgLNQp`c4!+T)woXTZ}Poc})4nCEu<;#MYnk+EVrXU?qm)E#bamSneAGP>)~ z)+p%Jc>jS^PFf0YnNdzLlg&>?WaLL!qMn5nRimF|H?r4*C4GK)cq8M6C`b4MPV!V9 z4L~<(LtQ;Ric>GxIhxi><>THX{H_@|K~j5sI0U#8xV&5C63{6hp&w4)vG(2msdi@CZDZhNo6olW8bY7 zsb>CBZ^~f%^&dG{d@%jw%w}sn?c--dBsKNPHP6NL;zy5uA8nH6@sd`szRrrIN5z_W~@c}v%IT2mi&>*C_LRt>W}*VJyskjkyhiS5%W6Iz4Hjz z-``7t%~vE$Opn~v!aOum&0F;ly^W?O0f{f$^5h@6V715D$984QK?dvaB}2G78wu^)LI-w8` zBkFyOI70j&E|X7M1QV6|$G)haI4wCE9O=k@hU8Z?TDf~}UMB)q2zWe`QIh^7Y3TpI E00ZOiUjP6A literal 19373 zcmafb1yq$?*X^M@rKGz{B&4NFI;C5X6zNt31f-;-TNpTdA5+Wxlrr|!npX#QgK10&Gj17y@r_~Wv@_8CzdXYf8ghbK~2BCzFKvFVjy6`Ki zZ1vx^i#(}aE3&DE_hc^q#=C`eKRy>ze#yw7gcsj9jAWU?{*H|uee6q4p7wE6cyl2p z`F7ZAr1?^qV_nR$1q{r9o-!W<z5&Ja{T}&V-907uXfgwbLob^SOMuw;8Zdi{mSu?kyLT$cb z02`Nh{B=1uF-9vcyeej7uX;IcOn(!xUv<4E`8#2)sh+|to!<5cEOL>yGK}pC9#mX#j`UH5b}HK)2lp3RgP<>lrgK&UgVWcDIr7?iZMwK-69{;sZ? znc2ZXE`0W2{PS7h#wftsO)v9ty>}oiw>Gn@q_-VjYW7m#&-J+W@D_QzJ#2m4-7|u4 z`t+Q|v1q@yvikP?rR8#qPfbk?DdxM$KGj*% zhfBhglq+bL9I?)N8;;7I1Qe z$@u)E%eD(`<&e!8pS4G#?*Ntw6^rsUb#hh zcz6(hN$O}>TH#@@3+_X?9GHxZ4FBSBbdsW<7rJe^xw$<(J!?P9%Rg9KGu1!Gd2V89 zi3lN~=Jl>$8T|cQWqU^klVZ-#xV5^P2l6F2SUHu;W%0%Z;&^v;>~niDH#-Yy3&J2F zrl@+c#t~Ihb5Ssnmm_HW{=IyTa=M7m(M-U`#s&oYIez`oVBnxOD_Ey@Au;uJj0~DRrv{pGpvjXXmQ6i1E2zKcm=;BwW|?3Q0PWoKcbF-L)b-Smb&X2Hh7LW;Jyq(nj9 zJe>?5A3yv9xx`)k*KSiaOS(N=@zTOhb`v;AWUrw6(MrRS3xjeh?FotxuH!4x3Q=BO zUP(XcaN=sqb7J-cufwJ0$Nih-uYYLX+t^SDx&NYZMS|>!{_=xP+r4=4;s)^s2M1@h zCtQ8}pF8DeiW3Zo6P$@#8tNOOlvL>Bp?R78wo?B(luXF|Xnin&kX7fktzm<+_0dZE znjt~hRGu;g_1NsykK|+ue$TFs4srVBp#@e^(dG8ccIe<5qd1DQz~bPb&BSH$+BDaT z7gV<~>FLU6!Ag11*;&$AKVxvBhK2?>B#ed2!4|N8Y~H_zZS#kLyVzf5h?WJLE+F7D zg@|W<4wTsycUvIJOuPQ2&foXZ&zI#LFiBrUasR>%`68Z~larJ0>wHZ!p8H9`tfou9 z-YK`RaA#+#NYAVWkrjjTGN=q=6TBfz25-B%^fP>ywr?p-D0_s-ESGjzHHcN-KK7#I6AiZS$dcXs60 zB1!n{H%C%O%u-<5=H@)WU%#*+Ktx4b_x5c6;yjlM&uW4qkGppjnPYn$J~V@1)E`U5 ziy#ier0q1$5-p2}Nh(WVl@^X4)-9Rku-qbQdrig6#mvDmIz8>GFcjb7bNk&(#*f?c zZ{9Nm*iT_$gWvt>%tfMgj@DsO15c(p%23hJ?Ck6k%5;?0Zf~xgZ0hV^F1~;NJ|2OM zhU-4zN;#ePeyT{@$ssl|F$o9pBY4AlwRUm**w?GL&!6*eSIR*+?QW|4b78ucUYPZM z2@LePJMJ|tzgmqHjhMxLVYx?SIs;;3tL~Mis;VkjR&ECi1x-+{UW3~11`2v!{8pI+a^`+Tda;--(8`@4fY9=%a6 zP6g3dX!>bh_U-4=lwK&C@5@e`G;LW~S(cXBPn2ZN8mzTPjh>qY-TO;*9@#F9ft364 zbCs5S+U3KA;{>5nQS2RyYmHyvQg=e_wBk@!88S?9a!!w=%RN0k-3737IvKUqtXm9g70c4TUsS5{3_$+OOMo9nnXjY4`Wajf9zP7+M?`^6rtEA( zuhltXbkC2Z9|8gbhIQ^@0y1(#bUCNc+18PVxTK_;s;Y*pP`+Pf;h!*vXOwfhqki|) zU^I9(Bexa{Sq!}V74gnJ&4oK#!QP@OT;B4R{#Fx z=Hbb1jT{*niMZugQc$qDjo9xD#zKOW>)cI5irzom9%^c8ru$sX-C*p7yh7>o(kM>S z|J0A&`~p17yk}e9OL`x!I_+Ah-@S^~)mETx`l9F|I|s+3$c?82s`5j^XxS=m$L+nhmG2scC#R<9M(>O^AE;4(TUBMO zWc0_-$1L|%v{|4d27J}7a^6;>Zg$<*&1xH4jyzbZPS&w{fW|G4r15yI55&2rL6?QJ zuB46q?v8^&b_Y04mT~^JH#Mv3V@E}>c=VT1uaS~JxOCUvzUJm@1?qWt{9OusUz;Sl zQKb-X5Yzo0u9Za}s!Y34Plf;zv74))qoG*^+ZXaWSFPV6N3YhNI`eCxbez)ZwRaYz z@rSU-iFs6LjK7hESL^B8#>T~3e+&{9IXdYp70MMGSF?=;uYun@iLRX1it?TY|NkfC@WWMV7GlF`f zXVJVoJond|>A3+vR@6zptl7CYn4RVlXnya~;?1qG@@)y!IDOR34p zUROsZ>qfM`!*&Ha#NiveyNz~GUaq{F8Z89{1qq4l{Cq2Lk@4lPPTjr_*PAvor3N5$ z2L?)siM6K*d+|CfecP;WW+8wqEH0KAHWxln^Rv)VFK$-tGq4`PB%weJ0DuUJ@uJuqv zK6st-M)t*4ak@T{B5cqDu zi{o|KnH(A#O5iZEpQ{LTzkYfy#aT@$#uH$JRam&Vxa1Uk`}U2SlarH&N7(Da*4eo#IyyQxcl~^K zCXQQ{NC#jiU0u|`3b2aM(9lo=$FpT3D=KDiNa0~Wm6sobxjBNBnhy+Lq{dp;1bl(R zUem&GWAW^foq^#l)5eO+`ECQjaWKEiGTcXF0 z>vlvKOjNiP| z&zuyXW`ssLnsKXmJbOrsX16D{x?znd9D@nx33(t5c^BTSDjOakmYdJ@E+% z6>1S7Nl8iL)=sm<`RzSAy1KY1dU{Zk&Y;v+AH=Dn^&4G>ySovFQN|+`)_ zF6)j{F6LP5v4UX;vQr!uL@%?dw%(!?F>*AYS&tMYjN)>TnTHq>`*MDjnbA^LSFiG2 zV@UUQ+8BB+RngzykAoTrSO#@;)Md)>(9p@r$yaA3rHHc|rUBJS<5jP2u5_Q?2(nuH zMPhy@+JN@9qG#4Jp>faY1{Q?l6Q|{Azo-5Dxp;f_va0%!$6}+E(AUBuZ{sHeq50yd zVq@o2_FD`x3m&kHt5bDYS|14V*lnT zxWmQ8#Sm{StjM;uwyb|fTia{XV_Hp>N#o0d#g{K%;!hEac)tpl)~kLWmykecnDkYD zQczwd*w5IA`S;k1%8VC8)${N78nq4MHsUU~3MLlajg5Z^Nazi=<+J`N{w`&NghA|l zu{Wn#q=kThAV>QhFub1L-e--lu&|SplOPkEoSxpEZ9l`o5nC&JTWQ%HicjHtMFsH& zK^i1%t@7GXVgRz&LEK?xX2!cO{t^_#{0_>+j8Kayx zVfN36bJnxhRSjrwZ(qANucv6u$?2MysO%5?gQH=aJYKAwiVQ+vRmiidGK0pC4^iQz z@t@-A)a}#Kee*h#)F=?co?z%Lwq1^}ET0d@s;o zj+2+Fr_P_fc$Ek8jBW3)aTK%q@fWwEH!{-SP9a2oCF9e6vCddvgx9JOYQBS z7IOOvghfP_`ujuLjdk?&4i_5}SX;d=?QLvq5CdK~t@Qyk-}F6d#MVr2WsDsUHGDs4 z$xF>pQ*(W5>*~Au(O-*h#>-#w(#t%0zW3J&0ikzJImefm%T?CTj@Lfk-<$*eV2xc$ zY2VP$5G=*g{QNrK`y23P`%ecrFBv%+K%#+219H~QZdohHM>%$T z;5GW*Y%_r51qT=y>PJyVn`5`d z*&--JUY1oTU8XfT?5WXFZPt8lL(1yx8l)5rk)_2|_!$wt`UA|N3S(?xAu|~nnbbZ! zJUmFBpT#p}Ibh(S_on&zd7yI0Z?c?-xj8ur_}rWU^i*pHt#SM#-eelZUZ|6} zZr69s#_0H-Ld3hy|1^V=p>ju4^CtY|&3lfQTwD(xZKlFyEGrt;ZnaL%&MDm1YGCms zd5iJUJPnDB`Uu>-i*Mi1KfQ)Pw%~(T@^v(c(1VhabTy@(*A`}R?;7b%*vmwaJ{Mxk zzd;C2z0C-YUy;Z&0h9tzeI2iYdPZ<>Ad`OlXjZNRq#R-AEo{RV$jn-FV6&wvarkJa zIaxSxu+WEfa~<$xaf|X?w&TZ;2hmUaym|8mXg(V&E5E_smeMki`$)+d<4sm1)DAP!z#`!t8WEAA`^54`qnC8Bw%<+@r&)_zkln1SN^v<4El#b{G9>3 zU9q<&_918W8>y0fmRQE|#Le<>P3Go;g*DWy>`Xnr-;;Opw0|9Dk7ytc9q@8*6Svj} zaijCyRB;SZk>_XKc!=yv9oQgWUve$58$I0p?M@`*h!F6q=`A<=cI93o6X}eKR(9$> zyx%#Pz_A{rk*C6#%;#Xql?bAwLOkoA(`!kX`tqgqpo^GY#${HA+l__|nx`nX`z$Y) z>|Hqs!V&K*$u}K+-*MJFCoY|ufb*9*Z%`wHgM*WznkoZ{=JDbFNpC4G-rBOt@?X$7 zbdtF3cZqd~ul4z8a2ky%4ehmZxV<`{T_+%bI8JnZ89F|g9#+uPlf$oPP*jz5fl!(? z05TQ*Vll4EGl5@AP7Wn{!>Jw}QNp9k4Gk@9c6Ju1SKHD_nndkH`*!9ABv?#wSJU5# z2nd`?ilsli^5aUB9BD5sG%6~Jqfjah!VlD7Fl&I$&Hek7Vx`$lSziy|jikuQ$~rnb z?@i>50+OMpLe#GML64G8w+eSz*SZQ7^*t$>LAr3G3dekHJ;wB_9D(N(!Wz>9dMnE8MW*X3vPlb$Wh&?m|?x_4Vk-j~}iFDJ5$qDC?u{ zI|Lkvp1q2xdW80WlOE4yLVaT5hZ1|l^wv2I?sFU1X3NR@K|%lE9r!Cifg zKL@W5GHS^{5_aINL8u1G#Y~ye;o;$9yo}$BJ>S-JKt?!1z8~J)!XFzT@7|nkpDM+L z;7SSn5vu7{cEhB_v$9sR*5Jv8QNQTk)Kk_Wl6SVF7P_tP-Kon zg>>yImfVIo?u0p8b~CG4#?Y)ajqf1Iv`qZ|jU6HhltT{>4?4QCbT|GHOgNRFvjIq0 zBk7_>)X}6sfGsygQEmWII8e%0R#qHZ@8hvefWlt8?0X9;25|n3jkiA)lfN1x;GtRo zW(>GK8#_BeSa%nV{t1t@H3pF0o(|+-V|$WhL0Y=GJXDSi`TF&1NJ!?yw&>&CN5JOd z+4QQatFg!g&iWbBA+No??@rbSLB>vevysGO)ADd*(=_lwV}adjnv*M`bD!7JMO^&z zO+LQBYKLdNy<5c-`4c2M zQ4x`}p@dx%nW)%U=gkqa@<|E$Dd9s%Mo!L`Zc`~~X@FxY=JxLH?f_3;Sur-{@SJjS zYKW~}jCDbQtTdfzn@)IMy*X`vHjJdGp|%b}V!H1QQ*;`qNeAFC77+kABqt`yx2e0g?`JJj_uboAjCmG!~24bC!vCw064Lw4+D~aGE+t zlRq7SYtCft9=5@>H|CZX(R44f9_-XgA&wv+)PLNR$I=C5he%R>YJ;B6PMTM*ehgby z&e=L~p@a(W;bmrR8pLF1lQGvA=*?S}@7rFK1T07B;9YJOjzLyP9gQbv1cOIz4f~_q z+dm_W^Diwealx(f*i3^m#o6KV^4Qo1fFRAU(!ob(`_RiyEYZ6o@C8t{@lGY2FPn={ zJza3C%E}z9tmw@<0u%<_Q2U93UKjD>Trv?%awtDXVf}jd-45aBhNQL5<@0p%SWj1* zB4-Xdy6&kdO;6izl*3ssy`Vf{wyskS?b(1&4<~n;yK2U5v|5yX{`|S+{sIcXH&`8j z2{i3RxyfiBFZK`ilfPmq-gzrhyT?>k`03H}{NuFVMHc|zTfZ~CMV7m}>A1LX%b4Nu zZ)+|t<}d0GOBnz*1jGFW)uC89-oVYYu)pLX*RBH-hFQ#;O(lVin-gbBvXg|tl;G*gJOlf3M?Imb#PwwNl6Y`qy!RgU!C z7+UrBN7FBbKzbr;um1#x_}sd3u&ql=8!k6qil{ElTz1B>h?;U$Q;4ixUERgSU!Ze{ z<(%USdUEedA>cdjCrZz!RA@`-f2x*_%Qn0DoeA{ZLTG@sozoW~=dGAVH?QSp=G@Vp&Uaue zg}}k1-D?q(?qR^&XgPIk1>izx1FieyZ52j0Z2YYg@r%g6l`Iqt5afoAGOm! z`UZ%dR#n_Fj3(dRxZUe(!;!+g%4)Lr^_4PQQsAp?naI0j;wbaDtNXUFzPh@0=qDoD z`gdKy&}wV_ZRHKlwRq<2(3{>_oyK3kPIk*izpvlljS%8#IM#n=)3X=gPyBlxTvZXi zzj%9ab-c`~8(ZhSD3jGNkmMBKLJ+5Y-=vg-2$6|YTUgj)(bn~S^f3{9Oi??ww*J3f z0Dbn_OUcLa@xF?RkhnN?hdm?1)?W3v9YME;T94B_+z|7rLicTN7MA-nXFo`W%4@}N zYJyhZ-ifL6%U{2gJ34!t+*L`4+<{U?N}b;6Axv9PfWt|&<9<(7Vr{lLtp1Xl8y%w= z3zA@OzJI&lRsYfNc*ngdNq(FJkW6wxSKHCFa=STec?t8L9w(VTAjb2!bS$ZBPwHum z-iXH4dGbUmX}{yNO5oU(-y|f^y4b-lDsA~BzxX<{I8Tia`}*=QVJO9;SSE5*CEJw6-w_(WMQty6l&(xJDr? zP-N6f&P|LDk?jnlJoMH`i83~|`f<2w7S&Ghl6(KhPc*}+uTzY8G>QjbaXcO$237AP zc5efFS5e$Gv6StLYl~z^MGR;OP%FyzwHL<+$k@WVzpLl9{3?IZH^PpE=0z5;IVxHS z7+lAIJjcsQ+odM;;YT^t1f`W2a!E}f6o)(`Mk5T(*92sVRAnOeYv4^oQtboI+qZ8Q zTkN18L<;h%^l!iEU0uniFrVtwzo&ZHZQ4JQ`nbPvo&M(2vY+zp{U!IhBGVX^Jf3yE zDU9*52)RE~+pbqKDFotvb##ArRbu2K01KHzxn1h1qLyvcvc3JYzeIPT(VbuOBHTzy z5-!Y{yxUboC0(|%Ev^w86on{dq2EFU!-EMM3aQ9&wh`uj_q1f%dD~df7uy-&034Z@ zId_>7*SFDuKqN%O&6BCk@yannm^n(^<32dURIoMt{zQS185Y9G{F$RQcJX!#hgAo% zJ1yqHuipTK$iiKRMXa05+3^m6C<#PC0SakJqTlE2X(RGQ!3fsG8TuC zcqF-s)?qXQwtx8xAusyg9yP{aUVJ)wZ~-thGUB@Tf@0VTm>sFcL_Z z)6UNNXHv21BkLa|yVlsjp`o??Aj{XODp&kwdAJl*L@1B=&J8b_%9xeoY`F?$BaS5vT?m}}z3;H3sxnD*T0K+yi>L1Jg5{$F` z{)}Fgf=a7nU4DnAOMY*U_WaX3x`G0S0l`5=x1isV&j{GDg)UTKiW>0mb9+N*bT5YM+If@-9!|u(( z)Y`ZAMYkDqmwnvWc-=EUFlE~n-8M~thz?<3`0?sk(f2iE=m(6w zeMS-5$4zl{svHs>;|}Ci^|us03iYrD@`)uGXiyfUu> zx5h5u3w%=tc2)WQP|pBaAThDHG3Afs+H)itBiSy#XJb8C;hJ%muTHweIOf5Eq6Kyx zWGop55qNy4m~C-T5J;fAziTqLouMrIPsB%t>SKwz|BFju9IVUlnfN>znx16)$=M`9)HO?B>y-=LSeP>>0&~kU(9rlvLkksYEHqxw@==fMSl6)JF zz;N?8c19SOG(g5{Zf?dR7h<#v0~M_ybFT1j-{M){c5I%;ZSwJ&nwG!f;u;5bmfyb} z0Tf*D92FEv2i(QM+}s@K=|>- zg@PC$maA5vQJ9oO49N#*;M!ThpaDTDG_H}~>tc^aCIZ-iyu5C~Khxbu^FLjFS!41V z)Hv%K8i=1iKR;N!?Fd9;WBe8>MZ%&Go=pQu(H5&B#gs83j9xEsRl$@OW`Sa&poiD3Bu|h5Jdpua@XZa=( zkQ(diCY6#TZAG|WDsaEJRxd9nd*!$SYI`{!!2$%e4@sS5#bjQv-bjduuCA|-cV<#m zzjMR@`d(gMj){p0icoNf=&wF*phu6c9)A^-1Dg{_TK4hbak8{P;@O_7%#)>6TS^CV zslPvjKBnKC3l0{x569`vn{O>GzN<@xv)7nh7S%jFh?VYhMgjOerNh2PDg0>`jjjvNMUeL z@95{Jh0|ij*5TP^FE?M`2cQ$o%lS1>(xu?4KU23NB5iA5YVYkuf{2StH2fyP8?OL@ zqvpMo)PL4kG;)>Q1PDNF1X^RK@EWWA0^{a@TTx4_T|~I~%_mA3N=ECt4y$;TS$-v8 z`czd{ht_}0^MHCGQv;n=y00+Il`~nmPBXI9D*u{1IKv4mT;i`Q^34ILgV)f^&R(i% zpNlaYCV}rcOew-> zV`JdI#m76|dp^S$2%ng7k6ycScXWb9gexw|WU24VG!>i|(i(%5`S}qE68PT8jg+!z zuRQq3%6%$kRoQdBOrnx7o?`Cnj~>>>!{p$?)nS!Y47|Oh5@`{O`;Kc|PRWHUB>ZVO z=*}A%D|lsvo*3Ta!ws?^lO1Pslkxfc{Cxl2nM{THzG`YB=s|OLH_ZqyPVT|F!rU)6 zbN9w7Zn^uS3;6|1+LjjFj~_$Q(z+(p)$|u6UkL#<)ADD|1KA^DFB=Dgp_^^g^rWpo zOWMLKA1>|Kz(87Ft*opt{e&jsv1cm=bF*4s!(`gbJF=v(@#&J4gK8@)1OEP{zv(jX zC^b;gfS;Q)Hib<~D?7yx>@=%v?~%TE4IdN)0Toz`@f?np?^m8qt7rX=8|bvO{@FBV z+i;;|2cX8Zk9%S}Gb!tN8IOn8S6jZltq9ezHf;VL<$G~)fm>htUf#A?|C!8Bd>+P+ z>ru%V_lL3+{QdPGztbD6{RVm54xa>i!%2iqj#;F|(?{D0ML>YrcFnUA5waturGtq? zvarC$N010=8Ue3&v=i=gz^7qE-rHePP5dMhqcShIsEgLqBmZyclmyut63WU=r<3%T zq01;~X%&~@J&{NZ3`Crey*=}8R&7}mlZ-N~`x`MO%)1NduD8^mqv>K8G_7%EQ+4c%<%m}cm$YWI9399q<|t8c?6m6SCMwhI(nVIGdXREX6Fa|8neR@ zJ&3-Qd1Uz6YSVFI!@@25@g3Po0>{xvkEyL7fG^Ru#Xo;;0Qho$e-HIuleG>AJro$h z?->*CuBi^E)0(qA*gq?M237hQ!>9^`sGsthk#=sBnXeUMv&9$eMw3*P-QF+H>8|l+0K{Lc-7Q5r{JMrz9NLBse%G0Dc%7AFU@C0Y7xB zp+adt&HaX6eay2P5T{DZVJ>cNV4h0l|F{9FMi#^j1j6*hR9fP6r$EUMu?PiU za}(5;8eD8f(}eq{)GQzLS>tohJe@p@A#7?%>);F}>^@jEjBlEs7 zcQ6^>Q*(1nZ@<~`y&E9~PXlV{K;!@T@$|6eR_W(!b936TZh1w;X1_<@rdW=&g(%m5 zn>BD0*tnTg`6q$G7#sUbrx@5)l$DivlT*{vDL~HAf4niD!7vNvy|6Qdee*T}0vS>8 zqvI_J9_6MG8uR`wNvApg&Q{QxnS});ZKjF3k`g=1=JeN|o(;||Sy8T_V*02`Q|=R`!<@BHO+ z2e_5;CUW6iWj9%N(tul4s@#b$_jLWIpbe2ADSnZsk>o}L)uE8wW5VE^CWVK6^Zjz! zpp18Ybw6BOe7s?cx5rYGhvcji2S=Gg0(;za@a#a5UnCy~hq9-tgVZ$_FkWn|t%3MY zEgd0COMNmtJlszJj4K~Ri7OQexUZB+-=IH zTb2I-2Dl!83doxb1kQk5?_<2cD)ld+nFmQZyFulh9(&Lsv)YG59)RQNK3s+jE649q zTx;$Hf6Nxtw`~MV4hr(E6}N)IASmbbgwIS*v+GuUwKDGv!r&%W^pF*l>NLQYSmfbn zJ}5TX==yVhfgAhEw%3ngmfvf z7n=CrSZZrp`{oI0i;0OnK|D}+23{bRo4?fzzuoezPn;@{Mo^19<44)N28!Nev(?=2 z7pbRF*x2j>0|vmCgoFuwms??g%j+4NmD#038)O`U%lFNZ(b3Uuv0B_^X@0vQfl44* zdrwP3gB{Y%aE9qvPtC8=@3XF5MwbVicEmy+;|JUvZqEs+W2E6ee!TjN=6;2(`6YCp zmA9sU)>ZONQZcKe)933`=nTIauCWsJrzB!o`OobECVM({ZdiffNW6cJgqM~E^v%X> z>a&&ez`lno?@$_sv~)%ulD)l(*2T}Y8arc?v5vSFYwoQnw3b`UmU{wfY8Bc1*%6*d zO_3t+V_05?AQ(7^E?&422nhbIqImdXCR9I?1F9Sh)NmK-;ndij*i1%9>ps8*PP!T| zq+ULUM%=yR@gW=ii7>Xc)>9aLtEr_WzvHt@3&CX~tha=3jqWcfh|Vus)edhF++Xae zQL+^bf$uWy>xU5pc6dmJ)Yw*RObYsHZ$KuM3M05#I)^16IE6v2S8=wylY$3SubAyy zpD6hHpxU+n+z2KnMNoHGW+5so8x;f67jf*6*VHiM_#;E;JHji(k_#CVnLjsNk~*U& zS{elb)omC)af-Sqv58}N-5c2{Ly;M!Ql4r<4yBEcKN^#9T$8QL9>aJJt5*X_K)b#^ z8s>A--Eb1qCakLd)D7#=;=(4$_+>%=YeW#69wjR}c-eM`yfx>?$DoPDQYIVPOu}yX z32y$~7tXG>+Lx76fHhQR- zY;HP$=YB_Yn0`W3fL_dcjaOc4-~i!aewM!7${7@bFSsH#1KkM2 zG2w<>NPmmgtj^9peW!gaLlVaOCs=eSlJDOu2L?b;_Q+sl7H9p>`S zVT+BOg_>o{EJ4z~jyd7sPdVP0vu&RE;=o7!6&Ef#dfO!4NLt{Q6(<+0f&KNotUg{HYh~Fw2Tg=AnHnDgg9?-bZ5jxH_ zlnD26qiSS}OzfXk@w>-0)Wa6d${Ps{gXu}T*(XeNp;ak;(glHEcE1g9q60$5j1^*> zr;kEc9AAM774RrI3*5&ji}1T0=!aRs{cEkw@CUB&;&$0&lsac{2rPD0^sTuSP5jL zrRQg7iHM2W_3NVaD8||Uv)d`o^VSa}>*?ufbVReYzG&-nj(fgZobLch0q=1lD5wAU z!KznNT>6k|4xERVuLt@^MnD<22KZb74^B?jd+Wn3oT*X={N*exEWmB_;|I~YkF-iT zn|WUpRgqT7K!3k#^8jcmJ6LW_|Ni|u08eCOiW|4Lw+{1FA-`mSGJ+MWYiW0Tu^$o= z0&o%Vt-*dWw)2q{1oM~R?Hs}BSb8TJ_p#!sBt{U*`Kwc{G*;I++sB~u7A5i#;@b!vc5 zXM3PYNout}FiV66kP<53$54=$|9k8X>mU*LT20e0jt7AS@&V{tX@$#>6kyt-3oLn4aMg z5eY!I8a_S(@GeIEsn>;17@PuQdfKvFCoCsxn@#5zB^VqWhoF-T0HlH2Z!1DIfv2+{ zH%Fe@jezI^%#1&HY=GT?dee(W`dh}tww9LG(~Fe`X0Gfv?{L%#x&JSE)gx z?!q77_Stp|nQt3ZK49sUEy~!LNCn+)PeSo`x*90`F zVqbqrSOy_9V`-4%#f#`!I)X6JNqRNN(W;@P1%eoG9jWW-kw8Fa9%vLu1D0iTu9@Pu zr{^<9&(?vv_Nj#kcposyh1>zhyT84ZL8+D@@mgv7w6pUbF~G#sG%GK!clB73S{1A{ zU@1@F0_{pA2#}8Zdms^No3@e*J@#gXT_ggHGaq~OC!EJM6==l*9_%MmCx~bP0TLj< zf{J@#VId>lK$cV(nB7PU(Fg`r6d-V>1Az&$06ON@=KIUuBXlOD5s^7J^jj|hGYK#r z{CHt@c76_Y%0bJ@WT9!G4-Wx$Gdv73#{<-%HTwF0m_LQLFZbq7CzM4&%P0{Mk?mZ? zI_R${3pU)@vE{u5UO=!>$CZv6UH2<$YCzn_#K34SV>HG(A;$;$;_aVc3a-RA#Nj=g zr$)`5xtW=&+S&{RVKBx({sk_R96_}49|HpeFsC(oy1KBht*y61@UtKE&&RHh$`wb> ze!STL%K!-86_u5WZ{7&y(iE_?O;5+m&d$v}Ipz;hk&(ZKhUx-?I#B*|PT#UlBT;x~ zl$I*xs)6IvM117e()mBqQ&F{#jg^BM2x0EuEs%z=QGl;`eqQ&^7n)!S;@R&KJwD*% zg~$RcsjMt0T6|Jr#6yPvLW2zXDwzfJU?H!IVwMzEsiLTUEGZNSWPN=-PQN`k%#UG! z#R*X67+4mEzPgT5;=w*r~z@Rwy?Y7d7oY=#K^NMo_LOb*#`` z(F0Gct2$g%P#VkPwf<}+;_rHJRkrFeSbnp%uHN2FKwSW0DhRm1nGbXY9&T<>XGlm* z-QU~{2D1(7@1-~0x%o_AI+*YV`T_-mJnVvg##5f1o`QriF*9=rJYY&nnEV`|Bl!}T z@qqJN#C2~L^oPr7KNt0Fiiw#3aRZbBv`Tby@O_E#B~nZSCc(^m+^4rK{Z@?U`nbSSBm+o6^keQKg}-z-qHz7T$gim#B0hk137;}bGOTLa$6mnjbzXf_TPk4vF4fa!GgNJ~Pf4u7kB z{bt+X{a+{{MK%5xah*nj;^MY8$WC_6XC3tDXk# zbGLl&7lpW=A@@WeAi|xUQ8J@GJlwjJ!yy@OD*dVi0@G~GzRO0M@X>@axHux>FAKCu z!3vsu9m$Ar&9hdR+e?YjGzdi4tK$=#;;30njLDrlCpSDQ!r56yj>vljRh+XOI=zJM z&sZW57ncmR_AdAx;Lg=xr3M1@4Tn)Y^WOu^(@hB_OyocnL(H|mAp``!-OCvj250D` zsH0^6b<0}Gy@kjLXblY+B^ay(vQl<|2xx$qot&(!E96Jcqx$-;timNGwrxthXa48i zoYb7oZk!Bq{Bok(+G?9ES83H?hP0imbH2xWB^Z!OrlZ?3f{yI}{AJrPhO>*wfxZgv z-^3J#7!=?d;H{bCCTCMlgpH(tOUD9gBzzOo>ufO%JRu)c4#TGM^7rqtu_54Ut77t~ zb#;t_Do~*-DZthSdw{5)Lo;l)OupSK^$O9xY{jeF3Y4j;fXr)Url(>9qVAtRf7~zr z)ocI~Gys>EmzNHwCS17~%r#^V*|jwn+s!2Ot@N76-@zkOu*9 zb`b8|ho~=0%|oKd~2(fA+~&sV-vcEY&qvB`MG z|CAUiDzYZF0icmpRHQqlp{52Y2n6Q`kgP$K6l4Ki9UWRaIvj*j!{(i>E!n&Y@H0L@ zd(H%}Hd^BsMfyHbP}q%n8rZHVBr@Im3I9LQ6C4k^12%_~H`mu)0Gw=S5O7M!BB}%h zI2AkxSAbOK=H{4~m_P&6c==Jz|A6;7qQ=62k+2f5@bH{J+}|D_ADjFB&&q5+aAZ7n zw^32E$?NGRw#kNeEXDtCk|`|fDNkTi;c^!-YT{8V2rP|NH@fqT*tDBUXYVcGW zMM4S&Eep@AF@w!O-8pA}Z?BI)O<1WslO@r7 z_bw*&pQHlLUu7RJpbh{_(UpyX>`83^%C~tF$)J+V`ESM$l57GfrKCuzQi8qML7?-$ zl-uazZBW&HvkDp%NRQ?Ds3+>2FS|_3nL%L}1tTDUS82J?Z4`iI(1!>>6d}8Qo9c%d zaeG>YIMM^iNa;=A$K8Dp?M40$mMD_vS5=*X`ab}5G=B$xE7zdGxuB{lcD9JIr}+D9 zUzr#)0Nkjkq-5B%oIvgtZu+TiOG-NQ0cVZaGYw%ux zA$j?ss&<010jP4Dr?VyhXZ2~mz(pFKcWRS9PgecyUMKqd;hhZEr|f((z!d_fFXsUF zi8?m3dEOU>^a3XDd$~$u|Hr+LZrq4qXJ_~IJGf;Z0!s(Mizk3PK{8CFX37f)INZ_Z19l7CPjt2I1|5s>>z6Oz zq}ei}Xq|~IlQB92&5ixHK7rQ8C!5c$icuGdzxD9(gN<`PFPaq{cV>N^;)>Otc7J03 zzjR!gzTIrQ`jcP*(a-mlff;Yzx^a?$z@(em^I!UAwlOPxjRF&%l0$QfTB-Nzv{t^6NkY%e-1r zzqZX+EKC3ag}Sd^2da;P_AlRKlo024JX)p_B_!@2X!mjXV&=!knSZ|6R9MN!zGv^j zDR#Iwi0W&{9hjnqIxJ-OMukB>D@pMIzesNsf$ zoL$Q)ua1s}*xey>^qO6mA|oF>Vfp<0^s~padO%}7n^s7O`@6F^)}pG_0K0j12_u| z9A5?QqMB*{*ao;D4me+(eeCG!m5pCtD@JTAXPnHryUa0AFeSaYle3~~-#OrXvfY1Q zLp%A5Eo{BrM<+~XE-U-+fbm>%w0O<>9o%)#re_co+(E?Lgp&;IhIfWU 1D algorithm and hypothesis that will be applied for meshing (logically) vertical edges of the prism (which connect the top and the base faces of the prism). In the sample picture above these are - "Regular_1D" algorithm and "Nb. Segments_1" hypothesis. + "Regular_1D" algorithm and "Nb. Segments" hypothesis named "Vertical + Nb. Segments".
      The \b Local algorithms and hypotheses to be chosen at @@ -51,9 +52,9 @@ The \b Local algorithms and hypotheses to be chosen at meshing the top and the base prism faces. These faces can be meshed with any type of 2D elements: quadrangles, triangles, polygons or their mix. It is enough to define a sub-mesh on either the top or the base - face. In the sample picture above, "BLSURF" algorithm meshes - "Face_1" base surface with triangles. (1D algorithm is not - assigned as "BLSURF" does not require divided edges to create a 2D mesh.) + face. In the sample picture above, "NETGEN_1D2D" algorithm meshes + "bottom disk" face with triangles. (1D algorithm is not + assigned as "NETGEN_1D2D" does not require divided edges to create a 2D mesh.)
    • Optionally you can define a 1D sub-mesh on some vertical edges of stacked prisms, which will override the global 1D hypothesis mentioned diff --git a/doc/salome/gui/SMESH/input/quad_ijk_algo.doc b/doc/salome/gui/SMESH/input/quad_ijk_algo.doc index 1ba49dd83..90e7eea94 100644 --- a/doc/salome/gui/SMESH/input/quad_ijk_algo.doc +++ b/doc/salome/gui/SMESH/input/quad_ijk_algo.doc @@ -20,8 +20,8 @@ The algorithm treats any face as quadrangle. If a face is bound by more than four edges, four most sharp vertices are considered as corners of the quadrangle and all edges between these vertices are treated as quadrangle sides. In the case of three edges, the vertex -specified by the user is considered as a degenerated side of the -quadrangle. +specified by the user is considered as a fourth degenerated side of the +quadrangle. \image html quad_meshes.png "Algorithm generates a structured mesh on complex faces provided that edges are properly discretized" diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index d2413b564..5c0a5af0f 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -1330,7 +1330,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) // update state of sub-meshes (mostly in order to erase improper errors) SMESH_subMesh* sm = myHelper->GetMesh()->GetSubMesh( thePrism.myShape3D ); - SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/false); + SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true); while ( smIt->more() ) { sm = smIt->next(); diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 51a639869..06aa33a57 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -1868,7 +1868,7 @@ StdMeshers_ProjectionUtils::GetPropagationEdge( SMESH_Mesh* aMes int prevChainSize = aChain.Extent(); if ( aChain.Add(anOppE) > prevChainSize ) { // ... anOppE is not in aChain // Add found edge to the chain oriented so that to - // have it co-directed with a forward MainEdge + // have it co-directed with a fromEdge TopAbs_Orientation ori = anE.Orientation(); if ( anOppE.Orientation() == fourEdges[found].Orientation() ) ori = TopAbs::Reverse( ori ); @@ -1931,7 +1931,7 @@ FindMatchingNodesOnFaces( const TopoDS_Face& face1, helper1.SetSubShape( face1 ); helper2.SetSubShape( face2 ); - if ( helper1.HasSeam() != helper2.HasSeam() ) + if ( helper1.HasRealSeam() != helper2.HasRealSeam() ) RETURN_BAD_RESULT("Different faces' geometry"); // Data to call SMESH_MeshEditor::FindMatchingNodes(): diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 66c893628..648510c94 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -821,8 +821,8 @@ namespace { // find trsf const int totNbSeg = 50; vector< gp_XY > srcPnts, tgtPnts; - srcPnts.resize( totNbSeg ); - tgtPnts.resize( totNbSeg ); + srcPnts.reserve( totNbSeg ); + tgtPnts.reserve( totNbSeg ); for ( size_t iW = 0; iW < srcWires.size(); ++iW ) { const double minSegLen = srcWires[iW]->Length() / totNbSeg; @@ -1392,10 +1392,19 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& } } } - else if ( nbEdgesInWires.front() == 1 ) + else if ( nbEdgesInWires.front() == 1 ) // a sole edge in a wire { - // TODO::Compare orientation of curves in a sole edge - //RETURN_BAD_RESULT("Not implemented case"); + TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front(); + for ( size_t iW = 0; iW < srcWires.size(); ++iW ) + { + StdMeshers_FaceSidePtr srcWire = srcWires[iW]; + for ( int iE = 0; iE < srcWire->NbEdges(); ++iE ) + if ( srcE1.IsSame( srcWire->Edge( iE ))) + { + reverse = ( tgtE1.Orientation() != tgtWires[iW]->Edge( iE ).Orientation() ); + break; + } + } } else { From a6bce4dabaa3e22cf4417358e150755e4dbb4d2a Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 17 Mar 2016 15:30:10 +0300 Subject: [PATCH 107/147] Fix regression of SALOME_TESTS/Grids/smesh/3D_submesh_00/A6 Fix SMESH_subMesh::cleanDependsOn() + minor improvements in SMESH_submesh and sample scripts --- doc/salome/examples/creating_meshes_ex04.py | 3 +-- doc/salome/examples/creating_meshes_ex06.py | 5 ++++- src/SMESH/SMESH_Mesh.cxx | 8 ++++---- src/SMESH/SMESH_subMesh.cxx | 16 +++++++++------- src/SMESH/SMESH_subMesh.hxx | 8 ++++---- src/SMESHDS/SMESHDS_Mesh.cxx | 2 +- .../StdMeshers_QuadFromMedialAxis_1D2D.cxx | 2 +- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/doc/salome/examples/creating_meshes_ex04.py b/doc/salome/examples/creating_meshes_ex04.py index f2cdfdb87..82408d5a3 100644 --- a/doc/salome/examples/creating_meshes_ex04.py +++ b/doc/salome/examples/creating_meshes_ex04.py @@ -46,8 +46,7 @@ tria.Compute() PrintMeshInfo(tria) # remove a local hypothesis -mesh = tria.GetMesh() -mesh.RemoveHypothesis(edge, hyp4) +tria.RemoveHypothesis(hyp4, edge) # compute the mesh tria.Compute() diff --git a/doc/salome/examples/creating_meshes_ex06.py b/doc/salome/examples/creating_meshes_ex06.py index d16e067d3..8e52da6be 100644 --- a/doc/salome/examples/creating_meshes_ex06.py +++ b/doc/salome/examples/creating_meshes_ex06.py @@ -1,5 +1,8 @@ # Creating a hexahedral mesh on a cylinder. -# Note: it is a copy of 'ex24_cylinder.py' from SMESH_SWIG +# +# This example uses Partition to divide the cylinder into blocks, which is +# a general approach. But for the case of cylinder there is a dedicated +# command creating a blocked cylinder: geompy.MakeDividedCylinder() import salome salome.salome_init() diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index ecc7888e7..467fdd6a3 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -679,8 +679,8 @@ SMESH_Mesh::AddHypothesis(const TopoDS_Shape & aSubShape, // shape - bool isAlgo = ( anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ); - int event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP; + bool isAlgo = ( anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ); + SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP; SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp); @@ -755,8 +755,8 @@ SMESH_Hypothesis::Hypothesis_Status // shape - bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ); - int event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP; + bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ); + SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP; SMESH_subMesh *subMesh = GetSubMesh(aSubShape); diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index f395b7986..ed0826782 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -609,7 +609,7 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, //================================================================================ SMESH_Hypothesis::Hypothesis_Status - SMESH_subMesh::AlgoStateEngine(int event, SMESH_Hypothesis * anHyp) + SMESH_subMesh::AlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp) { // **** les retour des evenement shape sont significatifs // (add ou remove fait ou non) @@ -1167,7 +1167,7 @@ void SMESH_subMesh::setAlgoState(algo_state state) //================================================================================ SMESH_Hypothesis::Hypothesis_Status - SMESH_subMesh::SubMeshesAlgoStateEngine(int event, + SMESH_subMesh::SubMeshesAlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp, bool exitOnFatal) { @@ -1232,9 +1232,11 @@ void SMESH_subMesh::cleanDependsOn( SMESH_Algo* algoRequiringCleaning/*=0*/ ) if ( !sameShapeType ) { // check if the algo allows presence of global algos of dimension the algo - // can generate it-self + // can generate it-self; + // always keep a node on VERTEX, as this node can be shared by segments + // lying on EDGEs not shared by the VERTEX of sm, due to MergeNodes (PAL23068) int shapeDim = SMESH_Gen::GetShapeDim( sm->GetSubShape() ); - keepSubMeshes = algoRequiringCleaning->NeedLowerHyps( shapeDim ); + keepSubMeshes = ( algoRequiringCleaning->NeedLowerHyps( shapeDim ) || shapeDim == 0 ); prevShapeType = sm->GetSubShape().ShapeType(); toKeepPrevShapeType = keepSubMeshes; } @@ -1345,7 +1347,7 @@ static void cleanSubMesh( SMESH_subMesh * subMesh ) */ //============================================================================= -bool SMESH_subMesh::ComputeStateEngine(int event) +bool SMESH_subMesh::ComputeStateEngine(compute_event event) { switch ( event ) { case MODIF_ALGO_STATE: @@ -1982,7 +1984,7 @@ void SMESH_subMesh::updateSubMeshState(const compute_state theState) //purpose : //======================================================================= -void SMESH_subMesh::ComputeSubMeshStateEngine(int event, const bool includeSelf) +void SMESH_subMesh::ComputeSubMeshStateEngine(compute_event event, const bool includeSelf) { SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(includeSelf,false); while ( smIt->more() ) @@ -2453,7 +2455,7 @@ void SMESH_subMeshEventListener::ProcessEvent(const int event, switch ( event ) { case SMESH_subMesh::CLEAN: for ( ; smIt != smEnd; ++ smIt) - (*smIt)->ComputeStateEngine( event ); + (*smIt)->ComputeStateEngine( SMESH_subMesh::compute_event( event )); break; case SMESH_subMesh::COMPUTE: case SMESH_subMesh::COMPUTE_SUBMESH: diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 8f9f83c2c..f00841373 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -216,10 +216,10 @@ protected: public: SMESH_Hypothesis::Hypothesis_Status - AlgoStateEngine(int event, SMESH_Hypothesis * anHyp); + AlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp); SMESH_Hypothesis::Hypothesis_Status - SubMeshesAlgoStateEngine(int event, SMESH_Hypothesis * anHyp, bool exitOnFatal=false); + SubMeshesAlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp, bool exitOnFatal=false); algo_state GetAlgoState() const { return _algoState; } compute_state GetComputeState() const { return _computeState; } @@ -227,8 +227,8 @@ public: void DumpAlgoState(bool isMain); - bool ComputeStateEngine(int event); - void ComputeSubMeshStateEngine(int event, const bool includeSelf=false); + bool ComputeStateEngine(compute_event event); + void ComputeSubMeshStateEngine(compute_event event, const bool includeSelf=false); bool Evaluate(MapShapeNbElems& aResMap); diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index ba7d59f37..0283b6b74 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -980,7 +980,7 @@ void SMESHDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elt, { //MESSAGE(" --------------------------------> SMESHDS_Mesh::RemoveFreeElement " << subMesh << " " << fromGroups); if (elt->GetType() == SMDSAbs_Node) { - RemoveFreeNode( static_cast(elt), subMesh); + RemoveFreeNode( static_cast(elt), subMesh, fromGroups); return; } diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index acd202846..58d179c55 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -554,7 +554,7 @@ namespace return false; for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints > 0 ].size(); ++iS ) - shortMap.Add( theShortEdges[ nbBranchPoints ][ iS ]); + shortMap.Add( theShortEdges[ nbBranchPoints > 0 ][ iS ]); ++nbBranchPoints; } From 1a82677a356073e12ab45362dcc473b4ddcdc278 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 17 Mar 2016 19:21:24 +0300 Subject: [PATCH 108/147] 52977: Find Element by Point does not find supporting node of Ball element at group of balls selection + minor changes in sample scripts --- doc/salome/examples/creating_meshes_ex06.py | 27 ++++++++++----------- doc/salome/examples/creating_meshes_ex08.py | 4 +-- src/SMESH_I/SMESH_MeshEditor_i.cxx | 17 +++++++------ 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/doc/salome/examples/creating_meshes_ex06.py b/doc/salome/examples/creating_meshes_ex06.py index 8e52da6be..90fe2765e 100644 --- a/doc/salome/examples/creating_meshes_ex06.py +++ b/doc/salome/examples/creating_meshes_ex06.py @@ -25,7 +25,7 @@ height = 200 # Build a cylinder # ---------------- -base = geompy.MakeVertex(0, 0, 0) +base = geompy.MakeVertex(0, 0, 0) direction = geompy.MakeVectorDXDYDZ(0, 0, 1) cylinder = geompy.MakeCylinder(base, direction, radius, height) @@ -37,9 +37,9 @@ geompy.addToStudy(cylinder, "cylinder") size = radius/2.0 -box_rot = geompy.MakeBox(-size, -size, 0, +size, +size, height) +box_rot = geompy.MakeBox(-size, -size, 0, +size, +size, height) box_axis = geompy.MakeLine(base, direction) -box = geompy.MakeRotation(box_rot, box_axis, math.pi/4) +box = geompy.MakeRotation(box_rot, box_axis, math.pi/4) hole = geompy.MakeCut(cylinder, box) @@ -50,8 +50,8 @@ plane_b = geompy.MakePlane(base, geompy.MakeVectorDXDYDZ(0, 1, 0), plane_trim) blocks_part = geompy.MakePartition([hole], [plane_a, plane_b], [], [], geompy.ShapeType["SOLID"]) blocks_list = [box] + geompy.SubShapeAll(blocks_part, geompy.ShapeType["SOLID"]) -blocks_all = geompy.MakeCompound(blocks_list) -blocks = geompy.MakeGlueFaces(blocks_all, 0.0001) +blocks_all = geompy.MakeCompound(blocks_list) +blocks = geompy.MakeGlueFaces(blocks_all, 0.0001) geompy.addToStudy(blocks, "cylinder:blocks") @@ -62,8 +62,7 @@ def group(name, shape, type, base=None, direction=None): t = geompy.ShapeType[type] g = geompy.CreateGroup(shape, t) - geompy.addToStudy(g, name) - g.SetName(name) + geompy.addToStudyInFather(shape, g, name) if base!=None: l = geompy.GetShapesOnPlaneWithLocationIDs(shape, t, direction, base, GEOM.ST_ON) @@ -76,7 +75,7 @@ group_a = group("baseA", blocks, "FACE", base, direction) base_b = geompy.MakeVertex(0, 0, height) group_b = group("baseB", blocks, "FACE", base_b, direction) -group_1 = group("limit", blocks, "SOLID") +group_1 = group("limit", blocks, "SOLID") group_1_all = geompy.SubShapeAllIDs(blocks, geompy.ShapeType["SOLID"]) geompy.UnionIDs(group_1, group_1_all) group_1_box = geompy.GetBlockNearPoint(blocks, base) @@ -87,12 +86,12 @@ geompy.DifferenceList(group_1, [group_1_box]) smesh.SetCurrentStudy(salome.myStudy) -def discretize(x, y, z, n, s=blocks): - p = geompy.MakeVertex(x, y, z) - e = geompy.GetEdgeNearPoint(s, p) - a = hexa.Segment(e) - a.NumberOfSegments(n) - a.Propagation() +def discretize(x, y, z, nbSeg, shape=blocks): + vert = geompy.MakeVertex( x, y, z ) + edge = geompy.GetEdgeNearPoint( shape, vert ) + algo = hexa.Segment( edge ) + algo.NumberOfSegments( nbSeg ) + algo.Propagation() hexa = smesh.Mesh(blocks) diff --git a/doc/salome/examples/creating_meshes_ex08.py b/doc/salome/examples/creating_meshes_ex08.py index e8f43eee6..0cb4b229f 100644 --- a/doc/salome/examples/creating_meshes_ex08.py +++ b/doc/salome/examples/creating_meshes_ex08.py @@ -14,7 +14,7 @@ smesh = smeshBuilder.New(salome.myStudy) box = geompy.MakeBoxDXDYDZ(100,100,100) face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0] -# generate 3D mesh +# generate a prismatic 3D mesh mesh = smesh.Mesh(box) localAlgo = mesh.Triangle(face) mesh.AutomaticHexahedralization() @@ -44,4 +44,4 @@ nodeIds = nGroup.GetIDs()[-10:] newMesh = smesh.CopyMesh( mesh.GetIDSource( nodeIds, SMESH.NODE), "some nodes copy") # 6. copy a sub-mesh -newMesh = smesh.CopyMesh( subMesh, "submesh copy" ) +newMesh = smesh.CopyMesh( subMesh, "sub-mesh copy" ) diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 76a5d6d16..52cb45765 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -4480,13 +4480,15 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID { SMESH_TRY; SMESH::long_array_var res = new SMESH::long_array; - - SMESH::array_of_ElementType_var types = elementIDs->GetTypes(); - if ( types->length() == 1 && // a part contains only nodes or 0D elements - ( types[0] == SMESH::NODE || types[0] == SMESH::ELEM0D || types[0] == SMESH::BALL) && - type != types[0] ) // but search of elements of dim > 0 - return res._retn(); + if ( type != SMESH::NODE ) + { + SMESH::array_of_ElementType_var types = elementIDs->GetTypes(); + if ( types->length() == 1 && // a part contains only nodes or 0D elements + ( types[0] == SMESH::NODE || types[0] == SMESH::ELEM0D || types[0] == SMESH::BALL) && + type != types[0] ) // but search of elements of dim > 0 + return res._retn(); + } if ( SMESH::DownCast( elementIDs )) // elementIDs is the whole mesh return FindElementsByPoint( x,y,z, type ); @@ -4500,7 +4502,8 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID SMESHDS_Mesh* meshDS = SMESH::DownCast( mesh )->GetImpl().GetMeshDS(); if ( !idSourceToSet( elementIDs, meshDS, elements, - SMDSAbs_ElementType(type), /*emptyIfIsMesh=*/true)) + ( type == SMESH::NODE ? SMDSAbs_All : (SMDSAbs_ElementType) type ), + /*emptyIfIsMesh=*/true)) return res._retn(); typedef SMDS_SetIterator TIter; From 4ed74ad3da0e1ddd1d6ac5891a8202e0831abcb5 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 17 Mar 2016 21:47:21 +0300 Subject: [PATCH 109/147] 52976: Find Elements by Point - All does not find Ball element + minor changes in sample scripts --- doc/salome/examples/defining_hypotheses_ex05.py | 2 +- doc/salome/examples/defining_hypotheses_ex07.py | 5 +++-- src/SMESHUtils/SMESH_MeshAlgos.cxx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/salome/examples/defining_hypotheses_ex05.py b/doc/salome/examples/defining_hypotheses_ex05.py index d2b98f1cc..204496ce0 100644 --- a/doc/salome/examples/defining_hypotheses_ex05.py +++ b/doc/salome/examples/defining_hypotheses_ex05.py @@ -37,7 +37,7 @@ algo.NumberOfSegments(20) # assign triangulation algorithm algo = tria_mesh.Triangle() -# apply "Max Element Area" hypothesis to each triangle +# assign "Max Element Area" hypothesis algo.MaxElementArea(100) # compute the mesh diff --git a/doc/salome/examples/defining_hypotheses_ex07.py b/doc/salome/examples/defining_hypotheses_ex07.py index c2dc2cfb0..1630a9047 100644 --- a/doc/salome/examples/defining_hypotheses_ex07.py +++ b/doc/salome/examples/defining_hypotheses_ex07.py @@ -24,12 +24,13 @@ tria = smesh.Mesh(face1, "Face : triangle 2D mesh") # Define 1D meshing algo1D = tria.Segment() -algo1D.NumberOfSegments(2) +algo1D.LocalLength(3.) # create and assign the algorithm for 2D meshing with triangles algo2D = tria.Triangle() -# create and assign "LengthFromEdges" hypothesis to build triangles based on the length of the edges taken from the wire +# create and assign "LengthFromEdges" hypothesis to build triangles with +# linear size close to the length of the segments generated on the face wires (3.) algo2D.LengthFromEdges() # compute the mesh diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index a897decd6..985e4a7ae 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1259,7 +1259,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin // Node or 0D element ------------------------------------------------------------------------- { gp_Vec n2p ( xyz[0], point ); - return n2p.SquareMagnitude() <= tol * tol; + return n2p.SquareMagnitude() > tol * tol; } return true; } From 3ae5846f2427f15ff0472576c2af89d8978a14ca Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 18 Mar 2016 15:42:33 +0300 Subject: [PATCH 110/147] IPAL52974: Find Element by Point shows nodes that do not belong to current group --- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 11 +++++++++ src/SMESHGUI/SMESHGUI_MeshEditPreview.h | 1 + src/SMESHUtils/SMESH_MeshAlgos.cxx | 30 ++++++++++++++++++++--- src/SMESHUtils/SMESH_MeshAlgos.hxx | 3 +++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx index 50fe4e592..73377c3b1 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx @@ -404,3 +404,14 @@ vtkUnstructuredGrid* SMESHGUI_MeshEditPreview::GetGrid() const { return myGrid; } + +//================================================================================ +/*! + * \brief Returns myViewWindow + */ +//================================================================================ + +SVTK_ViewWindow* SMESHGUI_MeshEditPreview::GetViewWindow() const +{ + return myViewWindow; +} diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.h b/src/SMESHGUI/SMESHGUI_MeshEditPreview.h index a506a3718..e88355819 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.h +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.h @@ -74,6 +74,7 @@ public: SALOME_Actor* GetActor() const; vtkUnstructuredGrid* GetGrid() const; + SVTK_ViewWindow* GetViewWindow() const; }; #endif // SMESHGUI_MESHEDITPREVIEW_H diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index 985e4a7ae..a5f7701c2 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -60,7 +60,8 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher /*! * \brief Constructor */ - SMESH_NodeSearcherImpl( const SMDS_Mesh* theMesh ) + SMESH_NodeSearcherImpl( const SMDS_Mesh* theMesh = 0, + SMDS_ElemIteratorPtr theElemIt = SMDS_ElemIteratorPtr() ) { myMesh = ( SMDS_Mesh* ) theMesh; @@ -70,6 +71,14 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher while ( nIt->more() ) nodes.insert( nodes.end(), nIt->next() ); } + else if ( theElemIt ) + { + while ( theElemIt->more() ) + { + const SMDS_MeshElement* e = theElemIt->next(); + nodes.insert( e->begin_nodes(), e->end_nodes() ); + } + } myOctreeNode = new SMESH_OctreeNode(nodes) ; // get max size of a leaf box @@ -714,8 +723,12 @@ FindElementsByPoint(const gp_Pnt& point, if ( type == SMDSAbs_Node || type == SMDSAbs_0DElement || type == SMDSAbs_Ball) { if ( !_nodeSearcher ) - _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh ); - + { + if ( _meshPartIt ) + _nodeSearcher = new SMESH_NodeSearcherImpl( 0, _meshPartIt ); + else + _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh ); + } std::vector< const SMDS_MeshNode* > foundNodes; _nodeSearcher->FindNearPoint( point, tolerance, foundNodes ); @@ -1695,6 +1708,17 @@ SMESH_NodeSearcher* SMESH_MeshAlgos::GetNodeSearcher(SMDS_Mesh& mesh) return new SMESH_NodeSearcherImpl( &mesh ); } +//======================================================================= +/*! + * \brief Return SMESH_NodeSearcher + */ +//======================================================================= + +SMESH_NodeSearcher* SMESH_MeshAlgos::GetNodeSearcher(SMDS_ElemIteratorPtr elemIt) +{ + return new SMESH_NodeSearcherImpl( 0, elemIt ); +} + //======================================================================= /*! * \brief Return SMESH_ElementSearcher diff --git a/src/SMESHUtils/SMESH_MeshAlgos.hxx b/src/SMESHUtils/SMESH_MeshAlgos.hxx index f8ea69a6b..6420bf966 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.hxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.hxx @@ -159,6 +159,9 @@ namespace SMESH_MeshAlgos SMESHUtils_EXPORT SMESH_NodeSearcher* GetNodeSearcher( SMDS_Mesh& mesh ); + SMESHUtils_EXPORT + SMESH_NodeSearcher* GetNodeSearcher( SMDS_ElemIteratorPtr elemIt ); + /*! * \brief Return SMESH_ElementSearcher. The caller is responsible for deleting it */ From 7eda9ca931ed2a11cb5e4637e4ffe19f5c061115 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 18 Mar 2016 20:10:20 +0300 Subject: [PATCH 111/147] Copyright update: 2016 --- AUTHORS | 0 CMakeLists.txt | 2 +- INSTALL | 1 - LICENCE | 504 ------------------ NEWS | 0 README | 119 +++++ SMESH_version.h.in | 2 +- SalomeSMESHConfig.cmake.in | 2 +- adm_local/CMakeLists.txt | 2 +- adm_local/cmake_files/CMakeLists.txt | 2 +- adm_local/cmake_files/FindCGNS.cmake | 2 +- adm_local/cmake_files/FindSMESH.cmake | 2 +- adm_local/cmake_files/FindSalomeCGNS.cmake | 2 +- adm_local/cmake_files/FindSalomeSMESH.cmake | 2 +- adm_local/cmake_files/FindSalomeTBB.cmake | 2 +- adm_local/cmake_files/FindSalomef2c.cmake | 2 +- adm_local/cmake_files/FindTBB.cmake | 2 +- adm_local/cmake_files/Findf2c.cmake | 2 +- adm_local/unix/CMakeLists.txt | 2 +- adm_local/unix/config_files/CMakeLists.txt | 2 +- adm_local/unix/config_files/check_Platform.m4 | 2 +- adm_local/unix/config_files/check_SMESH.m4 | 2 +- adm_local/unix/config_files/check_cgal.m4 | 2 +- adm_local/unix/config_files/check_cgns.m4 | 2 +- adm_local/unix/config_files/check_f77.m4 | 2 +- adm_local/unix/config_files/check_padder.m4 | 2 +- adm_local/unix/config_files/check_qwt.m4 | 2 +- bin/CMakeLists.txt | 2 +- bin/smesh_setenv.py | 2 +- cvs-tags | 35 -- doc/CMakeLists.txt | 2 +- doc/salome/CMakeLists.txt | 2 +- doc/salome/examples/CMakeLists.txt | 2 +- .../examples/CTestTestfileInstall.cmake | 2 +- doc/salome/examples/testme.py | 2 +- doc/salome/gui/CMakeLists.txt | 2 +- doc/salome/gui/SMESH/CMakeLists.txt | 2 +- doc/salome/gui/SMESH/collect_mesh_methods.py | 2 +- doc/salome/gui/SMESH/doxyfile.in | 2 +- doc/salome/gui/SMESH/doxyfile_py.in | 2 +- doc/salome/gui/SMESH/static/footer.html | 2 +- doc/salome/tui/CMakeLists.txt | 2 +- doc/salome/tui/doxyfile.in | 2 +- doc/salome/tui/static/footer.html | 2 +- idl/CMakeLists.txt | 2 +- idl/SMESH_BasicHypothesis.idl | 2 +- idl/SMESH_Filter.idl | 2 +- idl/SMESH_Gen.idl | 2 +- idl/SMESH_Group.idl | 2 +- idl/SMESH_Hypothesis.idl | 2 +- idl/SMESH_Measurements.idl | 2 +- idl/SMESH_Mesh.idl | 2 +- idl/SMESH_MeshEditor.idl | 2 +- idl/SMESH_Pattern.idl | 2 +- resources/CMakeLists.txt | 2 +- resources/SMESHCatalog.xml.in | 2 +- resources/SalomeApp.xml.in | 2 +- resources/StdMeshers.xml.in | 2 +- src/CMakeLists.txt | 2 +- src/Controls/CMakeLists.txt | 2 +- src/Controls/SMESH_Controls.cxx | 2 +- src/Controls/SMESH_ControlsDef.hxx | 2 +- src/Driver/CMakeLists.txt | 2 +- src/Driver/Driver_Document.cxx | 2 +- src/Driver/Driver_Document.h | 2 +- src/Driver/Driver_Mesh.cxx | 2 +- src/Driver/Driver_Mesh.h | 2 +- src/Driver/Driver_SMDS_Mesh.cxx | 2 +- src/Driver/Driver_SMDS_Mesh.h | 2 +- src/Driver/Driver_SMESHDS_Mesh.cxx | 2 +- src/Driver/Driver_SMESHDS_Mesh.h | 2 +- src/DriverCGNS/CMakeLists.txt | 2 +- src/DriverCGNS/DriverCGNS_Read.cxx | 2 +- src/DriverCGNS/DriverCGNS_Read.hxx | 2 +- src/DriverCGNS/DriverCGNS_Write.cxx | 2 +- src/DriverCGNS/DriverCGNS_Write.hxx | 2 +- src/DriverCGNS/SMESH_DriverCGNS.hxx | 2 +- src/DriverDAT/CMakeLists.txt | 2 +- src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx | 2 +- src/DriverDAT/DriverDAT_R_SMDS_Mesh.h | 2 +- src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx | 2 +- src/DriverDAT/DriverDAT_W_SMDS_Mesh.h | 2 +- src/DriverDAT/SMESH_DriverDAT.hxx | 2 +- src/DriverGMF/CMakeLists.txt | 2 +- src/DriverGMF/DriverGMF.cxx | 2 +- src/DriverGMF/DriverGMF.hxx | 2 +- src/DriverGMF/DriverGMF_Read.cxx | 2 +- src/DriverGMF/DriverGMF_Read.hxx | 2 +- src/DriverGMF/DriverGMF_Write.cxx | 2 +- src/DriverGMF/DriverGMF_Write.hxx | 2 +- src/DriverGMF/SMESH_DriverGMF.hxx | 2 +- src/DriverMED/CMakeLists.txt | 2 +- src/DriverMED/DriverMED.hxx | 2 +- src/DriverMED/DriverMED_Family.cxx | 2 +- src/DriverMED/DriverMED_Family.h | 2 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 2 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.h | 2 +- src/DriverMED/DriverMED_W_Field.cxx | 2 +- src/DriverMED/DriverMED_W_Field.h | 2 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 2 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.h | 2 +- src/DriverMED/SMESH_DriverMED.hxx | 2 +- src/DriverSTL/CMakeLists.txt | 2 +- src/DriverSTL/DriverSTL_R_SMDS_Mesh.cxx | 2 +- src/DriverSTL/DriverSTL_R_SMDS_Mesh.h | 2 +- src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx | 2 +- src/DriverSTL/DriverSTL_W_SMDS_Mesh.h | 2 +- src/DriverSTL/SMESH_DriverSTL.hxx | 2 +- src/DriverUNV/CMakeLists.txt | 2 +- src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx | 2 +- src/DriverUNV/DriverUNV_R_SMDS_Mesh.h | 2 +- src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx | 2 +- src/DriverUNV/DriverUNV_W_SMDS_Mesh.h | 2 +- src/DriverUNV/SMESH_DriverUNV.hxx | 2 +- src/DriverUNV/UNV164_Structure.cxx | 2 +- src/DriverUNV/UNV164_Structure.hxx | 2 +- src/DriverUNV/UNV2411_Structure.cxx | 2 +- src/DriverUNV/UNV2411_Structure.hxx | 2 +- src/DriverUNV/UNV2412_Structure.cxx | 2 +- src/DriverUNV/UNV2412_Structure.hxx | 2 +- src/DriverUNV/UNV2417_Structure.cxx | 2 +- src/DriverUNV/UNV2417_Structure.hxx | 2 +- src/DriverUNV/UNV2420_Structure.cxx | 2 +- src/DriverUNV/UNV2420_Structure.hxx | 2 +- src/DriverUNV/UNV_Utilities.cxx | 2 +- src/DriverUNV/UNV_Utilities.hxx | 2 +- src/MEDWrapper/Base/CMakeLists.txt | 2 +- src/MEDWrapper/Base/MED_Algorithm.cxx | 2 +- src/MEDWrapper/Base/MED_Algorithm.hxx | 2 +- src/MEDWrapper/Base/MED_Common.hxx | 2 +- src/MEDWrapper/Base/MED_CoordUtils.cxx | 2 +- src/MEDWrapper/Base/MED_CoordUtils.hxx | 2 +- src/MEDWrapper/Base/MED_GaussDef.cxx | 2 +- src/MEDWrapper/Base/MED_GaussDef.hxx | 2 +- src/MEDWrapper/Base/MED_GaussUtils.cxx | 2 +- src/MEDWrapper/Base/MED_GaussUtils.hxx | 2 +- src/MEDWrapper/Base/MED_SharedPtr.hxx | 2 +- src/MEDWrapper/Base/MED_SliceArray.hxx | 2 +- src/MEDWrapper/Base/MED_Structures.cxx | 2 +- src/MEDWrapper/Base/MED_Structures.hxx | 2 +- src/MEDWrapper/Base/MED_TStructures.hxx | 2 +- src/MEDWrapper/Base/MED_TWrapper.hxx | 2 +- src/MEDWrapper/Base/MED_Utilities.cxx | 2 +- src/MEDWrapper/Base/MED_Utilities.hxx | 2 +- src/MEDWrapper/Base/MED_Vector.hxx | 2 +- src/MEDWrapper/Base/MED_Wrapper.cxx | 2 +- src/MEDWrapper/Base/MED_Wrapper.hxx | 2 +- src/MEDWrapper/Base/MED_WrapperBase.hxx | 2 +- src/MEDWrapper/CMakeLists.txt | 2 +- src/MEDWrapper/Factory/CMakeLists.txt | 2 +- src/MEDWrapper/Factory/MED_Factory.cxx | 2 +- src/MEDWrapper/Factory/MED_Factory.hxx | 2 +- src/MEDWrapper/Factory/MED_Test.cxx | 2 +- src/MEDWrapper/Factory/MED_WrapperFactory.hxx | 2 +- src/MEDWrapper/Factory/mprint_version.cxx | 2 +- src/MEDWrapper/V2_2/CMakeLists.txt | 2 +- src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx | 2 +- src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx | 2 +- src/MEFISTO2/CMakeLists.txt | 2 +- src/MEFISTO2/Rn.h | 2 +- src/MEFISTO2/aptrte.cxx | 2 +- src/MEFISTO2/aptrte.h | 2 +- src/MEFISTO2/areteideale.f | 2 +- src/MEFISTO2/trte.f | 2 +- src/OBJECT/CMakeLists.txt | 2 +- src/OBJECT/SMESH_Actor.cxx | 2 +- src/OBJECT/SMESH_Actor.h | 2 +- src/OBJECT/SMESH_ActorDef.h | 2 +- src/OBJECT/SMESH_ActorUtils.cxx | 2 +- src/OBJECT/SMESH_ActorUtils.h | 2 +- src/OBJECT/SMESH_CellLabelActor.cxx | 2 +- src/OBJECT/SMESH_CellLabelActor.h | 2 +- src/OBJECT/SMESH_DeviceActor.cxx | 2 +- src/OBJECT/SMESH_DeviceActor.h | 2 +- src/OBJECT/SMESH_ExtractGeometry.cxx | 2 +- src/OBJECT/SMESH_ExtractGeometry.h | 2 +- src/OBJECT/SMESH_FaceOrientationFilter.cxx | 2 +- src/OBJECT/SMESH_FaceOrientationFilter.h | 2 +- src/OBJECT/SMESH_NodeLabelActor.cxx | 2 +- src/OBJECT/SMESH_NodeLabelActor.h | 2 +- src/OBJECT/SMESH_Object.cxx | 2 +- src/OBJECT/SMESH_Object.h | 2 +- src/OBJECT/SMESH_ObjectDef.h | 2 +- src/OBJECT/SMESH_PreviewActorsCollection.cxx | 2 +- src/OBJECT/SMESH_PreviewActorsCollection.h | 2 +- src/OBJECT/SMESH_SVTKActor.cxx | 2 +- src/OBJECT/SMESH_SVTKActor.h | 2 +- src/OBJECT/SMESH_ScalarBarActor.cxx | 2 +- src/OBJECT/SMESH_ScalarBarActor.h | 2 +- src/PluginUtils/CMakeLists.txt | 2 +- src/PluginUtils/GeomSelectionTools.cxx | 2 +- src/PluginUtils/GeomSelectionTools.h | 2 +- src/SMDS/CMakeLists.txt | 2 +- src/SMDS/ObjectPool.hxx | 2 +- src/SMDS/SMDSAbs_ElementType.hxx | 2 +- src/SMDS/SMDS_BallElement.cxx | 2 +- src/SMDS/SMDS_BallElement.hxx | 2 +- src/SMDS/SMDS_Downward.cxx | 2 +- src/SMDS/SMDS_Downward.hxx | 2 +- src/SMDS/SMDS_EdgePosition.cxx | 2 +- src/SMDS/SMDS_EdgePosition.hxx | 2 +- src/SMDS/SMDS_ElemIterator.hxx | 2 +- src/SMDS/SMDS_FaceOfEdges.cxx | 2 +- src/SMDS/SMDS_FaceOfEdges.hxx | 2 +- src/SMDS/SMDS_FaceOfNodes.cxx | 2 +- src/SMDS/SMDS_FaceOfNodes.hxx | 2 +- src/SMDS/SMDS_FacePosition.cxx | 2 +- src/SMDS/SMDS_FacePosition.hxx | 2 +- src/SMDS/SMDS_Iterator.hxx | 2 +- src/SMDS/SMDS_IteratorOfElements.cxx | 2 +- src/SMDS/SMDS_IteratorOfElements.hxx | 2 +- src/SMDS/SMDS_IteratorOnIterators.hxx | 2 +- src/SMDS/SMDS_LinearEdge.cxx | 2 +- src/SMDS/SMDS_LinearEdge.hxx | 2 +- src/SMDS/SMDS_MemoryLimit.cxx | 2 +- src/SMDS/SMDS_Mesh.cxx | 2 +- src/SMDS/SMDS_Mesh.hxx | 2 +- src/SMDS/SMDS_Mesh0DElement.cxx | 2 +- src/SMDS/SMDS_Mesh0DElement.hxx | 2 +- src/SMDS/SMDS_MeshCell.cxx | 2 +- src/SMDS/SMDS_MeshCell.hxx | 2 +- src/SMDS/SMDS_MeshEdge.cxx | 2 +- src/SMDS/SMDS_MeshEdge.hxx | 2 +- src/SMDS/SMDS_MeshElement.cxx | 2 +- src/SMDS/SMDS_MeshElement.hxx | 2 +- src/SMDS/SMDS_MeshElementIDFactory.cxx | 2 +- src/SMDS/SMDS_MeshElementIDFactory.hxx | 2 +- src/SMDS/SMDS_MeshFace.cxx | 2 +- src/SMDS/SMDS_MeshFace.hxx | 2 +- src/SMDS/SMDS_MeshGroup.cxx | 2 +- src/SMDS/SMDS_MeshGroup.hxx | 2 +- src/SMDS/SMDS_MeshIDFactory.cxx | 2 +- src/SMDS/SMDS_MeshIDFactory.hxx | 2 +- src/SMDS/SMDS_MeshInfo.hxx | 2 +- src/SMDS/SMDS_MeshNode.cxx | 2 +- src/SMDS/SMDS_MeshNode.hxx | 2 +- src/SMDS/SMDS_MeshNodeIDFactory.cxx | 2 +- src/SMDS/SMDS_MeshNodeIDFactory.hxx | 2 +- src/SMDS/SMDS_MeshObject.cxx | 2 +- src/SMDS/SMDS_MeshObject.hxx | 2 +- src/SMDS/SMDS_MeshVolume.cxx | 2 +- src/SMDS/SMDS_MeshVolume.hxx | 2 +- src/SMDS/SMDS_PolygonalFaceOfNodes.cxx | 2 +- src/SMDS/SMDS_PolygonalFaceOfNodes.hxx | 2 +- src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx | 2 +- src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx | 2 +- src/SMDS/SMDS_Position.cxx | 2 +- src/SMDS/SMDS_Position.hxx | 2 +- src/SMDS/SMDS_QuadraticEdge.cxx | 2 +- src/SMDS/SMDS_QuadraticEdge.hxx | 2 +- src/SMDS/SMDS_QuadraticFaceOfNodes.cxx | 2 +- src/SMDS/SMDS_QuadraticFaceOfNodes.hxx | 2 +- src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx | 2 +- src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx | 2 +- src/SMDS/SMDS_SetIterator.hxx | 2 +- src/SMDS/SMDS_SpacePosition.cxx | 2 +- src/SMDS/SMDS_SpacePosition.hxx | 2 +- src/SMDS/SMDS_StdIterator.hxx | 2 +- src/SMDS/SMDS_TypeOfPosition.hxx | 2 +- src/SMDS/SMDS_UnstructuredGrid.cxx | 2 +- src/SMDS/SMDS_UnstructuredGrid.hxx | 2 +- src/SMDS/SMDS_VertexPosition.cxx | 2 +- src/SMDS/SMDS_VertexPosition.hxx | 2 +- src/SMDS/SMDS_VolumeOfFaces.cxx | 2 +- src/SMDS/SMDS_VolumeOfFaces.hxx | 2 +- src/SMDS/SMDS_VolumeOfNodes.cxx | 2 +- src/SMDS/SMDS_VolumeOfNodes.hxx | 2 +- src/SMDS/SMDS_VolumeTool.cxx | 2 +- src/SMDS/SMDS_VolumeTool.hxx | 2 +- src/SMDS/SMDS_VtkCellIterator.cxx | 2 +- src/SMDS/SMDS_VtkCellIterator.hxx | 2 +- src/SMDS/SMDS_VtkEdge.cxx | 2 +- src/SMDS/SMDS_VtkEdge.hxx | 2 +- src/SMDS/SMDS_VtkFace.cxx | 2 +- src/SMDS/SMDS_VtkFace.hxx | 2 +- src/SMDS/SMDS_VtkVolume.cxx | 2 +- src/SMDS/SMDS_VtkVolume.hxx | 2 +- src/SMDS/SMESH_SMDS.hxx | 2 +- src/SMDS/chrono.cxx | 2 +- src/SMDS/chrono.hxx | 2 +- src/SMESH/CMakeLists.txt | 2 +- src/SMESH/SMESH_Algo.cxx | 2 +- src/SMESH/SMESH_Algo.hxx | 2 +- src/SMESH/SMESH_Gen.cxx | 2 +- src/SMESH/SMESH_Gen.hxx | 2 +- src/SMESH/SMESH_Group.cxx | 2 +- src/SMESH/SMESH_Group.hxx | 2 +- src/SMESH/SMESH_HypoFilter.cxx | 2 +- src/SMESH/SMESH_HypoFilter.hxx | 2 +- src/SMESH/SMESH_Hypothesis.cxx | 2 +- src/SMESH/SMESH_Hypothesis.hxx | 2 +- src/SMESH/SMESH_Mesh.cxx | 2 +- src/SMESH/SMESH_Mesh.hxx | 2 +- src/SMESH/SMESH_MeshEditor.cxx | 2 +- src/SMESH/SMESH_MeshEditor.hxx | 2 +- src/SMESH/SMESH_MesherHelper.cxx | 2 +- src/SMESH/SMESH_MesherHelper.hxx | 2 +- src/SMESH/SMESH_Pattern.cxx | 2 +- src/SMESH/SMESH_Pattern.hxx | 2 +- src/SMESH/SMESH_ProxyMesh.cxx | 2 +- src/SMESH/SMESH_ProxyMesh.hxx | 2 +- src/SMESH/SMESH_SMESH.hxx | 2 +- src/SMESH/SMESH_subMesh.cxx | 2 +- src/SMESH/SMESH_subMesh.hxx | 2 +- src/SMESH/SMESH_subMeshEventListener.hxx | 2 +- src/SMESH/memoire.h | 2 +- src/SMESHClient/CMakeLists.txt | 2 +- src/SMESHClient/SMESHClientBin.cxx | 2 +- src/SMESHClient/SMESH_Client.cxx | 2 +- src/SMESHClient/SMESH_Client.hxx | 2 +- src/SMESHDS/CMakeLists.txt | 2 +- src/SMESHDS/SMESHDS_Command.cxx | 2 +- src/SMESHDS/SMESHDS_Command.hxx | 2 +- src/SMESHDS/SMESHDS_CommandType.hxx | 2 +- src/SMESHDS/SMESHDS_DataMapOfShape.hxx | 2 +- src/SMESHDS/SMESHDS_Document.cxx | 2 +- src/SMESHDS/SMESHDS_Document.hxx | 2 +- src/SMESHDS/SMESHDS_Group.cxx | 2 +- src/SMESHDS/SMESHDS_Group.hxx | 2 +- src/SMESHDS/SMESHDS_GroupBase.cxx | 2 +- src/SMESHDS/SMESHDS_GroupBase.hxx | 2 +- src/SMESHDS/SMESHDS_GroupOnFilter.cxx | 2 +- src/SMESHDS/SMESHDS_GroupOnFilter.hxx | 2 +- src/SMESHDS/SMESHDS_GroupOnGeom.cxx | 2 +- src/SMESHDS/SMESHDS_GroupOnGeom.hxx | 2 +- src/SMESHDS/SMESHDS_Hypothesis.cxx | 2 +- src/SMESHDS/SMESHDS_Hypothesis.hxx | 2 +- src/SMESHDS/SMESHDS_Mesh.cxx | 2 +- src/SMESHDS/SMESHDS_Mesh.hxx | 2 +- src/SMESHDS/SMESHDS_Script.cxx | 2 +- src/SMESHDS/SMESHDS_Script.hxx | 2 +- src/SMESHDS/SMESHDS_SubMesh.cxx | 2 +- src/SMESHDS/SMESHDS_SubMesh.hxx | 2 +- src/SMESHDS/SMESHDS_TSubMeshHolder.hxx | 2 +- src/SMESHDS/SMESH_Controls.hxx | 2 +- src/SMESHDS/SMESH_SMESHDS.hxx | 2 +- src/SMESHFiltersSelection/CMakeLists.txt | 2 +- .../SMESH_LogicalFilter.cxx | 2 +- .../SMESH_LogicalFilter.hxx | 2 +- .../SMESH_NumberFilter.cxx | 2 +- .../SMESH_NumberFilter.hxx | 2 +- src/SMESHFiltersSelection/SMESH_Type.h | 2 +- .../SMESH_TypeFilter.cxx | 2 +- .../SMESH_TypeFilter.hxx | 2 +- src/SMESHGUI/CMakeLists.txt | 2 +- src/SMESHGUI/SMESHGUI.cxx | 2 +- src/SMESHGUI/SMESHGUI.h | 2 +- .../SMESHGUI_Add0DElemsOnAllNodesDlg.cxx | 2 +- .../SMESHGUI_Add0DElemsOnAllNodesDlg.h | 2 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h | 2 +- .../SMESHGUI_AddQuadraticElementDlg.cxx | 2 +- .../SMESHGUI_AddQuadraticElementDlg.h | 2 +- src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ClippingDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ClippingDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ComputeDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ConvToQuadDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ConvToQuadDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_ConvToQuadOp.h | 2 +- src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_CopyMeshDlg.h | 2 +- src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_CreatePatternDlg.h | 2 +- .../SMESHGUI_CreatePolyhedralVolumeDlg.cxx | 2 +- .../SMESHGUI_CreatePolyhedralVolumeDlg.h | 2 +- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Dialog.cxx | 2 +- src/SMESHGUI/SMESHGUI_Dialog.h | 2 +- src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Displayer.cxx | 2 +- src/SMESHGUI/SMESHGUI_Displayer.h | 2 +- src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.h | 2 +- .../SMESHGUI_ExtrusionAlongPathDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.h | 2 +- src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FieldSelectorWdg.h | 2 +- src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FileInfoDlg.h | 2 +- src/SMESHGUI/SMESHGUI_FileValidator.cxx | 2 +- src/SMESHGUI/SMESHGUI_FileValidator.h | 2 +- src/SMESHGUI/SMESHGUI_Filter.cxx | 2 +- src/SMESHGUI/SMESHGUI_Filter.h | 2 +- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FilterDlg.h | 2 +- src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h | 2 +- src/SMESHGUI/SMESHGUI_FilterUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_FilterUtils.h | 2 +- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h | 2 +- src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_GEOMGenUtils.h | 2 +- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_GroupDlg.h | 2 +- src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.h | 2 +- src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_GroupOpDlg.h | 2 +- src/SMESHGUI/SMESHGUI_GroupUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_GroupUtils.h | 2 +- src/SMESHGUI/SMESHGUI_Hypotheses.cxx | 2 +- src/SMESHGUI/SMESHGUI_Hypotheses.h | 2 +- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_HypothesesUtils.h | 2 +- src/SMESHGUI/SMESHGUI_IdPreview.cxx | 2 +- src/SMESHGUI/SMESHGUI_IdPreview.h | 2 +- src/SMESHGUI/SMESHGUI_IdValidator.h | 2 +- src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.h | 2 +- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Measurements.cxx | 2 +- src/SMESHGUI/SMESHGUI_Measurements.h | 2 +- src/SMESHGUI/SMESHGUI_MergeDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MergeDlg.h | 2 +- src/SMESHGUI/SMESHGUI_MeshDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshDlg.h | 2 +- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshEditPreview.h | 2 +- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshInfo.h | 2 +- src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshInfosBox.h | 2 +- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshOp.h | 2 +- src/SMESHGUI/SMESHGUI_MeshOrderDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshOrderDlg.h | 2 +- src/SMESHGUI/SMESHGUI_MeshOrderOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshOrderOp.h | 2 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.h | 2 +- src/SMESHGUI/SMESHGUI_MeshUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshUtils.h | 2 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.h | 2 +- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_NodesDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Operation.cxx | 2 +- src/SMESHGUI/SMESHGUI_Operation.h | 2 +- src/SMESHGUI/SMESHGUI_Operations.h | 2 +- src/SMESHGUI/SMESHGUI_PatternUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_PatternUtils.h | 2 +- src/SMESHGUI/SMESHGUI_PatternWidget.cxx | 2 +- src/SMESHGUI/SMESHGUI_PatternWidget.h | 2 +- src/SMESHGUI/SMESHGUI_PreVisualObj.cxx | 2 +- src/SMESHGUI/SMESHGUI_PreVisualObj.h | 2 +- .../SMESHGUI_Preferences_ScalarBarDlg.cxx | 2 +- .../SMESHGUI_Preferences_ScalarBarDlg.h | 2 +- src/SMESHGUI/SMESHGUI_PreviewDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_PreviewDlg.h | 2 +- src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_PropertiesDlg.h | 2 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h | 2 +- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h | 2 +- src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RenumberingDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ReorientFacesDlg.h | 2 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.h | 2 +- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_RotationDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ScaleDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ScaleDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Selection.cxx | 2 +- src/SMESHGUI/SMESHGUI_Selection.h | 2 +- src/SMESHGUI/SMESHGUI_SelectionOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_SelectionOp.h | 2 +- src/SMESHGUI/SMESHGUI_SewingDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SewingDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h | 2 +- src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SingleEditDlg.h | 2 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.h | 2 +- src/SMESHGUI/SMESHGUI_SpinBox.cxx | 2 +- src/SMESHGUI/SMESHGUI_SpinBox.h | 2 +- src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx | 2 +- src/SMESHGUI/SMESHGUI_SplitBiQuad.h | 2 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.h | 2 +- src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_TranslationDlg.h | 2 +- src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_TransparencyDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Utils.cxx | 2 +- src/SMESHGUI/SMESHGUI_Utils.h | 2 +- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 2 +- src/SMESHGUI/SMESHGUI_VTKUtils.h | 2 +- src/SMESHGUI/SMESHGUI_XmlHandler.cxx | 2 +- src/SMESHGUI/SMESHGUI_XmlHandler.h | 2 +- src/SMESHGUI/SMESH_SMESHGUI.hxx | 2 +- src/SMESHUtils/CMakeLists.txt | 2 +- src/SMESHUtils/SMESH_Block.cxx | 2 +- src/SMESHUtils/SMESH_Block.hxx | 2 +- src/SMESHUtils/SMESH_Comment.hxx | 2 +- src/SMESHUtils/SMESH_ComputeError.hxx | 2 +- src/SMESHUtils/SMESH_File.cxx | 2 +- src/SMESHUtils/SMESH_File.hxx | 2 +- src/SMESHUtils/SMESH_FreeBorders.cxx | 2 +- src/SMESHUtils/SMESH_MAT2d.cxx | 2 +- src/SMESHUtils/SMESH_MAT2d.hxx | 2 +- src/SMESHUtils/SMESH_MeshAlgos.cxx | 2 +- src/SMESHUtils/SMESH_MeshAlgos.hxx | 2 +- src/SMESHUtils/SMESH_Octree.cxx | 2 +- src/SMESHUtils/SMESH_Octree.hxx | 2 +- src/SMESHUtils/SMESH_OctreeNode.cxx | 2 +- src/SMESHUtils/SMESH_OctreeNode.hxx | 2 +- src/SMESHUtils/SMESH_Quadtree.cxx | 2 +- src/SMESHUtils/SMESH_Quadtree.hxx | 2 +- src/SMESHUtils/SMESH_Tree.hxx | 2 +- src/SMESHUtils/SMESH_TryCatch.cxx | 2 +- src/SMESHUtils/SMESH_TryCatch.hxx | 2 +- src/SMESHUtils/SMESH_TypeDefs.hxx | 2 +- src/SMESHUtils/SMESH_Utils.hxx | 2 +- src/SMESH_I/CMakeLists.txt | 2 +- src/SMESH_I/SMESH.hxx | 2 +- src/SMESH_I/SMESH_0D_Algo_i.cxx | 2 +- src/SMESH_I/SMESH_0D_Algo_i.hxx | 2 +- src/SMESH_I/SMESH_1D_Algo_i.cxx | 2 +- src/SMESH_I/SMESH_1D_Algo_i.hxx | 2 +- src/SMESH_I/SMESH_2D_Algo_i.cxx | 2 +- src/SMESH_I/SMESH_2D_Algo_i.hxx | 2 +- src/SMESH_I/SMESH_2smeshpy.cxx | 2 +- src/SMESH_I/SMESH_2smeshpy.hxx | 2 +- src/SMESH_I/SMESH_3D_Algo_i.cxx | 2 +- src/SMESH_I/SMESH_3D_Algo_i.hxx | 2 +- src/SMESH_I/SMESH_Algo_i.cxx | 2 +- src/SMESH_I/SMESH_Algo_i.hxx | 2 +- src/SMESH_I/SMESH_DumpPython.cxx | 2 +- src/SMESH_I/SMESH_Filter_i.cxx | 2 +- src/SMESH_I/SMESH_Filter_i.hxx | 2 +- src/SMESH_I/SMESH_Gen_i.cxx | 2 +- src/SMESH_I/SMESH_Gen_i.hxx | 2 +- src/SMESH_I/SMESH_Gen_i_1.cxx | 2 +- src/SMESH_I/SMESH_Group_i.cxx | 2 +- src/SMESH_I/SMESH_Group_i.hxx | 2 +- src/SMESH_I/SMESH_Hypothesis_i.cxx | 2 +- src/SMESH_I/SMESH_Hypothesis_i.hxx | 2 +- src/SMESH_I/SMESH_Measurements_i.cxx | 2 +- src/SMESH_I/SMESH_Measurements_i.hxx | 2 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 2 +- src/SMESH_I/SMESH_MeshEditor_i.hxx | 2 +- src/SMESH_I/SMESH_MeshPartDS.hxx | 2 +- src/SMESH_I/SMESH_Mesh_i.cxx | 2 +- src/SMESH_I/SMESH_Mesh_i.hxx | 2 +- src/SMESH_I/SMESH_NoteBook.cxx | 2 +- src/SMESH_I/SMESH_NoteBook.hxx | 2 +- src/SMESH_I/SMESH_Pattern_i.cxx | 2 +- src/SMESH_I/SMESH_Pattern_i.hxx | 2 +- src/SMESH_I/SMESH_PreMeshInfo.cxx | 2 +- src/SMESH_I/SMESH_PreMeshInfo.hxx | 2 +- src/SMESH_I/SMESH_PythonDump.hxx | 2 +- src/SMESH_I/SMESH_subMesh_i.cxx | 2 +- src/SMESH_I/SMESH_subMesh_i.hxx | 2 +- src/SMESH_PY/CMakeLists.txt | 2 +- src/SMESH_PY/__init__.py | 2 +- src/SMESH_PY/smeshstudytools.py | 2 +- src/SMESH_SWIG/CMakeLists.txt | 2 +- src/SMESH_SWIG/PAL_MESH_041_mesh.py | 2 +- src/SMESH_SWIG/PAL_MESH_043_2D.py | 2 +- src/SMESH_SWIG/PAL_MESH_043_3D.py | 2 +- src/SMESH_SWIG/SMESH_AdvancedEditor.py | 2 +- src/SMESH_SWIG/SMESH_BelongToGeom.py | 2 +- src/SMESH_SWIG/SMESH_BuildCompound.py | 2 +- src/SMESH_SWIG/SMESH_GroupFromGeom.py | 2 +- src/SMESH_SWIG/SMESH_GroupFromGeom2.py | 2 +- src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py | 2 +- src/SMESH_SWIG/SMESH_Nut.py | 2 +- src/SMESH_SWIG/SMESH_Partition1_tetra.py | 2 +- src/SMESH_SWIG/SMESH_Sphere.py | 2 +- src/SMESH_SWIG/SMESH_blocks.py | 2 +- src/SMESH_SWIG/SMESH_box.py | 2 +- src/SMESH_SWIG/SMESH_box2_tetra.py | 2 +- src/SMESH_SWIG/SMESH_box3_tetra.py | 2 +- src/SMESH_SWIG/SMESH_box_tetra.py | 2 +- src/SMESH_SWIG/SMESH_controls.py | 2 +- src/SMESH_SWIG/SMESH_demo_hexa2_upd.py | 2 +- src/SMESH_SWIG/SMESH_fixation.py | 2 +- src/SMESH_SWIG/SMESH_fixation_hexa.py | 2 +- src/SMESH_SWIG/SMESH_fixation_netgen.py | 2 +- src/SMESH_SWIG/SMESH_fixation_tetra.py | 2 +- src/SMESH_SWIG/SMESH_flight_skin.py | 2 +- src/SMESH_SWIG/SMESH_freebord.py | 2 +- src/SMESH_SWIG/SMESH_hexaedre.py | 2 +- src/SMESH_SWIG/SMESH_mechanic.py | 2 +- src/SMESH_SWIG/SMESH_mechanic_editor.py | 2 +- src/SMESH_SWIG/SMESH_mechanic_netgen.py | 2 +- src/SMESH_SWIG/SMESH_mechanic_tetra.py | 2 +- src/SMESH_SWIG/SMESH_reg.py | 2 +- src/SMESH_SWIG/SMESH_shared_modules.py | 2 +- src/SMESH_SWIG/SMESH_test.py | 2 +- src/SMESH_SWIG/SMESH_test0.py | 2 +- src/SMESH_SWIG/SMESH_test1.py | 2 +- src/SMESH_SWIG/SMESH_test1_AndDisplay.py | 2 +- src/SMESH_SWIG/SMESH_test2.py | 2 +- src/SMESH_SWIG/SMESH_test3.py | 2 +- src/SMESH_SWIG/SMESH_test4.py | 2 +- src/SMESH_SWIG/SMESH_test5.py | 2 +- src/SMESH_SWIG/StdMeshersBuilder.py | 2 +- src/SMESH_SWIG/__init__.py | 2 +- src/SMESH_SWIG/batchmode_mefisto.py | 2 +- src/SMESH_SWIG/batchmode_smesh.py | 2 +- src/SMESH_SWIG/ex00_all.py | 2 +- src/SMESH_SWIG/ex01_cube2build.py | 2 +- src/SMESH_SWIG/ex02_cube2primitive.py | 2 +- src/SMESH_SWIG/ex03_cube2partition.py | 2 +- src/SMESH_SWIG/ex04_cube5tetraHexa.py | 2 +- src/SMESH_SWIG/ex05_hole1build.py | 2 +- src/SMESH_SWIG/ex06_hole1boolean.py | 2 +- src/SMESH_SWIG/ex07_hole1partition.py | 2 +- src/SMESH_SWIG/ex08_hole2build.py | 2 +- src/SMESH_SWIG/ex09_grid4build.py | 2 +- src/SMESH_SWIG/ex10_grid4geometry.py | 2 +- src/SMESH_SWIG/ex11_grid3partition.py | 2 +- src/SMESH_SWIG/ex12_grid17partition.py | 2 +- src/SMESH_SWIG/ex13_hole1partial.py | 2 +- src/SMESH_SWIG/ex14_cyl1holed.py | 2 +- src/SMESH_SWIG/ex15_cyl2geometry.py | 2 +- src/SMESH_SWIG/ex16_cyl2complementary.py | 2 +- src/SMESH_SWIG/ex17_dome1.py | 2 +- src/SMESH_SWIG/ex18_dome2.py | 2 +- src/SMESH_SWIG/ex19_sphereINcube.py | 2 +- src/SMESH_SWIG/ex21_lamp.py | 2 +- src/SMESH_SWIG/ex24_cylinder.py | 2 +- src/SMESH_SWIG/ex29_refine.py | 2 +- src/SMESH_SWIG/ex30_groupsOp.py | 2 +- src/SMESH_SWIG/ex30_tepal.py | 2 +- src/SMESH_SWIG/ex31_dimGroup.py | 2 +- src/SMESH_SWIG/smesh.py | 2 +- src/SMESH_SWIG/smeshBuilder.py | 2 +- src/SMESH_SWIG/smesh_algorithm.py | 2 +- src/SMESH_SWIG/smesh_selection.py | 2 +- src/SMESH_SWIG_WITHIHM/CMakeLists.txt | 2 +- src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx | 2 +- src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h | 2 +- src/SMESH_SWIG_WITHIHM/libSMESH_Swig.i | 2 +- src/StdMeshers/CMakeLists.txt | 2 +- src/StdMeshers/SMESH_StdMeshers.hxx | 2 +- src/StdMeshers/StdMeshers_Adaptive1D.cxx | 2 +- src/StdMeshers/StdMeshers_Adaptive1D.hxx | 2 +- src/StdMeshers/StdMeshers_Arithmetic1D.cxx | 2 +- src/StdMeshers/StdMeshers_Arithmetic1D.hxx | 2 +- src/StdMeshers/StdMeshers_AutomaticLength.cxx | 2 +- src/StdMeshers/StdMeshers_AutomaticLength.hxx | 2 +- .../StdMeshers_CartesianParameters3D.cxx | 2 +- .../StdMeshers_CartesianParameters3D.hxx | 2 +- src/StdMeshers/StdMeshers_Cartesian_3D.cxx | 2 +- src/StdMeshers/StdMeshers_Cartesian_3D.hxx | 2 +- .../StdMeshers_CompositeHexa_3D.cxx | 2 +- .../StdMeshers_CompositeHexa_3D.hxx | 2 +- .../StdMeshers_CompositeSegment_1D.cxx | 2 +- .../StdMeshers_CompositeSegment_1D.hxx | 2 +- src/StdMeshers/StdMeshers_Deflection1D.cxx | 2 +- src/StdMeshers/StdMeshers_Deflection1D.hxx | 2 +- src/StdMeshers/StdMeshers_Distribution.cxx | 2 +- src/StdMeshers/StdMeshers_Distribution.hxx | 2 +- src/StdMeshers/StdMeshers_FaceSide.cxx | 2 +- src/StdMeshers/StdMeshers_FaceSide.hxx | 2 +- src/StdMeshers/StdMeshers_FixedPoints1D.cxx | 2 +- src/StdMeshers/StdMeshers_FixedPoints1D.hxx | 2 +- src/StdMeshers/StdMeshers_Geometric1D.cxx | 2 +- src/StdMeshers/StdMeshers_Geometric1D.hxx | 2 +- src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx | 2 +- src/StdMeshers/StdMeshers_HexaFromSkin_3D.hxx | 2 +- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 2 +- src/StdMeshers/StdMeshers_Hexa_3D.hxx | 2 +- src/StdMeshers/StdMeshers_ImportSource.cxx | 2 +- src/StdMeshers/StdMeshers_ImportSource.hxx | 2 +- src/StdMeshers/StdMeshers_Import_1D.cxx | 2 +- src/StdMeshers/StdMeshers_Import_1D.hxx | 2 +- src/StdMeshers/StdMeshers_Import_1D2D.cxx | 2 +- src/StdMeshers/StdMeshers_Import_1D2D.hxx | 2 +- .../StdMeshers_LayerDistribution.cxx | 2 +- .../StdMeshers_LayerDistribution.hxx | 2 +- .../StdMeshers_LayerDistribution2D.cxx | 2 +- .../StdMeshers_LayerDistribution2D.hxx | 2 +- src/StdMeshers/StdMeshers_LengthFromEdges.cxx | 2 +- src/StdMeshers/StdMeshers_LengthFromEdges.hxx | 2 +- src/StdMeshers/StdMeshers_LocalLength.cxx | 2 +- src/StdMeshers/StdMeshers_LocalLength.hxx | 2 +- src/StdMeshers/StdMeshers_MEFISTO_2D.cxx | 2 +- src/StdMeshers/StdMeshers_MEFISTO_2D.hxx | 2 +- src/StdMeshers/StdMeshers_MaxElementArea.cxx | 2 +- src/StdMeshers/StdMeshers_MaxElementArea.hxx | 2 +- .../StdMeshers_MaxElementVolume.cxx | 2 +- .../StdMeshers_MaxElementVolume.hxx | 2 +- src/StdMeshers/StdMeshers_MaxLength.cxx | 2 +- src/StdMeshers/StdMeshers_MaxLength.hxx | 2 +- .../StdMeshers_NotConformAllowed.cxx | 2 +- .../StdMeshers_NotConformAllowed.hxx | 2 +- src/StdMeshers/StdMeshers_NumberOfLayers.cxx | 2 +- src/StdMeshers/StdMeshers_NumberOfLayers.hxx | 2 +- .../StdMeshers_NumberOfLayers2D.cxx | 2 +- .../StdMeshers_NumberOfLayers2D.hxx | 2 +- .../StdMeshers_NumberOfSegments.cxx | 2 +- .../StdMeshers_NumberOfSegments.hxx | 2 +- src/StdMeshers/StdMeshers_Penta_3D.cxx | 2 +- src/StdMeshers/StdMeshers_Penta_3D.hxx | 2 +- .../StdMeshers_PolygonPerFace_2D.cxx | 2 +- .../StdMeshers_PolygonPerFace_2D.hxx | 2 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 2 +- src/StdMeshers/StdMeshers_Prism_3D.hxx | 2 +- .../StdMeshers_ProjectionSource1D.cxx | 2 +- .../StdMeshers_ProjectionSource1D.hxx | 2 +- .../StdMeshers_ProjectionSource2D.cxx | 2 +- .../StdMeshers_ProjectionSource2D.hxx | 2 +- .../StdMeshers_ProjectionSource3D.cxx | 2 +- .../StdMeshers_ProjectionSource3D.hxx | 2 +- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 2 +- src/StdMeshers/StdMeshers_ProjectionUtils.hxx | 2 +- src/StdMeshers/StdMeshers_Projection_1D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_1D.hxx | 2 +- src/StdMeshers/StdMeshers_Projection_1D2D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_1D2D.hxx | 2 +- src/StdMeshers/StdMeshers_Projection_2D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_2D.hxx | 2 +- src/StdMeshers/StdMeshers_Projection_3D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_3D.hxx | 2 +- src/StdMeshers/StdMeshers_Propagation.cxx | 2 +- src/StdMeshers/StdMeshers_Propagation.hxx | 2 +- .../StdMeshers_QuadFromMedialAxis_1D2D.cxx | 2 +- .../StdMeshers_QuadFromMedialAxis_1D2D.hxx | 2 +- .../StdMeshers_QuadToTriaAdaptor.cxx | 2 +- .../StdMeshers_QuadToTriaAdaptor.hxx | 2 +- .../StdMeshers_QuadrangleParams.cxx | 2 +- .../StdMeshers_QuadrangleParams.hxx | 2 +- .../StdMeshers_QuadranglePreference.cxx | 2 +- .../StdMeshers_QuadranglePreference.hxx | 2 +- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 2 +- src/StdMeshers/StdMeshers_Quadrangle_2D.hxx | 2 +- src/StdMeshers/StdMeshers_QuadraticMesh.cxx | 2 +- src/StdMeshers/StdMeshers_QuadraticMesh.hxx | 2 +- src/StdMeshers/StdMeshers_RadialPrism_3D.cxx | 2 +- src/StdMeshers/StdMeshers_RadialPrism_3D.hxx | 2 +- .../StdMeshers_RadialQuadrangle_1D2D.cxx | 2 +- .../StdMeshers_RadialQuadrangle_1D2D.hxx | 2 +- src/StdMeshers/StdMeshers_Regular_1D.cxx | 2 +- src/StdMeshers/StdMeshers_Regular_1D.hxx | 2 +- src/StdMeshers/StdMeshers_Reversible1D.cxx | 2 +- src/StdMeshers/StdMeshers_Reversible1D.hxx | 2 +- .../StdMeshers_SegmentAroundVertex_0D.cxx | 2 +- .../StdMeshers_SegmentAroundVertex_0D.hxx | 2 +- .../StdMeshers_SegmentLengthAroundVertex.cxx | 2 +- .../StdMeshers_SegmentLengthAroundVertex.hxx | 2 +- src/StdMeshers/StdMeshers_StartEndLength.cxx | 2 +- src/StdMeshers/StdMeshers_StartEndLength.hxx | 2 +- .../StdMeshers_UseExisting_1D2D.cxx | 2 +- .../StdMeshers_UseExisting_1D2D.hxx | 2 +- src/StdMeshers/StdMeshers_ViscousLayers.cxx | 2 +- src/StdMeshers/StdMeshers_ViscousLayers.hxx | 2 +- src/StdMeshers/StdMeshers_ViscousLayers2D.cxx | 2 +- src/StdMeshers/StdMeshers_ViscousLayers2D.hxx | 2 +- src/StdMeshersGUI/CMakeLists.txt | 2 +- src/StdMeshersGUI/SMESH_StdMeshersGUI.hxx | 2 +- src/StdMeshersGUI/StdMeshersGUI.cxx | 2 +- .../StdMeshersGUI_CartesianParamCreator.cxx | 2 +- .../StdMeshersGUI_CartesianParamCreator.h | 2 +- .../StdMeshersGUI_DistrPreview.cxx | 2 +- .../StdMeshersGUI_DistrPreview.h | 2 +- .../StdMeshersGUI_DistrTable.cxx | 2 +- src/StdMeshersGUI/StdMeshersGUI_DistrTable.h | 2 +- .../StdMeshersGUI_FixedPointsParamWdg.cxx | 2 +- .../StdMeshersGUI_FixedPointsParamWdg.h | 2 +- ...tdMeshersGUI_LayerDistributionParamWdg.cxx | 2 +- .../StdMeshersGUI_LayerDistributionParamWdg.h | 2 +- .../StdMeshersGUI_NbSegmentsCreator.cxx | 2 +- .../StdMeshersGUI_NbSegmentsCreator.h | 2 +- .../StdMeshersGUI_ObjectReferenceParamWdg.cxx | 2 +- .../StdMeshersGUI_ObjectReferenceParamWdg.h | 2 +- .../StdMeshersGUI_PropagationHelperWdg.cxx | 2 +- .../StdMeshersGUI_PropagationHelperWdg.h | 3 +- .../StdMeshersGUI_QuadrangleParamWdg.cxx | 2 +- .../StdMeshersGUI_QuadrangleParamWdg.h | 2 +- .../StdMeshersGUI_RadioButtonsGrpWdg.cxx | 2 +- .../StdMeshersGUI_RadioButtonsGrpWdg.h | 2 +- .../StdMeshersGUI_StdHypothesisCreator.cxx | 2 +- .../StdMeshersGUI_StdHypothesisCreator.h | 2 +- .../StdMeshersGUI_SubShapeSelectorWdg.cxx | 2 +- .../StdMeshersGUI_SubShapeSelectorWdg.h | 2 +- src/StdMeshers_I/CMakeLists.txt | 2 +- src/StdMeshers_I/SMESH_StdMeshers_I.hxx | 2 +- src/StdMeshers_I/StdMeshers_Adaptive1D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx | 2 +- .../StdMeshers_Arithmetic1D_i.cxx | 2 +- .../StdMeshers_Arithmetic1D_i.hxx | 2 +- .../StdMeshers_AutomaticLength_i.cxx | 2 +- .../StdMeshers_AutomaticLength_i.hxx | 2 +- .../StdMeshers_CartesianParameters3D_i.cxx | 2 +- .../StdMeshers_CartesianParameters3D_i.hxx | 2 +- .../StdMeshers_Cartesian_3D_i.cxx | 2 +- .../StdMeshers_Cartesian_3D_i.hxx | 2 +- .../StdMeshers_CompositeSegment_1D_i.cxx | 2 +- .../StdMeshers_CompositeSegment_1D_i.hxx | 2 +- .../StdMeshers_Deflection1D_i.cxx | 2 +- .../StdMeshers_Deflection1D_i.hxx | 2 +- .../StdMeshers_FixedPoints1D_i.cxx | 2 +- .../StdMeshers_FixedPoints1D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx | 2 +- .../StdMeshers_ImportSource1D_i.cxx | 2 +- .../StdMeshers_ImportSource1D_i.hxx | 2 +- .../StdMeshers_ImportSource2D_i.cxx | 2 +- .../StdMeshers_ImportSource2D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Import_1D2D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Import_1D2D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Import_1D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Import_1D_i.hxx | 2 +- .../StdMeshers_LayerDistribution2D_i.cxx | 2 +- .../StdMeshers_LayerDistribution2D_i.hxx | 2 +- .../StdMeshers_LayerDistribution_i.cxx | 2 +- .../StdMeshers_LayerDistribution_i.hxx | 2 +- .../StdMeshers_LengthFromEdges_i.cxx | 2 +- .../StdMeshers_LengthFromEdges_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_LocalLength_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_LocalLength_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx | 2 +- .../StdMeshers_MaxElementArea_i.cxx | 2 +- .../StdMeshers_MaxElementArea_i.hxx | 2 +- .../StdMeshers_MaxElementVolume_i.cxx | 2 +- .../StdMeshers_MaxElementVolume_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_MaxLength_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_MaxLength_i.hxx | 2 +- .../StdMeshers_NotConformAllowed_i.cxx | 2 +- .../StdMeshers_NotConformAllowed_i.hxx | 2 +- .../StdMeshers_NumberOfLayers2D_i.cxx | 2 +- .../StdMeshers_NumberOfLayers2D_i.hxx | 2 +- .../StdMeshers_NumberOfLayers_i.cxx | 2 +- .../StdMeshers_NumberOfLayers_i.hxx | 2 +- .../StdMeshers_NumberOfSegments_i.cxx | 2 +- .../StdMeshers_NumberOfSegments_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx | 2 +- src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx | 2 +- .../StdMeshers_PolygonPerFace_2D_i.cxx | 2 +- .../StdMeshers_PolygonPerFace_2D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx | 2 +- .../StdMeshers_ProjectionSource1D_i.cxx | 2 +- .../StdMeshers_ProjectionSource1D_i.hxx | 2 +- .../StdMeshers_ProjectionSource2D_i.cxx | 2 +- .../StdMeshers_ProjectionSource2D_i.hxx | 2 +- .../StdMeshers_ProjectionSource3D_i.cxx | 2 +- .../StdMeshers_ProjectionSource3D_i.hxx | 2 +- .../StdMeshers_Projection_1D_2D_3D_i.cxx | 2 +- .../StdMeshers_Projection_1D_2D_3D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Propagation_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Propagation_i.hxx | 2 +- .../StdMeshers_QuadrangleParams_i.cxx | 2 +- .../StdMeshers_QuadrangleParams_i.hxx | 2 +- .../StdMeshers_QuadranglePreference_i.cxx | 2 +- .../StdMeshers_QuadranglePreference_i.hxx | 2 +- .../StdMeshers_Quadrangle_2D_i.cxx | 2 +- .../StdMeshers_Quadrangle_2D_i.hxx | 2 +- .../StdMeshers_QuadraticMesh_i.cxx | 2 +- .../StdMeshers_QuadraticMesh_i.hxx | 2 +- .../StdMeshers_RadialQuadrangle_1D2D_i.cxx | 2 +- .../StdMeshers_RadialQuadrangle_1D2D_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx | 2 +- src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx | 2 +- .../StdMeshers_Reversible1D_i.cxx | 2 +- .../StdMeshers_Reversible1D_i.hxx | 2 +- .../StdMeshers_SegmentAroundVertex_0D_i.cxx | 2 +- .../StdMeshers_SegmentAroundVertex_0D_i.hxx | 2 +- ...StdMeshers_SegmentLengthAroundVertex_i.cxx | 2 +- ...StdMeshers_SegmentLengthAroundVertex_i.hxx | 2 +- .../StdMeshers_StartEndLength_i.cxx | 2 +- .../StdMeshers_StartEndLength_i.hxx | 2 +- .../StdMeshers_UseExisting_1D2D_i.cxx | 2 +- .../StdMeshers_UseExisting_1D2D_i.hxx | 2 +- .../StdMeshers_ViscousLayers2D_i.cxx | 2 +- .../StdMeshers_ViscousLayers2D_i.hxx | 2 +- .../StdMeshers_ViscousLayers_i.cxx | 2 +- .../StdMeshers_ViscousLayers_i.hxx | 2 +- src/StdMeshers_I/StdMeshers_i.cxx | 2 +- src/Tools/CMakeLists.txt | 2 +- src/Tools/MGCleanerPlug/CMakeLists.txt | 2 +- .../MGCleanerPlug/MGCleanerMonPlugDialog.py | 2 +- .../MGCleanerPlug/MGCleanerMonViewText.py | 2 +- .../MGCleanerPlug/MGCleanerplug_plugin.py | 2 +- src/Tools/MGCleanerPlug/doc/CMakeLists.txt | 2 +- src/Tools/MGCleanerPlug/doc/conf.py.in | 2 +- src/Tools/MacMesh/CMakeLists.txt | 2 +- src/Tools/MacMesh/Example/PressureValve.py.in | 2 +- src/Tools/MacMesh/MacMesh/Alarms.py | 2 +- src/Tools/MacMesh/MacMesh/CentralUnrefine.py | 2 +- src/Tools/MacMesh/MacMesh/CompositeBox.py | 2 +- src/Tools/MacMesh/MacMesh/CompositeBoxF.py | 2 +- src/Tools/MacMesh/MacMesh/Config.py | 2 +- src/Tools/MacMesh/MacMesh/CutnGroup.py | 2 +- src/Tools/MacMesh/MacMesh/Cylinder.py | 2 +- src/Tools/MacMesh/MacMesh/GenFunctions.py | 2 +- src/Tools/MacMesh/MacMesh/MacObject.py | 2 +- src/Tools/MacMesh/MacMesh/PublishGroups.py | 2 +- src/Tools/MacMesh/MacMesh/SharpAngle.py | 2 +- src/Tools/MeshCut/AUTHORS | 2 +- src/Tools/MeshCut/CMakeLists.txt | 2 +- src/Tools/MeshCut/MeshCut_Carre.cxx | 2 +- src/Tools/MeshCut/MeshCut_Carre.hxx | 2 +- src/Tools/MeshCut/MeshCut_Cas.cxx | 2 +- src/Tools/MeshCut/MeshCut_Cas.hxx | 2 +- src/Tools/MeshCut/MeshCut_Cube.cxx | 2 +- src/Tools/MeshCut/MeshCut_Cube.hxx | 2 +- src/Tools/MeshCut/MeshCut_DC.cxx | 2 +- src/Tools/MeshCut/MeshCut_Fonctions.cxx | 2 +- src/Tools/MeshCut/MeshCut_Fonctions.hxx | 2 +- src/Tools/MeshCut/MeshCut_Globals.hxx | 2 +- src/Tools/MeshCut/MeshCut_Maillage.cxx | 2 +- src/Tools/MeshCut/MeshCut_Maillage.hxx | 2 +- src/Tools/MeshCut/MeshCut_Utils.cxx | 2 +- src/Tools/MeshCut/MeshCut_Utils.hxx | 2 +- src/Tools/MeshCut/meshcut_plugin.py | 2 +- src/Tools/Verima/Base/CMakeLists.txt | 2 +- src/Tools/Verima/Base/__init__.py | 2 +- src/Tools/Verima/CMakeLists.txt | 2 +- src/Tools/Verima/CreeDocuments/CMakeLists.txt | 2 +- src/Tools/Verima/CreeDocuments/__init__.py | 2 +- .../templatesHtml/CMakeLists.txt | 2 +- src/Tools/Verima/Doc/CMakeLists.txt | 2 +- src/Tools/Verima/Doc/conf.py | 179 ------- src/Tools/Verima/Doc/conf.py.in | 2 +- src/Tools/Verima/Doc/makefile | 2 +- src/Tools/Verima/Gui/CMakeLists.txt | 2 +- src/Tools/Verima/Gui/__init__.py | 2 +- src/Tools/Verima/Stats/CMakeLists.txt | 2 +- src/Tools/Verima/Stats/__init__.py | 2 +- src/Tools/Verima/__init__.py | 2 +- src/Tools/YamsPlug/CMakeLists.txt | 2 +- src/Tools/YamsPlug/doc/CMakeLists.txt | 2 +- src/Tools/YamsPlug/doc/conf.py.in | 2 +- src/Tools/YamsPlug/monViewText.py | 2 +- src/Tools/YamsPlug/monYamsPlugDialog.py | 2 +- src/Tools/YamsPlug/yamsplug_plugin.py | 2 +- src/Tools/ZCracksPlug/CMakeLists.txt | 2 +- src/Tools/ZCracksPlug/doc/CMakeLists.txt | 2 +- src/Tools/ZCracksPlug/doc/conf.py.in | 2 +- src/Tools/ZCracksPlug/zcracks_plugin.py | 2 +- src/Tools/blocFissure/CMakeLists.txt | 2 +- src/Tools/blocFissure/CasTests/CMakeLists.txt | 2 +- src/Tools/blocFissure/doc/CMakeLists.txt | 2 +- src/Tools/blocFissure/gmu/CMakeLists.txt | 2 +- src/Tools/blocFissure/ihm/CMakeLists.txt | 2 +- .../blocFissure/ihm/fissureCoude_plugin.py | 4 +- .../blocFissure/ihm/fissureGenerale_plugin.py | 4 +- .../materielCasTests/CMakeLists.txt | 2 +- src/Tools/padder/CMakeLists.txt | 2 +- src/Tools/padder/doc/CMakeLists.txt | 2 +- src/Tools/padder/doc/doxyfile.in | 2 +- src/Tools/padder/meshjob/CMakeLists.txt | 2 +- src/Tools/padder/meshjob/idl/CMakeLists.txt | 2 +- src/Tools/padder/meshjob/idl/MESHJOB.idl | 2 +- .../padder/meshjob/idl/SPADDERPluginTest.idl | 2 +- src/Tools/padder/meshjob/impl/CMakeLists.txt | 2 +- .../padder/meshjob/impl/MeshJobManager_i.cxx | 2 +- .../padder/meshjob/impl/MeshJobManager_i.hxx | 2 +- .../meshjob/impl/SPADDERPluginTester_i.cxx | 2 +- .../meshjob/impl/SPADDERPluginTester_i.hxx | 2 +- src/Tools/padder/meshjob/impl/testhelper.hxx | 2 +- src/Tools/padder/resources/CMakeLists.txt | 2 +- .../resources/testdata/buildparticules.py | 2 +- src/Tools/padder/spadderpy/CMakeLists.txt | 2 +- src/Tools/padder/spadderpy/__init__.py | 2 +- src/Tools/padder/spadderpy/configreader.py | 2 +- src/Tools/padder/spadderpy/gui/CMakeLists.txt | 2 +- src/Tools/padder/spadderpy/gui/inputdata.py | 2 +- src/Tools/padder/spadderpy/gui/inputdialog.py | 2 +- .../padder/spadderpy/gui/plugindialog.py | 2 +- .../padder/spadderpy/plugin/CMakeLists.txt | 2 +- .../padder/spadderpy/plugin/envPlugins.sh.in | 2 +- .../padder/spadderpy/plugin/spadderPlugin.py | 2 +- src/Tools/padder/unittests/CMakeLists.txt | 2 +- src/Tools/padder/unittests/__init__.py | 2 +- src/Tools/padder/unittests/autotest.sh.in | 2 +- .../unittests/usecase_meshJobManager.py | 2 +- .../unittests/usecase_spadderPluginTester.py | 2 +- src/Tools/smesh_plugins.py | 2 +- 990 files changed, 1104 insertions(+), 1705 deletions(-) delete mode 100644 AUTHORS delete mode 100644 INSTALL delete mode 100644 LICENCE delete mode 100644 NEWS delete mode 100644 cvs-tags delete mode 100644 src/Tools/Verima/Doc/conf.py diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/CMakeLists.txt b/CMakeLists.txt index 312c48e84..89369d158 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 0ea0b81cb..000000000 --- a/INSTALL +++ /dev/null @@ -1 +0,0 @@ -SALOME2 : SMESH module diff --git a/LICENCE b/LICENCE deleted file mode 100644 index b1e3f5a26..000000000 --- a/LICENCE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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, or (at your option) any later version. - - 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 - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/README b/README index e69de29bb..78f5c9b6f 100644 --- a/README +++ b/README @@ -0,0 +1,119 @@ +***************** +About SALOME Mesh +***************** + +SALOME Mesh module implements the functionalities for: +- Creating meshes in different ways: + * By meshing geometrical models previously created or imported by the Geometry + component; + * Bottom-up, using mesh edition operations, especially extrusion and revolution; + * By generation of the 3D mesh from the 2D mesh (the latter can be either imported + or manually created). +- Importing and exporting meshes in various formats. +- Modifying meshes with a vast array of dedicated operations. +- Creating groups of mesh elements. +- Filtering mesh entities (nodes or elements) using Filters functionality for + creating groups and applying mesh modifications. +- Viewing meshes in the VTK viewer and getting info on mesh and its sub-objects. +- Applying to meshes Quality Controls, allowing to highlight important elements. +- Taking various measurements of the mesh objects. + +For more information please visit the SALOME platform web site: + + + +======= +License +======= + +SALOME platform is distributed under the GNU Lesser General Public License. +See COPYING file for more details. + +Also, additional information can be found at SALOME platform web site: + + + +============ +Installation +============ + +-------------- +Pre-requisites +-------------- + +SALOME platform relies on a set of third-party softwares; some of them are needed +at build time only, while other ones are needed in runtime also. + +For more information about the pre-requisites please visit SALOME platform web +site: + +* Check Release Notes and Software Requirements of the latest SALOME release at + + + +* Pre-requisites page at SALOME web site: + + + +Note: SALOME Mesh module needs SALOME KERNEL, SALOME GUI and SALOME Geometry as +pre-requisites. + +------------------ +Basic Installation +------------------ + +The build procedure of the SALOME platform is implemented with CMake. +In order to build the module you have to do the following actions: + +1. Set up environment for pre-requisites (see "Pre-requisites" section above). + +2. Create a build directory: + + % mkdir SMESH_BUILD + +3. Configure the build procedure: + + % cd SMESH_BUILD + % cmake -DCMAKE_BUILD_TYPE= -DCMAKE_INSTALL_PREFIX= + + where + - is either Release or Debug (default: Release); + - is a destination folder to install SALOME Mesh + module (default: /usr); + - is a path to the SALOME Mesh sources directory. + + Note: by default (if CMAKE_INSTALL_PREFIX option is not given), SALOME Mesh + module will be configured for installation to the /usr directory that requires + root permissions to complete the installation. + +4. Build and install: + + % make + % make install + + This will install SALOME Mesh module to the + specified to cmake command on the previous step. + +------------------- +Custom installation +------------------- + +SALOME Mesh module supports a set of advanced configuration options; +for more details learn CMakeLists.txt file in the root source directory. + +You can also use other options of cmake command to customize your installation. +Learn more about available options by typing + + % cmake --help + +============= +Documentation +============= + +The directory doc contains additional documentation file of SALOME Mesh module. + +=============== +Troubleshooting +=============== + +Please, send a mail to webmaster.salome@opencascade.com. diff --git a/SMESH_version.h.in b/SMESH_version.h.in index 79e9367d3..b12be09f3 100644 --- a/SMESH_version.h.in +++ b/SMESH_version.h.in @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 3ec182cbe..5b4233425 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -5,7 +5,7 @@ # ############################################################### -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/CMakeLists.txt b/adm_local/CMakeLists.txt index 3f181513f..4150922ef 100755 --- a/adm_local/CMakeLists.txt +++ b/adm_local/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt index 9be31435b..e38f32ae0 100755 --- a/adm_local/cmake_files/CMakeLists.txt +++ b/adm_local/cmake_files/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/cmake_files/FindCGNS.cmake b/adm_local/cmake_files/FindCGNS.cmake index 94535f27e..a60b77637 100644 --- a/adm_local/cmake_files/FindCGNS.cmake +++ b/adm_local/cmake_files/FindCGNS.cmake @@ -5,7 +5,7 @@ # ######################################################################### -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/cmake_files/FindSMESH.cmake b/adm_local/cmake_files/FindSMESH.cmake index e05012824..9a4ba3c87 100644 --- a/adm_local/cmake_files/FindSMESH.cmake +++ b/adm_local/cmake_files/FindSMESH.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/cmake_files/FindSalomeCGNS.cmake b/adm_local/cmake_files/FindSalomeCGNS.cmake index a49239168..c3cf74565 100644 --- a/adm_local/cmake_files/FindSalomeCGNS.cmake +++ b/adm_local/cmake_files/FindSalomeCGNS.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/cmake_files/FindSalomeSMESH.cmake b/adm_local/cmake_files/FindSalomeSMESH.cmake index dc63bd2fa..da6fbd6ee 100644 --- a/adm_local/cmake_files/FindSalomeSMESH.cmake +++ b/adm_local/cmake_files/FindSalomeSMESH.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/cmake_files/FindSalomeTBB.cmake b/adm_local/cmake_files/FindSalomeTBB.cmake index 0fc8270ee..5934aa531 100644 --- a/adm_local/cmake_files/FindSalomeTBB.cmake +++ b/adm_local/cmake_files/FindSalomeTBB.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/cmake_files/FindSalomef2c.cmake b/adm_local/cmake_files/FindSalomef2c.cmake index 4deefa22e..08f824b1c 100755 --- a/adm_local/cmake_files/FindSalomef2c.cmake +++ b/adm_local/cmake_files/FindSalomef2c.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/cmake_files/FindTBB.cmake b/adm_local/cmake_files/FindTBB.cmake index a1592539f..0f4077fa7 100644 --- a/adm_local/cmake_files/FindTBB.cmake +++ b/adm_local/cmake_files/FindTBB.cmake @@ -5,7 +5,7 @@ # ######################################################################### -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/cmake_files/Findf2c.cmake b/adm_local/cmake_files/Findf2c.cmake index 8510af1c7..08a131cda 100755 --- a/adm_local/cmake_files/Findf2c.cmake +++ b/adm_local/cmake_files/Findf2c.cmake @@ -6,7 +6,7 @@ # ######################################################################### -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/CMakeLists.txt b/adm_local/unix/CMakeLists.txt index 0e7521931..b27faef5b 100755 --- a/adm_local/unix/CMakeLists.txt +++ b/adm_local/unix/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/adm_local/unix/config_files/CMakeLists.txt b/adm_local/unix/config_files/CMakeLists.txt index 28926ce57..8d31a490e 100755 --- a/adm_local/unix/config_files/CMakeLists.txt +++ b/adm_local/unix/config_files/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_Platform.m4 b/adm_local/unix/config_files/check_Platform.m4 index 37cb27288..6a6fd4ca8 100755 --- a/adm_local/unix/config_files/check_Platform.m4 +++ b/adm_local/unix/config_files/check_Platform.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_SMESH.m4 b/adm_local/unix/config_files/check_SMESH.m4 index 189e12c85..bd2cb2208 100644 --- a/adm_local/unix/config_files/check_SMESH.m4 +++ b/adm_local/unix/config_files/check_SMESH.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_cgal.m4 b/adm_local/unix/config_files/check_cgal.m4 index 3f5d6b0eb..780f24bc2 100644 --- a/adm_local/unix/config_files/check_cgal.m4 +++ b/adm_local/unix/config_files/check_cgal.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_cgns.m4 b/adm_local/unix/config_files/check_cgns.m4 index 27d5741bc..3dfd6cf53 100644 --- a/adm_local/unix/config_files/check_cgns.m4 +++ b/adm_local/unix/config_files/check_cgns.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_f77.m4 b/adm_local/unix/config_files/check_f77.m4 index 9c74dee19..7c0906ead 100644 --- a/adm_local/unix/config_files/check_f77.m4 +++ b/adm_local/unix/config_files/check_f77.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_padder.m4 b/adm_local/unix/config_files/check_padder.m4 index 5c65463f2..f4a9fdc78 100644 --- a/adm_local/unix/config_files/check_padder.m4 +++ b/adm_local/unix/config_files/check_padder.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/adm_local/unix/config_files/check_qwt.m4 b/adm_local/unix/config_files/check_qwt.m4 index 43595035b..8c0fe5f73 100644 --- a/adm_local/unix/config_files/check_qwt.m4 +++ b/adm_local/unix/config_files/check_qwt.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +dnl Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE dnl dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 1b651f73d..a60ce61e1 100755 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/bin/smesh_setenv.py b/bin/smesh_setenv.py index bdb3afd23..8c888cb9e 100644 --- a/bin/smesh_setenv.py +++ b/bin/smesh_setenv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/cvs-tags b/cvs-tags deleted file mode 100644 index 6991d061f..000000000 --- a/cvs-tags +++ /dev/null @@ -1,35 +0,0 @@ -Start-v1_1a: ? - ? - -V1_2_1: ? - ? - -V1_2_2: 2003-09-26 17:00 - New data structure in SMDS. - -nadir_1_2_2: 2003-10-06 12:50 - Branch after V1_2_2. Developpement branch for user nadir - -merge_1_2_c__1_2_2: 2003-10-17 14:35 - Branch after V1_2_2. Branch to merge Salome 1.2c. Initiated by Paul Rascle. - -MergeV1_2c-1: 2003-10-19 13:49 - End of merge_1_2_c__1_2_2 branch. This branch is ready to be merge with the head. - -V1_3_0b1: 2003-11-12 - First pre-release of 1.3.0. Include the merge of 1.2c branch. - -nadir_update_MED_v1_3_0: 2003-11-17 10:22 - New branch for user nadir. Synchronization of API with MED 1.3. - -V1_3_0b2: 2003-11-18 - Second pre-release of 1.3.0. Synchronization of API with MED 1.3. - -V1_3_0: 2003-11-25 08:52 - Release 1.3.0. - -V1_3_1: 2004-01-05 14:28 - Release 1.3.1. Added Netgen. - -merge_1_2_d: 2003-01-20 11:25 - Branch to merge Release 1.2d of Salome Pro. diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 8bfe7cab7..beddf10e4 100755 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/CMakeLists.txt b/doc/salome/CMakeLists.txt index 1ccad11e2..88fb17859 100755 --- a/doc/salome/CMakeLists.txt +++ b/doc/salome/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/examples/CMakeLists.txt b/doc/salome/examples/CMakeLists.txt index 65d8e52e2..942c3b023 100644 --- a/doc/salome/examples/CMakeLists.txt +++ b/doc/salome/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/doc/salome/examples/CTestTestfileInstall.cmake b/doc/salome/examples/CTestTestfileInstall.cmake index ef512ff06..d56f42065 100644 --- a/doc/salome/examples/CTestTestfileInstall.cmake +++ b/doc/salome/examples/CTestTestfileInstall.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2015 CEA/DEN, EDF R&D +# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/doc/salome/examples/testme.py b/doc/salome/examples/testme.py index cd74c4495..6a502d00d 100755 --- a/doc/salome/examples/testme.py +++ b/doc/salome/examples/testme.py @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 1a8d6cf4d..07de864c8 100755 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/gui/SMESH/CMakeLists.txt b/doc/salome/gui/SMESH/CMakeLists.txt index a221bbfe8..1dfd05b52 100644 --- a/doc/salome/gui/SMESH/CMakeLists.txt +++ b/doc/salome/gui/SMESH/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/doc/salome/gui/SMESH/collect_mesh_methods.py b/doc/salome/gui/SMESH/collect_mesh_methods.py index 0d55a3c74..7aa83b084 100755 --- a/doc/salome/gui/SMESH/collect_mesh_methods.py +++ b/doc/salome/gui/SMESH/collect_mesh_methods.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: iso-8859-1 -*- -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/doc/salome/gui/SMESH/doxyfile.in b/doc/salome/gui/SMESH/doxyfile.in index 03d6398e0..6374b61b9 100755 --- a/doc/salome/gui/SMESH/doxyfile.in +++ b/doc/salome/gui/SMESH/doxyfile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/gui/SMESH/doxyfile_py.in b/doc/salome/gui/SMESH/doxyfile_py.in index 6cb04289b..d48007ab2 100755 --- a/doc/salome/gui/SMESH/doxyfile_py.in +++ b/doc/salome/gui/SMESH/doxyfile_py.in @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/gui/SMESH/static/footer.html b/doc/salome/gui/SMESH/static/footer.html index affd43d84..91afd6cc8 100755 --- a/doc/salome/gui/SMESH/static/footer.html +++ b/doc/salome/gui/SMESH/static/footer.html @@ -4,7 +4,7 @@
        $navpath
      diff --git a/doc/salome/tui/CMakeLists.txt b/doc/salome/tui/CMakeLists.txt index 6112e4024..c24a1eaeb 100755 --- a/doc/salome/tui/CMakeLists.txt +++ b/doc/salome/tui/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in index 3b002f990..654668715 100755 --- a/doc/salome/tui/doxyfile.in +++ b/doc/salome/tui/doxyfile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/doc/salome/tui/static/footer.html b/doc/salome/tui/static/footer.html index affd43d84..91afd6cc8 100755 --- a/doc/salome/tui/static/footer.html +++ b/doc/salome/tui/static/footer.html @@ -4,7 +4,7 @@
        $navpath
      diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 92bfcc47e..4122cf306 100755 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/idl/SMESH_BasicHypothesis.idl b/idl/SMESH_BasicHypothesis.idl index 62e4ed488..a6a0fef9f 100644 --- a/idl/SMESH_BasicHypothesis.idl +++ b/idl/SMESH_BasicHypothesis.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Filter.idl b/idl/SMESH_Filter.idl index 738aa325e..7625bba24 100644 --- a/idl/SMESH_Filter.idl +++ b/idl/SMESH_Filter.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index ec43ae714..75fbe0894 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Group.idl b/idl/SMESH_Group.idl index bdc3d6312..e5e533d18 100644 --- a/idl/SMESH_Group.idl +++ b/idl/SMESH_Group.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Hypothesis.idl b/idl/SMESH_Hypothesis.idl index ab6e7dd43..397079a96 100644 --- a/idl/SMESH_Hypothesis.idl +++ b/idl/SMESH_Hypothesis.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Measurements.idl b/idl/SMESH_Measurements.idl index 2da555d91..cb6d68acf 100644 --- a/idl/SMESH_Measurements.idl +++ b/idl/SMESH_Measurements.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 9ede0252f..51c98282c 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl index b28fb1432..28bc6f912 100644 --- a/idl/SMESH_MeshEditor.idl +++ b/idl/SMESH_MeshEditor.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/idl/SMESH_Pattern.idl b/idl/SMESH_Pattern.idl index 8799f2739..4e3b37f40 100644 --- a/idl/SMESH_Pattern.idl +++ b/idl/SMESH_Pattern.idl @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 66f426f00..9975b95b2 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/resources/SMESHCatalog.xml.in b/resources/SMESHCatalog.xml.in index 429d96009..a1d573d7f 100644 --- a/resources/SMESHCatalog.xml.in +++ b/resources/SMESHCatalog.xml.in @@ -1,6 +1,6 @@ tetrahedron - if (nbRepl == 3 && - iRepl[ 0 ] > 2 && iRepl[ 1 ] > 2 && iRepl[ 2 ] > 2 ) { - // all top nodes stick: reverse a bottom - uniqueNodes[ 0 ] = curNodes [ 1 ]; - uniqueNodes[ 1 ] = curNodes [ 0 ]; + if ( curNodes[3] == curNodes[4] && + curNodes[3] == curNodes[5] ) { + // top nodes stick + isOk = true; } - else if (nbRepl == 3 && - iRepl[ 0 ] < 3 && iRepl[ 1 ] < 3 && iRepl[ 2 ] < 3 ) { - // all bottom nodes stick: set a top before + else if ( curNodes[0] == curNodes[1] && + curNodes[0] == curNodes[2] ) { + // bottom nodes stick: set a top before uniqueNodes[ 3 ] = uniqueNodes [ 0 ]; - uniqueNodes[ 0 ] = curNodes [ 3 ]; + uniqueNodes[ 0 ] = curNodes [ 5 ]; uniqueNodes[ 1 ] = curNodes [ 4 ]; - uniqueNodes[ 2 ] = curNodes [ 5 ]; + uniqueNodes[ 2 ] = curNodes [ 3 ]; + isOk = true; } - else if (nbRepl == 4 && - iRepl[ 2 ] - iRepl [ 0 ] == 3 && iRepl[ 3 ] - iRepl [ 1 ] == 3 ) { - // a lateral face turns into a line: reverse a bottom - uniqueNodes[ 0 ] = curNodes [ 1 ]; - uniqueNodes[ 1 ] = curNodes [ 0 ]; + else if (( curNodes[0] == curNodes[3] ) + + ( curNodes[1] == curNodes[4] ) + + ( curNodes[2] == curNodes[5] ) == 2 ) { + // a lateral face turns into a line + isOk = true; } - else - isOk = false; } else if ( nbUniqueNodes == 5 ) { - // PENTAHEDRON --------------------> 2 tetrahedrons - if ( nbRepl == 2 && iRepl[ 1 ] - iRepl [ 0 ] == 3 ) { - // a bottom node sticks with a linked top one - // 1. - SMDS_MeshElement* newElem = - aMesh->AddVolume(curNodes[ 3 ], - curNodes[ 4 ], - curNodes[ 5 ], - curNodes[ iRepl[ 0 ] == 2 ? 1 : 2 ]); - myLastCreatedElems.Append(newElem); - if ( aShapeId ) - aMesh->SetMeshElementOnShape( newElem, aShapeId ); - // 2. : reverse a bottom - uniqueNodes[ 0 ] = curNodes [ 1 ]; - uniqueNodes[ 1 ] = curNodes [ 0 ]; - nbUniqueNodes = 4; + // PENTAHEDRON --------------------> pyramid + if ( curNodes[0] == curNodes[3] ) + { + uniqueNodes[ 0 ] = curNodes[ 1 ]; + uniqueNodes[ 1 ] = curNodes[ 4 ]; + uniqueNodes[ 2 ] = curNodes[ 5 ]; + uniqueNodes[ 3 ] = curNodes[ 2 ]; + uniqueNodes[ 4 ] = curNodes[ 0 ]; + isOk = true; + } + if ( curNodes[1] == curNodes[4] ) + { + uniqueNodes[ 0 ] = curNodes[ 0 ]; + uniqueNodes[ 1 ] = curNodes[ 2 ]; + uniqueNodes[ 2 ] = curNodes[ 5 ]; + uniqueNodes[ 3 ] = curNodes[ 3 ]; + uniqueNodes[ 4 ] = curNodes[ 1 ]; + isOk = true; + } + if ( curNodes[2] == curNodes[5] ) + { + uniqueNodes[ 0 ] = curNodes[ 0 ]; + uniqueNodes[ 1 ] = curNodes[ 3 ]; + uniqueNodes[ 2 ] = curNodes[ 4 ]; + uniqueNodes[ 3 ] = curNodes[ 1 ]; + uniqueNodes[ 4 ] = curNodes[ 2 ]; + isOk = true; } - else - isOk = false; } - else - isOk = false; break; - case 8: { - if(elem->IsQuadratic()) { // Quadratic quadrangle - // 1 5 2 - // +---+---+ - // | | - // | | - // 4+ +6 - // | | - // | | - // +---+---+ - // 0 7 3 - isOk = false; - if(nbRepl==2) { - MESSAGE("nbRepl=2: " << iRepl[0] << " " << iRepl[1]); - } - if(nbRepl==3) { - MESSAGE("nbRepl=3: " << iRepl[0] << " " << iRepl[1] << " " << iRepl[2]); - nbUniqueNodes = 6; - if( iRepl[0]==0 && iRepl[1]==1 && iRepl[2]==4 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[2]; - uniqueNodes[2] = curNodes[3]; - uniqueNodes[3] = curNodes[5]; - uniqueNodes[4] = curNodes[6]; - uniqueNodes[5] = curNodes[7]; - isOk = true; - } - if( iRepl[0]==0 && iRepl[1]==3 && iRepl[2]==7 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[1]; - uniqueNodes[2] = curNodes[2]; - uniqueNodes[3] = curNodes[4]; - uniqueNodes[4] = curNodes[5]; - uniqueNodes[5] = curNodes[6]; - isOk = true; - } - if( iRepl[0]==0 && iRepl[1]==4 && iRepl[2]==7 ) { - uniqueNodes[0] = curNodes[1]; - uniqueNodes[1] = curNodes[2]; - uniqueNodes[2] = curNodes[3]; - uniqueNodes[3] = curNodes[5]; - uniqueNodes[4] = curNodes[6]; - uniqueNodes[5] = curNodes[0]; - isOk = true; - } - if( iRepl[0]==1 && iRepl[1]==2 && iRepl[2]==5 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[1]; - uniqueNodes[2] = curNodes[3]; - uniqueNodes[3] = curNodes[4]; - uniqueNodes[4] = curNodes[6]; - uniqueNodes[5] = curNodes[7]; - isOk = true; - } - if( iRepl[0]==1 && iRepl[1]==4 && iRepl[2]==5 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[2]; - uniqueNodes[2] = curNodes[3]; - uniqueNodes[3] = curNodes[1]; - uniqueNodes[4] = curNodes[6]; - uniqueNodes[5] = curNodes[7]; - isOk = true; - } - if( iRepl[0]==2 && iRepl[1]==3 && iRepl[2]==6 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[1]; - uniqueNodes[2] = curNodes[2]; - uniqueNodes[3] = curNodes[4]; - uniqueNodes[4] = curNodes[5]; - uniqueNodes[5] = curNodes[7]; - isOk = true; - } - if( iRepl[0]==2 && iRepl[1]==5 && iRepl[2]==6 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[1]; - uniqueNodes[2] = curNodes[3]; - uniqueNodes[3] = curNodes[4]; - uniqueNodes[4] = curNodes[2]; - uniqueNodes[5] = curNodes[7]; - isOk = true; - } - if( iRepl[0]==3 && iRepl[1]==6 && iRepl[2]==7 ) { - uniqueNodes[0] = curNodes[0]; - uniqueNodes[1] = curNodes[1]; - uniqueNodes[2] = curNodes[2]; - uniqueNodes[3] = curNodes[4]; - uniqueNodes[4] = curNodes[5]; - uniqueNodes[5] = curNodes[3]; - isOk = true; - } - } - if(nbRepl==4) { - MESSAGE("nbRepl=4: " << iRepl[0] << " " << iRepl[1] << " " << iRepl[2] << " " << iRepl[3]); - } - if(nbRepl==5) { - MESSAGE("nbRepl=5: " << iRepl[0] << " " << iRepl[1] << " " << iRepl[2] << " " << iRepl[3] << " " << iRepl[4]); - } - break; - } + } + case SMDSEntity_Hexa: + { //////////////////////////////////// HEXAHEDRON isOk = false; SMDS_VolumeTool hexa (elem); hexa.SetExternalNormal(); if ( nbUniqueNodes == 4 && nbRepl == 4 ) { - //////////////////////// HEX ---> 1 tetrahedron + //////////////////////// HEX ---> tetrahedron for ( int iFace = 0; iFace < 6; iFace++ ) { const int *ind = hexa.GetFaceNodesIndices( iFace ); // indices of face nodes if (curNodes[ind[ 0 ]] == curNodes[ind[ 1 ]] && curNodes[ind[ 0 ]] == curNodes[ind[ 2 ]] && curNodes[ind[ 0 ]] == curNodes[ind[ 3 ]] ) { // one face turns into a point ... + int pickInd = ind[ 0 ]; int iOppFace = hexa.GetOppFaceIndex( iFace ); ind = hexa.GetFaceNodesIndices( iOppFace ); int nbStick = 0; + uniqueNodes.clear(); for ( iCur = 0; iCur < 4 && nbStick < 2; iCur++ ) { if ( curNodes[ind[ iCur ]] == curNodes[ind[ iCur + 1 ]] ) nbStick++; + else + uniqueNodes.push_back( curNodes[ind[ iCur ]]); } if ( nbStick == 1 ) { // ... and the opposite one - into a triangle. // set a top node - ind = hexa.GetFaceNodesIndices( iFace ); - uniqueNodes[ 3 ] = curNodes[ind[ 0 ]]; + uniqueNodes.push_back( curNodes[ pickInd ]); isOk = true; } break; @@ -7697,7 +7633,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) } } else if ( nbUniqueNodes == 6 && nbRepl == 2 ) { - //////////////////////// HEX ---> 1 prism + //////////////////////// HEX ---> prism int nbTria = 0, iTria[3]; const int *ind; // indices of face nodes // look for triangular faces @@ -7712,7 +7648,6 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) // check if triangles are opposite if ( nbTria == 2 && iTria[0] == hexa.GetOppFaceIndex( iTria[1] )) { - isOk = true; // set nodes of the bottom triangle ind = hexa.GetFaceNodesIndices( iTria[ 0 ]); vector indB; @@ -7732,11 +7667,12 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) uniqueNodes[ iCur + 3 ] = curNodes[ indT[ j ]]; break; } + isOk = true; + break; } - break; } - else if (nbUniqueNodes == 5 && nbRepl == 4 ) { - //////////////////// HEXAHEDRON ---> 2 tetrahedrons + else if (nbUniqueNodes == 5 && nbRepl == 3 ) { + //////////////////// HEXAHEDRON ---> pyramid for ( int iFace = 0; iFace < 6; iFace++ ) { const int *ind = hexa.GetFaceNodesIndices( iFace ); // indices of face nodes if (curNodes[ind[ 0 ]] == curNodes[ind[ 1 ]] && @@ -7745,139 +7681,61 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) // one face turns into a point ... int iOppFace = hexa.GetOppFaceIndex( iFace ); ind = hexa.GetFaceNodesIndices( iOppFace ); - int nbStick = 0; - iUnique = 2; // reverse a tetrahedron 1 bottom - for ( iCur = 0; iCur < 4 && nbStick == 0; iCur++ ) { + uniqueNodes.clear(); + for ( iCur = 0; iCur < 4; iCur++ ) { if ( curNodes[ind[ iCur ]] == curNodes[ind[ iCur + 1 ]] ) - nbStick++; - else if ( iUnique >= 0 ) - uniqueNodes[ iUnique-- ] = curNodes[ind[ iCur ]]; + break; + else + uniqueNodes.push_back( curNodes[ind[ iCur ]]); } - if ( nbStick == 0 ) { + if ( uniqueNodes.size() == 4 ) { // ... and the opposite one is a quadrangle // set a top node const int* indTop = hexa.GetFaceNodesIndices( iFace ); - uniqueNodes[ 3 ] = curNodes[indTop[ 0 ]]; - nbUniqueNodes = 4; - // tetrahedron 2 - SMDS_MeshElement* newElem = - aMesh->AddVolume(curNodes[ind[ 0 ]], - curNodes[ind[ 3 ]], - curNodes[ind[ 2 ]], - curNodes[indTop[ 0 ]]); - myLastCreatedElems.Append(newElem); - if ( aShapeId ) - aMesh->SetMeshElementOnShape( newElem, aShapeId ); + uniqueNodes.push_back( curNodes[indTop[ 0 ]]); isOk = true; } break; } } } - else if ( nbUniqueNodes == 6 && nbRepl == 4 ) { - ////////////////// HEXAHEDRON ---> 2 tetrahedrons or 1 prism - // find indices of quad and tri faces - int iQuadFace[ 6 ], iTriFace[ 6 ], nbQuad = 0, nbTri = 0, iFace; - for ( iFace = 0; iFace < 6; iFace++ ) { + + if ( !isOk && nbUniqueNodes > 4 ) { + ////////////////// HEXAHEDRON ---> polyhedron + hexa.SetExternalNormal(); + vector poly_nodes; poly_nodes.reserve( 6 * 4 ); + vector quantities; quantities.reserve( 6 ); + for ( int iFace = 0; iFace < 6; iFace++ ) + { const int *ind = hexa.GetFaceNodesIndices( iFace ); // indices of face nodes + if ( curNodes[ind[0]] == curNodes[ind[2]] || + curNodes[ind[1]] == curNodes[ind[3]] ) + { + quantities.clear(); + break; // opposite nodes stick + } nodeSet.clear(); for ( iCur = 0; iCur < 4; iCur++ ) - nodeSet.insert( curNodes[ind[ iCur ]] ); - nbUniqueNodes = nodeSet.size(); - if ( nbUniqueNodes == 3 ) - iTriFace[ nbTri++ ] = iFace; - else if ( nbUniqueNodes == 4 ) - iQuadFace[ nbQuad++ ] = iFace; + { + if ( nodeSet.insert( curNodes[ind[ iCur ]] ).second ) + poly_nodes.push_back( curNodes[ind[ iCur ]]); + } + if ( nodeSet.size() < 3 ) + poly_nodes.resize( poly_nodes.size() - nodeSet.size() ); + else + quantities.push_back( nodeSet.size() ); } - if (nbQuad == 2 && nbTri == 4 && - hexa.GetOppFaceIndex( iQuadFace[ 0 ] ) == iQuadFace[ 1 ]) { - // 2 opposite quadrangles stuck with a diagonal; - // sample groups of merged indices: (0-4)(2-6) - // --------------------------------------------> 2 tetrahedrons - const int *ind1 = hexa.GetFaceNodesIndices( iQuadFace[ 0 ]); // indices of quad1 nodes - const int *ind2 = hexa.GetFaceNodesIndices( iQuadFace[ 1 ]); - int i0, i1d, i2, i3d, i0t, i2t; // d-daigonal, t-top - if (curNodes[ind1[ 0 ]] == curNodes[ind2[ 0 ]] && - curNodes[ind1[ 2 ]] == curNodes[ind2[ 2 ]]) { - // stuck with 0-2 diagonal - i0 = ind1[ 3 ]; - i1d = ind1[ 0 ]; - i2 = ind1[ 1 ]; - i3d = ind1[ 2 ]; - i0t = ind2[ 1 ]; - i2t = ind2[ 3 ]; - } - else if (curNodes[ind1[ 1 ]] == curNodes[ind2[ 3 ]] && - curNodes[ind1[ 3 ]] == curNodes[ind2[ 1 ]]) { - // stuck with 1-3 diagonal - i0 = ind1[ 0 ]; - i1d = ind1[ 1 ]; - i2 = ind1[ 2 ]; - i3d = ind1[ 3 ]; - i0t = ind2[ 0 ]; - i2t = ind2[ 1 ]; - } - else { - ASSERT(0); - } - // tetrahedron 1 - uniqueNodes[ 0 ] = curNodes [ i0 ]; - uniqueNodes[ 1 ] = curNodes [ i1d ]; - uniqueNodes[ 2 ] = curNodes [ i3d ]; - uniqueNodes[ 3 ] = curNodes [ i0t ]; - nbUniqueNodes = 4; - // tetrahedron 2 - SMDS_MeshElement* newElem = aMesh->AddVolume(curNodes[ i1d ], - curNodes[ i2 ], - curNodes[ i3d ], - curNodes[ i2t ]); - myLastCreatedElems.Append(newElem); - if ( aShapeId ) + if ( quantities.size() >= 4 ) + { + const SMDS_MeshElement* newElem = aMesh->AddPolyhedralVolume( poly_nodes, quantities ); + myLastCreatedElems.Append( newElem ); + if ( aShapeId && newElem ) aMesh->SetMeshElementOnShape( newElem, aShapeId ); - isOk = true; + rmElemIds.push_back( elem->GetID() ); } - else if (( nbTri == 2 && nbQuad == 3 ) || // merged (0-4)(1-5) - ( nbTri == 4 && nbQuad == 2 )) { // merged (7-4)(1-5) - // --------------------------------------------> prism - // find 2 opposite triangles - nbUniqueNodes = 6; - for ( iFace = 0; iFace + 1 < nbTri; iFace++ ) { - if ( hexa.GetOppFaceIndex( iTriFace[ iFace ] ) == iTriFace[ iFace + 1 ]) { - // find indices of kept and replaced nodes - // and fill unique nodes of 2 opposite triangles - const int *ind1 = hexa.GetFaceNodesIndices( iTriFace[ iFace ]); - const int *ind2 = hexa.GetFaceNodesIndices( iTriFace[ iFace + 1 ]); - const SMDS_MeshNode** hexanodes = hexa.GetNodes(); - // fill unique nodes - iUnique = 0; - isOk = true; - for ( iCur = 0; iCur < 4 && isOk; iCur++ ) { - const SMDS_MeshNode* n = curNodes[ind1[ iCur ]]; - const SMDS_MeshNode* nInit = hexanodes[ind1[ iCur ]]; - if ( n == nInit ) { - // iCur of a linked node of the opposite face (make normals co-directed): - int iCurOpp = ( iCur == 1 || iCur == 3 ) ? 4 - iCur : iCur; - // check that correspondent corners of triangles are linked - if ( !hexa.IsLinked( ind1[ iCur ], ind2[ iCurOpp ] )) - isOk = false; - else { - uniqueNodes[ iUnique ] = n; - uniqueNodes[ iUnique + 3 ] = curNodes[ind2[ iCurOpp ]]; - iUnique++; - } - } - } - break; - } - } - } - } // if ( nbUniqueNodes == 6 && nbRepl == 4 ) - else - { - MESSAGE("MergeNodes() removes hexahedron "<< elem); } break; - } // HEXAHEDRON + } // case HEXAHEDRON default: isOk = false; @@ -7885,7 +7743,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) } // if ( nbNodes != nbUniqueNodes ) // some nodes stick - if ( isOk ) // the non-poly elem remains valid after sticking nodes + if ( isOk ) // a non-poly elem remains valid after sticking nodes { if ( nbNodes != nbUniqueNodes || !aMesh->ChangeElementNodes( elem, & curNodes[0], nbNodes )) From 57cd3cc56534d233d9555650065507ff7f0972af Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 24 Mar 2016 20:12:07 +0300 Subject: [PATCH 117/147] 23068: [CEA 1505] Be able to keep meshing in 2D after having merged the nodes in 1D In SMESH_subMesh::ComputeStateEngine() transform errors into warnings if it is caused by mesh edition Regression of SALOME_TESTS/Grids/smesh/2D_submesh_00/A7 fix SMESH_subMesh::cleanDependsOn() Regression of SALOME_TESTS/Grids/smesh/imps_02/C4 fix getSubMeshes() in SMESH_subMesh_i.cxx and use it in all cases Regression SALOME_TESTS/Grids/smesh/mesh_Projection_2D_01/B1 In StdMeshers_Projection_2D treat coincident nodes in all cases --- src/SMESH/SMESH_subMesh.cxx | 91 +++++------ src/SMESH/SMESH_subMesh.hxx | 5 +- src/SMESH_I/SMESH_subMesh_i.cxx | 171 ++++---------------- src/StdMeshers/StdMeshers_Projection_2D.cxx | 9 +- 4 files changed, 80 insertions(+), 196 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 64ee5948d..9618871bd 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -241,7 +241,7 @@ bool SMESH_subMesh::IsMeshComputed() const { if ( _alwaysComputed ) return true; - // algo may bind a submesh not to _subShape, eg 3D algo + // algo may bind a sub-mesh not to _subShape, eg 3D algo // sets nodes on SHELL while _subShape may be SOLID SMESHDS_Mesh* meshDS = _father->GetMeshDS(); @@ -280,7 +280,7 @@ bool SMESH_subMesh::SubMeshesComputed(bool * isFailedToCompute/*=0*/) const int dimToCheck = myDim - 1; bool subMeshesComputed = true; if ( isFailedToCompute ) *isFailedToCompute = false; - // check subMeshes with upper dimension => reverse iteration + // check sub-meshes with upper dimension => reverse iteration SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,true); while ( smIt->more() ) { @@ -291,67 +291,22 @@ bool SMESH_subMesh::SubMeshesComputed(bool * isFailedToCompute/*=0*/) const // MSV 07.04.2006: restrict checking to myDim-1 only. Ex., there is no sense // in checking of existence of edges if the algo needs only faces. Moreover, - // degenerated edges may have no submesh, as after computing NETGEN_2D. + // degenerated edges may have no sub-mesh, as after computing NETGEN_2D. if ( !_algo || _algo->NeedDiscreteBoundary() ) { int dim = SMESH_Gen::GetShapeDim( ss ); if (dim < dimToCheck) - break; // the rest subMeshes are all of less dimension + break; // the rest sub-meshes are all of less dimension } SMESHDS_SubMesh * ds = sm->GetSubMeshDS(); - bool computeOk = (sm->GetComputeState() == COMPUTE_OK || - (ds && ( dimToCheck ? ds->NbElements() : ds->NbNodes() ))); + bool computeOk = ((sm->GetComputeState() == COMPUTE_OK ) || + (ds && ( dimToCheck ? ds->NbElements() : ds->NbNodes() ))); if (!computeOk) { subMeshesComputed = false; + if ( isFailedToCompute && !(*isFailedToCompute) ) *isFailedToCompute = ( sm->GetComputeState() == FAILED_TO_COMPUTE ); - // int type = ss.ShapeType(); - - // switch (type) - // { - // case TopAbs_COMPOUND: - // { - // MESSAGE("The not computed sub mesh is a COMPOUND"); - // break; - // } - // case TopAbs_COMPSOLID: - // { - // MESSAGE("The not computed sub mesh is a COMPSOLID"); - // break; - // } - // case TopAbs_SHELL: - // { - // MESSAGE("The not computed sub mesh is a SHEL"); - // break; - // } - // case TopAbs_WIRE: - // { - // MESSAGE("The not computed sub mesh is a WIRE"); - // break; - // } - // case TopAbs_SOLID: - // { - // MESSAGE("The not computed sub mesh is a SOLID"); - // break; - // } - // case TopAbs_FACE: - // { - // MESSAGE("The not computed sub mesh is a FACE"); - // break; - // } - // case TopAbs_EDGE: - // { - // MESSAGE("The not computed sub mesh is a EDGE"); - // break; - // } - // default: - // { - // MESSAGE("The not computed sub mesh is of unknown type"); - // break; - // } - // } - if ( !isFailedToCompute ) break; } @@ -1254,7 +1209,7 @@ void SMESH_subMesh::cleanDependsOn( SMESH_Algo* algoRequiringCleaning/*=0*/ ) // remember all sub-meshes of sm if ( keepSubMeshes ) { - SMESH_subMeshIteratorPtr smIt2 = getDependsOnIterator(false); + SMESH_subMeshIteratorPtr smIt2 = sm->getDependsOnIterator(false); while ( smIt2->more() ) smToKeep.insert( smIt2->next() ); } @@ -1624,6 +1579,36 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) _computeError.reset(); } + // transform errors into warnings if it is caused by mesh edition (imp 0023068) + if (!ret && _father->GetIsModified() ) + { + for (subS.ReInit(); subS.More(); subS.Next()) + { + SMESH_subMesh* sm = _father->GetSubMesh( subS.Current() ); + if ( !sm->IsMeshComputed() && sm->_computeError ) + { + // check if there is a VERTEX w/o nodes + // with READY_TO_COMPUTE state (after MergeNodes()) + SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(false,false); + while ( smIt->more() ) + { + SMESH_subMesh * vertSM = smIt->next(); + if ( vertSM->_subShape.ShapeType() != TopAbs_VERTEX ) break; + if ( vertSM->GetComputeState() == READY_TO_COMPUTE ) + { + SMESHDS_SubMesh * ds = vertSM->GetSubMeshDS(); + if ( !ds || ds->NbNodes() == 0 ) + { + sm->_computeState = READY_TO_COMPUTE; + sm->_computeError->myName = COMPERR_WARNING; + break; + } + } + } + } + } + } + // send event SUBMESH_COMPUTED if ( ret ) { if ( !algo->NeedDiscreteBoundary() ) diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 331d70160..8de40d222 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -96,8 +96,7 @@ class SMESH_EXPORT SMESH_subMesh enum compute_state { - NOT_READY, READY_TO_COMPUTE, - COMPUTE_OK, FAILED_TO_COMPUTE + NOT_READY, READY_TO_COMPUTE, COMPUTE_OK, FAILED_TO_COMPUTE }; enum algo_state { @@ -123,7 +122,7 @@ class SMESH_EXPORT SMESH_subMesh }; // ================================================================== - // Members to track non hierarchical dependencies between submeshes + // Members to track non hierarchical dependencies between sub-meshes // ================================================================== /*! diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 7f86e0ddc..a660013ed 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -29,14 +29,13 @@ #include "SMESH_Gen_i.hxx" #include "SMESH_Mesh_i.hxx" #include "SMESH_PreMeshInfo.hxx" +#include "SMESH_MesherHelper.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" #include "OpUtil.hxx" #include "Utils_ExceptHandlers.hxx" -#include -#include #include using namespace std; @@ -97,99 +96,37 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh, { size_t size = theSubMeshList.size(); - SMESH_Mesh* aMesh = theSubMesh->GetFather(); - SMESHDS_Mesh* aMeshDS = aMesh->GetMeshDS(); - SMESHDS_SubMesh* aSubMeshDS = theSubMesh->GetSubMeshDS(); - ::SMESH_subMesh* sm; + // check all child sub-meshes of one complexity, + // if no elements found and no algo assigned, go to children of lower complexity - // nodes can be bound to either vertex, edge, face or solid_or_shell - TopoDS_Shape aShape = theSubMesh->GetSubShape(); - TopAbs_ShapeEnum aShapeType = aShape.ShapeType(); - - // IPAL18558: Wrong information of the created sub-mesh is shown. (Sub-mesh on a FACE - // with only 1D algo assigned) - // Find dimension of sub-meshes to return as highest dimension of the assigned algorithm - if (( theSubMesh->IsEmpty() || ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )) && - ( !theSubMesh->GetAlgo() )) + TopoDS_Shape shape = theSubMesh->GetSubShape(); + TopAbs_ShapeEnum mainType = SMESH_MesherHelper::GetGroupType( shape, /*noCompound=*/true ); + TopAbs_ShapeEnum shapeType = shape.ShapeType(); + bool elementsFound = false; + bool algoFound = false; + SMESH_subMeshIteratorPtr smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/true, + /*complexFirst=*/true); + while ( smIt->more() ) { - // on father sub-meshes, check presence of an algo which will mesh this sub-mesh - // even if no algo is assigned to this sub-mesh - bool topAlgoPresent = false; - TopTools_ListIteratorOfListOfShape ancestors( aMesh->GetAncestors( aShape )); - for ( ; ancestors.More() && !topAlgoPresent; ancestors.Next() ) - if (( sm = aMesh->GetSubMeshContaining( ancestors.Value() ))) - topAlgoPresent = ( sm->GetAlgo() && !sm->GetAlgo()->NeedDiscreteBoundary() ); - - if ( !topAlgoPresent ) + ::SMESH_subMesh* sm = smIt->next(); + if ( sm->GetSubShape().ShapeType() != shapeType ) { - // find max dimension of an assigned algo - TopAbs_ShapeEnum algoShape = TopAbs_SHAPE; - const std::list & hyps = aMesh->GetHypothesisList( aShape ); - std::list ::const_iterator hypIt = hyps.begin(); - for ( ; hypIt != hyps.end(); ++hypIt ) - if ( const SMESH_Algo* algo = dynamic_cast< const SMESH_Algo* >( *hypIt )) - switch ( algo->GetDim() ) { - case 1: algoShape = TopAbs_EDGE; break; - case 2: algoShape = TopAbs_FACE; break; - case 3: algoShape = TopAbs_SOLID; break; - case 0: algoShape = TopAbs_VERTEX; break; - } - if ( algoShape != TopAbs_SHAPE ) - { - // return all sub-meshes on this dimension - SMESH_subMeshIteratorPtr smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false); - while ( smIt->more() ) - { - sm = smIt->next(); - if ( sm->GetSubShape().ShapeType() == algoShape && sm->GetSubMeshDS() ) - theSubMeshList.push_back( sm->GetSubMeshDS() ); - } - return size < theSubMeshList.size(); - } + if ( elementsFound || algoFound ) + break; + if ( sm->GetSubShape().ShapeType() == TopAbs_VERTEX && + mainType != TopAbs_VERTEX ) + break; } + shapeType = sm->GetSubShape().ShapeType(); + if ( !sm->IsEmpty() ) + { + elementsFound = true; + theSubMeshList.push_back( sm->GetSubMeshDS() ); + } + if ( sm->GetAlgo() ) + algoFound = true; } - switch ( aShapeType ) - { - case TopAbs_SOLID: - { - // add sub-mesh of solid itself - if (( aSubMeshDS = aMeshDS->MeshElements( aShape ))) - theSubMeshList.push_back( aSubMeshDS ); - - // and of the first shell - TopExp_Explorer exp( aShape, TopAbs_SHELL ); - if ( exp.More() ) - if (( aSubMeshDS = aMeshDS->MeshElements( exp.Current() ))) - theSubMeshList.push_back( aSubMeshDS ); - break; - } - case TopAbs_WIRE: - case TopAbs_COMPOUND: - case TopAbs_COMPSOLID: - { - // call getSubMeshes() for sub-shapes - list shapeList; - shapeList.push_back( aShape ); - list::iterator sh = shapeList.begin(); - for ( ; sh != shapeList.end(); ++sh ) { - for ( TopoDS_Iterator it( *sh ); it.More(); it.Next() ) { - if (( sm = aMesh->GetSubMeshContaining( it.Value() ))) - getSubMeshes( sm, theSubMeshList ); // add found sub-mesh or explore deeper - else - // no submesh for a compound inside compound - shapeList.push_back( it.Value() ); - } - } - // return only unique sub-meshes - set smSet( theSubMeshList.begin(), theSubMeshList.end() ); - theSubMeshList.assign( smSet.begin(), smSet.end() ); - break; - } - default: - if ( aSubMeshDS ) - theSubMeshList.push_back( aSubMeshDS ); - } return size < theSubMeshList.size(); } @@ -211,15 +148,11 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfElements() return 0; ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; - SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); - if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) - aSubMeshDS = 0; - int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0; + int nbElems = 0; - // volumes are bound to shell TListOfSubMeshes smList; - if ( nbElems == 0 && getSubMeshes( aSubMesh, smList )) + if ( getSubMeshes( aSubMesh, smList )) { TListOfSubMeshes::iterator sm = smList.begin(); for ( ; sm != smList.end(); ++sm ) @@ -249,8 +182,6 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) } ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); - if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) - aSubMeshDS = 0; if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) { @@ -298,17 +229,10 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId() _preMeshInfo->FullLoadFromFile(); ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; - SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); - if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) - aSubMeshDS = 0; - int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0; + int nbElems = 0; TListOfSubMeshes smList; - if ( nbElems ) - smList.push_back( aSubMeshDS ); - - // volumes are bound to shell - if ( nbElems == 0 && getSubMeshes( aSubMesh, smList )) + if ( getSubMeshes( aSubMesh, smList )) { TListOfSubMeshes::iterator sm = smList.begin(); for ( ; sm != smList.end(); ++sm ) @@ -350,17 +274,14 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle _preMeshInfo->FullLoadFromFile(); ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; - SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS(); - if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() ) - aSubMeshDS = 0; - // PAL5440, return all nodes belonging to elements of submesh + // PAL5440, return all nodes belonging to elements of the sub-mesh set nodeIds; - int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0; + int nbElems = 0; // volumes may be bound to shell instead of solid TListOfSubMeshes smList; - if ( nbElems == 0 && getSubMeshes( aSubMesh, smList )) + if ( getSubMeshes( aSubMesh, smList )) { TListOfSubMeshes::iterator sm = smList.begin(); for ( ; sm != smList.end(); ++sm ) @@ -386,29 +307,6 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle nbElems += (*sm)->NbElements(); } } - aSubMeshDS = 0; - } - else - { - if ( nbElems ) - smList.push_back( aSubMeshDS ); - } - - if ( theElemType == SMESH::NODE && aSubMeshDS ) - { - SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements(); - if ( eIt->more() ) { - while ( eIt->more() ) { - const SMDS_MeshElement* anElem = eIt->next(); - SMDS_ElemIteratorPtr nIt = anElem->nodesIterator(); - while ( nIt->more() ) - nodeIds.insert( nIt->next()->GetID() ); - } - } else { - SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes(); - while ( nIt->more() ) - nodeIds.insert( nIt->next()->GetID() ); - } } if ( theElemType == SMESH::NODE ) @@ -428,8 +326,7 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle TListOfSubMeshes::iterator sm = smList.begin(); for ( i = 0; sm != smList.end(); sm++ ) { - aSubMeshDS = *sm; - SMDS_ElemIteratorPtr anIt = aSubMeshDS->GetElements(); + SMDS_ElemIteratorPtr anIt = (*sm)->GetElements(); while ( i < n && anIt->more() ) { const SMDS_MeshElement* anElem = anIt->next(); if ( theElemType == SMESH::ALL || anElem->GetType() == (SMDSAbs_ElementType)theElemType ) diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index fed12f5a5..c4375bac9 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -1437,6 +1437,9 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK ) return error("Can't make mesh by source mesh pattern"); + } // end of projection using Pattern mapping + + { // ------------------------------------------------------------------------- // mapper doesn't take care of nodes already existing on edges and vertices, // so we must merge nodes created by it with existing ones @@ -1476,7 +1479,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& continue; // do not treat sm of degen VERTEX } - // Sort new and old nodes of a submesh separately + // Sort new and old nodes of a sub-mesh separately bool isSeam = helper.IsRealSeam( sm->GetId() ); @@ -1600,6 +1603,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& // The mapper can't create quadratic elements, so convert if needed // ---------------------------------------------------------------- + SMDS_ElemIteratorPtr faceIt; faceIt = srcSubMesh->GetSubMeshDS()->GetElements(); bool srcIsQuad = faceIt->next()->IsQuadratic(); faceIt = tgtSubMesh->GetSubMeshDS()->GetElements(); @@ -1613,8 +1617,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& editor.ConvertToQuadratic(/*theForce3d=*/false, tgtFaces, false); } - - } // end of projection using Pattern mapping + } // end of coincident nodes and quadratic elements treatment if ( !projDone || is1DComputed ) From c8f0893cc3484e8945d65b740efdc7795619a560 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 25 Mar 2016 13:44:51 +0300 Subject: [PATCH 118/147] Regression of doc/salome/examples/use_existing_faces.py --- .../gui/SMESH/images/split_into_tetra_icon.png | Bin 923 -> 885 bytes resources/split_into_tetra.png | Bin 923 -> 885 bytes src/SMESH/SMESH_subMesh.cxx | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/salome/gui/SMESH/images/split_into_tetra_icon.png b/doc/salome/gui/SMESH/images/split_into_tetra_icon.png index b113c304db955efefb3cecebe156174c299177b8..c9ea7b4c97720e15c19bf2ce810a9d10e7030e97 100644 GIT binary patch delta 818 zcmV-21I_%K2lWP!Bnkm@Qb$4nuFf3kks&aD-~$;7DFptV4Z{Ec0`*BmK~y-)m6UI2 z6K5R9KX&k+kRmHoQWZ8Bc5gO{pqZqC7JMb_ z#YAjD=!+HlMg;$qFi^1WRsDx4%+1akkBd!e(l$%(((Z*#a$Q@sUpRQ~?s-1<{J!6R z=XU}Ywf)#Hf7aNNEtBoMPllOiF_U32ovyeQI+L-!6AFXfC%={5wGG*S%$`j_^6Lvc zyZaVndJKD0HyzzRm&e6q7rb4->zC zACIaspYQ=t9|%yT$i#&26OogCws-x1#J|~@N+2sVe*M)aHOh{q7WHQU#xDGT!!^4O zQd6@??SV^cb{rk_v*&!2$y3b$a&zy|J%YWddu6i{JC6ObX17+2_SMrhq!U|6AYWIOuiKo?)A?k7@?6hw z?1Qk;zLL{Qdpj;~9V>#sli{m~6XEccKqxdM!sUvc{&UvJ?~|rW#1>NM_wHdB27mwY z000SKA{-8G+j}59F#G4%ckazjY;B&2K*QXAwG|@ZoO#awIzFC!b3e=N8(3a>J50GT#bC z6oYoR>(YyhtpJo6@eymf(Lq0m;y$qe+e`&$D(RzYr@!A;?LGuxnosi9}@a5y1!)5L-31fMLv?9IUth7XEGt=JCsCQha(qjpY2 zIwM8L{-oQ3t!aZv+9nM#e|mH8?(v}}OIWtn4_vs1bMEJy^ZosVCgx=n1#NF>T2)bPrqNn!O#_38w0KNDAjoa-e(RL(z>HHYN@d)|S zYCB*k1J69+>~M9Jf80-h48S)NZ{QURw@JENGxP*cG;Fwbag3flACUUxU82#b2nK^s zDXzX@d8aEre(;Ni)7BF`wU-C>|AbPEVc$4`Wtsatp04i{KmZ=U-=EMl4NcQfRh6xH z^3`dQIYDM-AG)sNbUG;(i?l={k;9Xdli#kduOAcM!Q&&5e^0iQ)#q9+m+9;4LrPd& zTtuCop8h-%iM+2U%4eeZ`|-Kc!)%9SPHbM+wlPhUYuBzKrKAPm$Cw_z@6p%7kNFa$ z)9I5;KoW%Lz^{}vrbB)5FlOY zCq8qO|ASf|axy2_H9A+50%$^QD*f&IlT-}RT$s!?PV5?;t6d{e2mtWc4{ris-?VD$ zL~8}FSg7S^+cs*mY?NY*-l6fDG+pUON;&oCxz{m`e>~OPtG{Ix(==}hn}uI5RTL$h zPNzPMUl_x(EOa9^RbSn!Ums?9dHFfDzGBVj9U8~yjI&}s$j+VJZ?B}+MoiPhuoiAs z*IYSsh-5Mul2V$gWm#KR?*2U=v7_rD1_lP$FiO9!t*st&sLms8&k+kRmHoQWZ8Bc5gO{pqZqC7JMb_ z#YAjD=!+HlMg;$qFi^1WRsDx4%+1akkBd!e(l$%(((Z*#a$Q@sUpRQ~?s-1<{J!6R z=XU}Ywf)#Hf7aNNEtBoMPllOiF_U32ovyeQI+L-!6AFXfC%={5wGG*S%$`j_^6Lvc zyZaVndJKD0HyzzRm&e6q7rb4->zC zACIaspYQ=t9|%yT$i#&26OogCws-x1#J|~@N+2sVe*M)aHOh{q7WHQU#xDGT!!^4O zQd6@??SV^cb{rk_v*&!2$y3b$a&zy|J%YWddu6i{JC6ObX17+2_SMrhq!U|6AYWIOuiKo?)A?k7@?6hw z?1Qk;zLL{Qdpj;~9V>#sli{m~6XEccKqxdM!sUvc{&UvJ?~|rW#1>NM_wHdB27mwY z000SKA{-8G+j}59F#G4%ckazjY;B&2K*QXAwG|@ZoO#awIzFC!b3e=N8(3a>J50GT#bC z6oYoR>(YyhtpJo6@eymf(Lq0m;y$qe+e`&$D(RzYr@!A;?LGuxnosi9}@a5y1!)5L-31fMLv?9IUth7XEGt=JCsCQha(qjpY2 zIwM8L{-oQ3t!aZv+9nM#e|mH8?(v}}OIWtn4_vs1bMEJy^ZosVCgx=n1#NF>T2)bPrqNn!O#_38w0KNDAjoa-e(RL(z>HHYN@d)|S zYCB*k1J69+>~M9Jf80-h48S)NZ{QURw@JENGxP*cG;Fwbag3flACUUxU82#b2nK^s zDXzX@d8aEre(;Ni)7BF`wU-C>|AbPEVc$4`Wtsatp04i{KmZ=U-=EMl4NcQfRh6xH z^3`dQIYDM-AG)sNbUG;(i?l={k;9Xdli#kduOAcM!Q&&5e^0iQ)#q9+m+9;4LrPd& zTtuCop8h-%iM+2U%4eeZ`|-Kc!)%9SPHbM+wlPhUYuBzKrKAPm$Cw_z@6p%7kNFa$ z)9I5;KoW%Lz^{}vrbB)5FlOY zCq8qO|ASf|axy2_H9A+50%$^QD*f&IlT-}RT$s!?PV5?;t6d{e2mtWc4{ris-?VD$ zL~8}FSg7S^+cs*mY?NY*-l6fDG+pUON;&oCxz{m`e>~OPtG{Ix(==}hn}uI5RTL$h zPNzPMUl_x(EOa9^RbSn!Ums?9dHFfDzGBVj9U8~yjI&}s$j+VJZ?B}+MoiPhuoiAs z*IYSsh-5Mul2V$gWm#KR?*2U=v7_rD1_lP$FiO9!t*st&sLms8getDependsOnIterator(false); + SMESH_subMeshIteratorPtr smIt2 = sm->getDependsOnIterator(true); while ( smIt2->more() ) smToKeep.insert( smIt2->next() ); } From d82557916e0bdbca05093f35658e8cd81b6cf8aa Mon Sep 17 00:00:00 2001 From: ana Date: Fri, 1 Apr 2016 18:48:46 +0300 Subject: [PATCH 119/147] Windows compatibility --- src/SMESHGUI/SMESHGUI.cxx | 2 +- src/SMESH_I/SMESH_Gen_i.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index a08aefbc4..93b579798 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -586,7 +586,7 @@ namespace "SMESH_OCTAHEDRA","SMESH_POLYEDRONS","SMESH_QUADRATIC_POLYEDRONS","SMESH_BALLS" }; // is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed) - int nbTypes = sizeof( typeMsg ) / sizeof( const char* ); + const int nbTypes = sizeof( typeMsg ) / sizeof( const char* ); int _assert[( nbTypes == SMESH::Entity_Last ) ? 1 : -1 ]; _assert[0]=1; QString andStr = " " + QObject::tr("SMESH_AND") + " ", comma(", "); diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 24cc1967e..204466afe 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -4896,7 +4896,7 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent, _CORBA_Octet* buffer = new _CORBA_Octet[real_size]; char tmp[3]; tmp[2]='\0'; - uint c = -1; + unsigned int c = -1; for ( int i = 0; i < real_size; i++ ) { memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 ); From 53bd086779d54791bfd119de31f01eac699e0745 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 14 Apr 2016 18:31:42 +0300 Subject: [PATCH 120/147] 23269: Meshing a composite block with IJK StdMeshers_CompositeHexa_3D.cxx And more: 1) Avoid creating actors for not shown mesh objects SMESHGUI_ComputeDlg.cxx 2) Add wait-cursor while group deletion, which can be long on large meshes SMESHGUI_DeleteGroupDlg.cxx 3) Avoid getting elem types of a new group on filter, which can be long SMESH_Gen_i_1.cxx --- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 8 ++++++-- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 3 +++ src/SMESH_I/SMESH_Gen_i_1.cxx | 3 +-- src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx | 13 ++++++++++--- src/StdMeshers/StdMeshers_Prism_3D.cxx | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 05858cc14..ad4453c1c 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -939,7 +939,9 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( !smSObj ) continue; SMESH::SMESH_IDSource_var aSubMeshObj = SMESH::SObjectToInterface( smSObj ); - aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj )); + SMESH_Actor *anActor = SMESH::FindActorByObject( aSubMeshObj ); + if ( anActor && anActor->GetVisibility() ) + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj )); } // put Groups into list SMESH::ListOfGroups_var aGroups = myMesh->GetGroups(); @@ -955,7 +957,9 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( !aGroupSO ) continue; SMESH::SMESH_IDSource_var aGroupObj = SMESH::SObjectToInterface( aGroupSO ); - aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO )); + SMESH_Actor *anActor = SMESH::FindActorByObject( aGroupObj ); + if ( anActor && anActor->GetVisibility() ) + aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO )); } // update mesh, sub-mesh and groups, if it's possible diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index 6952b96c9..7711022c3 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -205,6 +206,8 @@ bool SMESHGUI_DeleteGroupDlg::onApply() if (!isValid()) return false; + SUIT_OverrideCursor wc; + myBlockSelection = true; QList::iterator anIter; diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 30ef9e5c6..af12566d8 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -771,8 +771,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy SetName( aRootSO, aRootNames[aType] ); // Add new group to corresponding sub-tree - SMESH::array_of_ElementType_var elemTypes = theGroup->GetTypes(); - int isEmpty = ( elemTypes->length() == 0 ); + int isEmpty = false; std::string pm[2] = { "ICON_SMESH_TREE_GROUP", "ICON_SMESH_TREE_MESH_WARN" }; if ( SMESH::DownCast< SMESH_GroupOnFilter_i* > ( theGroup )) { diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index cd047490a..cb0512d1f 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -382,12 +382,12 @@ namespace const TopTools_MapOfShape& cornerVV, TopTools_MapOfShape& internEE) { - TopTools_IndexedMapOfShape subEE, subFF; + TopTools_IndexedMapOfShape subEE; TopExp::MapShapes( shape, TopAbs_EDGE, subEE ); - TopExp::MapShapes( shape, TopAbs_FACE, subFF ); + //TopExp::MapShapes( shape, TopAbs_FACE, subFF ); TopoDS_Vertex VV[2]; - TopTools_MapOfShape subChecked/*, ridgeEE*/; + TopTools_MapOfShape subChecked, ridgeEE; TopTools_MapIteratorOfMapOfShape vIt( cornerVV ); for ( ; vIt.More(); vIt.Next() ) { @@ -401,6 +401,8 @@ namespace TopoDS_Edge ridgeE = TopoDS::Edge( *riE ); while ( !ridgeE.IsNull() ) { + if ( !ridgeEE.Add( ridgeE )) + break; TopExp::Vertices( ridgeE, VV[0], VV[1] ); TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )]; if ( cornerVV.Contains( V1 ) ) @@ -451,6 +453,11 @@ namespace } // loop on ridge EDGEs around a corner VERTEX } // loop on on corner VERTEXes + if ( subEE.Extent() > ridgeEE.Extent() + internEE.Extent() ) // PAL23269 + for ( int i = 1; i < subEE.Extent(); ++i ) + if ( !ridgeEE.Contains( subEE(i) )) + internEE.Add( subEE(i) ); + return true; } // getInternalEdges() } // namespace diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index c7a44bada..d60f1397e 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -1116,7 +1116,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) ( ! botSM->GetAlgo() || ! _gen->Compute( *botSM->GetFather(), botSM->GetSubShape(), /*shapeOnly=*/true ))) return error( COMPERR_BAD_INPUT_MESH, - TCom( "No mesher defined to compute the face #") + TCom( "No mesher defined to compute the base face #") << shapeID( thePrism.myBottom )); // Make all side FACEs of thePrism meshed with quads From 7fd18ae8b1ffffdb02816645ec7147e9b70711df Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 15 Apr 2016 17:50:49 +0200 Subject: [PATCH 121/147] general crack dialog: working on log... --- src/Tools/blocFissure/gmu/construitFissureGenerale.py | 2 ++ src/Tools/blocFissure/gmu/initLog.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index ddffac389..f75c2742b 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -12,6 +12,7 @@ from salome.smesh import smeshBuilder import SMESH import math import bisect +import traceback # from extractionOrientee import extractionOrientee # from extractionOrienteeMulti import extractionOrienteeMulti @@ -51,6 +52,7 @@ from construitMaillagePipe import construitMaillagePipe from mailleAretesEtJonction import mailleAretesEtJonction from mailleFacesFissure import mailleFacesFissure from mailleFacesPeau import mailleFacesPeau +from fissError import fissError # ----------------------------------------------------------------------------- # --- procédure complète fissure générale diff --git a/src/Tools/blocFissure/gmu/initLog.py b/src/Tools/blocFissure/gmu/initLog.py index c9c78b30c..bc427de1d 100644 --- a/src/Tools/blocFissure/gmu/initLog.py +++ b/src/Tools/blocFissure/gmu/initLog.py @@ -12,6 +12,7 @@ loglevel = warning def setDebug(logfile=None): global loglevel + logging.shutdown() if logfile: logging.basicConfig(filename=logfile, format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', @@ -24,6 +25,7 @@ def setDebug(logfile=None): def setVerbose(logfile=None): global loglevel + logging.shutdown() if logfile: logging.basicConfig(filename=logfile, format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', @@ -36,6 +38,7 @@ def setVerbose(logfile=None): def setRelease(logfile=None): global loglevel + logging.shutdown() if logfile: logging.basicConfig(filename=logfile, format='%(funcName)s[%(lineno)d] %(message)s', @@ -48,6 +51,7 @@ def setRelease(logfile=None): def setUnitTests(logfile=None): global loglevel + logging.shutdown() if logfile: logging.basicConfig(filename=logfile, format='%(funcName)s[%(lineno)d] %(message)s', @@ -60,6 +64,7 @@ def setUnitTests(logfile=None): def setPerfTests(logfile=None): global loglevel + logging.shutdown() if logfile: logging.basicConfig(filename=logfile, format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s', From 05cbd0eed80fc47431066455b03bc1e3b493e767 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 15 Apr 2016 17:51:36 +0200 Subject: [PATCH 122/147] tests on memory measurements --- src/SMESH/memoire.h | 6 +++--- src/StdMeshers/StdMeshers_Regular_1D.cxx | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/SMESH/memoire.h b/src/SMESH/memoire.h index fe08e6124..0b8a44b6e 100644 --- a/src/SMESH/memoire.h +++ b/src/SMESH/memoire.h @@ -30,14 +30,14 @@ void memostat(const char* f, int l) #ifdef WIN32 //rnv: TODO: find alternative of the malloc_stats() on windows platform #else - /* struct mallinfo mem = mallinfo(); */ - /* std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl; */ + struct mallinfo mem = mallinfo(); + std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl; std::cerr << f << ":" << l << " --------------------------" << std::endl; malloc_stats(); std::cerr << f << ":" << l << " --------------------------" << std::endl; #endif } -#define MEMOSTAT //memostat( __FILE__, __LINE__ ) +#define MEMOSTAT memostat( __FILE__, __LINE__ ) #endif diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 413a92494..e5c4d8eb2 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -184,6 +184,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh, else if (hypName == "NumberOfSegments") { + MESSAGE("CheckHypothesis: NumberOfSegments"); const StdMeshers_NumberOfSegments * hyp = dynamic_cast (theHyp); ASSERT(hyp); @@ -591,6 +592,7 @@ void StdMeshers_Regular_1D::redistributeNearVertices (SMESH_Mesh & theM } if ( _hypType == NB_SEGMENTS ) { + MESSAGE("redistributeNearVertices NB_SEGMENTS"); compensateError(0, vertexLength, f, l, theLength, theC3d, theParameters, true ); } else if ( nPar <= 3 ) @@ -665,6 +667,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, const bool theReverse, bool theConsiderPropagation) { + MESSAGE("computeInternalParameters"); theParams.clear(); double f = theFirstU, l = theLastU; @@ -686,7 +689,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if ( ! SMESH_Algo::GetSortedNodesOnEdge( theMesh.GetMeshDS(), mainEdge, _quadraticMesh, mainEdgeParamsOfNodes, SMDSAbs_Edge )) return error("Bad node parameters on the source edge of Propagation Of Distribution"); - + MESSAGE("mainEdgeParamsOfNodes.size(): " << mainEdgeParamsOfNodes.size()); vector< double > segLen( mainEdgeParamsOfNodes.size() - 1 ); double totalLen = 0; BRepAdaptor_Curve mainEdgeCurve( mainEdge ); @@ -715,7 +718,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, ++nbParams; } if ( nbParams != segLen.size()-1 ) - return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segements"); + return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segments"); compensateError( segLen[ theReverse ? segLen.size()-1 : 0 ], segLen[ theReverse ? 0 : segLen.size()-1 ], @@ -729,7 +732,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, case LOCAL_LENGTH: case MAX_LENGTH: case NB_SEGMENTS: { - + MESSAGE("computeInternalParameters: LOCAL_LENGTH MAX_LENGTH NB_SEGMENTS"); double eltSize = 1; int nbSegments; if ( _hypType == MAX_LENGTH ) @@ -762,6 +765,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if (computed) { SMESHDS_SubMesh* smds = sm->GetSubMeshDS(); int nb_segments = smds->NbElements(); + MESSAGE("nb_segments: "<AddNode(P.X(), P.Y(), P.Z()); + MESSAGE("meshDS->AddNode parameter " << param << " coords=" << "("<< P.X() <<", " << P.Y() << ", " << P.Z() << ")"); meshDS->SetNodeOnEdge(node, shapeID, param); if(_quadraticMesh) { From 6c4a42763edbad345290d9bbb757095a67275837 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 18 Apr 2016 14:04:36 +0200 Subject: [PATCH 123/147] Sphinx style for html doc --- src/Tools/blocFissure/doc/conf.py.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/doc/conf.py.in b/src/Tools/blocFissure/doc/conf.py.in index 47bfec558..72abf4e5f 100644 --- a/src/Tools/blocFissure/doc/conf.py.in +++ b/src/Tools/blocFissure/doc/conf.py.in @@ -83,7 +83,8 @@ pygments_style = 'sphinx' # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. -html_style = 'default' +#html_style = 'default' +html_theme = 'default' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". From c570e0f979380e153cef5dd6beb519180e89bd31 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 18 Apr 2016 14:07:49 +0200 Subject: [PATCH 124/147] general crack dialog documentation --- src/Tools/blocFissure/doc/faq.rst | 19 ++ src/Tools/blocFissure/doc/gui.rst | 78 ++++++++ .../blocFissure/doc/images/01_CubeAngle.png | Bin 0 -> 16367 bytes .../blocFissure/doc/images/01_CubeAngle_2.png | Bin 0 -> 17181 bytes .../blocFissure/doc/images/02_CubeAngle2.png | Bin 0 -> 20790 bytes .../doc/images/02_CubeAngle2_2.png | Bin 0 -> 28416 bytes .../blocFissure/doc/images/03_cylindre.png | Bin 0 -> 18194 bytes .../blocFissure/doc/images/03_cylindre_2.png | Bin 0 -> 31324 bytes .../blocFissure/doc/images/04_cylindre2.png | Bin 0 -> 20197 bytes .../blocFissure/doc/images/04_cylindre2_2.png | Bin 0 -> 32279 bytes .../blocFissure/doc/images/05_disque.png | Bin 0 -> 33658 bytes .../blocFissure/doc/images/05_disque_2.png | Bin 0 -> 25703 bytes .../blocFissure/doc/images/06_ellipse1.png | Bin 0 -> 16597 bytes .../blocFissure/doc/images/06_ellipse1_2.png | Bin 0 -> 25224 bytes .../blocFissure/doc/images/07_ellipse2.png | Bin 0 -> 18504 bytes .../blocFissure/doc/images/07_ellipse2_2.png | Bin 0 -> 15275 bytes .../doc/images/08_eprouvetteCourbe.png | Bin 0 -> 19681 bytes .../doc/images/08_eprouvetteCourbe_2.png | Bin 0 -> 31486 bytes .../doc/images/09_eprouvetteDroite.png | Bin 0 -> 13986 bytes .../doc/images/09_eprouvetteDroite_2.png | Bin 0 -> 32365 bytes .../doc/images/10_eprouvetteDroite2.png | Bin 0 -> 16064 bytes .../doc/images/10_eprouvetteDroite2_2.png | Bin 0 -> 23142 bytes .../blocFissure/doc/images/11_faceGauche.png | Bin 0 -> 37786 bytes .../doc/images/11_faceGauche_2.png | Bin 0 -> 42567 bytes .../blocFissure/doc/images/12_faceGauche2.png | Bin 0 -> 21163 bytes .../doc/images/12_faceGauche2_2.png | Bin 0 -> 32782 bytes src/Tools/blocFissure/doc/images/13_vis_1.png | Bin 0 -> 45831 bytes .../blocFissure/doc/images/13_vis_1_2.png | Bin 0 -> 73005 bytes .../blocFissure/doc/images/BF_GUI_capture.png | Bin 0 -> 44903 bytes .../doc/images/Capture_GUI_pipes.png | Bin 0 -> 80263 bytes .../doc/images/Capture_GUI_pipes_2.png | Bin 0 -> 174075 bytes src/Tools/blocFissure/doc/images/GUI_BG.png | Bin 0 -> 197652 bytes src/Tools/blocFissure/doc/images/coude_0.png | Bin 0 -> 18085 bytes .../blocFissure/doc/images/coude_0_2.png | Bin 0 -> 64981 bytes src/Tools/blocFissure/doc/images/coude_3.png | Bin 0 -> 74299 bytes .../doc/images/general_princ_a.png | Bin 0 -> 11626 bytes .../doc/images/general_princ_b.png | Bin 0 -> 856 bytes .../doc/images/general_princ_c.png | Bin 0 -> 11013 bytes .../doc/images/general_princ_d.png | Bin 0 -> 11945 bytes .../doc/images/general_princ_e.png | Bin 0 -> 3039 bytes .../doc/images/general_princ_f.png | Bin 0 -> 9675 bytes .../doc/images/general_princ_g.png | Bin 0 -> 10924 bytes .../doc/images/general_princ_h.png | Bin 0 -> 8342 bytes .../doc/images/general_princ_i.png | Bin 0 -> 17281 bytes .../doc/images/general_princ_j.png | Bin 0 -> 23091 bytes .../doc/images/general_princ_j_old.png | Bin 0 -> 28845 bytes .../doc/images/general_princ_k.png | Bin 0 -> 12488 bytes .../doc/images/general_princ_k_old.png | Bin 0 -> 16870 bytes src/Tools/blocFissure/doc/images/intro.png | Bin 0 -> 33009 bytes .../doc/images/longueur_influence.png | Bin 0 -> 51020 bytes .../blocFissure/doc/images/parametres.png | Bin 0 -> 61944 bytes .../blocFissure/doc/images/parametres_GUI.png | Bin 0 -> 61157 bytes .../doc/images/recom_groupe_apres.png | Bin 0 -> 8710 bytes .../doc/images/recom_groupe_avant.png | Bin 0 -> 7751 bytes .../doc/images/recom_interface_apres.png | Bin 0 -> 40314 bytes .../doc/images/recom_interface_avant.png | Bin 0 -> 21733 bytes .../doc/images/schema_fis_ext2.png | Bin 0 -> 67132 bytes .../blocFissure/doc/images/schema_fissure.png | Bin 0 -> 85443 bytes .../blocFissure/doc/images/schema_lignes1.png | Bin 0 -> 24412 bytes .../doc/images/schema_tube_sain.png | Bin 0 -> 75423 bytes .../blocFissure/doc/images/tutorial_1.png | Bin 0 -> 9899 bytes .../blocFissure/doc/images/tutorial_2.png | Bin 0 -> 10251 bytes .../blocFissure/doc/images/tutorial_3.png | Bin 0 -> 20325 bytes .../blocFissure/doc/images/tutorial_4.png | Bin 0 -> 16875 bytes src/Tools/blocFissure/doc/index.rst | 49 ++--- src/Tools/blocFissure/doc/introduction.rst | 22 +++ src/Tools/blocFissure/doc/pipes.rst | 104 +++++++++++ src/Tools/blocFissure/doc/principles.rst | 122 +++++++++++++ src/Tools/blocFissure/doc/scripts.rst | 86 +++++++++ src/Tools/blocFissure/doc/testcases.rst | 170 ++++++++++++++++++ src/Tools/blocFissure/doc/tutorials.rst | 66 +++++++ src/Tools/blocFissure/doc/use.rst | 14 ++ 72 files changed, 698 insertions(+), 32 deletions(-) create mode 100755 src/Tools/blocFissure/doc/faq.rst create mode 100755 src/Tools/blocFissure/doc/gui.rst create mode 100644 src/Tools/blocFissure/doc/images/01_CubeAngle.png create mode 100644 src/Tools/blocFissure/doc/images/01_CubeAngle_2.png create mode 100644 src/Tools/blocFissure/doc/images/02_CubeAngle2.png create mode 100644 src/Tools/blocFissure/doc/images/02_CubeAngle2_2.png create mode 100644 src/Tools/blocFissure/doc/images/03_cylindre.png create mode 100644 src/Tools/blocFissure/doc/images/03_cylindre_2.png create mode 100644 src/Tools/blocFissure/doc/images/04_cylindre2.png create mode 100644 src/Tools/blocFissure/doc/images/04_cylindre2_2.png create mode 100644 src/Tools/blocFissure/doc/images/05_disque.png create mode 100644 src/Tools/blocFissure/doc/images/05_disque_2.png create mode 100644 src/Tools/blocFissure/doc/images/06_ellipse1.png create mode 100644 src/Tools/blocFissure/doc/images/06_ellipse1_2.png create mode 100644 src/Tools/blocFissure/doc/images/07_ellipse2.png create mode 100644 src/Tools/blocFissure/doc/images/07_ellipse2_2.png create mode 100644 src/Tools/blocFissure/doc/images/08_eprouvetteCourbe.png create mode 100644 src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_2.png create mode 100644 src/Tools/blocFissure/doc/images/09_eprouvetteDroite.png create mode 100644 src/Tools/blocFissure/doc/images/09_eprouvetteDroite_2.png create mode 100644 src/Tools/blocFissure/doc/images/10_eprouvetteDroite2.png create mode 100644 src/Tools/blocFissure/doc/images/10_eprouvetteDroite2_2.png create mode 100644 src/Tools/blocFissure/doc/images/11_faceGauche.png create mode 100644 src/Tools/blocFissure/doc/images/11_faceGauche_2.png create mode 100644 src/Tools/blocFissure/doc/images/12_faceGauche2.png create mode 100644 src/Tools/blocFissure/doc/images/12_faceGauche2_2.png create mode 100644 src/Tools/blocFissure/doc/images/13_vis_1.png create mode 100644 src/Tools/blocFissure/doc/images/13_vis_1_2.png create mode 100644 src/Tools/blocFissure/doc/images/BF_GUI_capture.png create mode 100644 src/Tools/blocFissure/doc/images/Capture_GUI_pipes.png create mode 100644 src/Tools/blocFissure/doc/images/Capture_GUI_pipes_2.png create mode 100644 src/Tools/blocFissure/doc/images/GUI_BG.png create mode 100644 src/Tools/blocFissure/doc/images/coude_0.png create mode 100644 src/Tools/blocFissure/doc/images/coude_0_2.png create mode 100644 src/Tools/blocFissure/doc/images/coude_3.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_a.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_b.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_c.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_d.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_e.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_f.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_g.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_h.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_i.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_j.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_j_old.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_k.png create mode 100644 src/Tools/blocFissure/doc/images/general_princ_k_old.png create mode 100644 src/Tools/blocFissure/doc/images/intro.png create mode 100644 src/Tools/blocFissure/doc/images/longueur_influence.png create mode 100644 src/Tools/blocFissure/doc/images/parametres.png create mode 100644 src/Tools/blocFissure/doc/images/parametres_GUI.png create mode 100644 src/Tools/blocFissure/doc/images/recom_groupe_apres.png create mode 100644 src/Tools/blocFissure/doc/images/recom_groupe_avant.png create mode 100644 src/Tools/blocFissure/doc/images/recom_interface_apres.png create mode 100644 src/Tools/blocFissure/doc/images/recom_interface_avant.png create mode 100644 src/Tools/blocFissure/doc/images/schema_fis_ext2.png create mode 100644 src/Tools/blocFissure/doc/images/schema_fissure.png create mode 100644 src/Tools/blocFissure/doc/images/schema_lignes1.png create mode 100644 src/Tools/blocFissure/doc/images/schema_tube_sain.png create mode 100644 src/Tools/blocFissure/doc/images/tutorial_1.png create mode 100644 src/Tools/blocFissure/doc/images/tutorial_2.png create mode 100644 src/Tools/blocFissure/doc/images/tutorial_3.png create mode 100644 src/Tools/blocFissure/doc/images/tutorial_4.png create mode 100755 src/Tools/blocFissure/doc/introduction.rst create mode 100755 src/Tools/blocFissure/doc/pipes.rst create mode 100755 src/Tools/blocFissure/doc/principles.rst create mode 100755 src/Tools/blocFissure/doc/scripts.rst create mode 100755 src/Tools/blocFissure/doc/testcases.rst create mode 100755 src/Tools/blocFissure/doc/tutorials.rst create mode 100755 src/Tools/blocFissure/doc/use.rst diff --git a/src/Tools/blocFissure/doc/faq.rst b/src/Tools/blocFissure/doc/faq.rst new file mode 100755 index 000000000..03e5ff06c --- /dev/null +++ b/src/Tools/blocFissure/doc/faq.rst @@ -0,0 +1,19 @@ +.. _faq: + +####################### +FAQ +####################### + + - Does Bloc Fissure works on a 2D mesh ? + +No, Bloc Fissure works only for 3D meshes. However, the user can extrude the 2D mesh to a 3D mesh, insert a crack and then extract a surface containing the crack. + + - Can I insert a crack in a symmetry plan ? + +No, the user must insert the crack without using the symmetry plan passing through the crack lips. + + - I can't have Bloc Fissure working, it raises a pure python error, what can I do ? + +Bloc Fissure has some error messages for the most commonly encountered misuses. If the program raises a pure python error, it means that this error is rare or has not been encountered by the programmers yet. + +Still, either the case can't be treated using Bloc Fissure or the insertion procedure was not fully respected. In the first case, use Zcracks (soon available). In the second case, see the :ref:`tutorial `. \ No newline at end of file diff --git a/src/Tools/blocFissure/doc/gui.rst b/src/Tools/blocFissure/doc/gui.rst new file mode 100755 index 000000000..029341361 --- /dev/null +++ b/src/Tools/blocFissure/doc/gui.rst @@ -0,0 +1,78 @@ +.. _gui: + +With GUI +===================================== + +To make the use of « Bloc Fissure » easier, a Graphical User Interface (GUI) was developed. Inputs are similar to those of :ref:`script mode