X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=7b6b7dac3545496e5d0c16e79d9f2bc52de4fb55;hb=a08c213e66fe27f9073b915e1c549664fd5f47e8;hp=cf05b50bc4defa46c123074ca2ac5310520ad652;hpb=5f791c80a493e81f417d6716dedbe0091624846f;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index cf05b50bc..7b6b7dac3 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -385,9 +385,9 @@ int SMESH_subMesh::computeCost() const int computeCost; switch ( _subShape.ShapeType() ) { case TopAbs_SOLID: - case TopAbs_SHELL: computeCost = 1000; break; - case TopAbs_FACE: computeCost = 100; break; - case TopAbs_EDGE: computeCost = 10; break; + case TopAbs_SHELL: computeCost = 5000; break; + case TopAbs_FACE: computeCost = 500; break; + case TopAbs_EDGE: computeCost = 2; break; default: computeCost = 1; } SMESH_subMeshIteratorPtr childIt = getDependsOnIterator(/*includeSelf=*/false); @@ -1561,6 +1561,9 @@ bool SMESH_subMesh::ComputeStateEngine(int event) } // Compute + // to restore cout that may be redirected by algo + std::streambuf* coutBuffer = std::cout.rdbuf(); + //cleanDependants(); for "UseExisting_*D" algos //removeSubMeshElementsAndNodes(); loadDependentMeshes(); @@ -1568,9 +1571,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event) _computeState = FAILED_TO_COMPUTE; _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo); try { -#if OCC_VERSION_LARGE > 0x06010000 OCC_CATCH_SIGNALS; -#endif + algo->InitComputeError(); MemoryReserve aMemoryReserve; @@ -1641,6 +1643,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event) else ret = false; } + std::cout.rdbuf( coutBuffer ); // restore cout that could be redirected by algo + // check if an error reported on any sub-shape bool isComputeErrorSet = !checkComputeError( algo, ret, shape ); if ( isComputeErrorSet ) @@ -1650,7 +1654,10 @@ bool SMESH_subMesh::ComputeStateEngine(int event) if (ret) { for (; ret && subS.More(); subS.Next()) - ret = _father->GetSubMesh( subS.Current() )->IsMeshComputed(); + if ( !_father->GetSubMesh( subS.Current() )->IsMeshComputed() && + ( _subShape.ShapeType() != TopAbs_EDGE || + !algo->isDegenerated( TopoDS::Edge( subS.Current() )))) + ret = false; } // Set _computeError if (!ret && !isComputeErrorSet) @@ -1965,7 +1972,7 @@ bool SMESH_subMesh::checkComputeError(SMESH_Algo* theAlgo, if ( _computeState != COMPUTE_OK ) { if ( _subShape.ShapeType() == TopAbs_EDGE && - BRep_Tool::Degenerated( TopoDS::Edge( _subShape )) ) + SMESH_Algo::isDegenerated( TopoDS::Edge( _subShape )) ) _computeState = COMPUTE_OK; else if ( theComputeOK ) _computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);