mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 10:50:34 +05:00
Fix for 32-bit platforms
- int GetElementIds( int* ids ) const; + template< typename IDTYPE > + int GetElementIds( IDTYPE* ids ) const + { + return getElementIds( (void*)ids, sizeof(IDTYPE)); + }
This commit is contained in:
parent
58146f9215
commit
0115246c96
@ -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 );
|
SMESHDS_GroupOnFilter* me = const_cast<SMESHDS_GroupOnFilter*>( this );
|
||||||
|
|
||||||
int* curID = ids;
|
char* curID = (char*) ids;
|
||||||
SMDS_ElemIteratorPtr elIt = GetElements();
|
SMDS_ElemIteratorPtr elIt = GetElements();
|
||||||
if ( elIt->more() )
|
if ( elIt->more() )
|
||||||
{
|
{
|
||||||
if ( IsUpToDate() )
|
if ( IsUpToDate() )
|
||||||
{
|
{
|
||||||
while ( elIt->more() )
|
for ( ; elIt->more(); curID += idSize )
|
||||||
*curID++ = elIt->next()->GetID();
|
(*(int*) curID) = elIt->next()->GetID();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -250,18 +250,19 @@ int SMESHDS_GroupOnFilter::GetElementIds( int* ids ) const
|
|||||||
|
|
||||||
me->myMeshInfo.assign( SMDSEntity_Last, 0 );
|
me->myMeshInfo.assign( SMDSEntity_Last, 0 );
|
||||||
me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
|
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();
|
const SMDS_MeshElement* e = elIt->next();
|
||||||
|
(*(int*) curID) = e->GetID();
|
||||||
me->myMeshInfo[ e->GetEntityType() ]++;
|
me->myMeshInfo[ e->GetEntityType() ]++;
|
||||||
*curID++ = e->GetID();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
me->setChanged( false );
|
me->setChanged( false );
|
||||||
|
|
||||||
return curID - ids;
|
return ( curID - (char*)ids ) / idSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -48,7 +48,12 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase
|
|||||||
|
|
||||||
std::vector< int > GetMeshInfo() const;
|
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;
|
virtual int Extent() const;
|
||||||
|
|
||||||
@ -69,6 +74,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase
|
|||||||
void update() const;
|
void update() const;
|
||||||
void setChanged(bool changed=true);
|
void setChanged(bool changed=true);
|
||||||
const SMDS_MeshElement* setNbElemToSkip( SMDS_ElemIteratorPtr& elIt );
|
const SMDS_MeshElement* setNbElemToSkip( SMDS_ElemIteratorPtr& elIt );
|
||||||
|
int getElementIds( void* ids, size_t idSize ) const;
|
||||||
|
|
||||||
SMESH_PredicatePtr myPredicate;
|
SMESH_PredicatePtr myPredicate;
|
||||||
std::vector< int > myMeshInfo;
|
std::vector< int > myMeshInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user