+ //================================================================================
+ /*!
+ * \brief Returns an EDGE suitable for search of initial vertex association
+ */
+ //================================================================================
+
+ bool getOuterEdges( const TopoDS_Shape shape,
+ SMESH_Mesh& mesh,
+ std::list< TopoDS_Edge >& allBndEdges )
+ {
+ if ( shape.ShapeType() == TopAbs_COMPOUND )
+ {
+ TopoDS_Iterator it( shape );
+ if ( it.More() && it.Value().ShapeType() == TopAbs_FACE ) // group of FACEs
+ {
+ // look for a boundary EDGE of a group
+ StdMeshers_ProjectionUtils::GetBoundaryEdge( shape, mesh, &allBndEdges );
+ if ( !allBndEdges.empty() )
+ return true;
+ }
+ }
+ TopExp_Explorer expF( shape, TopAbs_FACE ), expE;
+ if ( expF.More() ) {
+ for ( ; expF.More(); expF.Next() ) {
+ TopoDS_Shape wire =
+ StdMeshers_ProjectionUtils::OuterShape( TopoDS::Face( expF.Current() ), TopAbs_WIRE );
+ for ( expE.Init( wire, TopAbs_EDGE ); expE.More(); expE.Next() )
+ if ( !SMESH_MesherHelper::IsClosedEdge( TopoDS::Edge( expE.Current() )))
+ allBndEdges.push_back( TopoDS::Edge( expE.Current() ));
+ }
+ }
+ else if ( shape.ShapeType() != TopAbs_EDGE) { // no faces
+ for ( expE.Init( shape, TopAbs_EDGE ); expE.More(); expE.Next() )
+ if ( !SMESH_MesherHelper::IsClosedEdge( TopoDS::Edge( expE.Current() )))
+ allBndEdges.push_back( TopoDS::Edge( expE.Current() ));
+ }
+ else if ( shape.ShapeType() == TopAbs_EDGE ) {
+ if ( !SMESH_MesherHelper::IsClosedEdge( TopoDS::Edge( shape )))
+ allBndEdges.push_back( TopoDS::Edge( shape ));
+ }
+ return !allBndEdges.empty();
+ }
+