mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 10:50:34 +05:00
un premier test de publication conditionnelle
This commit is contained in:
parent
249a5808d8
commit
77b224bfc9
@ -127,7 +127,7 @@ problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.reference
|
|||||||
|
|
||||||
|
|
||||||
# ---tous les cas en sequence, ou les cas selectionnés ...
|
# ---tous les cas en sequence, ou les cas selectionnés ...
|
||||||
runall = True
|
runall = False
|
||||||
if runall:
|
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,]
|
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
|
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
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
logging.info('start')
|
logging.info('start')
|
||||||
|
from initLog import getLogLevel
|
||||||
|
|
||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
@ -13,3 +14,12 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New(salome.myStudy)
|
smesh = smeshBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
logging.debug("initialisation de geompy et smesh OK")
|
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)
|
||||||
|
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublishDebug
|
||||||
|
from geomsmesh import geomPublishDebugInFather
|
||||||
|
|
||||||
from substractSubShapes import substractSubShapes
|
from substractSubShapes import substractSubShapes
|
||||||
|
|
||||||
def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSorted,
|
def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSorted,
|
||||||
@ -36,13 +39,13 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor
|
|||||||
nameEdge = "edgeRadFacePipePeau%d"%i
|
nameEdge = "edgeRadFacePipePeau%d"%i
|
||||||
facesPipePeau[i] = face
|
facesPipePeau[i] = face
|
||||||
endsEdgeFond[i] = sharedVertices[0]
|
endsEdgeFond[i] = sharedVertices[0]
|
||||||
geompy.addToStudy(face, nameFace)
|
geomPublishDebug(face, nameFace)
|
||||||
geompy.addToStudy(sharedVertices[0], nameVert)
|
geomPublishDebug(sharedVertices[0], nameVert)
|
||||||
edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
|
edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
|
||||||
for edge in edgesFace:
|
for edge in edgesFace:
|
||||||
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
||||||
edgeRadFacePipePeau[i] = edge
|
edgeRadFacePipePeau[i] = edge
|
||||||
geompy.addToStudy(edge, nameEdge)
|
geomPublishDebug(edge, nameEdge)
|
||||||
break
|
break
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
@ -59,14 +62,14 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor
|
|||||||
geompy.UnionList(grpEdgesCirc, edges)
|
geompy.UnionList(grpEdgesCirc, edges)
|
||||||
edgesCircPeau[i] = grpEdgesCirc
|
edgesCircPeau[i] = grpEdgesCirc
|
||||||
name = "edgeCirc%d"%i
|
name = "edgeCirc%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, grpEdgesCirc, name)
|
geomPublishDebugInFather(facePeau, grpEdgesCirc, name)
|
||||||
edgesListees = edgesListees + edges
|
edgesListees = edgesListees + edges
|
||||||
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
||||||
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
||||||
geompy.UnionList(grpVertCircPeau, vertices)
|
geompy.UnionList(grpVertCircPeau, vertices)
|
||||||
verticesCircPeau[i] = grpVertCircPeau
|
verticesCircPeau[i] = grpVertCircPeau
|
||||||
name = "pointEdgeCirc%d"%i
|
name = "pointEdgeCirc%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, grpVertCircPeau, name)
|
geomPublishDebugInFather(facePeau, grpVertCircPeau, name)
|
||||||
pass
|
pass
|
||||||
pass # --- au moins une extrémité du pipe sur cette face de peau
|
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):
|
for i, edge in enumerate(edgesFilling):
|
||||||
edgepeau = geompy.GetInPlace(facePeau, edge)
|
edgepeau = geompy.GetInPlace(facePeau, edge)
|
||||||
name = "edgepeau%d"%i
|
name = "edgepeau%d"%i
|
||||||
geompy.addToStudyInFather(facePeau,edgepeau, name)
|
geomPublishDebugInFather(facePeau,edgepeau, name)
|
||||||
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
|
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
|
||||||
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
||||||
logging.debug(" EDGES multiples")
|
logging.debug(" EDGES multiples")
|
||||||
@ -94,7 +97,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor
|
|||||||
if aretesVivesC is not None:
|
if aretesVivesC is not None:
|
||||||
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
|
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
|
||||||
if bordsVifs is not None:
|
if bordsVifs is not None:
|
||||||
geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs")
|
geomPublishDebugInFather(facePeau, bordsVifs, "bordsVifs")
|
||||||
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
|
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
|
||||||
grptmp = None
|
grptmp = None
|
||||||
if len(aretesVivesCoupees) > 0:
|
if len(aretesVivesCoupees) > 0:
|
||||||
@ -108,7 +111,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor
|
|||||||
edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
|
edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
|
||||||
aretesVivesCoupees += edv
|
aretesVivesCoupees += edv
|
||||||
logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
|
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
|
# --- 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):
|
if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
|
||||||
edgesFissurePeau[i] = edge
|
edgesFissurePeau[i] = edge
|
||||||
name = "edgeFissurePeau%d"%i
|
name = "edgeFissurePeau%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, edge, name)
|
geomPublishDebugInFather(facePeau, edge, name)
|
||||||
for edge in edges: # on ajoute après les edges manquantes
|
for edge in edges: # on ajoute après les edges manquantes
|
||||||
if edge not in edgesFissurePeau:
|
if edge not in edgesFissurePeau:
|
||||||
edgesFissurePeau.append(edge)
|
edgesFissurePeau.append(edge)
|
||||||
@ -130,7 +133,7 @@ def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSor
|
|||||||
for i, edge in enumerate(edges):
|
for i, edge in enumerate(edges):
|
||||||
edgesFissurePeau.append(edge)
|
edgesFissurePeau.append(edge)
|
||||||
name = "edgeFissurePeau%d"%i
|
name = "edgeFissurePeau%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, edge, name)
|
geomPublishDebugInFather(facePeau, edge, name)
|
||||||
|
|
||||||
return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
|
return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
|
||||||
edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
|
edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
|
||||||
|
@ -1,31 +1,45 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
loglevel = 3
|
||||||
|
|
||||||
def setDebug():
|
def setDebug():
|
||||||
|
global loglevel
|
||||||
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
|
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
|
||||||
level=logging.DEBUG)
|
level=logging.DEBUG)
|
||||||
logging.info('start Debug')
|
loglevel = 1
|
||||||
|
logging.info('start Debug %s', loglevel)
|
||||||
|
|
||||||
def setVerbose():
|
def setVerbose():
|
||||||
|
global loglevel
|
||||||
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
|
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
|
||||||
level=logging.INFO)
|
level=logging.INFO)
|
||||||
logging.info('start Verbose')
|
loglevel = 2
|
||||||
|
logging.info('start Verbose %s', loglevel)
|
||||||
|
|
||||||
def setRelease():
|
def setRelease():
|
||||||
|
global loglevel
|
||||||
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
|
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
|
||||||
level=logging.WARNING)
|
level=logging.WARNING)
|
||||||
logging.warning('start Release')
|
loglevel = 3
|
||||||
|
logging.warning('start Release %s', loglevel)
|
||||||
|
|
||||||
def setUnitTests():
|
def setUnitTests():
|
||||||
|
global loglevel
|
||||||
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
|
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
|
||||||
level=logging.CRITICAL)
|
level=logging.CRITICAL)
|
||||||
logging.critical('start UnitTests')
|
loglevel = 4
|
||||||
|
logging.critical('start UnitTests %s', loglevel)
|
||||||
|
|
||||||
def setPerfTests():
|
def setPerfTests():
|
||||||
|
global loglevel
|
||||||
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
|
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
|
||||||
level=logging.CRITICAL)
|
level=logging.CRITICAL)
|
||||||
logging.info('start PerfTests')
|
loglevel = 5
|
||||||
|
logging.info('start PerfTests %s', loglevel)
|
||||||
|
|
||||||
|
def getLogLevel():
|
||||||
|
return loglevel
|
||||||
|
|
||||||
#logging.basicConfig(filename='myapp.log',
|
#logging.basicConfig(filename='myapp.log',
|
||||||
# format='%(asctime)s %(message)s',
|
# format='%(asctime)s %(message)s',
|
||||||
|
Loading…
Reference in New Issue
Block a user