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