Salome HOME
Copyrights update 2013
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupOnFilter.cxx
index 3850da28be5c0bae05d2ebf3cb93db4c5849aa1e..7690f2df2ab7af4756531ab549a442991e2ee5d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013  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
@@ -228,18 +228,18 @@ std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo() const
  */
 //================================================================================
 
-int SMESHDS_GroupOnFilter::GetElementIds( int* ids ) const
+int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
 {
   SMESHDS_GroupOnFilter* me = const_cast<SMESHDS_GroupOnFilter*>( this );
 
-  int* curID = ids;
+  char* curID = (char*) ids;
   SMDS_ElemIteratorPtr elIt = GetElements();
   if ( elIt->more() )
   {
     if ( IsUpToDate() )
     {
-      while ( elIt->more() )
-        *curID++ = elIt->next()->GetID();
+      for ( ; elIt->more(); curID += idSize )
+        (*(int*) curID) = elIt->next()->GetID();
     }
     else
     {
@@ -250,18 +250,19 @@ int SMESHDS_GroupOnFilter::GetElementIds( int* ids ) const
 
       me->myMeshInfo.assign( SMDSEntity_Last, 0 );
       me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
-      *curID++ = firstOkElem->GetID();
-      while ( elIt->more() )
+
+      (*(int*) curID) = firstOkElem->GetID();
+      for ( curID += idSize; elIt->more(); curID += idSize )
       {
         const SMDS_MeshElement* e = elIt->next();
+        (*(int*) curID) = e->GetID();
         me->myMeshInfo[ e->GetEntityType() ]++;
-        *curID++ = e->GetID();
       }
     }
   }
   me->setChanged( false );
 
-  return curID - ids;
+  return ( curID - (char*)ids ) / idSize;
 }
 
 //================================================================================