]> SALOME platform Git repositories - plugins/netgenplugin.git/blob - src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_2D.cxx
1 //  NETGENPlugin : C++ implementation
2 //
3 //  Copyright (C) 2006  OPEN CASCADE, CEA/DEN, EDF R&D
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 //
22 // File      : NETGENPlugin_Hypothesis_2D.cxx
23 // Author    : Michael Sazonov (OCN)
24 // Date      : 28/03/2006
25 // Project   : SALOME
26 // $Header$
27 //=============================================================================
28
29 #include <NETGENPlugin_Hypothesis_2D.hxx>
30 #include <utilities.h>
31
32 using namespace std;
33
34 //=============================================================================
35 /*!
36  *  
37  */
38 //=============================================================================
39 NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId, int studyId,
40                                                         SMESH_Gen * gen)
41   : NETGENPlugin_Hypothesis(hypId, studyId, gen),
42     _quadAllowed (GetDefaultQuadAllowed())
43 {
44   _name = "NETGEN_Parameters_2D";
45   _param_algo_dim = 2;
46 }
47
48 //=============================================================================
49 /*!
50  *  
51  */
52 //=============================================================================
53 void NETGENPlugin_Hypothesis_2D::SetQuadAllowed(bool theVal)
54 {
55   if (theVal != _quadAllowed)
56   {
57     _quadAllowed = theVal;
58     NotifySubMeshesHypothesisModification();
59   }
60 }
61
62 //=============================================================================
63 /*!
64  *  
65  */
66 //=============================================================================
67 bool NETGENPlugin_Hypothesis_2D::GetDefaultQuadAllowed()
68 {
69   return false;
70 }
71
72 //=============================================================================
73 /*!
74  *  
75  */
76 //=============================================================================
77 ostream & NETGENPlugin_Hypothesis_2D::SaveTo(ostream & save)
78 {
79   NETGENPlugin_Hypothesis::SaveTo(save);
80
81   save << " " << (int)_quadAllowed;
82
83   return save;
84 }
85
86 //=============================================================================
87 /*!
88  *  
89  */
90 //=============================================================================
91 istream & NETGENPlugin_Hypothesis_2D::LoadFrom(istream & load)
92 {
93   NETGENPlugin_Hypothesis::LoadFrom(load);
94
95   bool isOK = true;
96   int is;
97
98   isOK = (load >> is);
99   if (isOK)
100     _quadAllowed = (bool) is;
101   else
102     load.clear(ios::badbit | load.rdstate());
103
104   return load;
105 }