// make any local coord systems of src and tgt faces
vector<gp_Pnt> srcPP, tgtPP; // 3 points on face boundaries to make axes of CS
- bool sameNbVert = ( TAssocTool::Count( tgtFace, TopAbs_VERTEX, /*ignoreSame=*/true ) ==
- TAssocTool::Count( srcFace, TopAbs_VERTEX, /*ignoreSame=*/true ));
+ int tgtNbVert = SMESH_MesherHelper::Count( tgtFace, TopAbs_VERTEX, /*ignoreSame=*/true );
+ int srcNbVert = SMESH_MesherHelper::Count( srcFace, TopAbs_VERTEX, /*ignoreSame=*/true );
SMESH_subMesh * srcSM = srcMesh->GetSubMesh( srcFace );
SMESH_subMeshIteratorPtr smIt = srcSM->getDependsOnIterator(/*includeSelf=*/false,false);
srcSM = smIt->next(); // sm of a vertex
if ( tgtShape.ShapeType() == TopAbs_VERTEX )
{
tgtP = BRep_Tool::Pnt( TopoDS::Vertex( tgtShape ));
- if ( sameNbVert || tgtPP.empty() )
+ if ( srcNbVert == tgtNbVert || tgtPP.empty() )
pOK = true;
else
pOK = (( tgtP.Distance( tgtPP[0] ) > tol*tol ) &&
{
if ( srcShape.ShapeType() == TopAbs_FACE )
{
- int nbE1 = TAssocTool::Count( tgtFace, TopAbs_EDGE, /*ignoreSame=*/true );
- int nbE2 = TAssocTool::Count( srcShape, TopAbs_EDGE, /*ignoreSame=*/true );
+ int nbE1 = SMESH_MesherHelper::Count( tgtFace, TopAbs_EDGE, /*ignoreSame=*/true );
+ int nbE2 = SMESH_MesherHelper::Count( srcShape, TopAbs_EDGE, /*ignoreSame=*/true );
if ( nbE1 != nbE2 )
return error(COMPERR_BAD_SHAPE,
SMESH_Comment("Different number of edges in source and target faces: ")
done = projectBy2DSimilarity( tgtFace, srcFace, tgtMesh, srcMesh, shape2ShapeMap, is1DComputed);
}
+ SMESH_MesherHelper helper( theMesh );
+ helper.SetSubShape( tgtFace );
+
if ( !done )
{
// --------------------
// Prepare to mapping
// --------------------
- SMESH_MesherHelper helper( theMesh );
- helper.SetSubShape( tgtFace );
-
// Check if node projection to a face is needed
Bnd_B2d uvBox;
SMDS_ElemIteratorPtr faceIt = srcSubMesh->GetSubMeshDS()->GetElements();
}
list< TopoDS_Edge > tgtEdges, srcEdges;
list< int > nbEdgesInWires;
- SMESH_Block::GetOrderedEdges( tgtFace, tgtV1, tgtEdges, nbEdgesInWires );
- SMESH_Block::GetOrderedEdges( srcFace, srcV1, srcEdges, nbEdgesInWires );
+ SMESH_Block::GetOrderedEdges( tgtFace, tgtEdges, nbEdgesInWires, tgtV1 );
+ SMESH_Block::GetOrderedEdges( srcFace, srcEdges, nbEdgesInWires, srcV1 );
if ( nbEdgesInWires.front() > 1 ) // possible to find out orientation
{
// Make groups of nodes to merge
- // loop on edge and vertex submeshes of a target face
+ // loop on EDGE and VERTEX sub-meshes of a target FACE
smIt = tgtSubMesh->getDependsOnIterator(/*includeSelf=*/false,/*complexShapeFirst=*/false);
while ( smIt->more() )
{
groupsOfNodes.back().push_back( nIt->next() );
}
}
- continue; // do not treate sm of degen VERTEX
+ continue; // do not treat sm of degen VERTEX
}
// Sort new and old nodes of a submesh separately
u2nodesOnSeam.size() > 0 &&
seam.ShapeType() == TopAbs_EDGE )
{
- int nbE1 = TAssocTool::Count( tgtFace, TopAbs_EDGE, /*ignoreSame=*/true );
- int nbE2 = TAssocTool::Count( srcFace, TopAbs_EDGE, /*ignoreSame=*/true );
+ int nbE1 = SMESH_MesherHelper::Count( tgtFace, TopAbs_EDGE, /*ignoreSame=*/true );
+ int nbE2 = SMESH_MesherHelper::Count( srcFace, TopAbs_EDGE, /*ignoreSame=*/true );
if ( nbE1 != nbE2 ) // 2 EDGEs are mapped to a seam EDGE
{
// find the 2 EDGEs of srcFace
TopTools_DataMapIteratorOfDataMapOfShapeShape src2tgtIt( shape2ShapeMap._map2to1 );
for ( ; src2tgtIt.More(); src2tgtIt.Next() )
if ( seam.IsSame( src2tgtIt.Value() ))
- {
- const TopoDS_Shape& tgtEdge = src2tgtIt.Key();
- if ( SMESHDS_SubMesh* tgtSM = srcMesh->GetMeshDS()->MeshElements( tgtEdge ))
- {
- SMDS_NodeIteratorPtr nIt = tgtSM->GetNodes();
- while ( nIt->more() )
- SMESH_Algo::addBadInputElement( nIt->next() );
- }
- }
+ SMESH_Algo::addBadInputElements
+ ( srcMesh->GetMeshDS()->MeshElements( src2tgtIt.Key() ));
return error( COMPERR_BAD_INPUT_MESH,
"Different number of nodes on two edges projected to a seam edge" );
}
groupsOfNodes.back().push_back( u_newNode->second );
groupsOfNodes.back().push_back( u_newOnSeam->second );
}
- }
+
+ } // loop on EDGE and VERTEX submeshes of a target FACE
// Merge
}
}
// Fix orientation
- if ( SMESH_Algo::IsReversedSubMesh( face, meshDS ))
+ if ( helper.IsReversedSubMesh( face ))
{
SMESH_MeshEditor editor( tgtMesh );
SMDS_ElemIteratorPtr eIt = meshDS->MeshElements( face )->GetElements();