X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Group_i.cxx;h=c69024ed215ce4f5d93118049be515259ff5fa35;hb=84e136e74b2bc729df20617a9968439919337a55;hp=045e691b9c79315a0a32e7c1125b73fa8661fe18;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 045e691b9..c69024ed2 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes // File : SMESH_Group_i.cxx // Author : Sergey ANIKIN, OCC @@ -165,11 +166,12 @@ SMESH::ElementType SMESH_GroupBase_i::GetType() SMDSAbs_ElementType aSMDSType = aGroupDS->GetType(); SMESH::ElementType aType; switch (aSMDSType) { - case SMDSAbs_Node: aType = SMESH::NODE; break; - case SMDSAbs_Edge: aType = SMESH::EDGE; break; - case SMDSAbs_Face: aType = SMESH::FACE; break; - case SMDSAbs_Volume: aType = SMESH::VOLUME; break; - default: aType = SMESH::ALL; break; + case SMDSAbs_Node: aType = SMESH::NODE; break; + case SMDSAbs_Edge: aType = SMESH::EDGE; break; + case SMDSAbs_Face: aType = SMESH::FACE; break; + case SMDSAbs_Volume: aType = SMESH::VOLUME; break; + case SMDSAbs_0DElement: aType = SMESH::ELEM0D; break; + default: aType = SMESH::ALL; break; } return aType; } @@ -305,8 +307,8 @@ typedef bool (SMESHDS_Group::*TFunChangeGroup)(const int); CORBA::Long ChangeByPredicate( SMESH::Predicate_i* thePredicate, - SMESHDS_GroupBase* theGroupBase, - TFunChangeGroup theFun) + SMESHDS_GroupBase* theGroupBase, + TFunChangeGroup theFun) { CORBA::Long aNb = 0; if(SMESHDS_Group* aGroupDS = dynamic_cast(theGroupBase)){ @@ -317,7 +319,7 @@ ChangeByPredicate( SMESH::Predicate_i* thePredicate, CORBA::Long i = 0, iEnd = aSequence.size(); for(; i < iEnd; i++) if((aGroupDS->*theFun)(aSequence[i])) - aNb++; + aNb++; return aNb; } return aNb; @@ -487,3 +489,27 @@ void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color) MESSAGE("set color number of a group"); return ; } + +//============================================================================= +/*! + * Returns statistic of mesh elements + * Result array of number enityties + * Inherited from SMESH_IDSource + */ +//============================================================================= +SMESH::long_array* SMESH_GroupBase_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; + + SMESHDS_GroupBase* aGrpDS = GetGroupDS(); + if ( !aGrpDS ) + return aRes._retn(); + if ( GetType() == NODE ) + aRes[ SMESH::Entity_Node ] = aGrpDS->Extent(); + else + SMESH_Mesh_i::CollectMeshInfo( aGrpDS->GetElements(), aRes); + return aRes._retn(); +}