{
// look for a seam edge
const TopoDS_Edge& edge = TopoDS::Edge( exp.Current() );
- bool isClosed = BRep_Tool::IsClosed( edge, face );
- // BEGIN: jfa for bug 0019943
- if (isClosed) {
- isClosed = false;
- for (TopExp_Explorer expw (face, TopAbs_WIRE); expw.More() && !isClosed; expw.Next()) {
- const TopoDS_Wire& wire = TopoDS::Wire(expw.Current());
- int nbe = 0;
- for (BRepTools_WireExplorer we (wire, face); we.More() && !isClosed; we.Next()) {
- if (we.Current().IsSame(edge)) {
- nbe++;
- if (nbe == 2) isClosed = true;
- }
- }
- }
- }
- // END: jfa for bug 0019943
- if (isClosed) {
+ if ( BRep_Tool::IsClosed( edge, face )) {
// initialize myPar1, myPar2 and myParIndex
if ( mySeamShapeIds.empty() ) {
gp_Pnt2d uv1, uv2;
myPar2 = surface.LastVParameter();
}
}
- // store shapes indices
- mySeamShapeIds.insert( meshDS->ShapeToIndex( edge ));
- for ( TopExp_Explorer v( edge, TopAbs_VERTEX ); v.More(); v.Next() )
- mySeamShapeIds.insert( meshDS->ShapeToIndex( v.Current() ));
+ // store seam shape indices, negative if shape encounters twice
+ int edgeID = meshDS->ShapeToIndex( edge );
+ mySeamShapeIds.insert( IsSeamShape( edgeID ) ? -edgeID : edgeID );
+ for ( TopExp_Explorer v( edge, TopAbs_VERTEX ); v.More(); v.Next() ) {
+ int vertexID = meshDS->ShapeToIndex( v.Current() );
+ mySeamShapeIds.insert( IsSeamShape( vertexID ) ? -vertexID : vertexID );
+ }
}
// look for a degenerated edge
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
uv = C2d->Value( epos->GetUParameter() );
// for a node on a seam edge select one of UVs on 2 pcurves
- if ( n2 && mySeamShapeIds.find( edgeID ) != mySeamShapeIds.end() )
+ if ( n2 && IsSeamShape( edgeID ) )
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX)
}
}
}
- if ( n2 && mySeamShapeIds.find( vertexID ) != mySeamShapeIds.end() )
+ if ( n2 && IsSeamShape( vertexID ) )
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
}
* \param subShape - edge or vertex index in SMESHDS
* \retval bool - true if subShape is a seam shape
*
- * It works only if IsQuadraticSubMesh() or SetSubShape() has been called
+ * It works only if IsQuadraticSubMesh() or SetSubShape() has been called.
+ * Seam shape has two 2D alternative represenations on the face
*/
bool IsSeamShape(const int subShape) const
{ return mySeamShapeIds.find( subShape ) != mySeamShapeIds.end(); }
* \param subShape - edge or vertex
* \retval bool - true if subShape is a seam shape
*
- * It works only if IsQuadraticSubMesh() or SetSubShape() has been called
+ * It works only if IsQuadraticSubMesh() or SetSubShape() has been called.
+ * Seam shape has two 2D alternative represenations on the face
*/
bool IsSeamShape(const TopoDS_Shape& subShape) const
{ return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); }
+ /*!
+ * \brief Return true if an edge or a vertex encounters twice in face wire
+ * \param subShape - Id of edge or vertex
+ */
+ bool IsRealSeam(const int subShape) const
+ { return mySeamShapeIds.find( -subShape ) != mySeamShapeIds.end(); }
+ /*!
+ * \brief Return true if an edge or a vertex encounters twice in face wire
+ * \param subShape - edge or vertex
+ */
+ bool IsRealSeam(const TopoDS_Shape& subShape) const
+ { return IsRealSeam( GetMeshDS()->ShapeToIndex( subShape)); }
/*!
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
* has a seam edge