X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_ProjectionUtils.cxx;h=262c92507de9fe45e8bbda35bb757ed810f62d64;hb=e12cb3f8c3219fb5d53a7a23569011f1009ffd41;hp=3e9f5c46239fdb906be4b9f9540f0f43699fce2c;hpb=a541c7e70ec1a55557f54bceeae9bd4833628b71;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 3e9f5c462..262c92507 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -438,8 +438,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the TShapeShapeMap & theMap) { // Structure of this long function is following - // 1) Group->group projection: theShape1 is a group member, - // theShape2 is a group. We find a group theShape1 is in and recall self. + // 1) Group -> Group projection: theShape1 is a group member, + // theShape2 is another group. We find a group theShape1 is in and recall self. // 2) Accosiate same shapes with different location (partners). // 3) If vertex association is given, perform accosiation according to shape type: // switch ( ShapeType ) { @@ -622,7 +622,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the TopTools_ListIteratorOfListOfShape ancestIt1( edgeToFace1.FindFromKey( edge1 )); for ( ; F1.IsNull() && ancestIt1.More(); ancestIt1.Next() ) if ( ancestIt1.Value().ShapeType() == TopAbs_FACE ) - F1 = ancestIt1.Value().Oriented( TopAbs_FORWARD ); + F1 = ancestIt1.Value().Oriented //( TopAbs_FORWARD ); + ( SMESH_MesherHelper::GetSubShapeOri( theShape1, ancestIt1.Value() )); if ( F1.IsNull() ) RETURN_BAD_RESULT(" Face1 not found"); @@ -630,7 +631,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the TopTools_ListIteratorOfListOfShape ancestIt2( edgeToFace2.FindFromKey( edge2 )); for ( int i = 0; FF2[1].IsNull() && ancestIt2.More(); ancestIt2.Next() ) if ( ancestIt2.Value().ShapeType() == TopAbs_FACE ) - FF2[ i++ ] = ancestIt2.Value().Oriented( TopAbs_FORWARD ); + FF2[ i++ ] = ancestIt2.Value().Oriented // ( TopAbs_FORWARD ); + ( SMESH_MesherHelper::GetSubShapeOri( theShape2, ancestIt2.Value() )); // get oriented edge1 and edge2 from F1 and FF2[0] for ( exp.Init( F1, TopAbs_EDGE ); exp.More(); exp.Next() ) @@ -1330,9 +1332,15 @@ int StdMeshers_ProjectionUtils::FindFaceAssociation(const TopoDS_Face& face1, CONT_BAD_RESULT("GetOrderedEdges() failed"); } } - edgeIt = --edges2.end(); if ( !VV2[1].IsSame( TopExp::LastVertex( edges2.front(), true ))) { reverse = !reverse; + edgeIt = --edges2.end(); + // move a degenerated edge from back to front + // http://www.salome-platform.org/forum/forum_11/173031193 + if ( TopExp::FirstVertex( *edgeIt ).IsSame( TopExp::LastVertex( *edgeIt ))) { + edges2.splice( edges2.begin(), edges2, edgeIt ); + edgeIt = --edges2.end(); + } // check if the second vertex belongs to the first or last edge in the wire if ( !VV2[1].IsSame( TopExp::FirstVertex( *edgeIt, true ))) { bool KO = true; // belongs to none @@ -2100,7 +2108,7 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter string algoType = algo->GetName(); if ( algoType.substr(0, 11) != "Projection_") - return gen->Compute( *mesh, shape ); + return gen->Compute( *mesh, shape, /*shapeOnly=*/true ); // try to compute source mesh @@ -2132,7 +2140,7 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter } } if ( srcShape.IsNull() ) // no projection source defined - return gen->Compute( *mesh, shape ); + return gen->Compute( *mesh, shape, /*shapeOnly=*/true ); if ( srcShape.IsSame( shape )) RETURN_BAD_RESULT("Projection from self"); @@ -2141,7 +2149,7 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter srcMesh = mesh; if ( MakeComputed( srcMesh->GetSubMesh( srcShape ), iterationNb + 1 ) && - gen->Compute( *mesh, shape )) + gen->Compute( *mesh, shape, /*shapeOnly=*/true )) return sm->IsMeshComputed(); return false;