X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Pattern.cxx;h=6f3c1b076931849b022eae8659e1d50de145c3a4;hb=c7d720eb8a7192a3316c968df9451e3a6d0f3f8d;hp=c317869bc546c079aec808ccd951790a3d054784;hpb=373690534aa482a4daea68f2a5a14fa9de8a9a1b;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index c317869bc..6f3c1b076 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -256,7 +256,7 @@ int loadVE( const list< TopoDS_Edge > & eList, //purpose : //======================================================================= -SMESH_Pattern::SMESH_Pattern () +SMESH_Pattern::SMESH_Pattern (): myToKeepNodes(false) { } @@ -565,11 +565,13 @@ static bool isMeshBoundToShape(SMESHDS_Mesh * aMeshDS, bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, const TopoDS_Face& theFace, bool theProject, - TopoDS_Vertex the1stVertex) + TopoDS_Vertex the1stVertex, + bool theKeepNodes) { MESSAGE(" ::Load(face) " ); Clear(); myIs2D = true; + myToKeepNodes = theKeepNodes; SMESHDS_Mesh * aMeshDS = theMesh->GetMeshDS(); SMESHDS_SubMesh * fSubMesh = aMeshDS->MeshElements( theFace ); @@ -792,7 +794,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, double u = epos->GetUParameter(); paramNodeMap.insert( make_pair( u, node )); } - if ((int) paramNodeMap.size() != eSubMesh->NbNodes() ) { + if ((int) paramNodeMap.size() != eSubMesh->NbNodes() - nbMeduimNodes ) { // wrong U on edge, project Extrema_ExtPC proj; BRepAdaptor_Curve aCurve( edge ); @@ -966,6 +968,19 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, myIsBoundaryPointsFound = true; } + if ( myToKeepNodes ) + { + myInNodes.resize( nodePointIDMap.size() + closeNodePointIDMap.size() ); + + TNodePointIDMap::iterator nIdIt = nodePointIDMap.begin(); + for ( ; nIdIt != nodePointIDMap.end(); nIdIt++ ) + myInNodes[ nIdIt->second ] = smdsNode( nIdIt->first ); + + nIdIt = closeNodePointIDMap.begin(); + for ( ; nIdIt != closeNodePointIDMap.end(); nIdIt++ ) + myInNodes[ nIdIt->second ] = smdsNode( nIdIt->first ); + } + // Assure that U range is proportional to V range Bnd_Box2d bndBox; @@ -3181,11 +3196,13 @@ bool SMESH_Pattern::Apply (std::set & theVolumes, //======================================================================= bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, - const TopoDS_Shell& theBlock) + const TopoDS_Shell& theBlock, + bool theKeepNodes) { MESSAGE(" ::Load(volume) " ); Clear(); myIs2D = false; + myToKeepNodes = theKeepNodes; SMESHDS_SubMesh * aSubMesh; const bool isQuadMesh = theMesh->NbVolumes( ORDER_QUADRATIC ); @@ -3219,7 +3236,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, SMDS_NodeIteratorPtr nIt = aSubMesh->GetNodes(); if ( !nIt->more() ) continue; - // store a node and a point + // store a node and a point while ( nIt->more() ) { const SMDS_MeshNode* node = smdsNode( nIt->next() ); if ( isQuadMesh && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Volume )) @@ -3297,6 +3314,14 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, myIsBoundaryPointsFound = true; + if ( myToKeepNodes ) + { + myInNodes.resize( nodePointIDMap.size() ); + TNodePointIDMap::iterator nIdIt = nodePointIDMap.begin(); + for ( ; nIdIt != nodePointIDMap.end(); nIdIt++ ) + myInNodes[ nIdIt->second ] = smdsNode( nIdIt->first ); + } + return setErrorCode( ERR_OK ); } @@ -4144,6 +4169,9 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh, aMeshDS->compactMesh(); + if ( myToKeepNodes ) + myOutNodes.swap( nodesVector ); + // const map& sm = aMeshDS->SubMeshes(); // map::const_iterator i_sm = sm.begin(); // for ( ; i_sm != sm.end(); i_sm++ )