#define SPACING 6
#define MARGIN 11
+using namespace NETGENPlugin;
+
// copied from StdMeshersGUI_StdHypothesisCreator.cxx
const double VALUE_MAX = 1.0e+15, // COORD_MAX
VALUE_MAX_2 = VALUE_MAX * VALUE_MAX,
if ( isCreation() )
myName->setText( hypName() );
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
+ // set default real values
+
+ NETGENPlugin_SimpleHypothesis_2D_var h =
+ NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis( hasInitParamsHypothesis() ));
+
+ if ( double len = h->GetLocalLength() )
+ myLength->setValue( len );
+ if ( double area = h->GetMaxElementArea() )
+ myArea->setValue( area );
+ if ( myVolume ) {
+ NETGENPlugin_SimpleHypothesis_3D_var h3d =
+ NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis( hasInitParamsHypothesis()) );
+ if ( double volume = (double) h3d->GetMaxElementVolume() )
+ myVolume->setValue( volume );
+ }
+
+ h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() );
+
+ // set values of hypothesis
// 1D
int nbSeg = (int) h->GetNumberOfSegments();
// 3D
if ( myVolume ) {
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis() );
+ NETGENPlugin_SimpleHypothesis_3D_var h = NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() );
if ( double volume = (double) h->GetMaxElementVolume() ) {
myLenFromFacesCheckBox->setChecked( false );
myVolume->setEnabled( true );
QString valStr;
try
{
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
+ NETGENPlugin_SimpleHypothesis_2D_var h =
+ NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() );
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() );
// 3D
if ( myVolume ) {
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
- NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis() );
+ NETGENPlugin_SimpleHypothesis_3D_var h =
+ NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() );
if ( myVolume->isEnabled() ) {
h->SetMaxElementVolume( myVolume->value() );
valStr += "; vol=" + myVolume->text();
// Author : Michael Sazonov (OCN)
// Date : 28/03/2006
// Project : SALOME
-// $Header$
-//=============================================================================
//
#include <NETGENPlugin_Hypothesis.hxx>
#include <utilities.h>
*/
//================================================================================
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 );
+}
+
//=============================================================================
/*!
*
// Author : Michael Sazonov (OCN)
// Date : 27/03/2006
// Project : SALOME
-// $Header$
-//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_HXX_
#define _NETGENPlugin_Hypothesis_HXX_
*/
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;
}
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 );
+}
+