+
+ typedef std::vector< SMDS_MeshGroup* > TGroupVec;
+
+ //================================================================================
+ /*!
+ * \brief Fill theFaceID2Groups map for a given face
+ * \param [in] theFace - the face
+ * \param [in] theGroupsToUpdate - list of groups to treat
+ * \param [out] theFaceID2Groups - the map to fill in
+ * \param [out] theWorkGroups - a working buffer of groups
+ */
+ //================================================================================
+
+ void findGroups( const SMDS_MeshElement * theFace,
+ TGroupVec & theGroupsToUpdate,
+ NCollection_DataMap< int, TGroupVec > & theFaceID2Groups,
+ TGroupVec & theWorkGroups )
+ {
+ theWorkGroups.clear();
+ for ( size_t i = 0; i < theGroupsToUpdate.size(); ++i )
+ if ( theGroupsToUpdate[i]->Contains( theFace ))
+ theWorkGroups.push_back( theGroupsToUpdate[i] );
+
+ if ( !theWorkGroups.empty() )
+ theFaceID2Groups.Bind( theFace->GetID(), theWorkGroups );
+ }