From: eap Date: Mon, 27 May 2013 13:56:30 +0000 (+0000) Subject: Make const GetAppliedHypothesis() and GetUsedHypothesis() X-Git-Tag: V7_3_0a1~405 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4443257370246592db3996a2fbdd92e85c26da6f;p=modules%2Fsmesh.git Make const GetAppliedHypothesis() and GetUsedHypothesis() --- diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 38e00d29f..63d232027 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -262,15 +262,16 @@ const vector < string > &SMESH_Algo::GetCompatibleHypothesis() const list & SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - const bool ignoreAuxiliary) + const bool ignoreAuxiliary) const { - _usedHypList.clear(); + SMESH_Algo* me = const_cast< SMESH_Algo* >( this ); + me->_usedHypList.clear(); SMESH_HypoFilter filter; if ( InitCompatibleHypoFilter( filter, ignoreAuxiliary )) { - aMesh.GetHypotheses( aShape, filter, _usedHypList, true ); + aMesh.GetHypotheses( aShape, filter, me->_usedHypList, true ); if ( ignoreAuxiliary && _usedHypList.size() > 1 ) - _usedHypList.clear(); //only one compatible hypothesis allowed + me->_usedHypList.clear(); //only one compatible hypothesis allowed } return _usedHypList; } @@ -286,12 +287,13 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, const list & SMESH_Algo::GetAppliedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - const bool ignoreAuxiliary) + const bool ignoreAuxiliary) const { - _appliedHypList.clear(); + SMESH_Algo* me = const_cast< SMESH_Algo* >( this ); + me->_appliedHypList.clear(); SMESH_HypoFilter filter; if ( InitCompatibleHypoFilter( filter, ignoreAuxiliary )) - aMesh.GetHypotheses( aShape, filter, _appliedHypList, false ); + aMesh.GetHypotheses( aShape, filter, me->_appliedHypList, false ); return _appliedHypList; } diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index a9872d812..25224689a 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -195,7 +195,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis virtual const std::list & GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - const bool ignoreAuxiliary=true); + const bool ignoreAuxiliary=true) const; /*! * \brief Returns a list of compatible hypotheses assigned to a shape in a mesh * \param aMesh - the mesh @@ -210,7 +210,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis const list & GetAppliedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - const bool ignoreAuxiliary=true); + const bool ignoreAuxiliary=true) const; /*! * \brief Make the filter recognize only compatible hypotheses * \param theFilter - the filter to initialize