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;
This commit is contained in:
eap 2009-01-23 14:11:20 +00:00
parent 001def51fb
commit bc77de347b
4 changed files with 16 additions and 12 deletions

View File

@ -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;
}
//=============================================================================

View File

@ -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;

View File

@ -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;
}

View File

@ -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;