X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=ecbfde44c51940908cf992415300bfbbc7aa2453;hp=5b5de318b6a1d46e29ff7f5990f9e62222989fef;hb=63d5619b14edc450a51d92f059879bee1c1fa12d;hpb=2f529dcd2629679dadcca3047583bfcf28ca7b1a diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 5b5de318b..ecbfde44c 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 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 @@ -365,7 +365,7 @@ int SMESH_subMesh::computeCost() const */ //============================================================================= -const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() +const std::map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() { if ( _dependenceAnalysed || !_father->HasShapeToMesh() ) return _mapDepend; @@ -1683,6 +1683,8 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event) else updateDependantsState( SUBMESH_COMPUTED ); } + // let algo clear its data gathered while algo->Compute() + algo->CheckHypothesis((*_father), _subShape, hyp_status); } break; case COMPUTE_CANCELED: // nothing to do @@ -2450,7 +2452,8 @@ void SMESH_subMesh::loadDependentMeshes() { list< OwnListenerData >::iterator d; for ( d = _ownListeners.begin(); d != _ownListeners.end(); ++d ) - if ( _father != d->mySubMesh->_father ) + if ( _father != d->mySubMesh->_father && + _father->FindMesh( d->myMeshID )) d->mySubMesh->_father->Load(); // map< EventListener*, EventListenerData* >::iterator l_d = _eventListeners.begin(); @@ -2592,10 +2595,12 @@ const std::vector< SMESH_subMesh * > & SMESH_subMesh::GetAncestors() const SMESH_subMesh* me = const_cast< SMESH_subMesh* >( this ); me->_ancestors.reserve( ancShapes.Extent() ); - TopTools_MapOfShape map; - // assure that all sub-meshes exist - _father->GetSubMesh( _father->GetShapeToMesh() )->DependsOn(); + TopoDS_Shape mainShape = _father->GetShapeToMesh(); + if ( !mainShape.IsNull() ) + _father->GetSubMesh( mainShape )->DependsOn(); + + TopTools_MapOfShape map; for ( TopTools_ListIteratorOfListOfShape it( ancShapes ); it.More(); it.Next() ) if ( SMESH_subMesh* sm = _father->GetSubMeshContaining( it.Value() ))