X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_subMesh_i.cxx;h=2813ceb32c3176231fc9f21f0e770c813fcb88c7;hb=40b2818f18601091d81e0d9d749a3fd6808c31ce;hp=f90cb300a536a2729e311d12c34e06dd89955bbc;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index f90cb300a..2813ceb32 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -515,3 +515,42 @@ 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; + + ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; + SMESHDS_SubMesh* aSubMeshDS = 0; + if (aSubMesh) aSubMeshDS = aSubMesh->GetSubMeshDS(); + if (!aSubMeshDS) + return aRes._retn(); + + // get own number of nodes + aRes[ SMESH::Entity_Node ] = aSubMeshDS->NbNodes(); + + // get own elements statistic + SMESH_Mesh_i::CollectMeshInfo( aSubMeshDS->GetElements(), aRes ); + + // get statistic from child sub-meshes + TListOfSubMeshes smList; + if ( getSubMeshes( aSubMesh, smList ) ) + for ( TListOfSubMeshes::iterator sm = smList.begin(); sm != smList.end(); ++sm ) + { + aRes[ SMESH::Entity_Node ]+= (*sm)->NbNodes(); + SMESH_Mesh_i::CollectMeshInfo( (*sm)->GetElements(), aRes ); + } + + return aRes._retn(); +}