X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;fp=src%2FSMESH%2FSMESH_subMesh.cxx;h=56c704ff6449f7a5f2f879c0f974b7cdf9e1050a;hb=e36717feb00b623f5bc7ffbbc47d28ea0b95f842;hp=093d3c1cae1bb99bbec207cfebdcd1fc8d61cd6c;hpb=961309c8a41786c455e6415ce543ca692f2016c8;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 093d3c1ca..56c704ff6 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -467,7 +467,7 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons //======================================================================= //function : IsApplicableHypotesis -//purpose : +//purpose : //======================================================================= bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, @@ -479,11 +479,20 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, // hypothesis switch ( theShapeType ) { - case TopAbs_EDGE: - case TopAbs_FACE: - case TopAbs_SHELL: + case TopAbs_EDGE: + case TopAbs_FACE: case TopAbs_SOLID: return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim(); + + case TopAbs_SHELL: + // Special case for algorithms, building 2D mesh on a whole shell. + // Before this fix there was a problem after restoring from study, + // because in that case algorithm is assigned before hypothesis + // (on shell in problem case) and hypothesis is checked on faces + // (because it is 2D), where we have NO_ALGO state. + // Now 2D hypothesis is also applicable to shells. + return (theHypothesis->GetDim() == 2 || theHypothesis->GetDim() == 3); + // case TopAbs_WIRE: // case TopAbs_COMPSOLID: // case TopAbs_COMPOUND: @@ -841,7 +850,7 @@ SMESH_Hypothesis::Hypothesis_Status f.And( SMESH_HypoFilter::IsApplicableTo( _subShape )); f.AndNot( SMESH_HypoFilter::Is( algo )); const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( _subShape, f, true ); - if (prevAlgo && + if (prevAlgo && string(algo->GetName()) != string(prevAlgo->GetName()) ) modifiedHyp = true; } @@ -899,7 +908,7 @@ SMESH_Hypothesis::Hypothesis_Status f.And( SMESH_HypoFilter::IsApplicableTo( _subShape )); f.AndNot( SMESH_HypoFilter::Is( algo )); const SMESH_Hypothesis* prevAlgo = _father->GetHypothesis( _subShape, f, true ); - if (prevAlgo && + if (prevAlgo && string(algo->GetName()) != string(prevAlgo->GetName()) ) modifiedHyp = true; } @@ -1264,6 +1273,9 @@ bool SMESH_subMesh::ComputeStateEngine(int event) RemoveSubMeshElementsAndNodes(); { try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput()) ret = ApplyToCollection( algo, GetCollection( gen, algo ) ); else