From: eap Date: Wed, 14 Jan 2009 13:06:10 +0000 (+0000) Subject: 0019923: EDF 765 SMESH : default values of hypothesis X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a1538968e6c8444b646aa64bac96bed9a30a983;p=plugins%2Fnetgenplugin.git 0019923: EDF 765 SMESH : default values of hypothesis + * \brief Initialize my parameter values by linear size of mesh element. + * \retval bool - true if parameter values have been successfully defined + */ + virtual bool SetParametersByElementSize(double elemLenght, const SMESH_Mesh* theMesh=0)=0; --- diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx index bda2508..14c23bd 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx @@ -289,11 +289,24 @@ istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp) */ //================================================================================ bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, - const TopoDS_Shape& theShape) + const TopoDS_Shape& theShape) { return false; } +//================================================================================ +/*! + * \brief Initialize my parameter values by linear size of mesh element. + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool NETGENPlugin_Hypothesis::SetParametersByElementSize(double elemLenght, + const SMESH_Mesh* /*theMesh*/) +{ + return bool( _maxSize = elemLenght ); +} + //============================================================================= /*! * diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx index f52504b..66090a1 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx @@ -102,6 +102,12 @@ public: */ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + /*! + * \brief Initialize my parameter values by linear size of mesh element. + * \retval bool - true if parameter values have been successfully defined + */ + virtual bool SetParametersByElementSize( double elemLenght, const SMESH_Mesh* theMesh=0); + private: double _maxSize; double _growthRate; diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx index b2800b7..b4b8d74 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx @@ -205,3 +205,17 @@ bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(const SMESH_Mesh* t } return nbEdges; } + +//================================================================================ +/*! + * \brief Initialize my parameter values by linear size of mesh element. + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByElementSize(double elemLenght, + const SMESH_Mesh* /*theMesh*/) +{ + return bool( _segmentLength = elemLenght ); +} + diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx index 5231a9b..1bff110 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx @@ -91,6 +91,12 @@ public: */ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + /*! + * \brief Initialize my parameter values by linear size of mesh element. + * \retval bool - true if parameter values have been successfully defined + */ + virtual bool SetParametersByElementSize( double elemLenght, const SMESH_Mesh* theMesh=0); + private: int _nbSegments; double _segmentLength, _area;