-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
TAssocTool::TNodeNodeMap& src2tgtNodes,
bool& is1DComputed)
{
- SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS();
- SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS();
-
src2tgtNodes.clear();
// get ordered src EDGEs
TError err;
srcWires = StdMeshers_FaceSide::GetFaceWires( srcFace, *srcMesh,/*skipMediumNodes=*/0, err);
- if ( err && !err->IsOK() || srcWires.empty() )
+ if (( err && !err->IsOK() ) ||
+ ( srcWires.empty() ))
return err;
SMESH_MesherHelper srcHelper( *srcMesh );
const double minSegLen = srcWires[iW]->Length() / totNbSeg;
for ( int iE = 0; iE < srcWires[iW]->NbEdges(); ++iE )
{
- int nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
+ size_t nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
double srcU = srcWires[iW]->FirstParameter( iE );
double tgtU = tgtWires[iW]->FirstParameter( iE );
double srcDu = ( srcWires[iW]->LastParameter( iE )- srcU ) / nbSeg;
// find trsf
const int totNbSeg = 50;
vector< gp_XY > srcPnts, tgtPnts;
- srcPnts.resize( totNbSeg );
- tgtPnts.resize( totNbSeg );
+ srcPnts.reserve( totNbSeg );
+ tgtPnts.reserve( totNbSeg );
for ( size_t iW = 0; iW < srcWires.size(); ++iW )
{
const double minSegLen = srcWires[iW]->Length() / totNbSeg;
for ( int iE = 0; iE < srcWires[iW]->NbEdges(); ++iE )
{
- int nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
+ size_t nbSeg = Max( 1, int( srcWires[iW]->EdgeLength( iE ) / minSegLen ));
double srcU = srcWires[iW]->FirstParameter( iE );
double tgtU = tgtWires[iW]->FirstParameter( iE );
double srcDu = ( srcWires[iW]->LastParameter( iE )- srcU ) / nbSeg;
tgtMeshDS->SetNodeOnVertex( n, TopoDS::Vertex( tgtV ));
break;
}
+ default:;
}
srcN_tgtN->second = n;
}
{
SMESH_Mesh * tgtMesh = tgtWires[0]->GetMesh();
SMESH_Mesh * srcMesh = srcWires[0]->GetMesh();
- SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS();
+ //SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS();
SMESHDS_Mesh * srcMeshDS = srcMesh->GetMeshDS();
if ( srcWires[0]->NbEdges() != 4 )
}
}
}
- else if ( nbEdgesInWires.front() == 1 )
+ else if ( nbEdgesInWires.front() == 1 ) // a sole edge in a wire
{
- // TODO::Compare orientation of curves in a sole edge
- //RETURN_BAD_RESULT("Not implemented case");
+ TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front();
+ for ( size_t iW = 0; iW < srcWires.size(); ++iW )
+ {
+ StdMeshers_FaceSidePtr srcWire = srcWires[iW];
+ for ( int iE = 0; iE < srcWire->NbEdges(); ++iE )
+ if ( srcE1.IsSame( srcWire->Edge( iE )))
+ {
+ reverse = ( tgtE1.Orientation() != tgtWires[iW]->Edge( iE ).Orientation() );
+ break;
+ }
+ }
}
else
{
if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK )
return error("Can't make mesh by source mesh pattern");
+ } // end of projection using Pattern mapping
+
+ {
// -------------------------------------------------------------------------
// mapper doesn't take care of nodes already existing on edges and vertices,
// so we must merge nodes created by it with existing ones
continue; // do not treat sm of degen VERTEX
}
- // Sort new and old nodes of a submesh separately
+ // Sort new and old nodes of a sub-mesh separately
bool isSeam = helper.IsRealSeam( sm->GetId() );
// The mapper can't create quadratic elements, so convert if needed
// ----------------------------------------------------------------
+ SMDS_ElemIteratorPtr faceIt;
faceIt = srcSubMesh->GetSubMeshDS()->GetElements();
bool srcIsQuad = faceIt->next()->IsQuadratic();
faceIt = tgtSubMesh->GetSubMeshDS()->GetElements();
editor.ConvertToQuadratic(/*theForce3d=*/false, tgtFaces, false);
}
-
- } // end of projection using Pattern mapping
+ } // end of coincident nodes and quadratic elements treatment
if ( !projDone || is1DComputed )