1 // SMESH StdMeshers_Deflection1D : 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 : StdMeshers_Deflection1D.cxx
30 #include "StdMeshers_Deflection1D.hxx"
31 #include "utilities.h"
34 //=============================================================================
38 //=============================================================================
40 StdMeshers_Deflection1D::StdMeshers_Deflection1D(int hypId,
43 :SMESH_Hypothesis(hypId, studyId, gen)
46 _name = "Deflection1D";
47 _param_algo_dim = 1; // is used by SMESH_Regular_1D
50 //=============================================================================
54 //=============================================================================
56 StdMeshers_Deflection1D::~StdMeshers_Deflection1D()
60 //=============================================================================
64 //=============================================================================
66 void StdMeshers_Deflection1D::SetDeflection(double value)
67 throw(SALOME_Exception)
69 if (_value != value) {
71 throw SALOME_Exception(LOCALIZED("Value must be positive"));
73 NotifySubMeshesHypothesisModification();
79 //=============================================================================
83 //=============================================================================
85 double StdMeshers_Deflection1D::GetDeflection() const
90 //=============================================================================
94 //=============================================================================
96 ostream & StdMeshers_Deflection1D::SaveTo(ostream & save)
102 //=============================================================================
106 //=============================================================================
108 istream & StdMeshers_Deflection1D::LoadFrom(istream & load)
110 bool isOK = (load >> _value);
112 load.clear(ios::badbit | load.rdstate());
116 //=============================================================================
120 //=============================================================================
122 ostream & operator <<(ostream & save, StdMeshers_Deflection1D & hyp)
124 return hyp.SaveTo( save );
127 //=============================================================================
131 //=============================================================================
133 istream & operator >>(istream & load, StdMeshers_Deflection1D & hyp)
135 return hyp.LoadFrom( load );