Back to index

salome-smesh  6.5.0
Classes | Functions | Variables
SMESH_PY.smeshstudytools Namespace Reference

Classes

class  SMeshStudyTools

Functions

def TEST_createBoxMesh
def TEST_selectAndExport_01
def TEST_selectAndExport_02
def TEST_display

Variables

 SMESH = None

Function Documentation

Definition at line 154 of file smeshstudytools.py.

00154 
00155 def TEST_createBoxMesh():
00156     theStudy = helper.getActiveStudy()
00157     
00158     import geompy
00159     geompy.init_geom(theStudy)
00160     box = geompy.MakeBoxDXDYDZ(200, 200, 200)
00161 
00162     import smesh, SMESH, SALOMEDS    
00163     smesh.SetCurrentStudy(theStudy)
00164     import StdMeshers
00165     boxmesh = smesh.Mesh(box)
00166     Regular_1D = boxmesh.Segment()
00167     Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
00168     Nb_Segments_1.SetDistrType( 0 )
00169     Quadrangle_2D = boxmesh.Quadrangle()
00170     Hexa_3D = smesh.CreateHypothesis('Hexa_3D')
00171     status = boxmesh.AddHypothesis(Hexa_3D)
00172     isDone = boxmesh.Compute()
00173 
00174     smesh.SetName(boxmesh.GetMesh(), 'boxmesh')
00175     if salome.sg.hasDesktop():
00176         salome.sg.updateObjBrowser(1)
00177 
00178 #
00179 # Definitions:
00180 # - the SObject is an item in the study (Study Object).
00181 # - the entry is the identifier of an item.
00182 # - the object (geom object or smesh object) is a CORBA servant
00183 #   embedded in the SALOME component container and with a reference in
00184 #   the SALOME study, so that it can be retrieved.
00185 #

Definition at line 205 of file smeshstudytools.py.

00205 
00206 def TEST_display():
00207     mySObject, myEntry = helper.getSObjectSelected()
00208 
00209     tool = SMeshStudyTools()
00210     tool.displayMeshObjectFromEntry(myEntry)

Here is the call graph for this function:

Definition at line 186 of file smeshstudytools.py.

00186 
00187 def TEST_selectAndExport_01():
00188     tool = SMeshStudyTools()
00189     myMesh = tool.getMeshObjectSelected()
00190     myMesh.ExportUNV("/tmp/myMesh.unv")

Here is the caller graph for this function:

Definition at line 191 of file smeshstudytools.py.

00191 
00192 def TEST_selectAndExport_02():
00193     # In this case, we want to retrieve the name of the mesh in the
00194     # object browser. Note that in SALOME, a mesh object has no
00195     # name. Only the SObject in the object browser has a name
00196     # attribute.
00197     tool = SMeshStudyTools()
00198 
00199     mySObject, myEntry = helper.getSObjectSelected()
00200     myName = mySObject.GetName()
00201 
00202     myMesh = tool.getMeshObjectFromEntry(myEntry)
00203     exportFileName = "/tmp/"+myName+".unv"
00204     myMesh.ExportUNV(exportFileName)

Here is the caller graph for this function:


Variable Documentation

Definition at line 27 of file smeshstudytools.py.