ipar.setParameter(
    "SMESH_3", "VTKViewer_0_Sizes",
    "line:1:outline:1:elem0d:5:ball:10:1:shrink:0.75:orientation:0.1:0")
ipar.setParameter("SMESH_3", "VTKViewer_0_PointMarker", "std:1:9")
ipar.setParameter("SMESH_3", "VTKViewer_0_Opacity", "1")
ipar.setParameter("SMESH_3", "VTKViewer_0_ClippingPlane", "Off")
# set up entry SMESH_4 (mesh) parameters
ipar.setParameter("SMESH_4", "VTKViewer_0_Visibility", "On")
ipar.setParameter("SMESH_4", "VTKViewer_0_Representation", "2")
ipar.setParameter("SMESH_4", "VTKViewer_0_IsShrunk", "0")
ipar.setParameter("SMESH_4", "VTKViewer_0_Entities", "e:0:f:1:v:0:0d:0:b:0")
ipar.setParameter(
    "SMESH_4", "VTKViewer_0_Colors",
    "surface:0:0.666667:1:backsurface:100:volume:1:0:0.666667:-100:edge:0:0.666667:1:node:1:0:0:outline:0:0.27451:0:elem0d:0:1:0:ball:0:0.333333:1:orientation:1:1:1"
)
ipar.setParameter(
    "SMESH_4", "VTKViewer_0_Sizes",
    "line:1:outline:1:elem0d:5:ball:10:1:shrink:0.75:orientation:0.1:0")
ipar.setParameter("SMESH_4", "VTKViewer_0_PointMarker", "std:1:9")
ipar.setParameter("SMESH_4", "VTKViewer_0_Opacity", "1")
ipar.setParameter("SMESH_4", "VTKViewer_0_ClippingPlane", "Off")

if salome.sg.hasDesktop():
    salome.sg.updateObjBrowser(True)
    iparameters.getSession().restoreVisualState(1)

import libSALOME_Swig
gui = libSALOME_Swig.SALOMEGUI_Swig()
gui.AddIObject(salome.ObjectToID(Mesh_2.GetMesh()))
gui.AddIObject(salome.ObjectToID(Mesh_2_WL.GetMesh()))
示例#2
0
def GetSalomeID(salome_object):
    return salome.ObjectToID(salome_object)
示例#3
0
    stdMeshersEngine = "StdMeshersEngine"
else:
    stdMeshersEngine = "libStdMeshersEngine.so"

print
print "--- Create hypotheses ..."

print
print "------ LocalLength ..."
hypLen1 = smesh.CreateHypothesis("LocalLength", stdMeshersEngine)
hypLen1.SetLength(100)
print hypLen1.GetName()
print hypLen1.GetId()
print hypLen1.GetLength()
if salome.hasDesktop():
    smeshgui.SetName(salome.ObjectToID(hypLen1), "Local_Length_100")
print "OK"

print
print "------ NumberOfSegments ..."
hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", stdMeshersEngine)
hypNbSeg1.SetNumberOfSegments(7)
print hypNbSeg1.GetName()
print hypNbSeg1.GetId()
print hypNbSeg1.GetNumberOfSegments()
if salome.hasDesktop():
    smeshgui.SetName(salome.ObjectToID(hypNbSeg1), "NumberOfSegments_7")
print "OK"

print
print "------ MaxElementArea [1] ..."
import  SMESH, SALOMEDS
from salome.smesh import smeshBuilder

smesh = smeshBuilder.New(salome.myStudy)
([mesh_1], status) = smesh.CreateMeshesFromMED(r'mesh1.med')

### Store presentation parameters of displayed objects
import iparameters
ipar = iparameters.IParameters(theStudy.GetModuleParameters("Interface Applicative", "SMESH", 1))

#Set up entries:
# set up entry SMESH_3 (mesh) parameters
ipar.setParameter("SMESH_3", "VTKViewer_0_Visibility", "On")
ipar.setParameter("SMESH_3", "VTKViewer_0_Representation", "2")
ipar.setParameter("SMESH_3", "VTKViewer_0_IsShrunk", "0")
ipar.setParameter("SMESH_3", "VTKViewer_0_Entities", "e:0:f:1:v:0:0d:0:b:0")
ipar.setParameter("SMESH_3", "VTKViewer_0_Colors", "surface:0:0.666667:1:backsurface:100:volume:1:0:0.666667:-100:edge:0:0.666667:1:node:1:0:0:outline:0:0.27451:0:elem0d:0:1:0:ball:0:0.333333:1:orientation:1:1:1")
ipar.setParameter("SMESH_3", "VTKViewer_0_Sizes", "line:1:outline:1:elem0d:5:ball:10:1:shrink:0.75:orientation:0.1:0")
ipar.setParameter("SMESH_3", "VTKViewer_0_PointMarker", "std:1:9")
ipar.setParameter("SMESH_3", "VTKViewer_0_Opacity", "1")
ipar.setParameter("SMESH_3", "VTKViewer_0_ClippingPlane", "Off")

if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser(True)
  iparameters.getSession().restoreVisualState(1)

import libSALOME_Swig
gui = libSALOME_Swig.SALOMEGUI_Swig()
gui.AddIObject( salome.ObjectToID( mesh_1.GetMesh() ))
示例#5
0
algo1d_2.SetNumberOfSegments(100)

my_edges = SubShapeAll(f3c, ShapeType["EDGE"])
i = 0
for edg in my_edges:
    i = i + 1
    addToStudy(edg, "myedg_" + str(i))
    updateStudy()

for tool in [hyp1d, hyp2d, algo1d, algo2d]:
    mesh2d.AddHypothesis(f3c, tool)
    pass

mesh2d.AddHypothesis(my_edges[4], hyp1d_2)
mesh2d.AddHypothesis(my_edges[4], algo1d_2)

b = smesh.Compute(mesh2d, f3c)
if in_tui:
    smeshgui = salome.ImportComponentGUI("SMESH")
    smeshgui.Init(salome.myStudyId)
    smeshgui.SetMeshIcon(salome.ObjectToID(mesh2d), b)
    pass

updateStudy()

file_name = "f3c_tetra.med"
from os import system
system("rm -f %s > /dev/null 2>&1" % (file_name))
file_name = "/home/edmondo/Documents/DOWN/f3c_tetra.med"
mesh2d.ExportMED(file_name, 0)