From: vsr Date: Fri, 6 Nov 2009 08:52:51 +0000 (+0000) Subject: 0020095: EDF 896 SMESH : Advanced Mesh info on a group X-Git-Tag: V5_1_3rc2~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=76756b14649babbe96c8f9bdc8c05d3136d4f494;p=modules%2Fsmesh.git 0020095: EDF 896 SMESH : Advanced Mesh info on a group Additional minor fix --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index dbb1a6ff4..a9babb02f 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -816,6 +816,20 @@ class smeshDC(SMESH._objref_SMESH_Gen): def CreateHypothesis(self, theHType, theLibName="libStdMeshersEngine.so"): return SMESH._objref_SMESH_Gen.CreateHypothesis(self, theHType, theLibName ) + ## Gets the mesh stattistic + # @return dictionary type element - count of elements + # @ingroup l1_meshinfo + def GetMeshInfo(self, obj): + if isinstance( obj, Mesh ): + obj = obj.GetMesh() + d = {} + if hasattr(obj, "_narrow") and obj._narrow(SMESH.SMESH_IDSource): + values = obj.GetMeshInfo() + for i in range(SMESH.Entity_Last._v): + if i < len(values): d[SMESH.EntityType._item(i)]=values[i] + pass + return d + import omniORB #Registering the new proxy for SMESH_Gen omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshDC) @@ -1650,13 +1664,7 @@ class Mesh: # @ingroup l1_meshinfo def GetMeshInfo(self, obj = None): if not obj: obj = self.mesh - d = {} - if hasattr(obj, "_narrow") and obj._narrow(SMESH.SMESH_IDSource): - values = obj.GetMeshInfo() - for i in range(SMESH.Entity_Last._v): - if i < len(values): d[SMESH.EntityType._item(i)]=values[i] - pass - return d + return self.smeshpyD.GetMeshInfo(obj) ## Returns the number of nodes in the mesh # @return an integer value