1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_MaxElementVolume.cxx
25 // Author : Paul RASCLE, EDF
31 #include "SMESH_MaxElementVolume.hxx"
32 #include "utilities.h"
34 //=============================================================================
38 //=============================================================================
40 SMESH_MaxElementVolume::SMESH_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
41 : SMESH_Hypothesis(hypId, studyId, gen)
44 _name = "MaxElementVolume";
49 //=============================================================================
53 //=============================================================================
55 SMESH_MaxElementVolume::~SMESH_MaxElementVolume()
57 MESSAGE("SMESH_MaxElementVolume::~SMESH_MaxElementVolume");
60 //=============================================================================
64 //=============================================================================
66 void SMESH_MaxElementVolume::SetMaxVolume(double maxVolume)
67 throw (SALOME_Exception)
69 double oldVolume = _maxVolume;
71 throw SALOME_Exception(LOCALIZED("maxVolume must be positive"));
72 _maxVolume = maxVolume;
73 if (_maxVolume != oldVolume)
74 NotifySubMeshesHypothesisModification();
77 //=============================================================================
81 //=============================================================================
83 double SMESH_MaxElementVolume::GetMaxVolume() const
88 //=============================================================================
92 //=============================================================================
94 ostream & SMESH_MaxElementVolume::SaveTo(ostream & save)
99 //=============================================================================
103 //=============================================================================
105 istream & SMESH_MaxElementVolume::LoadFrom(istream & load)
107 return load >> (*this);
110 //=============================================================================
114 //=============================================================================
116 ostream & operator << (ostream & save, SMESH_MaxElementVolume & hyp)
118 save << hyp._maxVolume;
122 //=============================================================================
126 //=============================================================================
128 istream & operator >> (istream & load, SMESH_MaxElementVolume & hyp)
133 if (isOK) hyp._maxVolume = a;
134 else load.clear(ios::badbit | load.rdstate());