Salome HOME
Merge changes from 'master' branch.
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_2D.cxx
index 6dfa5acce5428977222df93dfab8b104062b6810..d7f52e846ac4b564ad0f2419fd04022860bb41e7 100644 (file)
@@ -28,7 +28,6 @@
 //=============================================================================
 //
 #include "NETGENPlugin_Hypothesis_2D.hxx"
-#include <utilities.h>
 
 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;
+}