X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Gen.cxx;h=a9ef17d1eb215f0aa5ebb2679111f65eef81a9bb;hp=99a84ef7b56e444f3c83719c916911f81150f9b2;hb=20c126bc220757c06b5576f71ed6f34ae85e3e40;hpb=c60dfba99e8c75a65482bb67ac2fab9ef53e91c2 diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 99a84ef7b..a9ef17d1e 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -53,6 +53,9 @@ using namespace std; +//#include + + //============================================================================= /*! * Constructor @@ -67,11 +70,12 @@ SMESH_Gen::SMESH_Gen() _segmentation = _nbSegments = 10; SMDS_Mesh::_meshList.clear(); MESSAGE(SMDS_Mesh::_meshList.size()); - _counters = new counters(100); + //_counters = new counters(100); #ifdef WITH_SMESH_CANCEL_COMPUTE _compute_canceled = false; _sm_current = NULL; #endif + //vtkDebugLeaks::SetExitError(0); } //============================================================================= @@ -83,6 +87,12 @@ SMESH_Gen::SMESH_Gen() SMESH_Gen::~SMESH_Gen() { MESSAGE("SMESH_Gen::~SMESH_Gen"); + std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin(); + for ( ; i_sc != _mapStudyContext.end(); ++i_sc ) + { + delete i_sc->second->myDocument; + delete i_sc->second; + } } //============================================================================= @@ -155,7 +165,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, // check for preview dimension limitations if ( aShapesId && GetShapeDim( aShType ) > (int)aDim ) { - // clear compute state to not show previous compute errors + // clear compute state not to show previous compute errors // if preview invoked less dimension less than previous smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); continue; @@ -312,6 +322,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, .And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh )); if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( aSubShape, filter, true )) { + if ( ! subAlgo->NeedDiscreteBoundary() ) continue; SMESH_Hypothesis::Hypothesis_Status status; if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status )) // mesh a lower smToCompute starting from vertices @@ -360,7 +371,8 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, // fix quadratic mesh by bending iternal links near concave boundary if ( aShape.IsSame( aMesh.GetShapeToMesh() ) && - !aShapesId ) // not preview + !aShapesId && // not preview + ret ) // everything is OK { SMESH_MesherHelper aHelper( aMesh ); if ( aHelper.IsQuadraticMesh() != SMESH_MesherHelper::LINEAR ) @@ -581,12 +593,13 @@ static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh, } else { - bool isGlobal = (aMesh.IsMainShape( aSubMesh->GetSubShape() )); - int dim = algo->GetDim(); + bool isGlobal = (aMesh.IsMainShape( aSubMesh->GetSubShape() )); + int dim = algo->GetDim(); int aMaxGlobIgnoDim = ( aGlobIgnoAlgo ? aGlobIgnoAlgo->GetDim() : -1 ); + bool isNeededDim = ( aGlobIgnoAlgo ? aGlobIgnoAlgo->NeedLowerHyps( dim ) : false ); - if ( dim < aMaxGlobIgnoDim && - ( isGlobal || !aGlobIgnoAlgo->SupportSubmeshes() )) + if (( dim < aMaxGlobIgnoDim && !isNeededDim ) && + ( isGlobal || !aGlobIgnoAlgo->SupportSubmeshes() )) { // algo is hidden by a global algo theErrors.push_back( SMESH_Gen::TAlgoStateError() ); @@ -642,8 +655,15 @@ static bool checkMissing(SMESH_Gen* aGen, set& aCheckedMap, list< SMESH_Gen::TAlgoStateError > & theErrors) { - if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX || - aCheckedMap.count( aSubMesh )) + switch ( aSubMesh->GetSubShape().ShapeType() ) + { + case TopAbs_EDGE: + case TopAbs_FACE: + case TopAbs_SOLID: break; // check this submesh, it can be meshed + default: + return true; // not meshable submesh + } + if ( aCheckedMap.count( aSubMesh )) return true; //MESSAGE("=====checkMissing"); @@ -670,7 +690,7 @@ static bool checkMissing(SMESH_Gen* aGen, } case SMESH_subMesh::MISSING_HYP: { // notify if an algo missing hyp is attached to aSubMesh - algo = aGen->GetAlgo( aMesh, aSubMesh->GetSubShape() ); + algo = aSubMesh->GetAlgo(); ASSERT( algo ); bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh ); if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ]) @@ -721,7 +741,7 @@ static bool checkMissing(SMESH_Gen* aGen, { bool checkNoAlgo2 = ( algo->NeedDiscreteBoundary() ); SMESH_subMeshIteratorPtr itsub = aSubMesh->getDependsOnIterator( /*includeSelf=*/false, - /*complexShapeFirst=*/false); + /*complexShapeFirst=*/true); while ( itsub->more() ) { // sub-meshes should not be checked further more