Salome HOME
Merge from BR_V5_DEV 16Feb09
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_i.cxx
1 //  Copyright (C) 2007-2008  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.
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 //  NETGENPlugin : C++ implementation
23 // File      : NETGENPlugin_Hypothesis_i.cxx
24 // Author    : Michael Sazonov (OCN)
25 // Date      : 03/04/2006
26 // Project   : SALOME
27 // $Header$
28 //=============================================================================
29 //
30 #include "NETGENPlugin_Hypothesis_i.hxx"
31 #include "SMESH_Gen.hxx"
32 #include "SMESH_PythonDump.hxx"
33
34 #include "Utils_CorbaException.hxx"
35 #include "utilities.h"
36
37 using namespace std;
38
39 //=============================================================================
40 /*!
41  *  NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i
42  *
43  *  Constructor
44  */
45 //=============================================================================
46 NETGENPlugin_Hypothesis_i::
47 NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48                            int                     theStudyId,
49                            ::SMESH_Gen*            theGenImpl)
50   : SALOME::GenericObj_i( thePOA ), 
51     SMESH_Hypothesis_i( thePOA )
52 {
53   MESSAGE( "NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i" );
54   myBaseImpl = new ::NETGENPlugin_Hypothesis (theGenImpl->GetANewId(),
55                                               theStudyId,
56                                               theGenImpl);
57 }
58
59 //=============================================================================
60 /*!
61  *  NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i
62  *
63  *  Destructor
64  */
65 //=============================================================================
66 NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i()
67 {
68   MESSAGE( "NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i" );
69 }
70
71 //=============================================================================
72 /*!
73  *  NETGENPlugin_Hypothesis_i::SetMaxSize
74  *
75  *  Set MaxSize
76  */
77 //=============================================================================
78 void NETGENPlugin_Hypothesis_i::SetMaxSize (CORBA::Double theValue)
79 {
80   MESSAGE("NETGENPlugin_Hypothesis_i::SetMaxSize");
81   ASSERT(myBaseImpl);
82   this->GetImpl()->SetMaxSize(theValue);
83   SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theValue << " )";
84 }
85
86 //=============================================================================
87 /*!
88  *  NETGENPlugin_Hypothesis_i::GetMaxSize
89  *
90  *  Get MaxSize
91  */
92 //=============================================================================
93 CORBA::Double NETGENPlugin_Hypothesis_i::GetMaxSize()
94 {
95   MESSAGE("NETGENPlugin_Hypothesis_i::GetMaxSize");
96   ASSERT(myBaseImpl);
97   return this->GetImpl()->GetMaxSize();
98 }
99
100 //=============================================================================
101 /*!
102  *  NETGENPlugin_Hypothesis_i::SetSecondOrder
103  *
104  *  Set SecondOrder flag
105  */
106 //=============================================================================
107 void NETGENPlugin_Hypothesis_i::SetSecondOrder (CORBA::Boolean theValue)
108 {
109   MESSAGE("NETGENPlugin_Hypothesis_i::SetSecondOrder");
110   ASSERT(myBaseImpl);
111   this->GetImpl()->SetSecondOrder(theValue);
112   SMESH::TPythonDump() << _this() << ".SetSecondOrder( " << theValue << " )";
113 }
114
115 //=============================================================================
116 /*!
117  *  NETGENPlugin_Hypothesis_i::GetSecondOrder
118  *
119  *  Get SecondOrder flag
120  */
121 //=============================================================================
122 CORBA::Boolean NETGENPlugin_Hypothesis_i::GetSecondOrder()
123 {
124   MESSAGE("NETGENPlugin_Hypothesis_i::GetSecondOrder");
125   ASSERT(myBaseImpl);
126   return this->GetImpl()->GetSecondOrder();
127 }
128
129 //=============================================================================
130 /*!
131  *  NETGENPlugin_Hypothesis_i::SetOptimize
132  *
133  *  Set Optimize flag
134  */
135 //=============================================================================
136 void NETGENPlugin_Hypothesis_i::SetOptimize (CORBA::Boolean theValue)
137 {
138   MESSAGE("NETGENPlugin_Hypothesis_i::SetOptimize");
139   ASSERT(myBaseImpl);
140   this->GetImpl()->SetOptimize(theValue);
141   SMESH::TPythonDump() << _this() << ".SetOptimize( " << theValue << " )";
142 }
143
144 //=============================================================================
145 /*!
146  *  NETGENPlugin_Hypothesis_i::GetOptimize
147  *
148  *  Get Optimize flag
149  */
150 //=============================================================================
151 CORBA::Boolean NETGENPlugin_Hypothesis_i::GetOptimize()
152 {
153   MESSAGE("NETGENPlugin_Hypothesis_i::GetOptimize");
154   ASSERT(myBaseImpl);
155   return this->GetImpl()->GetOptimize();
156 }
157
158 //=============================================================================
159 /*!
160  *  NETGENPlugin_Hypothesis_i::SetFineness
161  *
162  *  Set Fineness
163  */
164 //=============================================================================
165 void NETGENPlugin_Hypothesis_i::SetFineness (CORBA::Long theValue)
166 {
167   MESSAGE("NETGENPlugin_Hypothesis_i::SetFineness");
168   ASSERT(myBaseImpl);
169   this->GetImpl()->SetFineness((::NETGENPlugin_Hypothesis::Fineness)theValue);
170   SMESH::TPythonDump() << _this() << ".SetFineness( " << theValue << " )";
171 }
172
173 //=============================================================================
174 /*!
175  *  NETGENPlugin_Hypothesis_i::GetFineness
176  *
177  *  Get Fineness
178  */
179 //=============================================================================
180 CORBA::Long NETGENPlugin_Hypothesis_i::GetFineness()
181 {
182   MESSAGE("NETGENPlugin_Hypothesis_i::GetFineness");
183   ASSERT(myBaseImpl);
184   return this->GetImpl()->GetFineness();
185 }
186
187 //=============================================================================
188 /*!
189  *  NETGENPlugin_Hypothesis_i::SetGrowthRate
190  *
191  *  Set GrowthRate
192  */
193 //=============================================================================
194 void NETGENPlugin_Hypothesis_i::SetGrowthRate (CORBA::Double theValue)
195 {
196   MESSAGE("NETGENPlugin_Hypothesis_i::SetGrowthRate");
197   ASSERT(myBaseImpl);
198   this->GetImpl()->SetGrowthRate(theValue);
199   SMESH::TPythonDump() << _this() << ".SetGrowthRate( " << theValue << " )";
200 }
201
202 //=============================================================================
203 /*!
204  *  NETGENPlugin_Hypothesis_i::GetGrowthRate
205  *
206  *  Get GrowthRate
207  */
208 //=============================================================================
209 CORBA::Double NETGENPlugin_Hypothesis_i::GetGrowthRate()
210 {
211   MESSAGE("NETGENPlugin_Hypothesis_i::GetGrowthRate");
212   ASSERT(myBaseImpl);
213   return this->GetImpl()->GetGrowthRate();
214 }
215
216 //=============================================================================
217 /*!
218  *  NETGENPlugin_Hypothesis_i::SetNbSegPerEdge
219  *
220  *  Set NbSegPerEdge
221  */
222 //=============================================================================
223 void NETGENPlugin_Hypothesis_i::SetNbSegPerEdge (CORBA::Double theValue)
224 {
225   MESSAGE("NETGENPlugin_Hypothesis_i::SetNbSegPerEdge");
226   ASSERT(myBaseImpl);
227   this->GetImpl()->SetNbSegPerEdge(theValue);
228   SMESH::TPythonDump() << _this() << ".SetNbSegPerEdge( " << theValue << " )";
229 }
230
231 //=============================================================================
232 /*!
233  *  NETGENPlugin_Hypothesis_i::GetNbSegPerEdge
234  *
235  *  Get NbSegPerEdge
236  */
237 //=============================================================================
238 CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerEdge()
239 {
240   MESSAGE("NETGENPlugin_Hypothesis_i::GetNbSegPerEdge");
241   ASSERT(myBaseImpl);
242   return this->GetImpl()->GetNbSegPerEdge();
243 }
244
245 //=============================================================================
246 /*!
247  *  NETGENPlugin_Hypothesis_i::SetNbSegPerRadius
248  *
249  *  Set NbSegPerRadius
250  */
251 //=============================================================================
252 void NETGENPlugin_Hypothesis_i::SetNbSegPerRadius (CORBA::Double theValue)
253 {
254   MESSAGE("NETGENPlugin_Hypothesis_i::SetNbSegPerRadius");
255   ASSERT(myBaseImpl);
256   this->GetImpl()->SetNbSegPerRadius(theValue);
257   SMESH::TPythonDump() << _this() << ".SetNbSegPerRadius( " << theValue << " )";
258 }
259
260 //=============================================================================
261 /*!
262  *  NETGENPlugin_Hypothesis_i::GetNbSegPerRadius
263  *
264  *  Get NbSegPerRadius
265  */
266 //=============================================================================
267 CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius()
268 {
269   MESSAGE("NETGENPlugin_Hypothesis_i::GetNbSegPerRadius");
270   ASSERT(myBaseImpl);
271   return this->GetImpl()->GetNbSegPerRadius();
272 }
273
274 //=============================================================================
275 /*!
276  *  NETGENPlugin_Hypothesis_i::GetImpl
277  *
278  *  Get implementation
279  */
280 //=============================================================================
281 ::NETGENPlugin_Hypothesis* NETGENPlugin_Hypothesis_i::GetImpl()
282 {
283   MESSAGE("NETGENPlugin_Hypothesis_i::GetImpl");
284   return (::NETGENPlugin_Hypothesis*)myBaseImpl;
285 }
286
287 //================================================================================
288 /*!
289  * \brief Verify whether hypothesis supports given entity type 
290   * \param type - dimension (see SMESH::Dimension enumeration)
291   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
292  * 
293  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
294  */
295 //================================================================================  
296 CORBA::Boolean NETGENPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
297 {
298   return type == SMESH::DIM_3D;
299 }