// $Header$
using namespace std;
+
+#include "SMESH_MaxElementVolume.hxx"
+#include "utilities.h"
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH_MaxElementVolume::SMESH_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
+ : SMESH_Hypothesis(hypId, studyId, gen)
+{
+ _maxVolume =1.;
+ _name = "MaxElementVolume";
+// SCRUTE(_name);
+ SCRUTE(&_name);
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH_MaxElementVolume::~SMESH_MaxElementVolume()
+{
+ MESSAGE("SMESH_MaxElementVolume::~SMESH_MaxElementVolume");
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+void SMESH_MaxElementVolume::SetMaxVolume(double maxVolume)
+ throw (SALOME_Exception)
+{
+ double oldVolume = _maxVolume;
+ if (maxVolume <= 0)
+ throw SALOME_Exception(LOCALIZED("maxVolume must be positive"));
+ _maxVolume = maxVolume;
+ if (_maxVolume != oldVolume)
+ NotifySubMeshesHypothesisModification();
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+double SMESH_MaxElementVolume::GetMaxVolume() const
+{
+ return _maxVolume;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & SMESH_MaxElementVolume::SaveTo(ostream & save)
+{
+ return save << this;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & SMESH_MaxElementVolume::LoadFrom(istream & load)
+{
+ return load >> (*this);
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & operator << (ostream & save, SMESH_MaxElementVolume & hyp)
+{
+ save << hyp._maxVolume;
+ return save;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & operator >> (istream & load, SMESH_MaxElementVolume & hyp)
+{
+ bool isOK = true;
+ double a;
+ isOK = (load >> a);
+ if (isOK) hyp._maxVolume = a;
+ else load.clear(ios::badbit | load.rdstate());
+ return load;
+}
+