]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021140: EDF 1759 SMESH: Netgen1D2D fails on subshape
authoreap <eap@opencascade.com>
Tue, 25 Jan 2011 14:46:58 +0000 (14:46 +0000)
committereap <eap@opencascade.com>
Tue, 25 Jan 2011 14:46:58 +0000 (14:46 +0000)
    Fix work on edges computed with the Composed Segment discretizer

src/StdMeshers/StdMeshers_FaceSide.cxx
src/StdMeshers/StdMeshers_FaceSide.hxx

index dc436d74fcc81b02102b408237ae31821982b506..39b8cdd7294e2c89ddf0d0b99f749c6ea4588310 100644 (file)
@@ -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<UVPtStruct>& 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<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_
@@ -340,8 +346,6 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
 #endif
         paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
       }
-      const SMDS_EdgePosition* epos =
-        dynamic_cast<const SMDS_EdgePosition*>(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 );
index d99e83bed0af6e0cbae889adaf01b82af734701a..738b74f5a4493a4901c9a07a957cf39fd0047a5a 100644 (file)
@@ -201,6 +201,7 @@ protected:
   // DON't FORGET tO update Reverse() when adding one more vector!
   std::vector<uvPtStruct>           myPoints, myFalsePoints;
   std::vector<TopoDS_Edge>          myEdge;
+  std::vector<int>                  myEdgeID;
   std::vector<Handle(Geom2d_Curve)> myC2d;
   std::vector<GeomAdaptor_Curve>    myC3dAdaptor;
   std::vector<double>               myFirst, myLast;