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