From 98119844c8755c5d2f89331db4c5e63a96b00c5e Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 25 Jan 2011 14:46:58 +0000 Subject: [PATCH] 0021140: EDF 1759 SMESH: Netgen1D2D fails on subshape Fix work on edges computed with the Composed Segment discretizer --- src/StdMeshers/StdMeshers_FaceSide.cxx | 11 ++++++++--- src/StdMeshers/StdMeshers_FaceSide.hxx | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index dc436d74f..39b8cdd72 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -91,6 +91,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, { int nbEdges = theEdges.size(); myEdge.resize( nbEdges ); + myEdgeID.resize( nbEdges ); myC2d.resize( nbEdges ); myC3dAdaptor.resize( nbEdges ); myFirst.resize( nbEdges ); @@ -118,6 +119,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, 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() ) @@ -326,7 +328,11 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, 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(uvPt.node->GetPosition()); + if (( myNormPar[ EdgeIndex ] < uvPt.normParam ) || + ( epos && uvPt.node->getshapeId() != myEdgeID[ EdgeIndex ])) // for myMissingVertexNodes + { prevNormPar = myNormPar[ EdgeIndex ]; ++EdgeIndex; #ifdef _DEBUG_ @@ -340,8 +346,6 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, #endif paramSize = myNormPar[ EdgeIndex ] - prevNormPar; } - const SMDS_EdgePosition* epos = - dynamic_cast(uvPt.node->GetPosition()); if ( epos ) { uvPt.param = epos->GetUParameter(); } @@ -444,6 +448,7 @@ void StdMeshers_FaceSide::Reverse() } if ( nbEdges > 1 ) { reverse( myEdge ); + reverse( myEdgeID ); reverse( myC2d ); reverse( myC3dAdaptor ); reverse( myFirst ); diff --git a/src/StdMeshers/StdMeshers_FaceSide.hxx b/src/StdMeshers/StdMeshers_FaceSide.hxx index d99e83bed..738b74f5a 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.hxx +++ b/src/StdMeshers/StdMeshers_FaceSide.hxx @@ -201,6 +201,7 @@ protected: // DON't FORGET tO update Reverse() when adding one more vector! std::vector myPoints, myFalsePoints; std::vector myEdge; + std::vector myEdgeID; std::vector myC2d; std::vector myC3dAdaptor; std::vector myFirst, myLast; -- 2.39.2