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
from salome.kernel import services

#
# Get SALOME PyQt interface to manipulate the GUI context
# (Get the active study for example. Note that the active study is a
# GUI concept only: it is the study that is currently active in the
# desktop)
#
import SalomePyQt
sgPyQt = SalomePyQt.SalomePyQt()

#
# Get SALOME Swig interface to manipulate the GUI widget
#
import libSALOME_Swig
SalomeGUI = libSALOME_Swig.SALOMEGUI_Swig()


#
# ==================================================================
# General helper function for GUI programming actions
# ==================================================================
#
# Get the active study
#
def getActiveStudy():
    """
    This returns a study object that corresponds to the active
    study. The active study is a GUI concept: it's the study currently
    active on the desktop.
    """