X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=4d92816fc560af3ed3ed77e3a0c3cc519fdb7163;hp=7a2c07db4ed0ff7aa102235e974014bffef95c9f;hb=6650dea1f85dd5c640829d6e0391d703a304a152;hpb=8726d7811f554b1e3f2b5dbf7e4b0db0c745fefa diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 7a2c07db4..4d92816fc 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2010 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 @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // SMESH SMESH : implementaion of SMESH idl descriptions // File : SMESH_subMesh.cxx // Author : Paul RASCLE, EDF @@ -39,6 +40,7 @@ #include "utilities.h" #include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include #include @@ -54,6 +56,8 @@ #include #include +#include + using namespace std; //============================================================================= @@ -1368,6 +1372,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) algo->InitComputeError(); MemoryReserve aMemoryReserve; SMDS_Mesh::CheckMemory(); + Kernel_Utils::Localizer loc; if ( !_father->HasShapeToMesh() ) // no shape { SMESH_MesherHelper helper( *_father ); @@ -1609,17 +1614,32 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) SMESH_Hypothesis::Hypothesis_Status hyp_status; algo = gen->GetAlgo((*_father), _subShape); - if(algo) { + if(algo && !aResMap.count(this) ) + { ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); if (!ret) return false; - if ( !aResMap.count(this) ) + if (_father->HasShapeToMesh() && algo->NeedDescretBoundary()) { - _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo); - ret = algo->Evaluate((*_father), _subShape, aResMap); - - aResMap.insert( make_pair( this,vector(0))); + // check submeshes needed + bool subMeshEvaluated = true; + int dimToCheck = SMESH_Gen::GetShapeDim( _subShape ) - 1; + SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,/*complexShapeFirst=*/true); + while ( smIt->more() && subMeshEvaluated ) + { + SMESH_subMesh* sm = smIt->next(); + int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() ); + if (dim < dimToCheck) break; // the rest subMeshes are all of less dimension + const vector & nbs = aResMap[ sm ]; + subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 ); + } + if ( !subMeshEvaluated ) + return false; } + _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo); + ret = algo->Evaluate((*_father), _subShape, aResMap); + + aResMap.insert( make_pair( this,vector(0))); } return ret;