Salome HOME
Merge V9_dev branch into master
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_2D.cxx
index 05949d50869fdad2432cd2cc2d436f6d4bf9774a..d7f52e846ac4b564ad0f2419fd04022860bb41e7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -28,7 +28,6 @@
 //=============================================================================
 //
 #include "NETGENPlugin_Hypothesis_2D.hxx"
-#include <utilities.h>
 
 using namespace std;
 
@@ -37,9 +36,9 @@ using namespace std;
  *  
  */
 //=============================================================================
-NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId, int studyId,
+NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId,
                                                         SMESH_Gen * gen)
-  : NETGENPlugin_Hypothesis(hypId, studyId, gen)/*,
+  : NETGENPlugin_Hypothesis(hypId, gen)/*,
     _quadAllowed (GetDefaultQuadAllowed())*/
 {
   _name = "NETGEN_Parameters_2D";
@@ -51,56 +50,72 @@ NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId, int studyId,
  *  
  */
 //=============================================================================
-// 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;
+}