+
+ //================================================================================
+ /*!
+ * \brief Find a face including two given nodes
+ */
+ //================================================================================
+
+ const SMDS_MeshElement* FindFaceByNodes( const SMDS_MeshNode* n1,
+ const SMDS_MeshNode* n2,
+ TIDSortedElemSet avoidSet,
+ SMESH_ProxyMesh& mesh)
+ {
+ SMDS_ElemIteratorPtr faceIt = mesh.GetInverseElementIterator( n1, SMDSAbs_Face );
+ while ( faceIt->more() )
+ {
+ const SMDS_MeshElement* f = faceIt->next();
+ if ( !avoidSet.count( f ) && f->GetNodeIndex( n2 ) >= 0 )
+ return f;
+ }
+ return 0;
+ }
+
+ //================================================================================
+ /*!
+ * \brief Check that a segment bounds a face belonging to smOfFaces
+ */
+ //================================================================================
+
+ bool IsSegmentOnSubMeshBoundary( const SMDS_MeshNode* n1,
+ const SMDS_MeshNode* n2,
+ const SMESHDS_SubMesh* smOfFaces,
+ SMESH_ProxyMesh& mesh)
+ {
+ TIDSortedElemSet avoidSet;
+ bool faceFound = false;
+
+ while ( const SMDS_MeshElement* f = FindFaceByNodes( n1, n2, avoidSet, mesh ))
+ {
+ if (( faceFound = smOfFaces->Contains( f )))
+ break;
+ avoidSet.insert( f );
+ }
+ return faceFound;
+ }
+