Salome HOME
fix the bug 8924: correct edges orientation definition, remove unused variables
[modules/smesh.git] / src / StdMeshers / StdMeshers_Deflection1D.cxx
1 //  SMESH StdMeshers_Deflection1D : implementaion of SMESH idl descriptions
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : StdMeshers_Deflection1D.cxx
25 //  Module : SMESH
26 //  $Header$
27
28 using namespace std;
29
30 #include "StdMeshers_Deflection1D.hxx"
31 #include "utilities.h"
32
33
34 //=============================================================================
35 /*!
36  *  
37  */
38 //=============================================================================
39
40 StdMeshers_Deflection1D::StdMeshers_Deflection1D(int         hypId,
41                                                  int         studyId,
42                                                  SMESH_Gen * gen)
43      :SMESH_Hypothesis(hypId, studyId, gen)
44 {
45   _value = 1.;
46   _name = "Deflection1D";
47   _param_algo_dim = 1; // is used by SMESH_Regular_1D
48 }
49
50 //=============================================================================
51 /*!
52  *  
53  */
54 //=============================================================================
55
56 StdMeshers_Deflection1D::~StdMeshers_Deflection1D()
57 {
58 }
59
60 //=============================================================================
61 /*!
62  *  
63  */
64 //=============================================================================
65
66 void StdMeshers_Deflection1D::SetDeflection(double value)
67      throw(SALOME_Exception)
68 {
69   if (_value != value) {
70     if (value <= 0.)
71       throw SALOME_Exception(LOCALIZED("Value must be positive"));
72
73     NotifySubMeshesHypothesisModification();
74
75     _value = value;
76   }
77 }
78
79 //=============================================================================
80 /*!
81  *  
82  */
83 //=============================================================================
84
85 double StdMeshers_Deflection1D::GetDeflection() const
86 {
87   return _value;
88 }
89
90 //=============================================================================
91 /*!
92  *  
93  */
94 //=============================================================================
95
96 ostream & StdMeshers_Deflection1D::SaveTo(ostream & save)
97 {
98   save << _value;
99   return save;
100 }
101
102 //=============================================================================
103 /*!
104  *  
105  */
106 //=============================================================================
107
108 istream & StdMeshers_Deflection1D::LoadFrom(istream & load)
109 {
110   bool isOK = (load >> _value);
111   if (!isOK)
112     load.clear(ios::badbit | load.rdstate());
113   return load;
114 }
115
116 //=============================================================================
117 /*!
118  *  
119  */
120 //=============================================================================
121
122 ostream & operator <<(ostream & save, StdMeshers_Deflection1D & hyp)
123 {
124   return hyp.SaveTo( save );
125 }
126
127 //=============================================================================
128 /*!
129  *  
130  */
131 //=============================================================================
132
133 istream & operator >>(istream & load, StdMeshers_Deflection1D & hyp)
134 {
135   return hyp.LoadFrom( load );
136 }