X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2FsmeshBuilder.py;h=e843ff1680e695aca305bfe6244a96113a08826a;hp=afa315b9bf416f38174e40f4819503fc1bd89d0d;hb=5dcb2f2b467e63a0e5d37e234b2ba8f8e624f987;hpb=54d95073e18f1aca5c8e031c6b14e930c84f320e diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index afa315b9b..e843ff168 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1250,6 +1250,27 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ): return hyp + def GetHypothesisParameterValues( self, hypType, libName, mesh, shape, initParams ): + """ + Create hypothesis initialized according to parameters + + Parameters: + hypType (string): hypothesis type + libName (string): plug-in library name + mesh: optional mesh by which a hypotheses can initialize self + shape: optional geometry by size of which a hypotheses can initialize self + initParams: structure SMESH.HypInitParams defining how to initialize a hypothesis + + Returns: + created hypothesis instance + """ + if isinstance( mesh, Mesh ): + mesh = mesh.GetMesh() + if isinstance( initParams, (bool,int)): + initParams = SMESH.HypInitParams( not initParams, 1.0, not mesh ) + return SMESH._objref_SMESH_Gen.GetHypothesisParameterValues(self, hypType, libName, + mesh, shape, initParams ) + def GetMeshInfo(self, obj): """ Get the mesh statistic. @@ -5595,6 +5616,8 @@ class Mesh(metaclass = MeshMeta): if isinstance( Elements, list ): if not Elements: raise RuntimeError("Elements empty!") + if isinstance( Elements[0], Mesh ): + Elements = [ Elements[0].GetMesh() ] if isinstance( Elements[0], int ): Elements = self.GetIDSource( Elements, SMESH.ALL ) unRegister.set( Elements )