*/
//================================================================================
-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
{
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;
}
//================================================================================
std::vector< int > GetMeshInfo() const;
- int GetElementIds( int* ids ) const;
+ template< typename IDTYPE >
+ int GetElementIds( IDTYPE* ids ) const
+ {
+ return getElementIds( (void*)ids, sizeof(IDTYPE));
+ }
+
virtual int Extent() const;
void update() const;
void setChanged(bool changed=true);
const SMDS_MeshElement* setNbElemToSkip( SMDS_ElemIteratorPtr& elIt );
+ int getElementIds( void* ids, size_t idSize ) const;
SMESH_PredicatePtr myPredicate;
std::vector< int > myMeshInfo;