Salome HOME
0023299: [CEA] Finalize multi-study removal
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hypothesis_i.cxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File   : HexoticPlugin_Hypothesis_i.cxx
22 // Author : Lioka RAZAFINDRAZAKA (CEA)
23 // ---
24 //
25 #include "HexoticPlugin_Hypothesis_i.hxx"
26 #include "SMESH_Mesh_i.hxx"
27 #include "SMESH_Gen.hxx"
28 #include "SMESH_PythonDump.hxx"
29
30 #include "Utils_CorbaException.hxx"
31 #include "utilities.h"
32
33 //=============================================================================
34 /*!
35  *  HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i
36  *
37  *  Constructor
38  */
39 //=============================================================================
40 HexoticPlugin_Hypothesis_i::
41 HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
42                             ::SMESH_Gen*            theGenImpl)
43   : SALOME::GenericObj_i( thePOA ), 
44     SMESH_Hypothesis_i( thePOA )
45 {
46   MESSAGE( "HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i" );
47   myBaseImpl = new ::HexoticPlugin_Hypothesis (theGenImpl->GetANewId(),
48                                                theGenImpl);
49 }
50
51 //=============================================================================
52 /*!
53  *  HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i
54  *
55  *  Destructor
56  */
57 //=============================================================================
58 HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i()
59 {
60   MESSAGE( "HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i" );
61 }
62
63 //=============================================================================
64 /*!
65  *  HexoticPlugin_Hypothesis_i::SetHexesMinLevel
66  *  HexoticPlugin_Hypothesis_i::SetHexesMaxLevel
67  *  HexoticPlugin_Hypothesis_i::SetMinSize
68  *  HexoticPlugin_Hypothesis_i::SetMaxSize
69  *  HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges
70  *  HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements
71  *  HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold
72  *  HexoticPlugin_Hypothesis_i::SetHexoticNbProc 
73  *  HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory 
74  *  HexoticPlugin_Hypothesis_i::SetHexoticSdMode
75  *  HexoticPlugin_Hypothesis_i::SetVerbosity
76  *  HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory
77  *  HexoticPlugin_Hypothesis_i::SetTextOptions
78  *  HexoticPlugin_Hypothesis_i::SetNbLayers
79  *  HexoticPlugin_Hypothesis_i::SetFirstLayerSize
80  *  HexoticPlugin_Hypothesis_i::SetDirection
81  *  HexoticPlugin_Hypothesis_i::SetGrowth
82  *  HexoticPlugin_Hypothesis_i::SetFacesWithLayers
83  *  HexoticPlugin_Hypothesis_i::SetImprintedFaces
84  */
85 //=============================================================================
86
87 void HexoticPlugin_Hypothesis_i::SetHexesMinLevel (CORBA::Long theValue)
88 {
89   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMinLevel");
90   ASSERT(myBaseImpl);
91   CORBA::Long oldValue = GetHexesMinLevel();
92   this->GetImpl()->SetHexesMinLevel(theValue);
93   if (theValue != oldValue)
94     SMESH::TPythonDump() << _this() << ".SetHexesMinLevel( " << theValue << " )";
95 }
96
97 void HexoticPlugin_Hypothesis_i::SetHexesMaxLevel (CORBA::Long theValue)
98 {
99   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
100   ASSERT(myBaseImpl);
101   CORBA::Long oldValue = GetHexesMaxLevel();
102   this->GetImpl()->SetHexesMaxLevel(theValue);
103   if (theValue != oldValue)
104     SMESH::TPythonDump() << _this() << ".SetHexesMaxLevel( " << theValue << " )";
105 }
106
107 void HexoticPlugin_Hypothesis_i::SetMinSize (CORBA::Double theValue)
108 {
109   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
110   ASSERT(myBaseImpl);
111   CORBA::Double oldValue = GetMinSize();
112   this->GetImpl()->SetMinSize(theValue);
113   if (theValue != oldValue)
114     SMESH::TPythonDump() << _this() << ".SetMinSize( " << theValue << " )";
115 }
116
117 void HexoticPlugin_Hypothesis_i::SetMaxSize (CORBA::Double theValue)
118 {
119   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
120   ASSERT(myBaseImpl);
121   CORBA::Double oldValue = GetMaxSize();
122   this->GetImpl()->SetMaxSize(theValue);
123   if (theValue != oldValue)
124     SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theValue << " )";
125 }
126
127 void HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges (CORBA::Boolean theValue)
128 {
129   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges");
130   ASSERT(myBaseImpl);
131   CORBA::Boolean oldValue = GetHexoticIgnoreRidges();
132   this->GetImpl()->SetHexoticIgnoreRidges(theValue);
133   if (theValue != oldValue)
134     SMESH::TPythonDump() << _this() << ".SetHexoticIgnoreRidges( " << theValue << " )";
135 }
136
137 void HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements (CORBA::Boolean theValue)
138 {
139   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements");
140   ASSERT(myBaseImpl);
141   CORBA::Boolean oldValue = GetHexoticInvalidElements();
142   this->GetImpl()->SetHexoticInvalidElements(theValue);
143   if (theValue != oldValue)
144     SMESH::TPythonDump() << _this() << ".SetHexoticInvalidElements( " << theValue << " )";
145 }
146
147 void HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold (CORBA::Double theValue)
148 {
149   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold");
150   ASSERT(myBaseImpl);
151   CORBA::Double oldValue = GetHexoticSharpAngleThreshold();
152   this->GetImpl()->SetHexoticSharpAngleThreshold(theValue);
153   if (theValue != oldValue)
154     SMESH::TPythonDump() << _this() << ".SetHexoticSharpAngleThreshold( " << theValue << " )";
155 }
156
157 void HexoticPlugin_Hypothesis_i::SetHexoticNbProc (CORBA::Long theValue)
158 {
159   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticNbProc");
160   ASSERT(myBaseImpl);
161   CORBA::Long oldValue = GetHexoticNbProc();
162   this->GetImpl()->SetHexoticNbProc(theValue);
163   if (theValue != oldValue)
164     SMESH::TPythonDump() << _this() << ".SetHexoticNbProc( " << theValue << " )";
165 }
166
167 void HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception )
168 {
169   if (!path )
170     THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM );
171
172   ASSERT(myBaseImpl);
173   std::string file(path);
174   std::string oldValue(GetHexoticWorkingDirectory());
175   bool doDump = false;
176   if (oldValue != file)
177     doDump = true;
178
179   const char lastChar = *file.rbegin();
180 #ifdef WIN32
181   if ( lastChar != '\\' ) file += '\\';
182 #else
183   if ( lastChar != '/' ) file += '/';
184 #endif
185   file += "Hexotic_In.mesh";
186   SMESH_Mesh_i::PrepareForWriting (file.c_str());
187
188   this->GetImpl()->SetHexoticWorkingDirectory(path);
189   if (doDump)
190     SMESH::TPythonDump() << _this() << ".SetHexoticWorkingDirectory( '" << path << "' )";
191 }
192
193 void HexoticPlugin_Hypothesis_i::SetHexoticSdMode (CORBA::Long theValue)
194 {
195   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticSdMode");
196   ASSERT(myBaseImpl);
197   CORBA::Long oldValue = GetHexoticSdMode();
198   this->GetImpl()->SetHexoticSdMode(theValue);
199   if (theValue != oldValue)
200     SMESH::TPythonDump() << _this() << ".SetHexoticSdMode( " << theValue << " )";
201 }
202
203 void HexoticPlugin_Hypothesis_i::SetHexoticVerbosity (CORBA::Long theValue)
204 {
205   // MESSAGE("HexoticPlugin_Hypothesis_i::SetVerbosity");
206   ASSERT(myBaseImpl);
207   CORBA::Long oldValue = GetHexoticVerbosity();
208   this->GetImpl()->SetHexoticVerbosity(theValue);
209   if (theValue != oldValue)
210     SMESH::TPythonDump() << _this() << ".SetHexoticVerbosity( " << theValue << " )";
211 }
212
213 void HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory (CORBA::Long theValue)
214 {
215   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory");
216   ASSERT(myBaseImpl);
217   CORBA::Long oldValue = GetHexoticMaxMemory();
218   this->GetImpl()->SetHexoticMaxMemory(theValue);
219   if (theValue != oldValue)
220     SMESH::TPythonDump() << _this() << ".SetHexoticMaxMemory( " << theValue << " )";
221 }
222
223 void HexoticPlugin_Hypothesis_i::SetTextOptions(const char* theOptions)
224 {
225   // MESSAGE("HexoticPlugin_Hypothesis_i::SetTextOptions");
226   ASSERT(myBaseImpl);
227   std::string oldValue(GetAdvancedOption());
228   this->GetImpl()->SetAdvancedOption(theOptions);
229   if (theOptions != oldValue)
230     SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptions << "' )";
231 }
232
233 void HexoticPlugin_Hypothesis_i::SetAdvancedOption(const char* theOptions)
234 {
235   // MESSAGE("HexoticPlugin_Hypothesis_i::SetAdvancedOption");
236   ASSERT(myBaseImpl);
237   std::string oldValue(GetAdvancedOption());
238   this->GetImpl()->SetAdvancedOption(theOptions);
239   if (theOptions != oldValue)
240     SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptions << "' )";
241 }
242
243 HexoticPlugin::HexoticPluginSizeMapsList* HexoticPlugin_Hypothesis_i::GetSizeMaps ()
244 {
245   // Get the std::map < std::string entry, double size >
246   HexoticPlugin::HexoticPluginSizeMapsList_var result = new HexoticPlugin::HexoticPluginSizeMapsList();
247   const ::HexoticPlugin_Hypothesis::THexoticSizeMaps sizeMaps = this->GetImpl()->GetSizeMaps();
248   result->length( sizeMaps.size() );
249   
250   // Write the content into a CORBA sequence of struct{ entry=anEntry; size=aSize; }
251   ::HexoticPlugin_Hypothesis::THexoticSizeMaps::const_iterator it = sizeMaps.begin(); 
252   for ( int i = 0; it != sizeMaps.end(); i++, it++ )
253   {
254     HexoticPlugin::HexoticPluginSizeMap_var aSizeMap = new HexoticPlugin::HexoticPluginSizeMap();
255     aSizeMap->entry = CORBA::string_dup( it->first.c_str() );
256     aSizeMap->size = it->second;
257     result[i] = aSizeMap;
258   }
259   return result._retn();
260 }
261
262 void HexoticPlugin_Hypothesis_i::SetSizeMapEntry ( const char* theEntry, CORBA::Double theSize )
263 {
264 //   MESSAGE("HexoticPlugin_Hypothesis_i::SetSizeMapEntry");
265   bool valueChanged = this->GetImpl()->AddSizeMap(theEntry, theSize);
266   if (valueChanged)
267     SMESH::TPythonDump() << _this() << ".SetSizeMap( "<< theEntry << ", " << theSize << " )";
268 }
269
270 void HexoticPlugin_Hypothesis_i::UnsetSizeMapEntry ( const char* theEntry )
271 {
272 //   MESSAGE("HexoticPlugin_Hypothesis_i::UnsetSizeMapEntry");
273   bool entryRemoved = this->GetImpl()->UnsetSizeMap(theEntry);
274   if (entryRemoved)
275     SMESH::TPythonDump() << _this() << ".UnsetSizeMap( "<< theEntry << " )";
276 }
277
278 void HexoticPlugin_Hypothesis_i::SetSizeMap (const GEOM::GEOM_Object_ptr theGeomObj, const double theSize)
279 {
280 //   MESSAGE("HexoticPlugin_Hypothesis_i::SetSizeMap");
281   ASSERT(myBaseImpl);
282   std::string entry = theGeomObj->GetStudyEntry();
283   SetSizeMapEntry( entry.c_str(), theSize);
284 }
285
286 void HexoticPlugin_Hypothesis_i::UnsetSizeMap (const GEOM::GEOM_Object_ptr theGeomObj)
287 {
288 //   MESSAGE("HexoticPlugin_Hypothesis_i::UnsetSizeMap");
289   ASSERT(myBaseImpl);
290   std::string entry = theGeomObj->GetStudyEntry();
291   UnsetSizeMapEntry( entry.c_str());
292 }
293
294 void HexoticPlugin_Hypothesis_i::SetNbLayers(CORBA::Long theVal)
295 {
296   // MESSAGE("HexoticPlugin_Hypothesis_i::SetNbLayers");
297   ASSERT(myBaseImpl);
298   CORBA::Long oldValue = GetNbLayers();
299   this->GetImpl()->SetNbLayers(theVal);
300   if (theVal != oldValue)
301     SMESH::TPythonDump() << _this() << ".SetNbLayers( " << theVal << " )";
302 }
303
304 void HexoticPlugin_Hypothesis_i::SetFirstLayerSize(CORBA::Double theVal)
305 {
306   // MESSAGE("HexoticPlugin_Hypothesis_i::SetFirstLayerSize");
307   ASSERT(myBaseImpl);
308   CORBA::Double oldValue = GetFirstLayerSize();
309   this->GetImpl()->SetFirstLayerSize(theVal);
310   if (theVal != oldValue)
311     SMESH::TPythonDump() << _this() << ".SetFirstLayerSize( " << theVal << " )";
312 }
313
314 void HexoticPlugin_Hypothesis_i::SetDirection(CORBA::Boolean theVal)
315 {
316   // MESSAGE("HexoticPlugin_Hypothesis_i::SetDirection");
317   ASSERT(myBaseImpl);
318   CORBA::Boolean oldValue = GetDirection();
319   this->GetImpl()->SetDirection(theVal);
320   if (theVal != oldValue)
321     SMESH::TPythonDump() << _this() << ".SetDirection( " << theVal << " )";
322 }
323
324 void HexoticPlugin_Hypothesis_i::SetGrowth(CORBA::Double theVal)
325 {
326   // MESSAGE("HexoticPlugin_Hypothesis_i::SetGrowth");
327   ASSERT(myBaseImpl);
328   CORBA::Double oldValue = GetGrowth();
329   this->GetImpl()->SetGrowth(theVal);
330   if (theVal != oldValue)
331     SMESH::TPythonDump() << _this() << ".SetGrowth( " << theVal << " )";
332 }
333
334 void HexoticPlugin_Hypothesis_i::SetFacesWithLayers(const ::SMESH::long_array& theVal)
335 {
336   // MESSAGE("HexoticPlugin_Hypothesis_i::SetFacesWithLayers");
337   std::vector<int> ids( theVal.length() );
338   for ( unsigned i = 0; i < ids.size(); ++i )
339    ids[i] = theVal[i];
340
341   bool valueChanged = this->GetImpl()->SetFacesWithLayers(ids);
342   if (valueChanged)
343     SMESH::TPythonDump() << _this() << ".SetFacesWithLayers( "<< theVal << " )";
344 }
345
346 void HexoticPlugin_Hypothesis_i::SetImprintedFaces(const ::SMESH::long_array& theVal)
347 {
348   // MESSAGE("HexoticPlugin_Hypothesis_i::SetImprintedFaces");
349   std::vector<int> ids( theVal.length() );
350   for ( unsigned i = 0; i < ids.size(); ++i )
351    ids[i] = theVal[i];
352
353   bool valueChanged = this->GetImpl()->SetImprintedFaces(ids);
354   if (valueChanged)
355     SMESH::TPythonDump() << _this() << ".SetImprintedFaces( "<< theVal << " )";
356 }
357
358 //=============================================================================
359 /*!
360  *  HexoticPlugin_Hypothesis_i::GetHexesMinLevel
361  *  HexoticPlugin_Hypothesis_i::GetHexesMaxLevel
362  *  HexoticPlugin_Hypothesis_i::GetMinSize
363  *  HexoticPlugin_Hypothesis_i::GetMaxSize
364  *  HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges
365  *  HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements
366  *  HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold 
367  *  HexoticPlugin_Hypothesis_i::GetHexoticNbProc 
368  *  HexoticPlugin_Hypothesis_i::GetHexoticWorkingDirectory 
369  *  HexoticPlugin_Hypothesis_i::GetHexoticSdMode
370  *  HexoticPlugin_Hypothesis_i::GetVerbosity
371  *  HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory
372  *  HexoticPlugin_Hypothesis_i::GetTextOptions
373  *  HexoticPlugin_Hypothesis_i::GetNbLayers
374  *  HexoticPlugin_Hypothesis_i::GetFirstLayerSize
375  *  HexoticPlugin_Hypothesis_i::GetDirection
376  *  HexoticPlugin_Hypothesis_i::GetGrowth
377  *  HexoticPlugin_Hypothesis_i::GetFacesWithLayers
378  *  HexoticPlugin_Hypothesis_i::GetImprintedFaces
379  */
380 //=============================================================================
381
382 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMinLevel()
383 {
384   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMinLevel");
385   ASSERT(myBaseImpl);
386   return this->GetImpl()->GetHexesMinLevel();
387 }
388
389 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMaxLevel()
390 {
391   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMaxLevel");
392   ASSERT(myBaseImpl);
393   return this->GetImpl()->GetHexesMaxLevel();
394 }
395
396 CORBA::Double HexoticPlugin_Hypothesis_i::GetMinSize()
397 {
398   // MESSAGE("HexoticPlugin_Hypothesis_i::GetMinSize");
399   ASSERT(myBaseImpl);
400   return this->GetImpl()->GetMinSize();
401 }
402
403 CORBA::Double HexoticPlugin_Hypothesis_i::GetMaxSize()
404 {
405   // MESSAGE("HexoticPlugin_Hypothesis_i::GetMaxSize");
406   ASSERT(myBaseImpl);
407   return this->GetImpl()->GetMaxSize();
408 }
409
410 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges()
411 {
412   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges");
413   ASSERT(myBaseImpl);
414   return this->GetImpl()->GetHexoticIgnoreRidges();
415 }
416
417 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements()
418 {
419   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements");
420   ASSERT(myBaseImpl);
421   return this->GetImpl()->GetHexoticInvalidElements();
422 }
423
424 CORBA::Double HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold()
425 {
426   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold");
427   ASSERT(myBaseImpl);
428   return this->GetImpl()->GetHexoticSharpAngleThreshold();
429 }
430
431 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticNbProc()
432 {
433   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticNbProc");
434   ASSERT(myBaseImpl);
435   return this->GetImpl()->GetHexoticNbProc();
436 }
437
438 char* HexoticPlugin_Hypothesis_i::GetHexoticWorkingDirectory()
439 {
440   ASSERT(myBaseImpl);
441   return CORBA::string_dup( this->GetImpl()->GetHexoticWorkingDirectory().c_str() );
442 }
443
444 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticSdMode ()
445 {
446   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticSdMode");
447   ASSERT(myBaseImpl);
448   return this->GetImpl()->GetHexoticSdMode();
449 }
450
451 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticVerbosity()
452 {
453   // MESSAGE("HexoticPlugin_Hypothesis_i::GetVerbosity");
454   ASSERT(myBaseImpl);
455   return this->GetImpl()->GetHexoticVerbosity();
456 }
457
458 CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory()
459 {
460   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory");
461   ASSERT(myBaseImpl);
462   return this->GetImpl()->GetHexoticMaxMemory();
463 }
464
465 char* HexoticPlugin_Hypothesis_i::GetAdvancedOption()
466 {
467   // MESSAGE("HexoticPlugin_Hypothesis_i::GetAdvancedOption");
468   ASSERT(myBaseImpl);
469   return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
470 }
471 char* HexoticPlugin_Hypothesis_i::GetTextOptions()
472 {
473   // MESSAGE("HexoticPlugin_Hypothesis_i::GetTextOptions");
474   ASSERT(myBaseImpl);
475   return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
476 }
477
478 CORBA::Long HexoticPlugin_Hypothesis_i::GetNbLayers()
479 {
480   // MESSAGE("HexoticPlugin_Hypothesis_i::GetNbLayers");
481   ASSERT(myBaseImpl);
482   return this->GetImpl()->GetNbLayers();
483 }
484
485 CORBA::Double HexoticPlugin_Hypothesis_i::GetFirstLayerSize()
486 {
487   // MESSAGE("HexoticPlugin_Hypothesis_i::GetFirstLayerSize");
488   ASSERT(myBaseImpl);
489   return this->GetImpl()->GetFirstLayerSize();
490 }
491
492 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetDirection()
493 {
494   // MESSAGE("HexoticPlugin_Hypothesis_i::GetDirection");
495   ASSERT(myBaseImpl);
496   return this->GetImpl()->GetDirection();
497 }
498
499 CORBA::Double HexoticPlugin_Hypothesis_i::GetGrowth()
500 {
501   // MESSAGE("HexoticPlugin_Hypothesis_i::GetGrowth");
502   ASSERT(myBaseImpl);
503   return this->GetImpl()->GetGrowth();
504 }
505
506 SMESH::long_array* HexoticPlugin_Hypothesis_i::GetFacesWithLayers()
507 {
508   // MESSAGE("HexoticPlugin_Hypothesis_i::GetFacesWithLayers");
509   ASSERT(myBaseImpl);
510   std::vector<int> idsVec = this->GetImpl()->GetFacesWithLayers();
511   SMESH::long_array_var ids = new SMESH::long_array;
512   ids->length( idsVec.size() );
513   for ( unsigned i = 0; i < idsVec.size(); ++i )
514     ids[i] = idsVec[i];
515   return ids._retn();
516 }
517
518 SMESH::long_array* HexoticPlugin_Hypothesis_i::GetImprintedFaces()
519 {
520   // MESSAGE("HexoticPlugin_Hypothesis_i::GetImprintedFaces");
521   ASSERT(myBaseImpl);
522   std::vector<int> idsVec = this->GetImpl()->GetImprintedFaces();
523   SMESH::long_array_var ids = new SMESH::long_array;
524   ids->length( idsVec.size() );
525   for ( unsigned i = 0; i < idsVec.size(); ++i )
526     ids[i] = idsVec[i];
527   return ids._retn();
528 }
529 //=============================================================================
530 /*!
531  *  HexoticPlugin_Hypothesis_i::GetImpl
532  *
533  *  Get implementation
534  */
535 //=============================================================================
536 ::HexoticPlugin_Hypothesis* HexoticPlugin_Hypothesis_i::GetImpl()
537 {
538   // MESSAGE("HexoticPlugin_Hypothesis_i::GetImpl");
539   return (::HexoticPlugin_Hypothesis*)myBaseImpl;
540 }
541
542 //================================================================================
543 /*!
544  * \brief Verify whether hypothesis supports given entity type 
545   * \param type - dimension (see SMESH::Dimension enumeration)
546   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
547  * 
548  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
549  */
550 //================================================================================  
551 CORBA::Boolean HexoticPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
552 {
553   return type == SMESH::DIM_3D;
554 }