X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Algo.cxx;h=12371ea6488133d8b66f26169916684ad54a74c4;hb=a87bde2a084268d40af501d4b8b5c9e8d48c8323;hp=8b2d1c5d2ab0baec4d5a4dab468802f40e656ab7;hpb=560f8b2d0c2a7fdb4047f981cfac56ed3629bc1a;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 8b2d1c5d2..12371ea64 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.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 @@ -263,6 +263,10 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, const bool ignoreAuxiliary) const { SMESH_Algo* me = const_cast< SMESH_Algo* >( this ); + + std::list savedHyps; // don't delete the list if + savedHyps.swap( me->_usedHypList ); // it does not change (#16578) + me->_usedHypList.clear(); if ( const SMESH_HypoFilter* filter = GetCompatibleHypoFilter( ignoreAuxiliary )) { @@ -270,6 +274,9 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, if ( ignoreAuxiliary && _usedHypList.size() > 1 ) me->_usedHypList.clear(); //only one compatible hypothesis allowed } + if ( _usedHypList == savedHyps ) + savedHyps.swap( me->_usedHypList ); + return _usedHypList; } @@ -287,10 +294,17 @@ SMESH_Algo::GetAppliedHypothesis(SMESH_Mesh & aMesh, const bool ignoreAuxiliary) const { SMESH_Algo* me = const_cast< SMESH_Algo* >( this ); + + std::list savedHyps; // don't delete the list if + savedHyps.swap( me->_appliedHypList ); // it does not change (#16578) + me->_appliedHypList.clear(); if ( const SMESH_HypoFilter* filter = GetCompatibleHypoFilter( ignoreAuxiliary )) aMesh.GetHypotheses( aShape, *filter, me->_appliedHypList, false ); + if ( _appliedHypList == savedHyps ) + savedHyps.swap( me->_appliedHypList ); + return _appliedHypList; } @@ -1254,3 +1268,33 @@ bool SMESH_2D_Algo::FixInternalNodes(const SMESH_ProxyMesh& mesh, } return true; } + +//======================================================================= +//function : IsApplicableToShape +//purpose : Return true if the algorithm can mesh a given shape +//======================================================================= + +bool SMESH_1D_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const +{ + return ( !shape.IsNull() && TopExp_Explorer( shape, TopAbs_EDGE ).More() ); +} + +//======================================================================= +//function : IsApplicableToShape +//purpose : Return true if the algorithm can mesh a given shape +//======================================================================= + +bool SMESH_2D_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const +{ + return ( !shape.IsNull() && TopExp_Explorer( shape, TopAbs_FACE ).More() ); +} + +//======================================================================= +//function : IsApplicableToShape +//purpose : Return true if the algorithm can mesh a given shape +//======================================================================= + +bool SMESH_3D_Algo::IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const +{ + return ( !shape.IsNull() && TopExp_Explorer( shape, TopAbs_SOLID ).More() ); +}