X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_Hypothesis_2D.cxx;h=d7f52e846ac4b564ad0f2419fd04022860bb41e7;hb=ac5dc648d839444366920d17980ba1690355bf25;hp=6dfa5acce5428977222df93dfab8b104062b6810;hpb=9f30c086ceceef57709bc2971bd30252920faa38;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx index 6dfa5ac..d7f52e8 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx @@ -28,7 +28,6 @@ //============================================================================= // #include "NETGENPlugin_Hypothesis_2D.hxx" -#include using namespace std; @@ -51,56 +50,72 @@ NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId, * */ //============================================================================= -// void NETGENPlugin_Hypothesis_2D::SetQuadAllowed(bool theVal) -// { -// if (theVal != _quadAllowed) -// { -// _quadAllowed = theVal; -// NotifySubMeshesHypothesisModification(); -// } -// } - -// //============================================================================= -// /*! -// * -// */ -// //============================================================================= -// bool NETGENPlugin_Hypothesis_2D::GetDefaultQuadAllowed() -// { -// return false; -// } - -// //============================================================================= -// /*! -// * -// */ -// //============================================================================= -// ostream & NETGENPlugin_Hypothesis_2D::SaveTo(ostream & save) -// { -// NETGENPlugin_Hypothesis::SaveTo(save); - -// save << " " << (int)_quadAllowed; - -// return save; -// } - -// //============================================================================= -// /*! -// * -// */ -// //============================================================================= -// istream & NETGENPlugin_Hypothesis_2D::LoadFrom(istream & load) -// { -// NETGENPlugin_Hypothesis::LoadFrom(load); - -// bool isOK = true; -// int is; - -// isOK = (load >> is); -// if (isOK) -// _quadAllowed = (bool) is; -// else -// load.clear(ios::badbit | load.rdstate()); - -// return load; -// } +NETGENPlugin_RemesherHypothesis_2D:: +NETGENPlugin_RemesherHypothesis_2D (int hypId, SMESH_Gen * gen) + : NETGENPlugin_Hypothesis(hypId, gen) +{ + _name = "NETGEN_RemesherParameters_2D"; + _param_algo_dim = 2; + + _ridgeAngle = DefaultRidgeAngle(); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +void NETGENPlugin_RemesherHypothesis_2D::SetRidgeAngle( double angle ) +{ + if ( _ridgeAngle != angle ) + { + _ridgeAngle = angle; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +double NETGENPlugin_RemesherHypothesis_2D::GetRidgeAngle() const +{ + return _ridgeAngle; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +std::ostream & NETGENPlugin_RemesherHypothesis_2D::SaveTo(std::ostream & save) +{ + NETGENPlugin_Hypothesis::SaveTo( save ); + save << " " << _ridgeAngle; + + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +std::istream & NETGENPlugin_RemesherHypothesis_2D::LoadFrom(std::istream & load) +{ + NETGENPlugin_Hypothesis::LoadFrom( load ); + if ( !load ) + load.clear(ios::badbit | load.rdstate()); + + load >> _ridgeAngle; + + if ( !load ) + _ridgeAngle = DefaultRidgeAngle(); + + return load; +}