//=============================================================================
NETGENPlugin_Hypothesis::NETGENPlugin_Hypothesis (int hypId,
SMESH_Gen * gen)
+
: SMESH_Hypothesis(hypId, gen),
- _maxSize (GetDefaultMaxSize()),
- _minSize (0),
- _growthRate (GetDefaultGrowthRate()),
- _nbSegPerEdge (GetDefaultNbSegPerEdge()),
- _nbSegPerRadius (GetDefaultNbSegPerRadius()),
- _fineness (GetDefaultFineness()),
- _secondOrder (GetDefaultSecondOrder()),
- _optimize (GetDefaultOptimize()),
- _localSize (GetDefaultLocalSize()),
- _quadAllowed (GetDefaultQuadAllowed()),
- _surfaceCurvature(GetDefaultSurfaceCurvature()),
- _fuseEdges (GetDefaultFuseEdges())
+ _maxSize (GetDefaultMaxSize()),
+ _minSize (0),
+ _growthRate (GetDefaultGrowthRate()),
+ _nbSegPerEdge (GetDefaultNbSegPerEdge()),
+ _nbSegPerRadius (GetDefaultNbSegPerRadius()),
+ _fineness (GetDefaultFineness()),
+ _chordalErrorEnabled(GetDefaultChordalError() > 0),
+ _chordalError (GetDefaultChordalError() ),
+ _secondOrder (GetDefaultSecondOrder()),
+ _optimize (GetDefaultOptimize()),
+ _localSize (GetDefaultLocalSize()),
+ _quadAllowed (GetDefaultQuadAllowed()),
+ _surfaceCurvature (GetDefaultSurfaceCurvature()),
+ _fuseEdges (GetDefaultFuseEdges())
{
_name = "NETGEN_Parameters";
_param_algo_dim = 3;
}
}
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void NETGENPlugin_Hypothesis::SetChordalErrorEnabled(bool theVal)
+{
+ if (theVal != _chordalErrorEnabled)
+ {
+ _chordalErrorEnabled = theVal;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void NETGENPlugin_Hypothesis::SetChordalError(double theVal)
+{
+ if (theVal != _chordalError)
+ {
+ _chordalError = theVal;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
//=============================================================================
/*!
*
if (it_sm != _localSize.end()) {
save << " " << "__LOCALSIZE_BEGIN__";
for ( ; it_sm != _localSize.end(); ++it_sm ) {
- save << " " << it_sm->first
- << " " << it_sm->second << "%#"; // "%#" is a mark of value end
+ save << " " << it_sm->first
+ << " " << it_sm->second << "%#"; // "%#" is a mark of value end
}
save << " " << "__LOCALSIZE_END__";
}
save << " " << _meshSizeFile.size() << " " << _meshSizeFile;
+ save << " " << ( _chordalErrorEnabled ? _chordalError : 0. );
+
return save;
}
load.get( &_meshSizeFile[0], is+1 );
}
+ isOK = static_cast<bool>(load >> val);
+ if (isOK)
+ _chordalError = val;
+ else
+ load.clear(ios::badbit | load.rdstate());
+ _chordalErrorEnabled = ( _chordalError > 0 );
+
return load;
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp)
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp)
{
return 2;
}
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+double NETGENPlugin_Hypothesis::GetDefaultChordalError()
+{
+ return -1; // disabled by default
+}
//=============================================================================
/*!