0021140: EDF 1759 SMESH: Netgen1D2D fails on subshape

Fix work on edges computed with the Composed Segment discretizer
This commit is contained in:
eap 2011-01-25 14:46:58 +00:00
parent 063408f854
commit 98119844c8
2 changed files with 9 additions and 3 deletions

View File

@ -91,6 +91,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
{ {
int nbEdges = theEdges.size(); int nbEdges = theEdges.size();
myEdge.resize( nbEdges ); myEdge.resize( nbEdges );
myEdgeID.resize( nbEdges );
myC2d.resize( nbEdges ); myC2d.resize( nbEdges );
myC3dAdaptor.resize( nbEdges ); myC3dAdaptor.resize( nbEdges );
myFirst.resize( nbEdges ); myFirst.resize( nbEdges );
@ -118,6 +119,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
if ( myEdgeLength[i] < DBL_MIN ) nbDegen++; if ( myEdgeLength[i] < DBL_MIN ) nbDegen++;
myLength += myEdgeLength[i]; myLength += myEdgeLength[i];
myEdge[i] = *edge; myEdge[i] = *edge;
myEdgeID[i] = meshDS->ShapeToIndex( *edge );
if ( !theIsForward ) myEdge[i].Reverse(); if ( !theIsForward ) myEdge[i].Reverse();
if ( theFace.IsNull() ) if ( theFace.IsNull() )
@ -326,7 +328,11 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
uvPt.x = uvPt.y = uvPt.normParam = u_node->first; uvPt.x = uvPt.y = uvPt.normParam = u_node->first;
if ( isXConst ) uvPt.x = constValue; if ( isXConst ) uvPt.x = constValue;
else uvPt.y = 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 ]; prevNormPar = myNormPar[ EdgeIndex ];
++EdgeIndex; ++EdgeIndex;
#ifdef _DEBUG_ #ifdef _DEBUG_
@ -340,8 +346,6 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
#endif #endif
paramSize = myNormPar[ EdgeIndex ] - prevNormPar; paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
} }
const SMDS_EdgePosition* epos =
dynamic_cast<const SMDS_EdgePosition*>(uvPt.node->GetPosition());
if ( epos ) { if ( epos ) {
uvPt.param = epos->GetUParameter(); uvPt.param = epos->GetUParameter();
} }
@ -444,6 +448,7 @@ void StdMeshers_FaceSide::Reverse()
} }
if ( nbEdges > 1 ) { if ( nbEdges > 1 ) {
reverse( myEdge ); reverse( myEdge );
reverse( myEdgeID );
reverse( myC2d ); reverse( myC2d );
reverse( myC3dAdaptor ); reverse( myC3dAdaptor );
reverse( myFirst ); reverse( myFirst );

View File

@ -201,6 +201,7 @@ protected:
// DON't FORGET tO update Reverse() when adding one more vector! // DON't FORGET tO update Reverse() when adding one more vector!
std::vector<uvPtStruct> myPoints, myFalsePoints; std::vector<uvPtStruct> myPoints, myFalsePoints;
std::vector<TopoDS_Edge> myEdge; std::vector<TopoDS_Edge> myEdge;
std::vector<int> myEdgeID;
std::vector<Handle(Geom2d_Curve)> myC2d; std::vector<Handle(Geom2d_Curve)> myC2d;
std::vector<GeomAdaptor_Curve> myC3dAdaptor; std::vector<GeomAdaptor_Curve> myC3dAdaptor;
std::vector<double> myFirst, myLast; std::vector<double> myFirst, myLast;