Salome HOME
4cc83d14692d95d16334f23bd98b89adc2ba535e
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
1 //  Copyright (C) 2007-2011  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.
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    : BLSURFPlugin_Hypothesis.cxx
22 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
23 //           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
24 // ---
25 //
26 #include "BLSURFPlugin_Hypothesis_i.hxx"
27 #include "SMESH_Gen.hxx"
28 #include "SMESH_PythonDump.hxx"
29 #include "GEOM_Object.hxx"
30
31 #include "Utils_CorbaException.hxx"
32 #include "utilities.h"
33
34 #include <stdexcept>
35 #include <cstring>
36 #include "boost/regex.hpp"
37
38 //=============================================================================
39 /*!
40  *  BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
41  *
42  *  Constructor
43  */
44 //=============================================================================
45 BLSURFPlugin_Hypothesis_i::
46 BLSURFPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
47                            int                     theStudyId,
48                            ::SMESH_Gen*            theGenImpl)
49   : SALOME::GenericObj_i( thePOA ), 
50     SMESH_Hypothesis_i( thePOA )
51 {
52   MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
53   myBaseImpl = new ::BLSURFPlugin_Hypothesis (theGenImpl->GetANewId(),
54                                               theStudyId,
55                                               theGenImpl);
56 }
57
58 //=============================================================================
59 /*!
60  *  BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
61  *
62  *  Destructor
63  */
64 //=============================================================================
65 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
66 {
67   MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
68 }
69
70 /*!
71  *  BLSURFPlugin_Hypothesis_i::SetTopology
72  *
73  *  Set topology
74  */
75
76 //=============================================================================
77 void BLSURFPlugin_Hypothesis_i::SetTopology (CORBA::Long theValue)
78 {
79   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
80   ASSERT(myBaseImpl);
81   this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology)theValue);
82   SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
83 }
84
85 //=============================================================================
86 /*!
87  *  BLSURFPlugin_Hypothesis_i::GetTopology
88  *
89  *  Get Topology
90  */
91 //=============================================================================
92 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology()
93 {
94   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
95   ASSERT(myBaseImpl);
96   return this->GetImpl()->GetTopology();
97 }
98
99 //=============================================================================
100
101 //=============================================================================
102 /*!
103  *  BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
104  *
105  *  Set PhysicalMesh
106  */
107
108 //=============================================================================
109 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh (CORBA::Long theValue)
110 {
111   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
112   ASSERT(myBaseImpl);
113   this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh)theValue);
114   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
115 }
116
117 //=============================================================================
118 /*!
119  *  BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
120  *
121  *  Get PhysicalMesh
122  */
123 //=============================================================================
124 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
125 {
126   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
127   ASSERT(myBaseImpl);
128   return this->GetImpl()->GetPhysicalMesh();
129 }
130
131 //=============================================================================
132 /*!
133  *  BLSURFPlugin_Hypothesis_i::SetPhySize
134  *
135  *  Set PhySize
136  */
137 //=============================================================================
138 void BLSURFPlugin_Hypothesis_i::SetPhySize (CORBA::Double theValue)
139 {
140   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
141   ASSERT(myBaseImpl);
142   this->GetImpl()->SetPhySize(theValue);
143   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
144 }
145
146 //=============================================================================
147 /*!
148  *  BLSURFPlugin_Hypothesis_i::GetPhySize
149  *
150  *  Get PhySize
151  */
152 //=============================================================================
153 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize()
154 {
155   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
156   ASSERT(myBaseImpl);
157   return this->GetImpl()->GetPhySize();
158 }
159
160 //=============================================================================
161 void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize)
162 {
163   ASSERT(myBaseImpl);
164   if ( GetPhyMin() != theMinSize ) {
165     this->GetImpl()->SetPhyMin(theMinSize);
166     SMESH::TPythonDump() << _this() << ".SetPhyMin( " << theMinSize << " )";
167   }
168 }
169
170 //=============================================================================
171 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin()
172 {
173   ASSERT(myBaseImpl);
174   return this->GetImpl()->GetPhyMin();
175 }
176
177
178 //=============================================================================
179 void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize)
180 {
181   ASSERT(myBaseImpl);
182   if ( GetPhyMax() != theMaxSize ) {
183     this->GetImpl()->SetPhyMax(theMaxSize);
184     SMESH::TPythonDump() << _this() << ".SetPhyMax( " << theMaxSize << " )";
185   }
186 }
187
188 //=============================================================================
189 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax()
190 {
191   ASSERT(myBaseImpl);
192   return this->GetImpl()->GetPhyMax();
193 }
194
195
196 //=============================================================================
197 /*!
198  *  BLSURFPlugin_Hypothesis_i::SetGeometricMesh
199  *
200  *  Set GeometricMesh
201  */
202
203 //=============================================================================
204 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh (CORBA::Long theValue)
205 {
206   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
207   ASSERT(myBaseImpl);
208   this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh)theValue);
209   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
210 }
211
212 //=============================================================================
213 /*!
214  *  BLSURFPlugin_Hypothesis_i::GetGeometricMesh
215  *
216  *  Get GeometricMesh
217  */
218 //=============================================================================
219 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
220 {
221   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
222   ASSERT(myBaseImpl);
223   return this->GetImpl()->GetGeometricMesh();
224 }
225
226 //=============================================================================
227 /*!
228  *  BLSURFPlugin_Hypothesis_i::SetAngleMeshS
229  *
230  *  Set AngleMeshS
231  */
232 //=============================================================================
233 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS (CORBA::Double theValue)
234 {
235   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMeshS");
236   ASSERT(myBaseImpl);
237   this->GetImpl()->SetAngleMeshS(theValue);
238   SMESH::TPythonDump() << _this() << ".SetAngleMeshS( " << theValue << " )";
239 }
240
241 //=============================================================================
242 /*!
243  *  BLSURFPlugin_Hypothesis_i::GetAngleMeshS
244  *
245  *  Get AngleMeshS
246  */
247 //=============================================================================
248 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS()
249 {
250   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMeshS");
251   ASSERT(myBaseImpl);
252   return this->GetImpl()->GetAngleMeshS();
253 }
254
255 //=============================================================================
256 void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double angle)
257 {
258   ASSERT(myBaseImpl);
259   this->GetImpl()->SetAngleMeshC(angle);
260   SMESH::TPythonDump() << _this() << ".SetAngleMeshC( " << angle << " )";
261 }
262
263 //=============================================================================
264 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC()
265 {
266   ASSERT(myBaseImpl);
267   return this->GetImpl()->GetAngleMeshC();
268 }
269
270 //=============================================================================
271 void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize)
272 {
273   ASSERT(myBaseImpl);
274   if ( GetGeoMin() != theMinSize ) {
275     this->GetImpl()->SetGeoMin(theMinSize);
276     SMESH::TPythonDump() << _this() << ".SetGeoMin( " << theMinSize << " )";
277   }
278 }
279
280 //=============================================================================
281 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin()
282 {
283   ASSERT(myBaseImpl);
284   return this->GetImpl()->GetGeoMin();
285 }
286
287 //=============================================================================
288 void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize)
289 {
290   ASSERT(myBaseImpl);
291   if ( GetGeoMax() != theMaxSize ) {
292     this->GetImpl()->SetGeoMax(theMaxSize);
293     SMESH::TPythonDump() << _this() << ".SetGeoMax( " << theMaxSize << " )";
294   }
295 }
296
297 //=============================================================================
298 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax()
299 {
300   ASSERT(myBaseImpl);
301   return this->GetImpl()->GetGeoMax();
302 }
303
304 //=============================================================================
305 /*!
306  *  BLSURFPlugin_Hypothesis_i::SetGradation
307  *
308  *  Set Gradation
309  */
310 //=============================================================================
311 void BLSURFPlugin_Hypothesis_i::SetGradation (CORBA::Double theValue)
312 {
313   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
314   ASSERT(myBaseImpl);
315   this->GetImpl()->SetGradation(theValue);
316   SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
317 }
318
319 //=============================================================================
320 /*!
321  *  BLSURFPlugin_Hypothesis_i::GetGradation
322  *
323  *  Get Gradation
324  */
325 //=============================================================================
326 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
327 {
328   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
329   ASSERT(myBaseImpl);
330   return this->GetImpl()->GetGradation();
331 }
332
333 //=============================================================================
334 /*!
335  *  BLSURFPlugin_Hypothesis_i::SetQuadAllowed
336  *
337  *  Set true or false
338  */
339 //=============================================================================
340 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed (CORBA::Boolean theValue)
341 {
342   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
343   ASSERT(myBaseImpl);
344   this->GetImpl()->SetQuadAllowed(theValue);
345   SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValue << " )";
346 }
347
348 //=============================================================================
349 /*!
350  *  BLSURFPlugin_Hypothesis_i::GetQuadAllowed
351  *
352  *  Get true or false
353  */
354 //=============================================================================
355 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
356 {
357   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
358   ASSERT(myBaseImpl);
359   return this->GetImpl()->GetQuadAllowed();
360 }
361
362 //=============================================================================
363 /*!
364  *  BLSURFPlugin_Hypothesis_i::SetDecimesh
365  *
366  *  Set true or false
367  */
368 //=============================================================================
369 void BLSURFPlugin_Hypothesis_i::SetDecimesh (CORBA::Boolean theValue)
370 {
371   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetDecimesh");
372   ASSERT(myBaseImpl);
373   this->GetImpl()->SetDecimesh(theValue);
374   SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValue << " )";
375 }
376
377 //=============================================================================
378 /*!
379  *  BLSURFPlugin_Hypothesis_i::GetDecimesh
380  *
381  *  Get true or false
382  */
383 //=============================================================================
384 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh()
385 {
386   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetDecimesh");
387   ASSERT(myBaseImpl);
388   return this->GetImpl()->GetDecimesh();
389 }
390
391 //=============================================================================
392 void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal)
393   throw (SALOME::SALOME_Exception)
394 {
395   ASSERT(myBaseImpl);
396   if ( theVal < 0 || theVal > 100 )
397     THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
398   this->GetImpl()->SetVerbosity(theVal);
399   SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
400 }
401
402 //=============================================================================
403
404 CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity()
405 {
406   ASSERT(myBaseImpl);
407   return (CORBA::Short) this->GetImpl()->GetVerbosity();
408 }
409
410 //=============================================================================
411
412 void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName,
413                                                const char* optionValue)
414   throw (SALOME::SALOME_Exception)
415 {
416   ASSERT(myBaseImpl);
417   bool valueChanged = false;
418   try {
419     valueChanged = ( this->GetImpl()->GetOptionValue(optionName) != optionValue );
420     if ( valueChanged )
421       this->GetImpl()->SetOptionValue(optionName, optionValue);
422   }
423   catch (const std::invalid_argument& ex) {
424     SALOME::ExceptionStruct ExDescription;
425     ExDescription.text = ex.what();
426     ExDescription.type = SALOME::BAD_PARAM;
427     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetOptionValue(name,value)";
428     ExDescription.lineNumber = 0;
429     throw SALOME::SALOME_Exception(ExDescription);
430   }
431   catch (SALOME_Exception& ex) {
432     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
433   }
434   if ( valueChanged )
435     SMESH::TPythonDump() << _this() << ".SetOptionValue( '"
436                          << optionName << "', '" << optionValue << "' )";
437 }
438
439 //=============================================================================
440
441 char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName)
442   throw (SALOME::SALOME_Exception)
443 {
444   ASSERT(myBaseImpl);
445   try {
446     return CORBA::string_dup( this->GetImpl()->GetOptionValue(optionName).c_str() );
447   }
448   catch (const std::invalid_argument& ex) {
449     SALOME::ExceptionStruct ExDescription;
450     ExDescription.text = ex.what();
451     ExDescription.type = SALOME::BAD_PARAM;
452     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetOptionValue(name)";
453     ExDescription.lineNumber = 0;
454     throw SALOME::SALOME_Exception(ExDescription);
455   }
456   catch (SALOME_Exception& ex) {
457     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
458   }
459   return 0;
460 }
461
462 //=============================================================================
463
464 void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName)
465 {
466   ASSERT(myBaseImpl);
467   this->GetImpl()->ClearOption(optionName);
468   SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
469 }
470
471 //=============================================================================
472
473 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues()
474 {
475   ASSERT(myBaseImpl);
476   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
477
478   const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues();
479   result->length( opts.size() );
480
481   ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
482   for ( int i = 0 ; opIt != opts.end(); ++opIt, ++i ) {
483     string name_value = opIt->first;
484     if ( !opIt->second.empty() ) {
485       name_value += ":";
486       name_value += opIt->second;
487     }
488     result[i] = CORBA::string_dup(name_value.c_str());
489   }
490   return result._retn();
491 }
492
493 //=============================================================================
494
495 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
496   throw (SALOME::SALOME_Exception)
497 {
498   ASSERT(myBaseImpl);
499   for (int i = 0; i < options.length(); ++i)
500   {
501     string name_value = options[i].in();
502     int colonPos = name_value.find( ':' );
503     string name, value;
504     if ( colonPos == string::npos ) // ':' not found
505       name = name_value;
506     else {
507       name = name_value.substr( 0, colonPos);
508       if ( colonPos < name_value.size()-1 && name_value[colonPos] != ' ')
509         value = name_value.substr( colonPos+1 );
510     }
511     SetOptionValue( name.c_str(), value.c_str() );
512   }
513 }
514
515 //=============================================================================
516
517 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry,const char* sizeMap)
518   throw (SALOME::SALOME_Exception)
519 {
520   ASSERT(myBaseImpl);
521   MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry); 
522   bool valueChanged = false;
523   try {
524     valueChanged = ( this->GetImpl()->GetSizeMapEntry(entry) != sizeMap );
525     if ( valueChanged )
526       this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
527   }
528   catch (const std::invalid_argument& ex) {
529     SALOME::ExceptionStruct ExDescription;
530     ExDescription.text = ex.what();
531     ExDescription.type = SALOME::BAD_PARAM;
532     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
533     ExDescription.lineNumber = 0;
534     throw SALOME::SALOME_Exception(ExDescription);
535   }
536   catch (SALOME_Exception& ex) {
537     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
538   }
539   MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
540   if ( valueChanged )
541     SMESH::TPythonDump() << _this() << ".SetSizeMap("
542                          << entry << ", '" << sizeMap << "' )";
543 }
544
545 //=============================================================================
546
547 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry,const char* attractor )
548   throw (SALOME::SALOME_Exception)
549 {
550   ASSERT(myBaseImpl);
551   MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
552   bool valueChanged = false;
553   try {
554     valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
555     if ( valueChanged ) {
556       boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)\\)$");
557       if (!boost::regex_match(string(attractor), re))
558         throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False)");
559       this->GetImpl()->SetAttractorEntry(entry, attractor);
560     }
561   }
562   catch (const std::invalid_argument& ex) {
563     SALOME::ExceptionStruct ExDescription;
564     ExDescription.text = ex.what();
565     ExDescription.type = SALOME::BAD_PARAM;
566     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
567     ExDescription.lineNumber = 0;
568     throw SALOME::SALOME_Exception(ExDescription);
569   }
570   catch (SALOME_Exception& ex) {
571     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
572   }
573   MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
574   if ( valueChanged )
575     SMESH::TPythonDump() << _this() << ".SetAttractor("
576                          << entry << ", '" << attractor << "' )";
577 }
578
579
580 //=============================================================================
581
582 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) 
583   throw (SALOME::SALOME_Exception)
584 {
585   ASSERT(myBaseImpl);
586   try {
587     return CORBA::string_dup( this->GetImpl()->GetSizeMapEntry(entry).c_str());
588   }
589   catch (const std::invalid_argument& ex) {
590     SALOME::ExceptionStruct ExDescription;
591     ExDescription.text = ex.what();
592     ExDescription.type = SALOME::BAD_PARAM;
593     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
594     ExDescription.lineNumber = 0;
595     throw SALOME::SALOME_Exception(ExDescription);
596   }
597   catch (SALOME_Exception& ex) {
598     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
599   }
600   return 0;
601 }
602
603 //=============================================================================
604
605 char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry)
606   throw (SALOME::SALOME_Exception)
607 {
608   ASSERT(myBaseImpl);
609   try {
610     return CORBA::string_dup( this->GetImpl()->GetAttractorEntry(entry).c_str());
611   }
612   catch (const std::invalid_argument& ex) {
613     SALOME::ExceptionStruct ExDescription;
614     ExDescription.text = ex.what();
615     ExDescription.type = SALOME::BAD_PARAM;
616     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
617     ExDescription.lineNumber = 0;
618     throw SALOME::SALOME_Exception(ExDescription);
619   }
620   catch (SALOME_Exception& ex) {
621     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
622   }
623   return 0;
624 }
625
626 //=============================================================================
627
628 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry)
629 {
630   ASSERT(myBaseImpl); 
631   this->GetImpl()->ClearEntry(entry);
632 //  SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
633 }
634
635 //=============================================================================
636
637 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries()
638 {
639   ASSERT(myBaseImpl);
640   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
641
642   const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps= this->GetImpl()->_GetSizeMapEntries();
643   result->length( sizeMaps.size() );
644
645   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
646   for ( int i = 0 ; smIt != sizeMaps.end(); ++smIt, ++i ) {
647     string entry_sizemap = smIt->first;
648     if ( !smIt->second.empty() ) {
649       entry_sizemap += "|";
650       entry_sizemap += smIt->second;
651     }
652     result[i] = CORBA::string_dup(entry_sizemap.c_str());
653   }
654   return result._retn();
655 }
656
657 //=============================================================================
658
659 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries()
660 {
661   ASSERT(myBaseImpl);
662   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
663
664   const ::BLSURFPlugin_Hypothesis::TSizeMap attractors= this->GetImpl()->_GetAttractorEntries();
665   result->length( attractors.size() );
666
667   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
668   for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
669     string entry_attractor = atIt->first;
670     if ( !atIt->second.empty() ) {
671       entry_attractor += "|";
672       entry_attractor += atIt->second;
673     }
674     result[i] = CORBA::string_dup(entry_attractor.c_str());
675   }
676   return result._retn();
677 }
678
679 //=============================================================================
680
681 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
682   throw (SALOME::SALOME_Exception)
683 {
684   ASSERT(myBaseImpl);
685   for (int i = 0; i < sizeMaps.length(); ++i)
686   {
687     string entry_sizemap = sizeMaps[i].in();
688     int colonPos = entry_sizemap.find( '|' );
689     string entry, sizemap;
690     if ( colonPos == string::npos ) // '|' separator not found
691       entry = entry_sizemap;
692     else {
693       entry = entry_sizemap.substr( 0, colonPos);
694       if ( colonPos < entry_sizemap.size()-1 && entry_sizemap[colonPos] != ' ')
695         sizemap = entry_sizemap.substr( colonPos+1 );
696     }
697     this->GetImpl()->SetSizeMapEntry( entry.c_str(), sizemap.c_str() );
698   }
699 }
700
701 //=============================================================================
702
703 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps()
704 {
705   ASSERT(myBaseImpl);
706   this->GetImpl()->ClearSizeMaps();
707 }
708
709
710 //=============================================================================
711
712 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj,const char* sizeMap)
713 {
714   ASSERT(myBaseImpl);
715   string entry;
716   entry=GeomObj->GetStudyEntry();
717   MESSAGE("IDL : GetName : " << GeomObj->GetName());
718   MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")"); 
719   SetSizeMapEntry( entry.c_str(),sizeMap);
720 }
721   
722 //=============================================================================
723 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj)
724 {
725   ASSERT(myBaseImpl);
726   string entry;
727   entry=GeomObj->GetStudyEntry();
728   MESSAGE("IDL : GetName : " << GeomObj->GetName());
729   MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
730   UnsetEntry( entry.c_str());
731   SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
732 }
733
734
735 void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor)
736 {
737   ASSERT(myBaseImpl);
738   string entry;
739   entry=GeomObj->GetStudyEntry();
740   MESSAGE("IDL : GetName : " << GeomObj->GetName());
741   MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
742   SetAttractorEntry( entry.c_str(),attractor);
743 }
744
745 void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj)
746 {
747   ASSERT(myBaseImpl);
748   string entry;
749   entry=GeomObj->GetStudyEntry();
750   MESSAGE("IDL : GetName : " << GeomObj->GetName());
751   MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
752   UnsetEntry( entry.c_str());
753   SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
754 }
755
756
757
758
759 /*
760 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
761 {}
762
763 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
764 {}
765
766 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
767 {}
768
769 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
770 {}
771
772 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
773 {
774   ASSERT(myBaseImpl);
775   this->GetImpl()->UnsetCustomSizeMap(entry);
776   SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
777 }
778
779
780 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
781 {}
782
783 */
784
785
786 ///////////////////////
787 // ENFORCED VERTEXES //
788 ///////////////////////
789
790 BLSURFPlugin::TEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices()
791 {
792   MESSAGE("IDL: GetAllEnforcedVertices()");
793   ASSERT(myBaseImpl);
794   BLSURFPlugin::TEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TEntryEnfVertexListMap();
795   const ::BLSURFPlugin_Hypothesis::TEntryEnfVertexListMap entryEnfVertexListMap = this->GetImpl()->_GetAllEnforcedVertices();
796   resultMap->length(entryEnfVertexListMap.size());
797   MESSAGE("Enforced Vertex map size is " << entryEnfVertexListMap.size());
798
799   ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList;
800   ::BLSURFPlugin_Hypothesis::TEntryEnfVertexListMap::const_iterator evmIt = entryEnfVertexListMap.begin();
801   for ( int i = 0 ; evmIt != entryEnfVertexListMap.end(); ++evmIt, ++i ) {
802     std::string entry = evmIt->first;
803     MESSAGE("Entry: " << entry);
804     enfVertexList = evmIt->second;
805
806     BLSURFPlugin::TEntryEnfVertexListMapElement_var mapElement = new BLSURFPlugin::TEntryEnfVertexListMapElement();
807
808     BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
809     vertexList->length(enfVertexList.size());
810     MESSAGE("Number of enforced vertices: " << enfVertexList.size());
811
812     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
813     for ( int j = 0 ; evlIt != enfVertexList.end(); ++evlIt, ++j ) {
814       MESSAGE("Enforced Vertex #" << j);
815       BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
816       enfVertex->length(3);
817       enfVertex[0] = (*evlIt)[0];
818       enfVertex[1] = (*evlIt)[1];
819       enfVertex[2] = (*evlIt)[2];
820       vertexList[j] = enfVertex;
821       MESSAGE("Enforced vertex: " << enfVertex[0] << ", " << enfVertex[1] << ", " << enfVertex[2]);
822     }
823
824     mapElement->entry = CORBA::string_dup(entry.c_str());
825     mapElement->vertexList = vertexList;
826
827     resultMap[i] = mapElement;
828
829   }
830   return resultMap._retn();
831 }
832
833 void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices()
834 {
835   ASSERT(myBaseImpl);
836   this->GetImpl()->ClearAllEnforcedVertices();
837   SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
838 }
839
840 /*!
841   * Set/get/unset an enforced vertex on geom object
842   */
843 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double x, CORBA::Double y, CORBA::Double z)
844   throw (SALOME::SALOME_Exception)
845 {
846   ASSERT(myBaseImpl);
847   // TODO check that GeomObj is a face => in engine ?
848   // TODO Affecter un nom de groupe vide
849   string entry = GeomObj->GetStudyEntry();
850   MESSAGE("IDL : GetName : " << GeomObj->GetName());
851   MESSAGE("IDL : SetEnforcedVertex ( "<< entry << ", " << x << ", " << y << ", " << z << ")");
852   try {
853     SetEnforcedVertexEntry(entry.c_str(), x, y, z);
854   }
855   catch (SALOME_Exception& ex) {
856     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
857   }
858 }
859
860 /*!
861   * Set/get/unset an enforced vertex on geom object with group name
862   */
863 /* TODO GROUPS
864 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr GeomObj,
865                   CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
866   throw (SALOME::SALOME_Exception)
867 {
868   ASSERT(myBaseImpl);
869   // TODO check that GeomObj is a face => in engine ?
870   string entry = GeomObj->GetStudyEntry();
871   MESSAGE("IDL : GetName : " << GeomObj->GetName());
872   MESSAGE("IDL : SetEnforcedVertexWithGroup ( "<< entry << ", " << x << ", " << y << ", " << z << ", " << groupName <<")");
873   try {
874     SetEnforcedVertexEntryWithGroup(entry.c_str(), x, y, z, groupName);
875   }
876   catch (SALOME_Exception& ex) {
877     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
878   }
879 }
880 */
881 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr GeomObj)
882   throw (SALOME::SALOME_Exception)
883 {
884   ASSERT(myBaseImpl);
885   string entry = GeomObj->GetStudyEntry();
886   MESSAGE("IDL : GetName : " << GeomObj->GetName());
887   MESSAGE("IDL : GetEnforcedVertexList ( "<< entry << ")");
888   try {
889     return GetEnforcedVerticesEntry(entry.c_str());
890   }
891   catch (SALOME_Exception& ex) {
892     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
893   }
894 }
895
896
897 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double x, CORBA::Double y, CORBA::Double z)
898   throw (SALOME::SALOME_Exception)
899 {
900   ASSERT(myBaseImpl);
901   string entry = GeomObj->GetStudyEntry();
902   MESSAGE("IDL : GetName : " << GeomObj->GetName());
903   MESSAGE("IDL : UnsetEnforcedVertex ( "<< entry << ", " << x << ", " << y << ", " << z << ")");
904
905   try {
906     UnsetEnforcedVertexEntry(entry.c_str(), x, y, z);
907   }
908   catch (SALOME_Exception& ex) {
909     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
910   }
911 }
912
913
914 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr GeomObj)
915   throw (SALOME::SALOME_Exception)
916 {
917   ASSERT(myBaseImpl);;
918   string entry = GeomObj->GetStudyEntry();
919   MESSAGE("IDL : GetName : " << GeomObj->GetName());
920   MESSAGE("IDL : UnsetEnforcedVertices ( "<< entry << ")");
921
922   try {
923     UnsetEnforcedVerticesEntry(entry.c_str());
924   }
925   catch (SALOME_Exception& ex) {
926     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
927   }
928 }
929
930
931 /*!
932   * Set/get/unset an enforced vertex on geom object given by entry
933   */
934 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* entry, double x, double y, double z)
935   throw (SALOME::SALOME_Exception)
936 {
937   ASSERT(myBaseImpl);
938   MESSAGE("IDL : SETENFORCEDVERTEX START - ENTRY: " << entry << " VERTEX: " << x << " " << y << " " << z);
939   bool newValue = false;
940   
941   try {
942     ::BLSURFPlugin_Hypothesis::TEnfVertexList vertexList = this->GetImpl()->GetEnforcedVertices(entry);
943     ::BLSURFPlugin_Hypothesis::TEnfVertex vertex;
944     vertex.push_back(x);
945     vertex.push_back(y);
946     vertex.push_back(z);
947     if (vertexList.find(vertex) == vertexList.end()) {
948       MESSAGE("Vertex not found: add it in vertexList")
949       newValue = true;
950     }
951     else
952       MESSAGE("Vertex already found")
953   }
954   catch (const std::invalid_argument& ex) {
955     // no enforced vertex for entry
956     MESSAGE("Entry not found : add it to the list")
957     newValue = true;
958   }
959   catch (SALOME_Exception& ex) {
960     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
961   }
962   
963   if ( newValue ) {
964     this->GetImpl()->SetEnforcedVertex(entry, x, y, z);
965     SMESH::TPythonDump() << _this() << ".SetEnforcedVertex("
966                          << entry << ", "
967                          << x << ", "
968                          << y << ", "
969                          << z << ")";
970   }
971   MESSAGE("IDL : SETENFORCEDVERTEX END - ENTRY: " << entry);
972 }
973
974 /*!
975   * Set/get/unset an enforced vertex on geom object given by entry
976   */
977 /* TODO GROUPS
978 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntryWithGroup(const char* entry,
979                                  double x, double y, double z, const char* groupName)
980   throw (SALOME::SALOME_Exception)
981 {
982   ASSERT(myBaseImpl);
983   MESSAGE("IDL : SETENFORCEDVERTEXWITHGROUP START - ENTRY: " << entry << " VERTEX: "
984             << x << " " << y << " " << z << " group name: " << groupName);
985   bool newValue = false;
986   bool newGroupName = false;
987   try {
988     ::BLSURFPlugin_Hypothesis::TEnfVertexList vertexList = this->GetImpl()->GetEnforcedVertices(entry);
989     ::BLSURFPlugin_Hypothesis::TEnfVertex vertex;
990     vertex.push_back(x);
991     vertex.push_back(y);
992     vertex.push_back(z);
993     if (vertexList.find(vertex) == vertexList.end()) {
994       MESSAGE("Vertex not found: add it in vertexList");
995       newValue = true;
996     }
997     else {
998       MESSAGE("Vertex already found");
999       std::string oldGroupName = this->GetImpl()->GetEnforcedVertexGroupName(x,y,z);
1000       if (strcmp(oldGroupName.c_str(),groupName)!=0)
1001         newGroupName = true;
1002     }
1003   }
1004   catch (const std::invalid_argument& ex) {
1005     // no enforced vertex for entry
1006     MESSAGE("Entry not found : add it to the list");
1007     newValue = true;
1008   }
1009   catch (SALOME_Exception& ex) {
1010     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1011   }
1012   
1013   if ( newValue ) {
1014     this->GetImpl()->SetEnforcedVertex(entry, x, y, z, groupName);
1015     SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup("
1016                          << entry << ", "
1017                          << x << ", "
1018                          << y << ", "
1019                          << z << ", '"
1020                          << groupName << "')";
1021   }
1022   else {
1023     if (newGroupName) {
1024       this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
1025       SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
1026                           << x << ", "
1027                           << y << ", "
1028                           << z << ", '"
1029                           << groupName << "')";
1030     }
1031   }
1032   MESSAGE("IDL : SETENFORCEDVERTEXWITHGROUP END - ENTRY: " << entry);
1033 }
1034 */
1035 /*
1036 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexListEntry(const char* entry, BLSURFPlugin::TEnfVertexList& vertexList)
1037   throw (SALOME::SALOME_Exception)
1038 {
1039   ASSERT(myBaseImpl);
1040 }
1041 */
1042
1043 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
1044   throw (SALOME::SALOME_Exception)
1045 {
1046   ASSERT(myBaseImpl);
1047   MESSAGE("ENGINE : GETENFORCEDVERTICES START ENTRY : " << entry);
1048   
1049   try {
1050     BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
1051     ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnforcedVertices(entry);
1052     vertexList->length(_vList.size());
1053     MESSAGE("Number of enforced vertices: " << _vList.size());
1054     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
1055     for ( int i = 0; evlIt != _vList.end() ; ++evlIt, ++i ) {
1056       BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1057       enfVertex->length(3);
1058       MESSAGE("Enforced vertex #" << i << ": "<< (*evlIt)[0] << ", " << (*evlIt)[1] << ", " << (*evlIt)[2]);
1059       enfVertex[0] = (*evlIt)[0];
1060       enfVertex[1] = (*evlIt)[1];
1061       enfVertex[2] = (*evlIt)[2];
1062       vertexList[i] = enfVertex;
1063     }
1064     return vertexList._retn();
1065   }
1066   catch (const std::invalid_argument& ex) {
1067     SALOME::ExceptionStruct ExDescription;
1068     ExDescription.text = ex.what();
1069     ExDescription.type = SALOME::BAD_PARAM;
1070     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
1071     ExDescription.lineNumber = 1048;
1072     throw SALOME::SALOME_Exception(ExDescription);
1073   }
1074   catch(const std::exception& ex) {
1075     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1076   }
1077
1078   MESSAGE("ENGINE : GETENFORCEDVERTICES END ENTRY : " << entry);
1079 }
1080
1081
1082 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* entry, CORBA::Double x, CORBA::Double y, CORBA::Double z)
1083   throw (SALOME::SALOME_Exception)
1084 {
1085   ASSERT(myBaseImpl);
1086   MESSAGE("ENGINE : UNSETENFORCEDVERTEX START ENTRY : " << entry);
1087   
1088   try {
1089     this->GetImpl()->ClearEnforcedVertex(entry, x, y, z);
1090     SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertex("
1091                          << entry << ", "
1092                          << x << ", "
1093                          << y << ", "
1094                          << z << ")";
1095   }
1096   catch (const std::invalid_argument& ex) {
1097     SALOME::ExceptionStruct ExDescription;
1098     ExDescription.text = ex.what();
1099     ExDescription.type = SALOME::BAD_PARAM;
1100     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(entry,x,y,z)";
1101     ExDescription.lineNumber = 1086;
1102     throw SALOME::SALOME_Exception(ExDescription);
1103   }
1104   catch(const std::exception& ex) {
1105     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1106   }
1107
1108   MESSAGE("ENGINE : UNSETENFORCEDVERTEX END ENTRY : " << entry);
1109 }
1110 /*
1111 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexListEntry(const char* entry, BLSURFPlugin::TEnfVertexList& vertexList)
1112   throw (SALOME::SALOME_Exception)
1113 {
1114   ASSERT(myBaseImpl);
1115 }
1116 */
1117 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* entry)
1118   throw (SALOME::SALOME_Exception)
1119 {
1120   ASSERT(myBaseImpl);
1121   MESSAGE("ENGINE : UNSETENFORCEDVERTICES START ENTRY : " << entry);
1122   
1123   try {
1124     this->GetImpl()->ClearEnforcedVertices(entry);
1125     SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << entry << ")";
1126   }
1127   catch (const std::invalid_argument& ex) {
1128     SALOME::ExceptionStruct ExDescription;
1129     ExDescription.text = ex.what();
1130     ExDescription.type = SALOME::BAD_PARAM;
1131     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(entry)";
1132     ExDescription.lineNumber = 1121;
1133     throw SALOME::SALOME_Exception(ExDescription);
1134   }
1135   catch(const std::exception& ex) {
1136     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1137   }
1138
1139   MESSAGE("ENGINE : UNSETENFORCEDVERTICES END ENTRY : " << entry);
1140 }
1141
1142 /* TODO GROUPS
1143 char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
1144   throw (SALOME::SALOME_Exception)
1145 {
1146   ASSERT(myBaseImpl);
1147   MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
1148   try {
1149     return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
1150   }
1151   catch (const std::invalid_argument& ex) {
1152     SALOME::ExceptionStruct ExDescription;
1153     ExDescription.text = ex.what();
1154     ExDescription.type = SALOME::BAD_PARAM;
1155     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
1156     ExDescription.lineNumber = 1146;
1157     throw SALOME::SALOME_Exception(ExDescription);
1158   }
1159   catch (SALOME_Exception& ex) {
1160     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1161   }
1162   MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
1163   return 0;
1164 }
1165
1166
1167 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
1168   throw (SALOME::SALOME_Exception)
1169 {
1170   ASSERT(myBaseImpl);
1171   MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
1172   try {
1173     this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
1174   }
1175   catch (const std::invalid_argument& ex) {
1176     SALOME::ExceptionStruct ExDescription;
1177     ExDescription.text = ex.what();
1178     ExDescription.type = SALOME::BAD_PARAM;
1179     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
1180     ExDescription.lineNumber = 1170;
1181     throw SALOME::SALOME_Exception(ExDescription);
1182   }
1183   catch (SALOME_Exception& ex) {
1184     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1185   }
1186
1187   SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
1188                         << x << ", " << y << ", " << z << ", '" << groupName << "' )";
1189
1190   MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
1191 }
1192 */
1193 ///////////////////////
1194
1195
1196
1197
1198
1199 //=============================================================================
1200 /*!
1201  *  BLSURFPlugin_Hypothesis_i::GetImpl
1202  *
1203  *  Get implementation
1204  */
1205 //=============================================================================
1206 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl()
1207 {
1208   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
1209   return (::BLSURFPlugin_Hypothesis*)myBaseImpl;
1210 }
1211
1212 //================================================================================
1213 /*!
1214  * \brief Verify whether hypothesis supports given entity type 
1215   * \param type - dimension (see SMESH::Dimension enumeration)
1216   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
1217  * 
1218  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
1219  */
1220 //================================================================================  
1221 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
1222 {
1223   return type == SMESH::DIM_2D;
1224 }