X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=9c30aa8119de8395c99c05c74d484ab061f3205d;hb=b58c9632e3158d6cdbf2374324f84c3b959544e8;hp=751cf8b791104e823d29969e7c0e2424d579bc7c;hpb=5d3c1425f83862a5a3616e3128f70341637216ba;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 751cf8b79..9c30aa811 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -65,7 +65,7 @@ using namespace std; //#define PRINT_WHO_COMPUTE_WHAT #endif -#define PRINT_WHO_COMPUTE_WHAT +//#define PRINT_WHO_COMPUTE_WHAT //============================================================================= /*! * \brief Allocate some memory at construction and release it at destruction. @@ -207,20 +207,6 @@ SMESH_Algo* SMESH_subMesh::GetAlgo() const return _algo; } -//================================================================================ -/*! - * \brief Returns a current algorithm - */ -//================================================================================ - -SMESH_Algo* SMESH_subMesh::CopyAlgo() const -{ - //SMESH_Algo* algo = (SMESH_Algo*) new StdMeshers_Regular_1D(666, _father->GetGent()); - SMESH_Algo* algo; - - return algo; -} - //================================================================================ /*! * \brief Allow algo->Compute() if a sub-shape of lower dim is meshed but @@ -1520,12 +1506,11 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) case COMPUTE_SUBMESH: { algo = GetAlgo(); - SMESH_Algo* algo2 = CopyAlgo(); - cout << "Algo2" << algo2; ASSERT(algo); - //_father->Lock(); - //ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); - //_father->Unlock(); + if(!_father->IsParallel()) + ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); + else + ret = true; if (!ret) { MESSAGE("***** verify compute state *****"); @@ -1534,11 +1519,11 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) break; } TopoDS_Shape shape = _subShape; - algo->SubMeshesToCompute().assign( 1, this ); + if(!_father->IsParallel()) + algo->SubMeshesToCompute().assign( 1, this ); // check submeshes needed - // Forcing to false for parallel run - // TODO: Remove forced false - if (_father->HasShapeToMesh() && false) { + // In parallel there would be no submesh to check + if (_father->HasShapeToMesh() && !_father->IsParallel()) { bool subComputed = false, subFailed = false; if (!algo->OnlyUnaryInput()) { // --- commented for bos#22320 to compute all sub-shapes at once if possible; @@ -1756,9 +1741,8 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) updateDependantsState( SUBMESH_COMPUTED ); } // let algo clear its data gathered while algo->Compute() - //_father->Lock(); - //algo->CheckHypothesis((*_father), _subShape, hyp_status); - //_father->Unlock(); + if(!_father->IsParallel()) + algo->CheckHypothesis((*_father), _subShape, hyp_status); } break; case COMPUTE_CANCELED: // nothing to do @@ -2194,10 +2178,8 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * /*theGen*/, return _subShape; const bool skipAuxHyps = false; - _father->Lock(); list usedHyps = theAlgo->GetUsedHypothesis( *_father, _subShape, skipAuxHyps ); // copy - _father->Lock(); std::list < TopoDS_Shape > assiShapes = theAlgo->GetAssignedShapes(); // put in a compound all shapes with the same hypothesis assigned @@ -2225,7 +2207,6 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * /*theGen*/, } else if ( subMesh->GetComputeState() == READY_TO_COMPUTE ) { - _father->Lock(); SMESH_Algo* anAlgo = subMesh->GetAlgo(); if (( anAlgo->IsSameName( *theAlgo )) && // same algo ( anAlgo->GetUsedHypothesis( *_father, S, skipAuxHyps ) == usedHyps ) && // same hyps @@ -2237,7 +2218,6 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * /*theGen*/, theSubComputed = false; theSubs.push_back( subMesh ); } - _father->Unlock(); } }