Salome HOME
rnc: added a parameter for attractors on faces
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
1 //  Copyright (C) 2007-2010  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       boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$");
558       if (!boost::regex_match(string(attractor), re))
559         throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False;d(opt.))");
560       this->GetImpl()->SetAttractorEntry(entry, attractor);
561     }
562   }
563   catch (const std::invalid_argument& ex) {
564     SALOME::ExceptionStruct ExDescription;
565     ExDescription.text = ex.what();
566     ExDescription.type = SALOME::BAD_PARAM;
567     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
568     ExDescription.lineNumber = 0;
569     throw SALOME::SALOME_Exception(ExDescription);
570   }
571   catch (SALOME_Exception& ex) {
572     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
573   }
574   MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
575   if ( valueChanged )
576     SMESH::TPythonDump() << _this() << ".SetAttractor("
577                          << entry << ", '" << attractor << "' )";
578 }
579
580
581 //=============================================================================
582
583 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) 
584   throw (SALOME::SALOME_Exception)
585 {
586   ASSERT(myBaseImpl);
587   try {
588     return CORBA::string_dup( this->GetImpl()->GetSizeMapEntry(entry).c_str());
589   }
590   catch (const std::invalid_argument& ex) {
591     SALOME::ExceptionStruct ExDescription;
592     ExDescription.text = ex.what();
593     ExDescription.type = SALOME::BAD_PARAM;
594     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
595     ExDescription.lineNumber = 0;
596     throw SALOME::SALOME_Exception(ExDescription);
597   }
598   catch (SALOME_Exception& ex) {
599     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
600   }
601   return 0;
602 }
603
604 //=============================================================================
605
606 char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry)
607   throw (SALOME::SALOME_Exception)
608 {
609   ASSERT(myBaseImpl);
610   try {
611     return CORBA::string_dup( this->GetImpl()->GetAttractorEntry(entry).c_str());
612   }
613   catch (const std::invalid_argument& ex) {
614     SALOME::ExceptionStruct ExDescription;
615     ExDescription.text = ex.what();
616     ExDescription.type = SALOME::BAD_PARAM;
617     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
618     ExDescription.lineNumber = 0;
619     throw SALOME::SALOME_Exception(ExDescription);
620   }
621   catch (SALOME_Exception& ex) {
622     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
623   }
624   return 0;
625 }
626
627 //=============================================================================
628
629 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry)
630 {
631   ASSERT(myBaseImpl); 
632   this->GetImpl()->ClearEntry(entry);
633 //  SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
634 }
635
636 //=============================================================================
637
638 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries()
639 {
640   ASSERT(myBaseImpl);
641   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
642
643   const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps= this->GetImpl()->_GetSizeMapEntries();
644   result->length( sizeMaps.size() );
645
646   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
647   for ( int i = 0 ; smIt != sizeMaps.end(); ++smIt, ++i ) {
648     string entry_sizemap = smIt->first;
649     if ( !smIt->second.empty() ) {
650       entry_sizemap += "|";
651       entry_sizemap += smIt->second;
652     }
653     result[i] = CORBA::string_dup(entry_sizemap.c_str());
654   }
655   return result._retn();
656 }
657
658 //=============================================================================
659
660 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries()
661 {
662   ASSERT(myBaseImpl);
663   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
664
665   const ::BLSURFPlugin_Hypothesis::TSizeMap attractors= this->GetImpl()->_GetAttractorEntries();
666   result->length( attractors.size() );
667
668   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
669   for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
670     string entry_attractor = atIt->first;
671     if ( !atIt->second.empty() ) {
672       entry_attractor += "|";
673       entry_attractor += atIt->second;
674     }
675     result[i] = CORBA::string_dup(entry_attractor.c_str());
676   }
677   return result._retn();
678 }
679
680 //=============================================================================
681
682 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
683   throw (SALOME::SALOME_Exception)
684 {
685   ASSERT(myBaseImpl);
686   for (int i = 0; i < sizeMaps.length(); ++i)
687   {
688     string entry_sizemap = sizeMaps[i].in();
689     int colonPos = entry_sizemap.find( '|' );
690     string entry, sizemap;
691     if ( colonPos == string::npos ) // '|' separator not found
692       entry = entry_sizemap;
693     else {
694       entry = entry_sizemap.substr( 0, colonPos);
695       if ( colonPos < entry_sizemap.size()-1 && entry_sizemap[colonPos] != ' ')
696         sizemap = entry_sizemap.substr( colonPos+1 );
697     }
698     this->GetImpl()->SetSizeMapEntry( entry.c_str(), sizemap.c_str() );
699   }
700 }
701
702 //=============================================================================
703
704 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps()
705 {
706   ASSERT(myBaseImpl);
707   this->GetImpl()->ClearSizeMaps();
708 }
709
710
711 //=============================================================================
712
713 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj,const char* sizeMap)
714 {
715   ASSERT(myBaseImpl);
716   string entry;
717   entry=GeomObj->GetStudyEntry();
718   MESSAGE("IDL : GetName : " << GeomObj->GetName());
719   MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")"); 
720   SetSizeMapEntry( entry.c_str(),sizeMap);
721 }
722   
723 //=============================================================================
724 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj)
725 {
726   ASSERT(myBaseImpl);
727   string entry;
728   entry=GeomObj->GetStudyEntry();
729   MESSAGE("IDL : GetName : " << GeomObj->GetName());
730   MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
731   UnsetEntry( entry.c_str());
732   SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
733 }
734
735
736 void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor)
737 {
738   ASSERT(myBaseImpl);
739   string entry;
740   entry=GeomObj->GetStudyEntry();
741   MESSAGE("IDL : GetName : " << GeomObj->GetName());
742   MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
743   SetAttractorEntry( entry.c_str(),attractor);
744 }
745
746 void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj)
747 {
748   ASSERT(myBaseImpl);
749   string entry;
750   entry=GeomObj->GetStudyEntry();
751   MESSAGE("IDL : GetName : " << GeomObj->GetName());
752   MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
753   UnsetEntry( entry.c_str());
754   SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
755 }
756
757
758
759
760 /*
761 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
762 {}
763
764 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
765 {}
766
767 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
768 {}
769
770 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
771 {}
772
773 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
774 {
775   ASSERT(myBaseImpl);
776   this->GetImpl()->UnsetCustomSizeMap(entry);
777   SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
778 }
779
780
781 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
782 {}
783
784 */
785
786
787 ///////////////////////
788 // ENFORCED VERTEXES //
789 ///////////////////////
790
791 BLSURFPlugin::TEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices()
792 {
793   MESSAGE("IDL: GetAllEnforcedVertices()");
794   ASSERT(myBaseImpl);
795   BLSURFPlugin::TEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TEntryEnfVertexListMap();
796   const ::BLSURFPlugin_Hypothesis::TEntryEnfVertexListMap entryEnfVertexListMap = this->GetImpl()->_GetAllEnforcedVertices();
797   resultMap->length(entryEnfVertexListMap.size());
798   MESSAGE("Enforced Vertex map size is " << entryEnfVertexListMap.size());
799
800   ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList;
801   ::BLSURFPlugin_Hypothesis::TEntryEnfVertexListMap::const_iterator evmIt = entryEnfVertexListMap.begin();
802   for ( int i = 0 ; evmIt != entryEnfVertexListMap.end(); ++evmIt, ++i ) {
803     std::string entry = evmIt->first;
804     MESSAGE("Entry: " << entry);
805     enfVertexList = evmIt->second;
806
807     BLSURFPlugin::TEntryEnfVertexListMapElement_var mapElement = new BLSURFPlugin::TEntryEnfVertexListMapElement();
808
809     BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
810     vertexList->length(enfVertexList.size());
811     MESSAGE("Number of enforced vertices: " << enfVertexList.size());
812
813     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
814     for ( int j = 0 ; evlIt != enfVertexList.end(); ++evlIt, ++j ) {
815       MESSAGE("Enforced Vertex #" << j);
816       BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
817       enfVertex->length(3);
818       enfVertex[0] = (*evlIt)[0];
819       enfVertex[1] = (*evlIt)[1];
820       enfVertex[2] = (*evlIt)[2];
821       vertexList[j] = enfVertex;
822       MESSAGE("Enforced vertex: " << enfVertex[0] << ", " << enfVertex[1] << ", " << enfVertex[2]);
823     }
824
825     mapElement->entry = CORBA::string_dup(entry.c_str());
826     mapElement->vertexList = vertexList;
827
828     resultMap[i] = mapElement;
829
830   }
831   return resultMap._retn();
832 }
833
834 void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices()
835 {
836   ASSERT(myBaseImpl);
837   this->GetImpl()->ClearAllEnforcedVertices();
838   SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
839 }
840
841 /*!
842   * Set/get/unset an enforced vertex on geom object
843   */
844 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double x, CORBA::Double y, CORBA::Double z)
845   throw (SALOME::SALOME_Exception)
846 {
847   ASSERT(myBaseImpl);
848   // TODO check that GeomObj is a face => in engine ?
849   // TODO Affecter un nom de groupe vide
850   string entry = GeomObj->GetStudyEntry();
851   MESSAGE("IDL : GetName : " << GeomObj->GetName());
852   MESSAGE("IDL : SetEnforcedVertex ( "<< entry << ", " << x << ", " << y << ", " << z << ")");
853   try {
854     SetEnforcedVertexEntry(entry.c_str(), x, y, z);
855   }
856   catch (SALOME_Exception& ex) {
857     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
858   }
859 }
860
861 /*!
862   * Set/get/unset an enforced vertex on geom object with group name
863   */
864 /* TODO GROUPS
865 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr GeomObj,
866                   CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
867   throw (SALOME::SALOME_Exception)
868 {
869   ASSERT(myBaseImpl);
870   // TODO check that GeomObj is a face => in engine ?
871   string entry = GeomObj->GetStudyEntry();
872   MESSAGE("IDL : GetName : " << GeomObj->GetName());
873   MESSAGE("IDL : SetEnforcedVertexWithGroup ( "<< entry << ", " << x << ", " << y << ", " << z << ", " << groupName <<")");
874   try {
875     SetEnforcedVertexEntryWithGroup(entry.c_str(), x, y, z, groupName);
876   }
877   catch (SALOME_Exception& ex) {
878     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
879   }
880 }
881 */
882 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr GeomObj)
883   throw (SALOME::SALOME_Exception)
884 {
885   ASSERT(myBaseImpl);
886   string entry = GeomObj->GetStudyEntry();
887   MESSAGE("IDL : GetName : " << GeomObj->GetName());
888   MESSAGE("IDL : GetEnforcedVertexList ( "<< entry << ")");
889   try {
890     return GetEnforcedVerticesEntry(entry.c_str());
891   }
892   catch (SALOME_Exception& ex) {
893     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
894   }
895 }
896
897
898 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double x, CORBA::Double y, CORBA::Double z)
899   throw (SALOME::SALOME_Exception)
900 {
901   ASSERT(myBaseImpl);
902   string entry = GeomObj->GetStudyEntry();
903   MESSAGE("IDL : GetName : " << GeomObj->GetName());
904   MESSAGE("IDL : UnsetEnforcedVertex ( "<< entry << ", " << x << ", " << y << ", " << z << ")");
905
906   try {
907     UnsetEnforcedVertexEntry(entry.c_str(), x, y, z);
908   }
909   catch (SALOME_Exception& ex) {
910     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
911   }
912 }
913
914
915 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr GeomObj)
916   throw (SALOME::SALOME_Exception)
917 {
918   ASSERT(myBaseImpl);;
919   string entry = GeomObj->GetStudyEntry();
920   MESSAGE("IDL : GetName : " << GeomObj->GetName());
921   MESSAGE("IDL : UnsetEnforcedVertices ( "<< entry << ")");
922
923   try {
924     UnsetEnforcedVerticesEntry(entry.c_str());
925   }
926   catch (SALOME_Exception& ex) {
927     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
928   }
929 }
930
931
932 /*!
933   * Set/get/unset an enforced vertex on geom object given by entry
934   */
935 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* entry, double x, double y, double z)
936   throw (SALOME::SALOME_Exception)
937 {
938   ASSERT(myBaseImpl);
939   MESSAGE("IDL : SETENFORCEDVERTEX START - ENTRY: " << entry << " VERTEX: " << x << " " << y << " " << z);
940   bool newValue = false;
941   
942   try {
943     ::BLSURFPlugin_Hypothesis::TEnfVertexList vertexList = this->GetImpl()->GetEnforcedVertices(entry);
944     ::BLSURFPlugin_Hypothesis::TEnfVertex vertex;
945     vertex.push_back(x);
946     vertex.push_back(y);
947     vertex.push_back(z);
948     if (vertexList.find(vertex) == vertexList.end()) {
949       MESSAGE("Vertex not found: add it in vertexList")
950       newValue = true;
951     }
952     else
953       MESSAGE("Vertex already found")
954   }
955   catch (const std::invalid_argument& ex) {
956     // no enforced vertex for entry
957     MESSAGE("Entry not found : add it to the list")
958     newValue = true;
959   }
960   catch (SALOME_Exception& ex) {
961     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
962   }
963   
964   if ( newValue ) {
965     this->GetImpl()->SetEnforcedVertex(entry, x, y, z);
966     SMESH::TPythonDump() << _this() << ".SetEnforcedVertex("
967                          << entry << ", "
968                          << x << ", "
969                          << y << ", "
970                          << z << ")";
971   }
972   MESSAGE("IDL : SETENFORCEDVERTEX END - ENTRY: " << entry);
973 }
974
975 /*!
976   * Set/get/unset an enforced vertex on geom object given by entry
977   */
978 /* TODO GROUPS
979 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntryWithGroup(const char* entry,
980                                  double x, double y, double z, const char* groupName)
981   throw (SALOME::SALOME_Exception)
982 {
983   ASSERT(myBaseImpl);
984   MESSAGE("IDL : SETENFORCEDVERTEXWITHGROUP START - ENTRY: " << entry << " VERTEX: "
985             << x << " " << y << " " << z << " group name: " << groupName);
986   bool newValue = false;
987   bool newGroupName = false;
988   try {
989     ::BLSURFPlugin_Hypothesis::TEnfVertexList vertexList = this->GetImpl()->GetEnforcedVertices(entry);
990     ::BLSURFPlugin_Hypothesis::TEnfVertex vertex;
991     vertex.push_back(x);
992     vertex.push_back(y);
993     vertex.push_back(z);
994     if (vertexList.find(vertex) == vertexList.end()) {
995       MESSAGE("Vertex not found: add it in vertexList");
996       newValue = true;
997     }
998     else {
999       MESSAGE("Vertex already found");
1000       std::string oldGroupName = this->GetImpl()->GetEnforcedVertexGroupName(x,y,z);
1001       if (strcmp(oldGroupName.c_str(),groupName)!=0)
1002         newGroupName = true;
1003     }
1004   }
1005   catch (const std::invalid_argument& ex) {
1006     // no enforced vertex for entry
1007     MESSAGE("Entry not found : add it to the list");
1008     newValue = true;
1009   }
1010   catch (SALOME_Exception& ex) {
1011     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1012   }
1013   
1014   if ( newValue ) {
1015     this->GetImpl()->SetEnforcedVertex(entry, x, y, z, groupName);
1016     SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup("
1017                          << entry << ", "
1018                          << x << ", "
1019                          << y << ", "
1020                          << z << ", '"
1021                          << groupName << "')";
1022   }
1023   else {
1024     if (newGroupName) {
1025       this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
1026       SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
1027                           << x << ", "
1028                           << y << ", "
1029                           << z << ", '"
1030                           << groupName << "')";
1031     }
1032   }
1033   MESSAGE("IDL : SETENFORCEDVERTEXWITHGROUP END - ENTRY: " << entry);
1034 }
1035 */
1036 /*
1037 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexListEntry(const char* entry, BLSURFPlugin::TEnfVertexList& vertexList)
1038   throw (SALOME::SALOME_Exception)
1039 {
1040   ASSERT(myBaseImpl);
1041 }
1042 */
1043
1044 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
1045   throw (SALOME::SALOME_Exception)
1046 {
1047   ASSERT(myBaseImpl);
1048   MESSAGE("ENGINE : GETENFORCEDVERTICES START ENTRY : " << entry);
1049   
1050   try {
1051     BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
1052     ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnforcedVertices(entry);
1053     vertexList->length(_vList.size());
1054     MESSAGE("Number of enforced vertices: " << _vList.size());
1055     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
1056     for ( int i = 0; evlIt != _vList.end() ; ++evlIt, ++i ) {
1057       BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1058       enfVertex->length(3);
1059       MESSAGE("Enforced vertex #" << i << ": "<< (*evlIt)[0] << ", " << (*evlIt)[1] << ", " << (*evlIt)[2]);
1060       enfVertex[0] = (*evlIt)[0];
1061       enfVertex[1] = (*evlIt)[1];
1062       enfVertex[2] = (*evlIt)[2];
1063       vertexList[i] = enfVertex;
1064     }
1065     return vertexList._retn();
1066   }
1067   catch (const std::invalid_argument& ex) {
1068     SALOME::ExceptionStruct ExDescription;
1069     ExDescription.text = ex.what();
1070     ExDescription.type = SALOME::BAD_PARAM;
1071     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
1072     ExDescription.lineNumber = 1048;
1073     throw SALOME::SALOME_Exception(ExDescription);
1074   }
1075   catch(const std::exception& ex) {
1076     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1077   }
1078
1079   MESSAGE("ENGINE : GETENFORCEDVERTICES END ENTRY : " << entry);
1080 }
1081
1082
1083 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* entry, CORBA::Double x, CORBA::Double y, CORBA::Double z)
1084   throw (SALOME::SALOME_Exception)
1085 {
1086   ASSERT(myBaseImpl);
1087   MESSAGE("ENGINE : UNSETENFORCEDVERTEX START ENTRY : " << entry);
1088   
1089   try {
1090     this->GetImpl()->ClearEnforcedVertex(entry, x, y, z);
1091     SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertex("
1092                          << entry << ", "
1093                          << x << ", "
1094                          << y << ", "
1095                          << z << ")";
1096   }
1097   catch (const std::invalid_argument& ex) {
1098     SALOME::ExceptionStruct ExDescription;
1099     ExDescription.text = ex.what();
1100     ExDescription.type = SALOME::BAD_PARAM;
1101     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(entry,x,y,z)";
1102     ExDescription.lineNumber = 1086;
1103     throw SALOME::SALOME_Exception(ExDescription);
1104   }
1105   catch(const std::exception& ex) {
1106     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1107   }
1108
1109   MESSAGE("ENGINE : UNSETENFORCEDVERTEX END ENTRY : " << entry);
1110 }
1111 /*
1112 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexListEntry(const char* entry, BLSURFPlugin::TEnfVertexList& vertexList)
1113   throw (SALOME::SALOME_Exception)
1114 {
1115   ASSERT(myBaseImpl);
1116 }
1117 */
1118 void BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* entry)
1119   throw (SALOME::SALOME_Exception)
1120 {
1121   ASSERT(myBaseImpl);
1122   MESSAGE("ENGINE : UNSETENFORCEDVERTICES START ENTRY : " << entry);
1123   
1124   try {
1125     this->GetImpl()->ClearEnforcedVertices(entry);
1126     SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << entry << ")";
1127   }
1128   catch (const std::invalid_argument& ex) {
1129     SALOME::ExceptionStruct ExDescription;
1130     ExDescription.text = ex.what();
1131     ExDescription.type = SALOME::BAD_PARAM;
1132     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(entry)";
1133     ExDescription.lineNumber = 1121;
1134     throw SALOME::SALOME_Exception(ExDescription);
1135   }
1136   catch(const std::exception& ex) {
1137     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1138   }
1139
1140   MESSAGE("ENGINE : UNSETENFORCEDVERTICES END ENTRY : " << entry);
1141 }
1142
1143 /* TODO GROUPS
1144 char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
1145   throw (SALOME::SALOME_Exception)
1146 {
1147   ASSERT(myBaseImpl);
1148   MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
1149   try {
1150     return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
1151   }
1152   catch (const std::invalid_argument& ex) {
1153     SALOME::ExceptionStruct ExDescription;
1154     ExDescription.text = ex.what();
1155     ExDescription.type = SALOME::BAD_PARAM;
1156     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
1157     ExDescription.lineNumber = 1146;
1158     throw SALOME::SALOME_Exception(ExDescription);
1159   }
1160   catch (SALOME_Exception& ex) {
1161     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1162   }
1163   MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
1164   return 0;
1165 }
1166
1167
1168 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
1169   throw (SALOME::SALOME_Exception)
1170 {
1171   ASSERT(myBaseImpl);
1172   MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
1173   try {
1174     this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
1175   }
1176   catch (const std::invalid_argument& ex) {
1177     SALOME::ExceptionStruct ExDescription;
1178     ExDescription.text = ex.what();
1179     ExDescription.type = SALOME::BAD_PARAM;
1180     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
1181     ExDescription.lineNumber = 1170;
1182     throw SALOME::SALOME_Exception(ExDescription);
1183   }
1184   catch (SALOME_Exception& ex) {
1185     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1186   }
1187
1188   SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
1189                         << x << ", " << y << ", " << z << ", '" << groupName << "' )";
1190
1191   MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
1192 }
1193 */
1194 ///////////////////////
1195
1196
1197
1198
1199
1200 //=============================================================================
1201 /*!
1202  *  BLSURFPlugin_Hypothesis_i::GetImpl
1203  *
1204  *  Get implementation
1205  */
1206 //=============================================================================
1207 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl()
1208 {
1209   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
1210   return (::BLSURFPlugin_Hypothesis*)myBaseImpl;
1211 }
1212
1213 //================================================================================
1214 /*!
1215  * \brief Verify whether hypothesis supports given entity type 
1216   * \param type - dimension (see SMESH::Dimension enumeration)
1217   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
1218  * 
1219  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
1220  */
1221 //================================================================================  
1222 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
1223 {
1224   return type == SMESH::DIM_2D;
1225 }