Salome HOME
IPAL21374 Add 0D element leads to visualization failure.
[modules/smesh.git] / src / SMESH_I / SMESH_subMesh_i.cxx
index f90cb300a536a2729e311d12c34e06dd89955bbc..7d342969a9adaa29e0c2fa776efa6a2e636e1f1d 100644 (file)
@@ -515,3 +515,32 @@ SMESH::ElementType SMESH_subMesh_i::GetElementType( const CORBA::Long id, const
 {
   return GetFather()->GetElementType( id, iselem );
 }
+
+
+//=============================================================================
+/*!
+ * Returns statistic of mesh elements
+ * Result array of number enityties
+ * Inherited from SMESH_IDSource
+ */
+//=============================================================================
+SMESH::long_array* SMESH_subMesh_i::GetMeshInfo()
+{
+  SMESH::long_array_var aRes = new SMESH::long_array();
+  aRes->length(SMESH::Entity_Last);
+  for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
+    aRes[i] = 0;
+  
+  // get number of nodes
+  aRes[ SMESH::Entity_Node ] = GetNumberOfNodes(true);
+  ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
+
+  // get statistic from child sub-meshes
+  TListOfSubMeshes smList;
+  if ( getSubMeshes( aSubMesh, smList ) )
+    for ( TListOfSubMeshes::iterator sm = smList.begin(); sm != smList.end(); ++sm )
+      SMESH_Mesh_i::CollectMeshInfo( (*sm)->GetElements(), aRes );
+
+  return aRes._retn();
+}