// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FaceSide.hxx
// Created : Wed Jan 31 18:41:25 2007
// Author : Edward AGAPOV (eap)
#include <Adaptor2d_Curve2d.hxx>
#include <BRepAdaptor_CompCurve.hxx>
-#include <BRepAdaptor_Curve.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
+#include <GCPnts_AbscissaPoint.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
-#include <GCPnts_AbscissaPoint.hxx>
-#include <Geom2dAdaptor_Curve.hxx>
-
#include <map>
#include "utilities.h"
{
int nbEdges = theEdges.size();
myEdge.resize( nbEdges );
+ myEdgeID.resize( nbEdges );
myC2d.resize( nbEdges );
myC3dAdaptor.resize( nbEdges );
myFirst.resize( nbEdges );
if ( myEdgeLength[i] < DBL_MIN ) nbDegen++;
myLength += myEdgeLength[i];
myEdge[i] = *edge;
+ myEdgeID[i] = meshDS->ShapeToIndex( *edge );
if ( !theIsForward ) myEdge[i].Reverse();
if ( theFace.IsNull() )
uvPt.x = uvPt.y = uvPt.normParam = u_node->first;
if ( isXConst ) uvPt.x = constValue;
else uvPt.y = constValue;
- if ( myNormPar[ EdgeIndex ] < uvPt.normParam ) {
+ const SMDS_EdgePosition* epos =
+ dynamic_cast<const SMDS_EdgePosition*>(uvPt.node->GetPosition());
+ if (( myNormPar[ EdgeIndex ] < uvPt.normParam ) ||
+ ( epos && uvPt.node->getshapeId() != myEdgeID[ EdgeIndex ])) // for myMissingVertexNodes
+ {
prevNormPar = myNormPar[ EdgeIndex ];
++EdgeIndex;
#ifdef _DEBUG_
#endif
paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
}
- const SMDS_EdgePosition* epos =
- dynamic_cast<const SMDS_EdgePosition*>(uvPt.node->GetPosition());
if ( epos ) {
uvPt.param = epos->GetUParameter();
}
}
if ( nbEdges > 1 ) {
reverse( myEdge );
+ reverse( myEdgeID );
reverse( myC2d );
reverse( myC3dAdaptor );
reverse( myFirst );
if ( myEdge.empty() )
return 0;
-// if ( myEdge.size() == 1 )
-// return new BRepAdaptor_Curve( myEdge[0] );
-
TopoDS_Wire aWire;
BRep_Builder aBuilder;
aBuilder.MakeWire(aWire);
for ( int i=0; i<myEdge.size(); ++i )
aBuilder.Add( aWire, myEdge[i] );
+
+ if ( myEdge.size() == 2 && FirstVertex().IsSame( LastVertex() ))
+ aWire.Closed(true); // issue 0021141
+
return new BRepAdaptor_CompCurve( aWire );
}