From bc77de347ba94a0272802df63f5638a03d9a0d22 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 23 Jan 2009 14:11:20 +0000 Subject: [PATCH] 0019941: EDF 766 SMESH : Max length hypothesis - virtual bool SetParametersByElementSize(double elemLenght, const SMESH_Mesh* theMesh=0)=0; + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0)=0; --- src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx | 10 ++++++---- src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx | 4 ++-- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx | 10 ++++++---- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx | 4 ++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx index 1ed64ee..75100b5 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx @@ -295,15 +295,17 @@ bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, //================================================================================ /*! - * \brief Initialize my parameter values by linear size of mesh element. + * \brief Initialize my parameter values by default parameters. * \retval bool - true if parameter values have been successfully defined */ //================================================================================ -bool NETGENPlugin_Hypothesis::SetParametersByElementSize(double elemLenght, - const SMESH_Mesh* /*theMesh*/) +bool NETGENPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, + const SMESH_Mesh* /*theMesh*/) { - return bool( _maxSize = elemLenght ); + _nbSegPerEdge = dflts._nbSegments; + _maxSize = dflts._elemLength; + return _nbSegPerEdge && _maxSize > 0; } //============================================================================= diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx index 3cf75a4..3654f86 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx @@ -102,10 +102,10 @@ public: virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); /*! - * \brief Initialize my parameter values by linear size of mesh element. + * \brief Initialize my parameter values by default parameters. * \retval bool - true if parameter values have been successfully defined */ - virtual bool SetParametersByElementSize( double elemLenght, const SMESH_Mesh* theMesh=0); + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); private: double _maxSize; diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx index 4ccef3b..a54d2fb 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx @@ -209,14 +209,16 @@ bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(const SMESH_Mesh* t //================================================================================ /*! - * \brief Initialize my parameter values by linear size of mesh element. + * \brief Initialize my parameter values by default parameters. * \retval bool - true if parameter values have been successfully defined */ //================================================================================ -bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByElementSize(double elemLenght, - const SMESH_Mesh* /*theMesh*/) +bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByDefaults(const TDefaults& dflts, + const SMESH_Mesh* /*theMesh*/) { - return bool( _segmentLength = elemLenght ); + _nbSegments = dflts._nbSegments; + _segmentLength = dflts._elemLength; + return _nbSegments && _segmentLength > 0; } diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx index 545f92e..4ed9218 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx @@ -93,10 +93,10 @@ public: virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); /*! - * \brief Initialize my parameter values by linear size of mesh element. + * \brief Initialize my parameter values by default parameters. * \retval bool - true if parameter values have been successfully defined */ - virtual bool SetParametersByElementSize( double elemLenght, const SMESH_Mesh* theMesh=0); + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); private: int _nbSegments; -- 2.39.2