Call myPredicate->SetMesh( GetMesh() ) in order to let him update
his data according to a changed mesh
me->myElements.clear();
if ( myPredicate )
{
+ myPredicate->SetMesh( GetMesh() ); // hope myPredicate updates self here if necessary
me->myElements.reserve( GetMesh()->GetMeshInfo().NbElements(GetType()));
SMDS_ElemIteratorPtr elIt = GetMesh()->elementsIterator(GetType());
while ( elIt->more() )
if ( myPredicate->IsSatisfy( e->GetID() ))
me->myElements.push_back( e );
}
- me->myElements.resize( myElements.size() );
+ vector< const SMDS_MeshElement*> elems( me->myElements.begin(), me->myElements.end() );
+ me->myElements.swap( elems );
}
me->setChanged( false );
}