2 //=============================================================================
3 // File : SMESH_MaxElementArea.cxx
4 // Created : sam mai 18 23:14:08 CEST 2002
5 // Author : Paul RASCLE, EDF
7 // Copyright : EDF 2002
9 //=============================================================================
12 #include "SMESH_MaxElementArea.hxx"
13 #include "utilities.h"
15 //=============================================================================
19 //=============================================================================
21 SMESH_MaxElementArea::SMESH_MaxElementArea(int hypId, int studyId, SMESH_Gen* gen)
22 : SMESH_Hypothesis(hypId, studyId, gen)
25 _name = "MaxElementArea";
30 //=============================================================================
34 //=============================================================================
36 SMESH_MaxElementArea::~SMESH_MaxElementArea()
40 //=============================================================================
44 //=============================================================================
46 void SMESH_MaxElementArea::SetMaxArea(double maxArea)
47 throw (SALOME_Exception)
49 double oldArea = _maxArea;
51 throw SALOME_Exception(LOCALIZED("maxArea must be positive"));
53 if (_maxArea != oldArea)
54 NotifySubMeshesHypothesisModification();
57 //=============================================================================
61 //=============================================================================
63 double SMESH_MaxElementArea::GetMaxArea()
68 //=============================================================================
72 //=============================================================================
74 ostream & SMESH_MaxElementArea::SaveTo(ostream & save)
79 //=============================================================================
83 //=============================================================================
85 istream & SMESH_MaxElementArea::LoadFrom(istream & load)
87 return load >> (*this);
90 //=============================================================================
94 //=============================================================================
96 ostream & operator << (ostream & save, SMESH_MaxElementArea & hyp)
102 //=============================================================================
106 //=============================================================================
108 istream & operator >> (istream & load, SMESH_MaxElementArea & hyp)
113 if (isOK) hyp._maxArea = a;
114 else load.clear(ios::badbit | load.rdstate());