Salome HOME
Merge changes from 'master' branch.
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_2D.cxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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, or (at your option) any later version.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  NETGENPlugin : C++ implementation
24 // File      : NETGENPlugin_Hypothesis_2D.cxx
25 // Author    : Michael Sazonov (OCN)
26 // Date      : 28/03/2006
27 // Project   : SALOME
28 //=============================================================================
29 //
30 #include "NETGENPlugin_Hypothesis_2D.hxx"
31
32 using namespace std;
33
34 //=============================================================================
35 /*!
36  *  
37  */
38 //=============================================================================
39 NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId,
40                                                         SMESH_Gen * gen)
41   : NETGENPlugin_Hypothesis(hypId, gen)/*,
42     _quadAllowed (GetDefaultQuadAllowed())*/
43 {
44   _name = "NETGEN_Parameters_2D";
45   _param_algo_dim = 2;
46 }
47
48 //=============================================================================
49 /*!
50  *  
51  */
52 //=============================================================================
53 NETGENPlugin_RemesherHypothesis_2D::
54 NETGENPlugin_RemesherHypothesis_2D (int hypId, SMESH_Gen * gen)
55   : NETGENPlugin_Hypothesis(hypId, gen)
56 {
57   _name = "NETGEN_RemesherParameters_2D";
58   _param_algo_dim = 2;
59
60   _ridgeAngle = DefaultRidgeAngle();
61 }
62
63 //=============================================================================
64 /*!
65  *  
66  */
67 //=============================================================================
68
69 void NETGENPlugin_RemesherHypothesis_2D::SetRidgeAngle( double angle )
70 {
71   if ( _ridgeAngle != angle )
72   {
73     _ridgeAngle = angle;
74     NotifySubMeshesHypothesisModification();
75   }
76 }
77
78 //=============================================================================
79 /*!
80  *
81  */
82 //=============================================================================
83
84 double NETGENPlugin_RemesherHypothesis_2D::GetRidgeAngle() const
85 {
86   return _ridgeAngle;
87 }
88
89 //=============================================================================
90 /*!
91  *
92  */
93 //=============================================================================
94
95 std::ostream & NETGENPlugin_RemesherHypothesis_2D::SaveTo(std::ostream & save)
96 {
97   NETGENPlugin_Hypothesis::SaveTo( save );
98   save << " " << _ridgeAngle;
99
100   return save;
101 }
102
103 //=============================================================================
104 /*!
105  *
106  */
107 //=============================================================================
108
109 std::istream & NETGENPlugin_RemesherHypothesis_2D::LoadFrom(std::istream & load)
110 {
111   NETGENPlugin_Hypothesis::LoadFrom( load );
112   if ( !load )
113     load.clear(ios::badbit | load.rdstate());
114
115   load >> _ridgeAngle;
116
117   if ( !load )
118     _ridgeAngle = DefaultRidgeAngle();
119
120   return load;
121 }