From 2d179048e3c7bdf2c4ab3aa3738bed58ea4fb9c4 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 26 Jan 2012 15:32:57 +0000 Subject: [PATCH] 0021338: EDF 1926 SMESH: New controls and filters Call myPredicate->SetMesh( GetMesh() ) in order to let him update his data according to a changed mesh --- src/SMESHDS/SMESHDS_GroupOnFilter.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx index 8307b279a..3c2b2a36b 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx @@ -149,6 +149,7 @@ void SMESHDS_GroupOnFilter::update() const 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() ) @@ -157,7 +158,8 @@ void SMESHDS_GroupOnFilter::update() const 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 ); }