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:
-- If there is a sub-mesh on either sinuous border, then the nodes of
+
- 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.
-- If there is no sub-meshes on the sinuous borders, then a part of
+
- 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() = "< tmpNodes(Nodes1.size());
+ vector< const SMDS_MeshNode* > tmpNodes;
gp_Trsf aTrsf;
gp_Ax1 theAxis(P0,gp_Dir(Axis));
aTrsf.SetRotation( theAxis, Angles.Value(i) );
@@ -948,10 +948,10 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
aTrsf2d.Transforms( cx, cy );
// set node on face
meshDS->SetNodeOnFace( node, faceID, cx, cy );
- tmpNodes[j-1] = node;
+ tmpNodes.push_back(node);
}
// create faces
- tmpNodes[Points.Length()] = CNodes[i];
+ tmpNodes.push_back( CNodes[i] );
// quad
for(j=0; j
Date: Tue, 10 Nov 2015 14:17:25 +0300
Subject: [PATCH 035/147] 52941: Remove selected group does't work in sewing
operation
---
src/SMESHGUI/SMESHGUI_SewingDlg.cxx | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
index d7a47f7d0..d7f598c82 100644
--- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
+++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
@@ -826,12 +826,13 @@ bool SMESHGUI_SewingDlg::haveBorders()
QString SMESHGUI_SewingDlg::getPartText(const SMESH::FreeBorderPart& aPART)
{
+ typedef CORBA::Long TInt;
QString text;
- if ( 0 <= aPART.border && aPART.border < myBorders->borders.length() )
+ if ( 0 <= aPART.border && aPART.border < (TInt)myBorders->borders.length() )
{
const SMESH::FreeBorder& aBRD = myBorders->borders[ aPART.border ];
- if ( 0 <= aPART.node1 && aPART.node1 < aBRD.nodeIDs.length() &&
- 0 <= aPART.nodeLast && aPART.nodeLast < aBRD.nodeIDs.length() )
+ if ( 0 <= aPART.node1 && aPART.node1 < (TInt)aBRD.nodeIDs.length() &&
+ 0 <= aPART.nodeLast && aPART.nodeLast < (TInt)aBRD.nodeIDs.length() )
{
text += QString("( %1 %2 %3 ) ")
.arg( aBRD.nodeIDs[ aPART.node1 ] )
@@ -853,7 +854,7 @@ QString SMESHGUI_SewingDlg::getGroupText(int groupIndex)
if ( haveBorders() &&
groupIndex >= 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