return tol;
}
+
+//================================================================================
+/*!
+ * \brief Check if the first and last vertices of an edge are the same
+ * \param anEdge - the edge to check
+ * \retval bool - true if same
+ */
+//================================================================================
+
+bool SMESH_MesherHelper::IsClosedEdge( const TopoDS_Edge& anEdge )
+{
+ if ( anEdge.Orientation() >= TopAbs_INTERNAL )
+ return IsClosedEdge( TopoDS::Edge( anEdge.Oriented( TopAbs_FORWARD )));
+ return TopExp::FirstVertex( anEdge ).IsSame( TopExp::LastVertex( anEdge ));
+}
+
//=======================================================================
//function : IsQuadraticMesh
//purpose : Check mesh without geometry for: if all elements on this shape are quadratic,
return true; // done
}
}
- if ( IsClosedEdge( edge1 ) && IsClosedEdge( edge2 ))
+ if ( SMESH_MesherHelper::IsClosedEdge( edge1 ) &&
+ SMESH_MesherHelper::IsClosedEdge( edge2 ))
{
// TODO: find out a proper orientation (is it possible?)
InsertAssociation( edge1, edge2, theMap, bidirect); // insert with a proper orientation
edge.Nullify();
TopoDS_Shape wire = OuterShape( TopoDS::Face( expF.Current() ), TopAbs_WIRE );
for ( expE.Init( wire, TopAbs_EDGE ); edge.IsNull() && expE.More(); expE.Next() )
- if ( !IsClosedEdge( TopoDS::Edge( expE.Current() )))
+ if ( !SMESH_MesherHelper::IsClosedEdge( TopoDS::Edge( expE.Current() )))
edge = expE.Current();
if ( !edge.IsNull() )
break;
} else if (edge.ShapeType() != TopAbs_EDGE) { // no faces
edge.Nullify();
for ( expE.Init( theShape1, TopAbs_EDGE ); edge.IsNull() && expE.More(); expE.Next() )
- if ( !IsClosedEdge( TopoDS::Edge( expE.Current() )))
+ if ( !SMESH_MesherHelper::IsClosedEdge( TopoDS::Edge( expE.Current() )))
edge = expE.Current();
}
if ( edge.IsNull() || edge.ShapeType() != TopAbs_EDGE )
if ( hasNodesOnEdge )
{
int nbNodeToGet = 1;
- if ( IsClosedEdge( edge1 ) || IsClosedEdge( edge2 ) )
+ if ( helper1.IsClosedEdge( edge1 ) || helper2.IsClosedEdge( edge2 ) )
nbNodeToGet = 2;
for ( int is2 = 0; is2 < 2; ++is2 )
{
return true;
}
-//================================================================================
-/*!
- * \brief Check if the first and last vertices of an edge are the same
- * \param anEdge - the edge to check
- * \retval bool - true if same
- */
-//================================================================================
-
-bool StdMeshers_ProjectionUtils::IsClosedEdge( const TopoDS_Edge& anEdge )
-{
- return TopExp::FirstVertex( anEdge ).IsSame( TopExp::LastVertex( anEdge ));
-}
-
//================================================================================
/*!
* \brief Return any subshape of a face belonging to the outer wire
SMESH_Mesh* mesh2,
const TShapeShapeMap & assocMap,
TNodeNodeMap & nodeIn2OutMap);
- /*!
- * \brief Check if the first and last vertices of an edge are the same
- * \param anEdge - the edge to check
- * \retval bool - true if same
- */
- static bool IsClosedEdge( const TopoDS_Edge& anEdge );
-
/*!
* \brief Return any subshape of a face belonging to the outer wire
* \param face - the face