]> SALOME platform Git repositories - plugins/blsurfplugin.git/blob - src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
Salome HOME
Import a new plugin, sent by Stephane LIAUZU
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
1 //  BLSURFPlugin : 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
20 //
21 //
22 // File      : BLSURFPlugin_Hypothesis_i.cxx
23 // Authors   : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
24 // Date      : 03/04/2006
25 // Project   : SALOME
26 //=============================================================================
27 using namespace std;
28
29 #include "BLSURFPlugin_Hypothesis_i.hxx"
30 #include "SMESH_Gen.hxx"
31 #include "SMESH_PythonDump.hxx"
32
33 #include "Utils_CorbaException.hxx"
34 #include "utilities.h"
35
36 //=============================================================================
37 /*!
38  *  BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
39  *
40  *  Constructor
41  */
42 //=============================================================================
43 BLSURFPlugin_Hypothesis_i::
44 BLSURFPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
45                            int                     theStudyId,
46                            ::SMESH_Gen*            theGenImpl)
47   : SALOME::GenericObj_i( thePOA ), 
48     SMESH_Hypothesis_i( thePOA )
49 {
50   MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
51   myBaseImpl = new ::BLSURFPlugin_Hypothesis (theGenImpl->GetANewId(),
52                                               theStudyId,
53                                               theGenImpl);
54 }
55
56 //=============================================================================
57 /*!
58  *  BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
59  *
60  *  Destructor
61  */
62 //=============================================================================
63 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
64 {
65   MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
66 }
67
68 //=============================================================================
69 /*!
70  *  BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
71  *
72  *  Set PhysicalMesh
73  */
74
75 //=============================================================================
76 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh (CORBA::Long theValue)
77 {
78   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
79   ASSERT(myBaseImpl);
80   this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh)theValue);
81   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
82 }
83
84 //=============================================================================
85 /*!
86  *  BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
87  *
88  *  Get PhysicalMesh
89  */
90 //=============================================================================
91 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
92 {
93   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
94   ASSERT(myBaseImpl);
95   return this->GetImpl()->GetPhysicalMesh();
96 }
97
98 //=============================================================================
99 /*!
100  *  BLSURFPlugin_Hypothesis_i::SetPhySize
101  *
102  *  Set PhySize
103  */
104 //=============================================================================
105 void BLSURFPlugin_Hypothesis_i::SetPhySize (CORBA::Double theValue)
106 {
107   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
108   ASSERT(myBaseImpl);
109   this->GetImpl()->SetPhySize(theValue);
110   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
111 }
112
113 //=============================================================================
114 /*!
115  *  BLSURFPlugin_Hypothesis_i::GetPhySize
116  *
117  *  Get PhySize
118  */
119 //=============================================================================
120 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize()
121 {
122   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
123   ASSERT(myBaseImpl);
124   return this->GetImpl()->GetPhySize();
125 }
126
127 //=============================================================================
128 /*!
129  *  BLSURFPlugin_Hypothesis_i::SetGeometricMesh
130  *
131  *  Set GeometricMesh
132  */
133
134 //=============================================================================
135 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh (CORBA::Long theValue)
136 {
137   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
138   ASSERT(myBaseImpl);
139   this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh)theValue);
140   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
141 }
142
143 //=============================================================================
144 /*!
145  *  BLSURFPlugin_Hypothesis_i::GetGeometricMesh
146  *
147  *  Get GeometricMesh
148  */
149 //=============================================================================
150 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
151 {
152   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
153   ASSERT(myBaseImpl);
154   return this->GetImpl()->GetGeometricMesh();
155 }
156
157 //=============================================================================
158 /*!
159  *  BLSURFPlugin_Hypothesis_i::SetAngleMeshS
160  *
161  *  Set AngleMeshS
162  */
163 //=============================================================================
164 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS (CORBA::Double theValue)
165 {
166   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMeshS");
167   ASSERT(myBaseImpl);
168   this->GetImpl()->SetAngleMeshS(theValue);
169   SMESH::TPythonDump() << _this() << ".SetAngleMeshS( " << theValue << " )";
170 }
171
172 //=============================================================================
173 /*!
174  *  BLSURFPlugin_Hypothesis_i::GetAngleMeshS
175  *
176  *  Get AngleMeshS
177  */
178 //=============================================================================
179 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS()
180 {
181   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMeshS");
182   ASSERT(myBaseImpl);
183   return this->GetImpl()->GetAngleMeshS();
184 }
185
186 //=============================================================================
187 /*!
188  *  BLSURFPlugin_Hypothesis_i::SetGradation
189  *
190  *  Set Gradation
191  */
192 //=============================================================================
193 void BLSURFPlugin_Hypothesis_i::SetGradation (CORBA::Double theValue)
194 {
195   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
196   ASSERT(myBaseImpl);
197   this->GetImpl()->SetGradation(theValue);
198   SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
199 }
200
201 //=============================================================================
202 /*!
203  *  BLSURFPlugin_Hypothesis_i::GetGradation
204  *
205  *  Get Gradation
206  */
207 //=============================================================================
208 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
209 {
210   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
211   ASSERT(myBaseImpl);
212   return this->GetImpl()->GetGradation();
213 }
214
215 //=============================================================================
216 /*!
217  *  BLSURFPlugin_Hypothesis_i::SetQuadAllowed
218  *
219  *  Set true or false
220  */
221 //=============================================================================
222 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed (CORBA::Boolean theValue)
223 {
224   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
225   ASSERT(myBaseImpl);
226   this->GetImpl()->SetQuadAllowed(theValue);
227   SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValue << " )";
228 }
229
230 //=============================================================================
231 /*!
232  *  BLSURFPlugin_Hypothesis_i::GetQuadAllowed
233  *
234  *  Get true or false
235  */
236 //=============================================================================
237 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
238 {
239   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
240   ASSERT(myBaseImpl);
241   return this->GetImpl()->GetQuadAllowed();
242 }
243
244 //=============================================================================
245 /*!
246  *  BLSURFPlugin_Hypothesis_i::SetDecimesh
247  *
248  *  Set true or false
249  */
250 //=============================================================================
251 void BLSURFPlugin_Hypothesis_i::SetDecimesh (CORBA::Boolean theValue)
252 {
253   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetDecimesh");
254   ASSERT(myBaseImpl);
255   this->GetImpl()->SetDecimesh(theValue);
256   SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValue << " )";
257 }
258
259 //=============================================================================
260 /*!
261  *  BLSURFPlugin_Hypothesis_i::GetDecimesh
262  *
263  *  Get true or false
264  */
265 //=============================================================================
266 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh()
267 {
268   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetDecimesh");
269   ASSERT(myBaseImpl);
270   return this->GetImpl()->GetDecimesh();
271 }
272
273 //=============================================================================
274 /*!
275  *  BLSURFPlugin_Hypothesis_i::GetImpl
276  *
277  *  Get implementation
278  */
279 //=============================================================================
280 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl()
281 {
282   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
283   return (::BLSURFPlugin_Hypothesis*)myBaseImpl;
284 }
285
286 //================================================================================
287 /*!
288  * \brief Verify whether hypothesis supports given entity type 
289   * \param type - dimension (see SMESH::Dimension enumeration)
290   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
291  * 
292  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
293  */
294 //================================================================================  
295 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
296 {
297   return type == SMESH::DIM_2D;
298 }