]> SALOME platform Git repositories - plugins/blsurfplugin.git/blob - src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
Salome HOME
Merge branch 'cbr/CEA_1537_remove_deprecated_precad' of ssh://git.salome-platform...
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File    : 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
28 #include <SMESH_Gen.hxx>
29 #include <SMESH_Gen_i.hxx>
30 #include <SMESH_PythonDump.hxx>
31
32 #include <SALOMEDS_wrap.hxx>
33 #include <Utils_CorbaException.hxx>
34 #include <utilities.h>
35
36 #include <stdexcept>
37 #include <cstring>
38 #include <boost/regex.hpp>
39
40 using namespace std;
41
42 //=============================================================================
43 /*!
44  *  BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
45  *
46  *  Constructor
47  */
48 //=============================================================================
49 BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId,
50     ::SMESH_Gen* theGenImpl) :
51   SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
52   MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
53   myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theStudyId, theGenImpl);
54 }
55
56 //=============================================================================
57 /*!
58  *  BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
59  *
60  *  Destructor
61  */
62 //=============================================================================
63 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
64   MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
65 }
66
67 //=============================================================================
68
69 //=============================================================================
70 /*!
71  *  BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
72  *
73  *  Set PhysicalMesh
74  */
75
76 //=============================================================================
77 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
78   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
79   ASSERT(myBaseImpl);
80   this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
81   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
82 }
83
84 //=============================================================================
85 /*!
86  *  BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
87  *
88  *  Get PhysicalMesh
89  */
90 //=============================================================================
91 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
92   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
93   ASSERT(myBaseImpl);
94   return this->GetImpl()->GetPhysicalMesh();
95 }
96
97 //=============================================================================
98 /*!
99  *  BLSURFPlugin_Hypothesis_i::SetGeometricMesh
100  *
101  *  Set GeometricMesh
102  */
103
104 //=============================================================================
105 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
106   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
107   ASSERT(myBaseImpl);
108   this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
109   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
110 }
111
112 //=============================================================================
113 /*!
114  *  BLSURFPlugin_Hypothesis_i::GetGeometricMesh
115  *
116  *  Get GeometricMesh
117  */
118 //=============================================================================
119 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
120   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
121   ASSERT(myBaseImpl);
122   return this->GetImpl()->GetGeometricMesh();
123 }
124
125 //=============================================================================
126 /*!
127  *  BLSURFPlugin_Hypothesis_i::SetPhySize
128  *
129  *  Set PhySize
130  */
131 //=============================================================================
132 void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
133 //   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
134   ASSERT(myBaseImpl);
135   this->GetImpl()->SetPhySize(theValue, false);
136   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
137 }
138
139 //=============================================================================
140 /*!
141  *  BLSURFPlugin_Hypothesis_i::SetPhySizeRel
142  *
143  *  Set Relative PhySize
144  */
145 //=============================================================================
146 void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
147 //   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySizeRel");
148   ASSERT(myBaseImpl);
149   this->GetImpl()->SetPhySize(theValue, true);
150   SMESH::TPythonDump() << _this() << ".SetPhySizeRel( " << theValue << " )";
151 }
152
153 //=============================================================================
154 /*!
155  *  BLSURFPlugin_Hypothesis_i::GetPhySize
156  *
157  *  Get PhySize
158  */
159 //=============================================================================
160 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
161 //   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
162   ASSERT(myBaseImpl);
163   return this->GetImpl()->GetPhySize();
164 }
165
166 //=============================================================================
167 /*!
168  *  BLSURFPlugin_Hypothesis_i::IsPhySizeRel
169  *
170  *  Returns True if PhySize is relative
171  */
172 //=============================================================================
173 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
174 //   MESSAGE("BLSURFPlugin_Hypothesis_i::IsPhySizeRel");
175   ASSERT(myBaseImpl);
176   return this->GetImpl()->IsPhySizeRel();
177 }
178
179 //=============================================================================
180 void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
181   ASSERT(myBaseImpl);
182   if (IsMinSizeRel() || GetMinSize() != theMinSize ) {
183     this->GetImpl()->SetMinSize(theMinSize, false);
184     SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
185   }
186 }
187
188 //=============================================================================
189 void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
190   ASSERT(myBaseImpl);
191   if ( !IsMinSizeRel() || (GetMinSize() != theMinSize) ) {
192     this->GetImpl()->SetMinSize(theMinSize, true);
193     SMESH::TPythonDump() << _this() << ".SetMinSizeRel( " << theMinSize << " )";
194   }
195 }
196
197 //=============================================================================
198 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize() {
199   ASSERT(myBaseImpl);
200   return this->GetImpl()->GetMinSize();
201 }
202
203 //=============================================================================
204 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
205 //   MESSAGE("BLSURFPlugin_Hypothesis_i::IsMinSizeRel");
206   ASSERT(myBaseImpl);
207   return this->GetImpl()->IsMinSizeRel();
208 }
209
210 //=============================================================================
211 void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
212   ASSERT(myBaseImpl);
213   if (IsMaxSizeRel() || GetMaxSize() != theMaxSize) {
214     this->GetImpl()->SetMaxSize(theMaxSize, false);
215     SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
216   }
217 }
218
219 //=============================================================================
220 void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
221   ASSERT(myBaseImpl);
222   if ( !IsMaxSizeRel() || (GetMaxSize() != theMaxSize) ) {
223     this->GetImpl()->SetMaxSize(theMaxSize, true);
224     SMESH::TPythonDump() << _this() << ".SetMaxSizeRel( " << theMaxSize << " )";
225   }
226 }
227
228 //=============================================================================
229 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize() {
230   ASSERT(myBaseImpl);
231   return this->GetImpl()->GetMaxSize();
232 }
233
234 //=============================================================================
235 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
236 //   MESSAGE("BLSURFPlugin_Hypothesis_i::IsMaxSizeRel");
237   ASSERT(myBaseImpl);
238   return this->GetImpl()->IsMaxSizeRel();
239 }
240
241 //=============================================================================
242 /*!
243  *  BLSURFPlugin_Hypothesis_i::SetGradation
244  *
245  *  Set Gradation
246  */
247 //=============================================================================
248 void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
249   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
250   ASSERT(myBaseImpl);
251   this->GetImpl()->SetGradation(theValue);
252   SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
253 }
254
255 //=============================================================================
256 /*!
257  *  BLSURFPlugin_Hypothesis_i::GetGradation
258  *
259  *  Get Gradation
260  */
261 //=============================================================================
262 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
263   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
264   ASSERT(myBaseImpl);
265   return this->GetImpl()->GetGradation();
266 }
267
268 //=============================================================================
269 /*!
270  *  BLSURFPlugin_Hypothesis_i::SetQuadAllowed
271  *
272  *  Set true or false
273  */
274 //=============================================================================
275 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
276   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
277   ASSERT(myBaseImpl);
278   this->GetImpl()->SetQuadAllowed(theValue);
279   std::string theValueStr = theValue ? "True" : "False";
280   SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
281 }
282
283 //=============================================================================
284 /*!
285  *  BLSURFPlugin_Hypothesis_i::GetQuadAllowed
286  *
287  *  Get true or false
288  */
289 //=============================================================================
290 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
291   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
292   ASSERT(myBaseImpl);
293   return this->GetImpl()->GetQuadAllowed();
294 }
295
296 //=============================================================================
297 /*!
298  *  BLSURFPlugin_Hypothesis_i::SetAngleMesh
299  *
300  *  Set AngleMesh
301  */
302 //=============================================================================
303 void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
304   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMesh");
305   ASSERT(myBaseImpl);
306   this->GetImpl()->SetAngleMesh(theValue);
307   SMESH::TPythonDump() << _this() << ".SetAngleMesh( " << theValue << " )";
308 }
309
310 //=============================================================================
311 /*!
312  *  BLSURFPlugin_Hypothesis_i::GetAngleMesh
313  *
314  *  Get AngleMesh
315  */
316 //=============================================================================
317 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
318   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMesh");
319   ASSERT(myBaseImpl);
320   return this->GetImpl()->GetAngleMesh();
321 }
322
323 //=============================================================================
324 /*!
325  *  BLSURFPlugin_Hypothesis_i::SetChordalError
326  *
327  *  Set Chordal Error
328  */
329 //=============================================================================
330 void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
331   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetChordalError");
332   ASSERT(myBaseImpl);
333   this->GetImpl()->SetChordalError(theValue);
334   SMESH::TPythonDump() << _this() << ".SetChordalError( " << theValue << " )";
335 }
336
337 //=============================================================================
338 /*!
339  *  BLSURFPlugin_Hypothesis_i::GetChordalError
340  *
341  *  Get Chordal Error
342  */
343 //=============================================================================
344 CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
345   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetChordalError");
346   ASSERT(myBaseImpl);
347   return this->GetImpl()->GetChordalError();
348 }
349
350 //=============================================================================
351 /*!
352  *  BLSURFPlugin_Hypothesis_i::SetAnisotropic
353  *
354  *  Set true or false
355  */
356 //=============================================================================
357 void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
358   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropic");
359   ASSERT(myBaseImpl);
360   this->GetImpl()->SetAnisotropic(theValue);
361   std::string theValueStr = theValue ? "True" : "False";
362   SMESH::TPythonDump() << _this() << ".SetAnisotropic( " << theValueStr.c_str() << " )";
363 }
364
365 //=============================================================================
366 /*!
367  *  BLSURFPlugin_Hypothesis_i::GetAnisotropic
368  *
369  *  Get true or false
370  */
371 //=============================================================================
372 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
373   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropic");
374   ASSERT(myBaseImpl);
375   return this->GetImpl()->GetAnisotropic();
376 }
377
378 //=============================================================================
379 /*!
380  *  BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio
381  *
382  *  Set Anisotropic Ratio
383  */
384 //=============================================================================
385 void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
386   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio");
387   ASSERT(myBaseImpl);
388   this->GetImpl()->SetAnisotropicRatio(theValue);
389   SMESH::TPythonDump() << _this() << ".SetAnisotropicRatio( " << theValue << " )";
390 }
391
392 //=============================================================================
393 /*!
394  *  BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio
395  *
396  *  Get Anisotropic Ratio
397  */
398 //=============================================================================
399 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
400   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio");
401   ASSERT(myBaseImpl);
402   return this->GetImpl()->GetAnisotropicRatio();
403 }
404
405
406 //=============================================================================
407 /*!
408  *  BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges
409  *
410  *  Set true or false
411  */
412 //=============================================================================
413 void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
414   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges");
415   ASSERT(myBaseImpl);
416   this->GetImpl()->SetRemoveTinyEdges(theValue);
417   std::string theValueStr = theValue ? "True" : "False";
418   SMESH::TPythonDump() << _this() << ".SetRemoveTinyEdges( " << theValueStr.c_str() << " )";
419 }
420
421 //=============================================================================
422 /*!
423  *  BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges
424  *
425  *  Get true or false
426  */
427 //=============================================================================
428 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
429   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges");
430   ASSERT(myBaseImpl);
431   return this->GetImpl()->GetRemoveTinyEdges();
432 }
433
434 //=============================================================================
435 /*!
436  *  BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength
437  *
438  *  Set Tiny Edge Length
439  */
440 //=============================================================================
441 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
442   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength");
443   ASSERT(myBaseImpl);
444   this->GetImpl()->SetTinyEdgeLength(theValue);
445   SMESH::TPythonDump() << _this() << ".SetTinyEdgeLength( " << theValue << " )";
446 }
447
448 //=============================================================================
449 /*!
450  *  BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength
451  *
452  *  Get Tiny Edge Length
453  */
454 //=============================================================================
455 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
456   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength");
457   ASSERT(myBaseImpl);
458   return this->GetImpl()->GetTinyEdgeLength();
459 }
460
461 //=============================================================================
462 /*!
463  *  BLSURFPlugin_Hypothesis_i::SetBadElementRemoval
464  *
465  *  Set true or false
466  */
467 //=============================================================================
468 void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
469   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementRemoval");
470   ASSERT(myBaseImpl);
471   this->GetImpl()->SetBadElementRemoval(theValue);
472   std::string theValueStr = theValue ? "True" : "False";
473   SMESH::TPythonDump() << _this() << ".SetBadElementRemoval( " << theValueStr.c_str() << " )";
474 }
475
476 //=============================================================================
477 /*!
478  *  BLSURFPlugin_Hypothesis_i::GetBadElementRemoval
479  *
480  *  Get true or false
481  */
482 //=============================================================================
483 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
484   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementRemoval");
485   ASSERT(myBaseImpl);
486   return this->GetImpl()->GetBadElementRemoval();
487 }
488
489 //=============================================================================
490 /*!
491  *  BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio
492  *
493  *  Set Bad Surface Element Aspect Ratio
494  */
495 //=============================================================================
496 void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue) {
497   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio");
498   ASSERT(myBaseImpl);
499   this->GetImpl()->SetBadElementAspectRatio(theValue);
500   SMESH::TPythonDump() << _this() << ".SetBadElementAspectRatio( " << theValue << " )";
501 }
502
503 //=============================================================================
504 /*!
505  *  BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio
506  *
507  *  Get Bad Surface Element Aspect Ratio
508  */
509 //=============================================================================
510 CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
511   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio");
512   ASSERT(myBaseImpl);
513   return this->GetImpl()->GetBadElementAspectRatio();
514 }
515
516 //=============================================================================
517 /*!
518  *  BLSURFPlugin_Hypothesis_i::SetOptimizeMesh
519  *
520  *  Set true or false
521  */
522 //=============================================================================
523 void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
524   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimizeMesh");
525   ASSERT(myBaseImpl);
526   this->GetImpl()->SetOptimizeMesh(theValue);
527   std::string theValueStr = theValue ? "True" : "False";
528   SMESH::TPythonDump() << _this() << ".SetOptimizeMesh( " << theValueStr.c_str() << " )";
529 }
530
531 //=============================================================================
532 /*!
533  *  BLSURFPlugin_Hypothesis_i::GetOptimizeMesh
534  *
535  *  Get true or false
536  */
537 //=============================================================================
538 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
539   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimizeMesh");
540   ASSERT(myBaseImpl);
541   return this->GetImpl()->GetOptimizeMesh();
542 }
543
544 //=============================================================================
545 /*!
546  *  BLSURFPlugin_Hypothesis_i::SetQuadraticMesh
547  *
548  *  Set true or false
549  */
550 //=============================================================================
551 void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
552   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadraticMesh");
553   ASSERT(myBaseImpl);
554   this->GetImpl()->SetQuadraticMesh(theValue);
555   std::string theValueStr = theValue ? "True" : "False";
556   SMESH::TPythonDump() << _this() << ".SetQuadraticMesh( " << theValueStr.c_str() << " )";
557 }
558
559 //=============================================================================
560 /*!
561  *  BLSURFPlugin_Hypothesis_i::GetQuadraticMesh
562  *
563  *  Get true or false
564  */
565 //=============================================================================
566 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
567   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadraticMesh");
568   ASSERT(myBaseImpl);
569   return this->GetImpl()->GetQuadraticMesh();
570 }
571
572
573
574
575
576 /*!
577  *  BLSURFPlugin_Hypothesis_i::SetTopology
578  *
579  *  Set topology
580  */
581
582 //=============================================================================
583 void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
584   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
585   ASSERT(myBaseImpl);
586   this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
587   SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
588 }
589
590 //=============================================================================
591 /*!
592  *  BLSURFPlugin_Hypothesis_i::GetTopology
593  *
594  *  Get Topology
595  */
596 //=============================================================================
597 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
598   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
599   ASSERT(myBaseImpl);
600   return this->GetImpl()->GetTopology();
601 }
602
603 //=============================================================================
604 void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception) {
605   ASSERT(myBaseImpl);
606   if (theVal < 0 || theVal > 100)
607     THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
608   this->GetImpl()->SetVerbosity(theVal);
609   SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
610 }
611
612 //=============================================================================
613
614 CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() {
615   ASSERT(myBaseImpl);
616   return (CORBA::Short) this->GetImpl()->GetVerbosity();
617 }
618
619 //=============================================================================
620 /*!
621  *  BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
622  *
623  *  Set true or false
624  */
625 //=============================================================================
626 void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
627   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
628   ASSERT(myBaseImpl);
629   this->GetImpl()->SetPreCADMergeEdges(theValue);
630   std::string theValueStr = theValue ? "True" : "False";
631   SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValueStr.c_str() << " )";
632 }
633
634 //=============================================================================
635 /*!
636  *  BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges
637  *
638  *  Get true or false
639  */
640 //=============================================================================
641 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
642   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
643   ASSERT(myBaseImpl);
644   return this->GetImpl()->GetPreCADMergeEdges();
645 }
646
647 //=============================================================================
648 /*!
649  *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges
650  *
651  *  Set true or false
652  */
653 //=============================================================================
654 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue) {
655   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges");
656   ASSERT(myBaseImpl);
657   this->GetImpl()->SetPreCADRemoveTinyUVEdges(theValue);
658   std::string theValueStr = theValue ? "True" : "False";
659   SMESH::TPythonDump() << _this() << ".SetPreCADRemoveTinyUVEdges( " << theValueStr.c_str() << " )";
660 }
661
662 //=============================================================================
663 /*!
664  *  BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges
665  *
666  *  Get true or false
667  */
668 //=============================================================================
669 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
670   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges");
671   ASSERT(myBaseImpl);
672   return this->GetImpl()->GetPreCADRemoveTinyUVEdges();
673 }
674
675 //=============================================================================
676 /*!
677  *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces
678  *
679  *  Set true or false
680  */
681 //=============================================================================
682 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue) {
683   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces");
684   ASSERT(myBaseImpl);
685   this->GetImpl()->SetPreCADRemoveDuplicateCADFaces(theValue);
686   std::string theValueStr = theValue ? "True" : "False";
687   SMESH::TPythonDump() << _this() << ".SetPreCADRemoveDuplicateCADFaces( " << theValueStr.c_str() << " )";
688 }
689
690 //=============================================================================
691 /*!
692  *  BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces
693  *
694  *  Get true or false
695  */
696 //=============================================================================
697 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces() {
698   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces");
699   ASSERT(myBaseImpl);
700   return this->GetImpl()->GetPreCADRemoveDuplicateCADFaces();
701 }
702
703 //=============================================================================
704 /*!
705  *  BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology
706  *
707  *  Set true or false
708  */
709 //=============================================================================
710 void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theValue) {
711   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology");
712   ASSERT(myBaseImpl);
713   this->GetImpl()->SetPreCADProcess3DTopology(theValue);
714   std::string theValueStr = theValue ? "True" : "False";
715   SMESH::TPythonDump() << _this() << ".SetPreCADProcess3DTopology( " << theValueStr.c_str() << " )";
716 }
717
718 //=============================================================================
719 /*!
720  *  BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology
721  *
722  *  Get true or false
723  */
724 //=============================================================================
725 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
726   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology");
727   ASSERT(myBaseImpl);
728   return this->GetImpl()->GetPreCADProcess3DTopology();
729 }
730
731 //=============================================================================
732 /*!
733  *  BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput
734  *
735  *  Set true or false
736  */
737 //=============================================================================
738 void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
739   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
740   ASSERT(myBaseImpl);
741   this->GetImpl()->SetPreCADDiscardInput(theValue);
742   std::string theValueStr = theValue ? "True" : "False";
743   SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValueStr.c_str() << " )";
744 }
745
746 //=============================================================================
747 /*!
748  *  BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput
749  *
750  *  Get true or false
751  */
752 //=============================================================================
753 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
754   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
755   ASSERT(myBaseImpl);
756   return this->GetImpl()->GetPreCADDiscardInput();
757 }
758
759
760 //=============================================================================
761
762 void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue)
763     throw (SALOME::SALOME_Exception) {
764   ASSERT(myBaseImpl);
765   bool valueChanged = false;
766   try {
767     valueChanged = (this->GetImpl()->GetOptionValue(optionName) != optionValue);
768     if (valueChanged)
769       this->GetImpl()->SetOptionValue(optionName, optionValue);
770   } catch (const std::invalid_argument& ex) {
771     SALOME::ExceptionStruct ExDescription;
772     ExDescription.text = ex.what();
773     ExDescription.type = SALOME::BAD_PARAM;
774     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetOptionValue(name,value)";
775     ExDescription.lineNumber = 0;
776     throw SALOME::SALOME_Exception(ExDescription);
777   } catch (SALOME_Exception& ex) {
778     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
779   }
780   if (valueChanged)
781     SMESH::TPythonDump() << _this() << ".SetOptionValue( '" << optionName << "', '" << optionValue << "' )";
782 }
783
784 //=============================================================================
785
786 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, const char* optionValue)
787     throw (SALOME::SALOME_Exception) {
788   ASSERT(myBaseImpl);
789   bool valueChanged = false;
790   try {
791     valueChanged = (this->GetImpl()->GetPreCADOptionValue(optionName) != optionValue);
792     if (valueChanged)
793       this->GetImpl()->SetPreCADOptionValue(optionName, optionValue);
794   } catch (const std::invalid_argument& ex) {
795     SALOME::ExceptionStruct ExDescription;
796     ExDescription.text = ex.what();
797     ExDescription.type = SALOME::BAD_PARAM;
798     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetPreCADOptionValue(name,value)";
799     ExDescription.lineNumber = 0;
800     throw SALOME::SALOME_Exception(ExDescription);
801   } catch (SALOME_Exception& ex) {
802     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
803   }
804   if (valueChanged)
805     SMESH::TPythonDump() << _this() << ".SetPreCADOptionValue( '" << optionName << "', '" << optionValue << "' )";
806 }
807
808 //=============================================================================
809
810 char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
811   ASSERT(myBaseImpl);
812   try {
813     return CORBA::string_dup(this->GetImpl()->GetOptionValue(optionName).c_str());
814   } catch (const std::invalid_argument& ex) {
815     SALOME::ExceptionStruct ExDescription;
816     ExDescription.text = ex.what();
817     ExDescription.type = SALOME::BAD_PARAM;
818     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetOptionValue(name)";
819     ExDescription.lineNumber = 0;
820     throw SALOME::SALOME_Exception(ExDescription);
821   } catch (SALOME_Exception& ex) {
822     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
823   }
824   return 0;
825 }
826
827 //=============================================================================
828
829 char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
830   ASSERT(myBaseImpl);
831   try {
832     return CORBA::string_dup(this->GetImpl()->GetPreCADOptionValue(optionName).c_str());
833   } catch (const std::invalid_argument& ex) {
834     SALOME::ExceptionStruct ExDescription;
835     ExDescription.text = ex.what();
836     ExDescription.type = SALOME::BAD_PARAM;
837     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetPreCADOptionValue(name)";
838     ExDescription.lineNumber = 0;
839     throw SALOME::SALOME_Exception(ExDescription);
840   } catch (SALOME_Exception& ex) {
841     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
842   }
843   return 0;
844 }
845
846 //=============================================================================
847
848 void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName) {
849   ASSERT(myBaseImpl);
850   this->GetImpl()->ClearOption(optionName);
851   SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
852 }
853
854 //=============================================================================
855
856 void BLSURFPlugin_Hypothesis_i::UnsetPreCADOption(const char* optionName) {
857   ASSERT(myBaseImpl);
858   this->GetImpl()->ClearPreCADOption(optionName);
859   SMESH::TPythonDump() << _this() << ".UnsetPreCADOption( '" << optionName << "' )";
860 }
861
862 //=============================================================================
863
864 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues() {
865   ASSERT(myBaseImpl);
866   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
867
868   const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues();
869   const ::BLSURFPlugin_Hypothesis::TOptionValues & custom_opts = this->GetImpl()->GetCustomOptionValues();
870   result->length(opts.size()+custom_opts.size());
871   int i=0;
872
873   ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
874   for (; opIt != opts.end(); ++opIt, ++i) {
875     string name_value_type = opIt->first;
876     if (!opIt->second.empty()) {
877       name_value_type += ":";
878       name_value_type += opIt->second;
879       name_value_type += ":0";
880     }
881     result[i] = CORBA::string_dup(name_value_type.c_str());
882   }
883
884   opIt = custom_opts.begin();
885   for (; opIt != custom_opts.end(); ++opIt,++i) {
886     string name_value_type = opIt->first;
887     if (!opIt->second.empty()) {
888       name_value_type += ":";
889       name_value_type += opIt->second;
890       name_value_type += ":1";
891     }
892     result[i] = CORBA::string_dup(name_value_type.c_str());
893   }
894   return result._retn();
895 }
896
897 //=============================================================================
898
899 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValues() {
900   ASSERT(myBaseImpl);
901   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
902
903   const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetPreCADOptionValues();
904   const ::BLSURFPlugin_Hypothesis::TOptionValues & custom_opts = this->GetImpl()->GetCustomPreCADOptionValues();
905   result->length(opts.size()+custom_opts.size());
906   int i=0;
907
908   ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
909   for (; opIt != opts.end(); ++opIt, ++i) {
910     string name_value_type = opIt->first;
911     if (!opIt->second.empty()) {
912       name_value_type += ":";
913       name_value_type += opIt->second;
914       name_value_type += ":0";
915     }
916     result[i] = CORBA::string_dup(name_value_type.c_str());
917   }
918
919   opIt = custom_opts.begin();
920   for (; opIt != custom_opts.end(); ++opIt,++i) {
921     string name_value_type = opIt->first;
922     if (!opIt->second.empty()) {
923       name_value_type += ":";
924       name_value_type += opIt->second;
925       name_value_type += ":1";
926     }
927     result[i] = CORBA::string_dup(name_value_type.c_str());
928   }
929   return result._retn();
930 }
931
932 //=============================================================================
933
934 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
935     throw (SALOME::SALOME_Exception) {
936   ASSERT(myBaseImpl);
937   for (CORBA::ULong i = 0; i < options.length(); ++i) {
938     string name_value_type = options[i].in();
939     if(name_value_type.empty())
940       continue;
941     size_t colonPos = name_value_type.find(':');
942     string name, value;
943     bool custom = false;
944     if (colonPos == string::npos) // ':' not found
945       name = name_value_type;
946     else {
947       name = name_value_type.substr(0, colonPos);
948       if (colonPos < name_value_type.size() - 1 && name_value_type[colonPos] != ' ') {
949         string value_type = name_value_type.substr(colonPos + 1);
950         colonPos = value_type.find(':');
951         value = value_type.substr(0, colonPos);
952         if (colonPos < value_type.size() - 1 && value_type[colonPos] != ' ')
953           custom = atoi((value_type.substr(colonPos + 1)).c_str());
954       }
955     }
956     custom ? AddOption(name.c_str(), value.c_str()) : SetOptionValue(name.c_str(), value.c_str());
957   }
958 }
959
960 //=============================================================================
961
962 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options)
963     throw (SALOME::SALOME_Exception) {
964   ASSERT(myBaseImpl);
965   for ( CORBA::ULong i = 0; i < options.length(); ++i) {
966     string name_value_type = options[i].in();
967     if(name_value_type.empty())
968       continue;
969     size_t colonPos = name_value_type.find(':');
970     string name, value;
971     bool custom = false;
972     if (colonPos == string::npos) // ':' not found
973       name = name_value_type;
974     else {
975       name = name_value_type.substr(0, colonPos);
976       if (colonPos < name_value_type.size() - 1 && name_value_type[colonPos] != ' ') {
977         string value_type = name_value_type.substr(colonPos + 1);
978         colonPos = value_type.find(':');
979         value = value_type.substr(0, colonPos);
980         if (colonPos < value_type.size() - 1 && value_type[colonPos] != ' ')
981           custom = atoi((value_type.substr(colonPos + 1)).c_str());
982       }
983     }
984     custom ? AddPreCADOption(name.c_str(), value.c_str()) : SetPreCADOptionValue(name.c_str(), value.c_str());
985   }
986 }
987
988 //=============================================================================
989
990 void BLSURFPlugin_Hypothesis_i::AddOption(const char* optionName, const char* optionValue)
991 {
992   ASSERT(myBaseImpl);
993   bool valueChanged = (this->GetImpl()->GetOption(optionName) != optionValue);
994   if (valueChanged) {
995     this->GetImpl()->AddOption(optionName, optionValue);
996     SMESH::TPythonDump() << _this() << ".AddOption( '" << optionName << "', '" << optionValue << "' )";
997   }
998 }
999
1000 //=============================================================================
1001
1002 void BLSURFPlugin_Hypothesis_i::AddPreCADOption(const char* optionName, const char* optionValue)
1003 {
1004   ASSERT(myBaseImpl);
1005   bool valueChanged = (this->GetImpl()->GetPreCADOption(optionName) != optionValue);
1006   if (valueChanged) {
1007     this->GetImpl()->AddPreCADOption(optionName, optionValue);
1008     SMESH::TPythonDump() << _this() << ".AddPreCADOption( '" << optionName << "', '" << optionValue << "' )";
1009   }
1010 }
1011
1012 //=============================================================================
1013
1014 char* BLSURFPlugin_Hypothesis_i::GetOption(const char* optionName)
1015 {
1016   ASSERT(myBaseImpl);
1017   return CORBA::string_dup(this->GetImpl()->GetOption(optionName).c_str());
1018 }
1019
1020 //=============================================================================
1021
1022 char* BLSURFPlugin_Hypothesis_i::GetPreCADOption(const char* optionName)
1023 {
1024   ASSERT(myBaseImpl);
1025   return CORBA::string_dup(this->GetImpl()->GetPreCADOption(optionName).c_str());
1026 }
1027
1028 //=============================================================================
1029
1030 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
1031     throw (SALOME::SALOME_Exception) {
1032   ASSERT(myBaseImpl);
1033   MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
1034   if ( !entry || !entry[0] )
1035     THROW_SALOME_CORBA_EXCEPTION( "SetSizeMapEntry(): empty geom entry", SALOME::BAD_PARAM );
1036   bool valueChanged = false;
1037   try {
1038     valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMap);
1039     if (valueChanged)
1040       this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
1041   } catch (const std::invalid_argument& ex) {
1042     SALOME::ExceptionStruct ExDescription;
1043     ExDescription.text = ex.what();
1044     ExDescription.type = SALOME::BAD_PARAM;
1045     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
1046     ExDescription.lineNumber = 0;
1047     throw SALOME::SALOME_Exception(ExDescription);
1048   } catch (SALOME_Exception& ex) {
1049     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1050   }
1051   MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
1052   if (valueChanged)
1053     SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
1054 }
1055
1056 //=============================================================================
1057
1058 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap)
1059   throw (SALOME::SALOME_Exception) {
1060   ASSERT(myBaseImpl);
1061   MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
1062   bool valueChanged = false;
1063   std::ostringstream sizeMapFunction;
1064   switch (shapeType) {
1065   case GEOM::FACE:   sizeMapFunction << "def f(u,v): return " << sizeMap ; break;
1066   case GEOM::EDGE:   sizeMapFunction << "def f(t): return " << sizeMap ; break;
1067   case GEOM::VERTEX: sizeMapFunction << "def f(): return " << sizeMap ; break;
1068   default:;
1069   }
1070   try {
1071     valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMapFunction.str());
1072     if (valueChanged)
1073       this->GetImpl()->SetSizeMapEntry(entry, sizeMapFunction.str());
1074   } catch (const std::invalid_argument& ex) {
1075     SALOME::ExceptionStruct ExDescription;
1076     ExDescription.text = ex.what();
1077     ExDescription.type = SALOME::BAD_PARAM;
1078     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
1079     ExDescription.lineNumber = 0;
1080     throw SALOME::SALOME_Exception(ExDescription);
1081   } catch (SALOME_Exception& ex) {
1082     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1083   }
1084   MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
1085   if (valueChanged)
1086     SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
1087 }
1088
1089 //=============================================================================
1090
1091 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
1092     throw (SALOME::SALOME_Exception) {
1093   ASSERT(myBaseImpl);
1094   MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
1095   bool valueChanged = false;
1096   try {
1097     valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
1098     if ( valueChanged ) {
1099       boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$");
1100       if (!boost::regex_match(string(attractor), re))
1101         throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False;d(opt.))");
1102       this->GetImpl()->SetAttractorEntry(entry, attractor);
1103     }
1104   } catch (const std::invalid_argument& ex) {
1105     SALOME::ExceptionStruct ExDescription;
1106     ExDescription.text = ex.what();
1107     ExDescription.type = SALOME::BAD_PARAM;
1108     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
1109     ExDescription.lineNumber = 0;
1110     throw SALOME::SALOME_Exception(ExDescription);
1111   } catch (SALOME_Exception& ex) {
1112     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1113   }
1114   MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
1115   if (valueChanged)
1116     SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
1117 }
1118
1119 //=============================================================================
1120
1121 void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO à finir
1122   throw (SALOME::SALOME_Exception)
1123 {
1124   ASSERT(myBaseImpl);
1125   MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
1126   //bool valueChanged = false;
1127   try {
1128     this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
1129   }
1130   catch (const std::invalid_argument& ex) {
1131     SALOME::ExceptionStruct ExDescription;
1132     ExDescription.text = ex.what();
1133     ExDescription.type = SALOME::BAD_PARAM;
1134     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius)";
1135     ExDescription.lineNumber = 0;
1136     throw SALOME::SALOME_Exception(ExDescription);
1137   } catch (SALOME_Exception& ex) {
1138     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1139   }
1140   MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
1141   //if ( valueChanged )
1142   SMESH::TPythonDump() << _this() << ".SetAttractorGeom( "
1143                        << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
1144 }
1145
1146 //=============================================================================
1147
1148 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1149   ASSERT(myBaseImpl);
1150   try {
1151     return CORBA::string_dup(this->GetImpl()->GetSizeMapEntry(entry).c_str());
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::GetSizeMapEntry(name)";
1157     ExDescription.lineNumber = 0;
1158     throw SALOME::SALOME_Exception(ExDescription);
1159   } catch (SALOME_Exception& ex) {
1160     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1161   }
1162   return 0;
1163 }
1164
1165 //=============================================================================
1166
1167 char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1168   ASSERT(myBaseImpl);
1169   try {
1170     return CORBA::string_dup(this->GetImpl()->GetAttractorEntry(entry).c_str());
1171   } catch (const std::invalid_argument& ex) {
1172     SALOME::ExceptionStruct ExDescription;
1173     ExDescription.text = ex.what();
1174     ExDescription.type = SALOME::BAD_PARAM;
1175     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
1176     ExDescription.lineNumber = 0;
1177     throw SALOME::SALOME_Exception(ExDescription);
1178   } catch (SALOME_Exception& ex) {
1179     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1180   }
1181   return 0;
1182 }
1183
1184 // //=============================================================================
1185 // 
1186 // // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
1187 // // A finir pour le dump
1188 // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
1189 //   throw (SALOME::SALOME_Exception)
1190 // {
1191 //   ASSERT(myBaseImpl);
1192 //   try {
1193 //     return CORBA::string_dup( this->GetImpl()->GetClassAttractorEntry(entry).c_str());
1194 //   }
1195 //   catch (const std::invalid_argument& ex) {
1196 //     SALOME::ExceptionStruct ExDescription;
1197 //     ExDescription.text = ex.what();
1198 //     ExDescription.type = SALOME::BAD_PARAM;
1199 //     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetClassAttractorEntry(name)";
1200 //     ExDescription.lineNumber = 0;
1201 //     throw SALOME::SALOME_Exception(ExDescription);
1202 //   }
1203 //   catch (SALOME_Exception& ex) {
1204 //     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1205 //   }
1206 //   return 0;
1207 // }
1208
1209 //=============================================================================
1210
1211 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry) {
1212   ASSERT(myBaseImpl);
1213   this->GetImpl()->ClearEntry(entry);
1214   //  SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
1215 }
1216
1217 //=============================================================================
1218
1219 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries() {
1220   ASSERT(myBaseImpl);
1221   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1222
1223   const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = this->GetImpl()->_GetSizeMapEntries();
1224   result->length(sizeMaps.size());
1225
1226   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
1227   for (int i = 0; smIt != sizeMaps.end(); ++smIt, ++i) {
1228     string entry_sizemap = smIt->first;
1229     if (!smIt->second.empty()) {
1230       entry_sizemap += "|";
1231       entry_sizemap += smIt->second;
1232     }
1233     result[i] = CORBA::string_dup(entry_sizemap.c_str());
1234   }
1235   return result._retn();
1236 }
1237
1238 //=============================================================================
1239
1240 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries() {
1241   ASSERT(myBaseImpl);
1242   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1243
1244   const ::BLSURFPlugin_Hypothesis::TSizeMap attractors = this->GetImpl()->_GetAttractorEntries();
1245   result->length(attractors.size());
1246
1247   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
1248   for (int i = 0; atIt != attractors.end(); ++atIt, ++i) {
1249     string entry_attractor = atIt->first;
1250     if (!atIt->second.empty()) {
1251       entry_attractor += "|";
1252       entry_attractor += atIt->second;
1253     }
1254     result[i] = CORBA::string_dup(entry_attractor.c_str());
1255   }
1256   return result._retn();
1257 }
1258
1259 //=============================================================================
1260
1261 BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
1262 {
1263   ASSERT(myBaseImpl);
1264   BLSURFPlugin::TAttParamsMap_var result = new BLSURFPlugin::TAttParamsMap();
1265
1266   const ::BLSURFPlugin_Hypothesis::TAttractorMap attractors= this->GetImpl()->_GetClassAttractorEntries();
1267   result->length( attractors.size() );
1268
1269   ::BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator atIt = attractors.begin();
1270   for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
1271     string faceEntry = atIt->first;
1272     string attEntry;
1273     double startSize, endSize, infDist, constDist;
1274     if ( !atIt->second->Empty() ) {
1275       attEntry = atIt->second->GetAttractorEntry();
1276       MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
1277       std::vector<double> params = atIt->second->GetParameters();
1278       startSize = params[0];
1279       endSize = params[1];
1280       infDist = params[2];
1281       constDist = params[3];
1282     }
1283     result[i].faceEntry = CORBA::string_dup(faceEntry.c_str());
1284     result[i].attEntry = CORBA::string_dup(attEntry.c_str());
1285     result[i].startSize = startSize;
1286     result[i].endSize = endSize;
1287     result[i].infDist = infDist;
1288     result[i].constDist = constDist;
1289     MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
1290     MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
1291   }
1292   return result._retn();
1293 }
1294
1295 //=============================================================================
1296
1297 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
1298     throw (SALOME::SALOME_Exception) {
1299   ASSERT(myBaseImpl);
1300   for ( CORBA::ULong i = 0; i < sizeMaps.length(); ++i) {
1301     string entry_sizemap = sizeMaps[i].in();
1302     size_t colonPos = entry_sizemap.find('|');
1303     string entry, sizemap;
1304     if (colonPos == string::npos) // '|' separator not found
1305       entry = entry_sizemap;
1306     else {
1307       entry = entry_sizemap.substr(0, colonPos);
1308       if (colonPos < entry_sizemap.size() - 1 && entry_sizemap[colonPos] != ' ')
1309         sizemap = entry_sizemap.substr(colonPos + 1);
1310     }
1311     this->GetImpl()->SetSizeMapEntry(entry.c_str(), sizemap.c_str());
1312   }
1313 }
1314
1315 //=============================================================================
1316
1317 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps() {
1318   ASSERT(myBaseImpl);
1319   this->GetImpl()->ClearSizeMaps();
1320 }
1321
1322 //=============================================================================
1323
1324 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
1325   throw (SALOME::SALOME_Exception)
1326 {
1327   ASSERT(myBaseImpl);
1328   string entry;
1329   entry = GeomObj->GetStudyEntry();
1330   MESSAGE("IDL : GetName : " << GeomObj->GetName());
1331   MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1332   SetSizeMapEntry(entry.c_str(), sizeMap);
1333 }
1334
1335 //=============================================================================
1336
1337 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMap(const GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap) {
1338   ASSERT(myBaseImpl);
1339   string entry = GeomObj->GetStudyEntry();
1340   GEOM::shape_type shapeType = GeomObj->GetShapeType();
1341   if (shapeType == GEOM::COMPOUND)
1342     shapeType = GeomObj->GetMaxShapeType();
1343   MESSAGE("IDL : GetName : " << GeomObj->GetName());
1344   MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1345   SetConstantSizeMapEntry(entry.c_str(), shapeType, sizeMap);
1346 }
1347
1348 //=============================================================================
1349 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj) {
1350   ASSERT(myBaseImpl);
1351   string entry;
1352   entry = GeomObj->GetStudyEntry();
1353   MESSAGE("IDL : GetName : " << GeomObj->GetName());
1354   MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
1355   UnsetEntry(entry.c_str());
1356   SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
1357 }
1358
1359 void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor) {
1360   ASSERT(myBaseImpl);
1361   string entry;
1362   entry = GeomObj->GetStudyEntry();
1363   MESSAGE("IDL : GetName : " << GeomObj->GetName());
1364   MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
1365   SetAttractorEntry(entry.c_str(), attractor);
1366 }
1367
1368 void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
1369   ASSERT(myBaseImpl);
1370   string entry;
1371   entry = GeomObj->GetStudyEntry();
1372   MESSAGE("IDL : GetName : " << GeomObj->GetName());
1373   MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
1374   UnsetEntry(entry.c_str());
1375   SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
1376 }
1377
1378 void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theAttractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius)
1379 {
1380   ASSERT(myBaseImpl);
1381   string theFaceEntry;
1382   string theAttEntry;
1383   theFaceEntry = theFace->GetStudyEntry();
1384   theAttEntry  = theAttractor->GetStudyEntry();
1385   
1386   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1387   SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1388   string aName;
1389   
1390   if (theFaceEntry.empty()) {
1391     aName = "Face_";
1392     aName += theFace->GetEntry();
1393     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1394     if (!theSFace->_is_nil())
1395       theFaceEntry = theSFace->GetID();
1396   }
1397   if (theFaceEntry.empty())
1398     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1399   
1400   if (theAttEntry.empty()) {
1401     if (theAttractor->GetShapeType() == GEOM::VERTEX)
1402       aName = "Vertex_";
1403     if (theAttractor->GetShapeType() == GEOM::EDGE)
1404       aName = "Edge_";
1405     if (theAttractor->GetShapeType() == GEOM::WIRE)
1406       aName = "Wire_";
1407     if (theAttractor->GetShapeType() == GEOM::COMPOUND)
1408       aName = "Compound_";
1409     aName += theAttractor->GetEntry();
1410     SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theAttractor, aName.c_str());
1411     if (!theSAtt->_is_nil())
1412       theAttEntry = theSAtt->GetID();
1413   }
1414   if (theAttEntry.empty())
1415     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1416   
1417   TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
1418   TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
1419   MESSAGE("IDL : GetName : " << theFace->GetName());
1420   MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
1421   SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
1422 }
1423
1424 void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace,
1425                                                    GEOM::GEOM_Object_ptr theAttractor)
1426 {
1427   ASSERT(myBaseImpl);
1428   CORBA::String_var theFaceEntry = theFace->GetStudyEntry();
1429   CORBA::String_var theAttrEntry = theAttractor->GetStudyEntry();
1430   
1431   // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1432   // SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1433   // string aName;
1434   
1435   // if (theFaceEntry.empty()) {
1436   //   aName = "Face_";
1437   //   aName += theFace->GetEntry();
1438   //   SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1439   //   if (!theSFace->_is_nil())
1440   //     theFaceEntry = theSFace->GetID();
1441   // }
1442   if ( !theFaceEntry.in() || !theFaceEntry.in()[0] ||
1443        !theAttrEntry.in() || !theAttrEntry.in()[0] )
1444     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1445   
1446   MESSAGE("IDL : GetName : " << theFace->GetName());
1447   MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
1448   GetImpl()->ClearEntry( theFaceEntry.in(), theAttrEntry.in() );
1449   SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( "
1450                        << theFace << ", " << theAttractor << " )";
1451 }
1452
1453 void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry,
1454                                                     const char* attractorEntry)
1455 {
1456   GetImpl()->ClearEntry( faceEntry, attractorEntry );
1457   SMESH::TPythonDump() << _this() << ".UnsetAttractorEntry( '"
1458                        << faceEntry << "', '" << attractorEntry << "' )";
1459 }
1460
1461
1462 /*
1463  void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
1464  {}
1465
1466  void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
1467  {}
1468
1469  void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
1470  {}
1471
1472  char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
1473  {}
1474
1475  void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
1476  {
1477  ASSERT(myBaseImpl);
1478  this->GetImpl()->UnsetCustomSizeMap(entry);
1479  SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
1480  }
1481
1482
1483  BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
1484  {}
1485
1486  */
1487
1488 // ///////////////////////
1489 // // ENFORCED VERTICES //
1490 // ///////////////////////
1491
1492
1493 /**
1494  * Returns the list of enforced vertices for a given Face entry
1495  * @return A map of Face entry / List of enforced vertices
1496  *
1497  */
1498 BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
1499   MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
1500   ASSERT(myBaseImpl);
1501
1502   BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
1503
1504   const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
1505       this->GetImpl()->_GetAllEnforcedVerticesByFace();
1506   resultMap->length(faceEntryEnfVertexListMap.size());
1507   MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
1508
1509   ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
1510   ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
1511   for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
1512     BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
1513         new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
1514     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1515     MESSAGE("Face Entry: " << mapElement->faceEntry);
1516
1517     _enfVertexList = it_entry->second;
1518     BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
1519     enfVertexList->length(_enfVertexList.size());
1520     MESSAGE("Number of enf vertex: " << enfVertexList->length());
1521
1522     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
1523     ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1524     for (int j = 0; it_enfVertex != _enfVertexList.end(); ++it_enfVertex, ++j) {
1525       currentEnfVertex = (*it_enfVertex);
1526
1527       BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1528
1529       // Name
1530       enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1531
1532       // Geom entry
1533       enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1534
1535       // Coords
1536       BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1537       coords->length(currentEnfVertex->coords.size());
1538       for (CORBA::ULong i=0;i<coords->length();i++)
1539         coords[i] = currentEnfVertex->coords[i];
1540       enfVertex->coords = coords;
1541
1542       // Group name
1543       enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1544       
1545       // Face entry list
1546       BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1547       faceEntryList->length(currentEnfVertex->faceEntries.size());
1548       ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1549       for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1550         faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1551       enfVertex->faceEntries = faceEntryList;
1552
1553       ostringstream msg;
1554       msg << "Enforced vertex: \n"
1555           << "Name: " << enfVertex->name << "\n";
1556       if (coords->length())
1557           msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1558       msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1559           << "Group Name: " << enfVertex->grpName;
1560       MESSAGE(msg.str());
1561
1562       enfVertexList[j] = enfVertex;
1563     }
1564     mapElement->enfVertexList = enfVertexList;
1565
1566     resultMap[i] = mapElement;
1567
1568   }
1569   return resultMap._retn();
1570 }
1571
1572 /**
1573  * Returns the list of all enforced vertices
1574  * @return a list of enforced vertices
1575  *
1576  */
1577 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
1578   MESSAGE("IDL: GetAllEnforcedVertices()");
1579   ASSERT(myBaseImpl);
1580   BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
1581   const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
1582   resultMap->length(enfVertexList.size());
1583   MESSAGE("Enforced Vertex map size is " << resultMap->length());
1584
1585   ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
1586   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1587   for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
1588     MESSAGE("Enforced Vertex #" << i);
1589     currentEnfVertex = (*evlIt);
1590     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1591     // Name
1592     enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1593     // Geom entry
1594     enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1595     // Coords
1596     BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1597     coords->length(currentEnfVertex->coords.size());
1598     for (CORBA::ULong ind = 0; ind < coords->length(); ind++)
1599       coords[ind] = currentEnfVertex->coords[ind];
1600     enfVertex->coords = coords;
1601     // Group name
1602     enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());  
1603     // Face entry list
1604     BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1605     faceEntryList->length(currentEnfVertex->faceEntries.size());
1606     ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1607     for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1608       faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1609     enfVertex->faceEntries = faceEntryList;
1610
1611     ostringstream msg;
1612     msg << "Enforced vertex: \n"
1613         << "Name: " << enfVertex->name << "\n";
1614     if (coords->length())
1615         msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1616     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1617         << "Group Name: " << enfVertex->grpName;
1618     MESSAGE(msg.str());
1619
1620     resultMap[i] = enfVertex;
1621   }
1622   return resultMap._retn();
1623
1624 }
1625
1626 /**
1627  * Returns the list of enforced vertices coords for a given Face entry.
1628  * They are the coords of the "manual" enforced vertices.
1629  * @return A map of Face entry / List of enforced vertices coords
1630  *
1631  */
1632 BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
1633   MESSAGE("IDL: GetAllCoordsByFace()");
1634   ASSERT(myBaseImpl);
1635
1636   BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
1637
1638   const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
1639   resultMap->length(entryCoordsListMap.size());
1640   MESSAGE("Enforced Vertex map size is " << resultMap->length());
1641
1642   ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
1643   ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
1644   for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
1645     BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
1646     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1647     MESSAGE("Face Entry: " << mapElement->faceEntry);
1648
1649     _coordsList = it_entry->second;
1650     BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
1651     coordsList->length(_coordsList.size());
1652     MESSAGE("Number of coords: " << coordsList->length());
1653
1654     ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
1655     for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
1656       BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1657       coords->length((*it_coords).size());
1658       for (CORBA::ULong i=0;i<coords->length();i++)
1659         coords[i] = (*it_coords)[i];
1660       coordsList[j] = coords;
1661       MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
1662     }
1663     mapElement->coordsList = coordsList;
1664
1665     resultMap[i] = mapElement;
1666
1667   }
1668   return resultMap._retn();
1669 }
1670
1671 /**
1672  * Returns a map of enforced vertices coords / enforced vertex.
1673  * They are the coords of the "manual" enforced vertices.
1674  */
1675 BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
1676   MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
1677   ASSERT(myBaseImpl);
1678
1679   BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
1680   const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
1681       this->GetImpl()->_GetAllEnforcedVerticesByCoords();
1682   resultMap->length(coordsEnfVertexMap.size());
1683   MESSAGE("Enforced Vertex map size is " << resultMap->length());
1684
1685   ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
1686   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1687   for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
1688     MESSAGE("Enforced Vertex #" << i);
1689     currentEnfVertex = (it_coords->second);
1690     BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
1691     BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1692     coords->length(it_coords->first.size());
1693     for (CORBA::ULong ind=0;ind<coords->length();ind++)
1694       coords[ind] = it_coords->first[ind];
1695     mapElement->coords = coords;
1696     MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
1697
1698     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1699     // Name
1700     enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1701     // Geom entry
1702     enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1703     // Coords
1704     BLSURFPlugin::TEnfVertexCoords_var coords2 = new BLSURFPlugin::TEnfVertexCoords();
1705     coords2->length(currentEnfVertex->coords.size());
1706     for (CORBA::ULong ind=0;ind<coords2->length();ind++)
1707       coords2[ind] = currentEnfVertex->coords[ind];
1708     enfVertex->coords = coords2;
1709     // Group name
1710     enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());  
1711     // Face entry list
1712     BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1713     faceEntryList->length(currentEnfVertex->faceEntries.size());
1714     ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1715     for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1716       faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1717     enfVertex->faceEntries = faceEntryList;
1718       
1719     mapElement->enfVertex = enfVertex;
1720     ostringstream msg;
1721     msg << "Enforced vertex: \n"
1722         << "Name: " << enfVertex->name << "\n";
1723     if (coords->length())
1724         msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1725     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1726         << "Group Name: " << enfVertex->grpName;
1727     MESSAGE(msg.str());
1728
1729     resultMap[i] = mapElement;
1730   }
1731   return resultMap._retn();
1732 }
1733
1734 /**
1735  * Returns the list of enforced vertices entries for a given Face entry.
1736  * They are the geom entries of the enforced vertices based on geom shape (vertex, compound, group).
1737  * @return A map of Face entry / List of enforced vertices geom entries
1738  *
1739  */
1740 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
1741   MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
1742   ASSERT(myBaseImpl);
1743
1744   BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
1745
1746   const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
1747       this->GetImpl()->_GetAllEnfVertexEntriesByFace();
1748   resultMap->length(entryEnfVertexEntryListMap.size());
1749   MESSAGE("Enforced Vertex map size is " << resultMap->length());
1750
1751   ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
1752   ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
1753       entryEnfVertexEntryListMap.begin();
1754   for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
1755     BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
1756         new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
1757     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1758     MESSAGE("Face Entry: " << mapElement->faceEntry);
1759
1760     _enfVertexEntryList = it_entry->second;
1761     BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
1762     enfVertexEntryList->length(_enfVertexEntryList.size());
1763     MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
1764
1765     ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
1766     for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
1767       enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
1768       MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
1769     }
1770     mapElement->enfVertexEntryList = enfVertexEntryList;
1771
1772     resultMap[i] = mapElement;
1773
1774   }
1775   return resultMap._retn();
1776 }
1777
1778 /**
1779  * Returns a map of enforced vertices geom entry / enforced vertex.
1780  * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
1781  */
1782 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
1783   MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
1784   ASSERT(myBaseImpl);
1785
1786   BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
1787   const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
1788       this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
1789   resultMap->length(enfVertexEntryEnfVertexMap.size());
1790   MESSAGE("Enforced Vertex map size is " << resultMap->length());
1791
1792   ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
1793   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1794   for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
1795     MESSAGE("Enforced Vertex #" << i);
1796     currentEnfVertex = it_enfVertexEntry->second;
1797     BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
1798     mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
1799     MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
1800
1801     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1802     // Name
1803     enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1804     // Geom entry
1805     enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1806     // Coords
1807     BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1808     coords->length(currentEnfVertex->coords.size());
1809     for (CORBA::ULong ind=0;ind<coords->length();ind++)
1810       coords[ind] = currentEnfVertex->coords[ind];
1811     enfVertex->coords = coords;
1812     // Group name
1813     enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());  
1814     // Face entry list
1815     BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1816     faceEntryList->length(currentEnfVertex->faceEntries.size());
1817     ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1818     for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1819       faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1820     enfVertex->faceEntries = faceEntryList;
1821
1822     ostringstream msg;
1823     msg << "Enforced vertex: \n"
1824         << "Name: " << enfVertex->name << "\n";
1825     if (coords->length())
1826         msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1827     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1828         << "Group Name: " << enfVertex->grpName;
1829     MESSAGE(msg.str());
1830
1831     mapElement->enfVertex = enfVertex;
1832     resultMap[i] = mapElement;
1833   }
1834   return resultMap._retn();
1835 }
1836
1837 /**
1838  * Erase all enforced vertices
1839  */
1840 void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
1841   ASSERT(myBaseImpl);
1842   this->GetImpl()->ClearAllEnforcedVertices();
1843   SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
1844 }
1845
1846 /*!
1847  * Set/get/unset an enforced vertex on face
1848  */
1849 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
1850     CORBA::Double z) throw (SALOME::SALOME_Exception) {
1851   ASSERT(myBaseImpl);
1852
1853   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1854     MESSAGE("theFace shape type is not FACE or COMPOUND");
1855     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1856   }
1857
1858   string theFaceEntry = theFace->GetStudyEntry();
1859   
1860   if (theFaceEntry.empty()) {
1861     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1862     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1863     string aName;
1864     if (theFace->GetShapeType() == GEOM::FACE)
1865       aName = "Face_";
1866     if (theFace->GetShapeType() == GEOM::COMPOUND)
1867       aName = "Compound_";
1868     aName += theFace->GetEntry();
1869     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1870     if (!theSFace->_is_nil())
1871       theFaceEntry = theSFace->GetID();
1872   }
1873   if (theFaceEntry.empty())
1874     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1875   MESSAGE("IDL : GetName : " << theFace->GetName());
1876   MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
1877   try {
1878     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
1879   } catch (SALOME_Exception& ex) {
1880     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1881   }
1882 }
1883
1884 /*!
1885  * Set/get/unset an enforced vertex with name on face
1886  */
1887 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
1888     CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
1889   ASSERT(myBaseImpl);
1890
1891   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1892     MESSAGE("theFace shape type is not FACE or COMPOUND");
1893     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1894   }
1895
1896   string theFaceEntry = theFace->GetStudyEntry();
1897   
1898   if (theFaceEntry.empty()) {
1899     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1900     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1901     string aName;
1902     if (theFace->GetShapeType() == GEOM::FACE)
1903       aName = "Face_";
1904     if (theFace->GetShapeType() == GEOM::COMPOUND)
1905       aName = "Compound_";
1906     aName += theFace->GetEntry();
1907     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1908     if (!theSFace->_is_nil())
1909       theFaceEntry = theSFace->GetID();
1910   }
1911   if (theFaceEntry.empty())
1912     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1913   
1914   MESSAGE("IDL : GetName : " << theFace->GetName());
1915   MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
1916   try {
1917     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
1918   } catch (SALOME_Exception& ex) {
1919     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1920   }
1921 }
1922
1923 /*!
1924  * Set/get/unset an enforced vertex with geom object on face
1925  */
1926 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
1927     throw (SALOME::SALOME_Exception) {
1928   ASSERT(myBaseImpl);
1929
1930   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1931     MESSAGE("theFace shape type is not FACE or COMPOUND");
1932     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1933   }
1934
1935   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
1936     MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
1937     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
1938   }
1939
1940   //  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1941   //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
1942   //  if (CORBA::is_nil(measureOp))
1943   //    return false;
1944   //
1945   //  CORBA::Double x, y, z;
1946   //  x = y = z = 0.;
1947   //  measureOp->PointCoordinates(theVertex, x, y, z);
1948
1949   string theFaceEntry = theFace->GetStudyEntry();
1950   string theVertexEntry = theVertex->GetStudyEntry();
1951   
1952   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1953   SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1954   string aName;
1955   
1956   if (theFaceEntry.empty()) {
1957     if (theFace->GetShapeType() == GEOM::FACE)
1958       aName = "Face_";
1959     if (theFace->GetShapeType() == GEOM::COMPOUND)
1960       aName = "Compound_";
1961     aName += theFace->GetEntry();
1962     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1963     if (!theSFace->_is_nil())
1964       theFaceEntry = theSFace->GetID();
1965   }
1966   if (theFaceEntry.empty())
1967     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1968   
1969   if (theVertexEntry.empty()) {
1970     if (theVertex->GetShapeType() == GEOM::VERTEX)
1971       aName = "Vertex_";
1972     if (theVertex->GetShapeType() == GEOM::COMPOUND)
1973       aName = "Compound_";
1974     aName += theVertex->GetEntry();
1975     SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
1976     if (!theSVertex->_is_nil())
1977       theVertexEntry = theSVertex->GetID();
1978   }
1979   if (theVertexEntry.empty())
1980     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1981
1982   string theVertexName = theVertex->GetName();
1983   MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
1984   MESSAGE("IDL : theVertex->GetName : " << theVertexName);
1985   MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
1986   try {
1987     return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
1988   } catch (SALOME_Exception& ex) {
1989     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1990   }
1991 }
1992
1993 /*!
1994  * Set an enforced vertex with group name on face
1995  */
1996 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
1997  throw (SALOME::SALOME_Exception)
1998 {
1999   ASSERT(myBaseImpl);
2000
2001   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2002     MESSAGE("theFace shape type is not FACE or COMPOUND");
2003     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2004   }
2005
2006   string theFaceEntry = theFace->GetStudyEntry();
2007   
2008   if (theFaceEntry.empty()) {
2009     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2010     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2011     string aName;
2012     if (theFace->GetShapeType() == GEOM::FACE)
2013       aName = "Face_";
2014     if (theFace->GetShapeType() == GEOM::COMPOUND)
2015       aName = "Compound_";
2016     aName += theFace->GetEntry();
2017     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2018     if (!theSFace->_is_nil())
2019       theFaceEntry = theSFace->GetID();
2020   }
2021   if (theFaceEntry.empty())
2022     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2023   MESSAGE("IDL : GetName : " << theFace->GetName());
2024   MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
2025   try {
2026     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
2027   } catch (SALOME_Exception& ex) {
2028     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2029   }
2030 }
2031
2032 /*!
2033  * Set an enforced vertex with name and group name on face
2034  */
2035 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, 
2036                                                                 const char* theVertexName, const char* theGroupName)
2037  throw (SALOME::SALOME_Exception)
2038 {
2039   ASSERT(myBaseImpl);
2040
2041   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2042     MESSAGE("theFace shape type is not FACE or COMPOUND");
2043     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2044   }
2045
2046   string theFaceEntry = theFace->GetStudyEntry();
2047   
2048   if (theFaceEntry.empty()) {
2049     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2050     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2051     string aName;
2052     if (theFace->GetShapeType() == GEOM::FACE)
2053       aName = "Face_";
2054     if (theFace->GetShapeType() == GEOM::COMPOUND)
2055       aName = "Compound_";
2056     aName += theFace->GetEntry();
2057     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2058     if (!theSFace->_is_nil())
2059       theFaceEntry = theSFace->GetID();
2060   }
2061   if (theFaceEntry.empty())
2062     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2063   MESSAGE("IDL : GetName : " << theFace->GetName());
2064   MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
2065   try {
2066     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
2067   } catch (SALOME_Exception& ex) {
2068     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2069   }
2070 }
2071
2072 /*!
2073  * Set an enforced vertex with geom entry and group name on face
2074  */
2075 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
2076  throw (SALOME::SALOME_Exception)
2077 {
2078   ASSERT(myBaseImpl);
2079
2080   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2081     MESSAGE("theFace shape type is not FACE or COMPOUND");
2082     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2083   }
2084
2085   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2086     MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2087     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2088   }
2089
2090   string theFaceEntry = theFace->GetStudyEntry();
2091   string theVertexEntry = theVertex->GetStudyEntry();
2092   
2093   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2094   SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2095   string aName;
2096   
2097   if (theFaceEntry.empty()) {
2098     if (theFace->GetShapeType() == GEOM::FACE)
2099       aName = "Face_";
2100     if (theFace->GetShapeType() == GEOM::COMPOUND)
2101       aName = "Compound_";
2102     aName += theFace->GetEntry();
2103     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2104     if (!theSFace->_is_nil())
2105       theFaceEntry = theSFace->GetID();
2106   }
2107   if (theFaceEntry.empty())
2108     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2109   
2110   if (theVertexEntry.empty()) {
2111     if (theVertex->GetShapeType() == GEOM::VERTEX)
2112       aName = "Vertex_";
2113     if (theVertex->GetShapeType() == GEOM::COMPOUND)
2114       aName = "Compound_";
2115     aName += theVertex->GetEntry();
2116     SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
2117     if (!theSVertex->_is_nil())
2118       theVertexEntry = theSVertex->GetID();
2119   }
2120   if (theVertexEntry.empty())
2121     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2122
2123   string theVertexName = theVertex->GetName();
2124   MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
2125   MESSAGE("IDL : theVertex->GetName : " << theVertexName);
2126   MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
2127   try {
2128     return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
2129   } catch (SALOME_Exception& ex) {
2130     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2131   }
2132 }
2133
2134 //Enable internal enforced vertices on specific face if requested by user
2135 ///*!
2136 // * Are internal enforced vertices used for a face ?
2137 // */
2138 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace)
2139 //    throw (SALOME::SALOME_Exception) {
2140 //  ASSERT(myBaseImpl);
2141
2142 //  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2143 //    MESSAGE("theFace shape type is not FACE or COMPOUND");
2144 //    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2145 //  }
2146
2147 //  string theFaceEntry = theFace->GetStudyEntry();
2148   
2149 //  if (theFaceEntry.empty()) {
2150 //    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2151 //    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2152 //    string aName;
2153 //    if (theFace->GetShapeType() == GEOM::FACE)
2154 //      aName = "Face_";
2155 //    if (theFace->GetShapeType() == GEOM::COMPOUND)
2156 //      aName = "Compound_";
2157 //    aName += theFace->GetEntry();
2158 //    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2159 //    if (!theSFace->_is_nil())
2160 //      theFaceEntry = theSFace->GetID();
2161 //  }
2162 //  if (theFaceEntry.empty())
2163 //    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2164
2165 //  MESSAGE("IDL : GetName : " << theFace->GetName());
2166 //  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2167 //  try {
2168 //    return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
2169 //  } catch (SALOME_Exception& ex) {
2170 //    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2171 //  }
2172 //}
2173
2174 /*!
2175  * Get the list of all enforced vertices
2176  */
2177 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
2178     throw (SALOME::SALOME_Exception) {
2179   ASSERT(myBaseImpl);
2180
2181   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2182     MESSAGE("theFace shape type is not FACE or COMPOUND");
2183     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2184   }
2185
2186   string theFaceEntry = theFace->GetStudyEntry();
2187   
2188   if (theFaceEntry.empty()) {
2189     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2190     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2191     string aName;
2192     if (theFace->GetShapeType() == GEOM::FACE)
2193       aName = "Face_";
2194     if (theFace->GetShapeType() == GEOM::COMPOUND)
2195       aName = "Compound_";
2196     aName += theFace->GetEntry();
2197     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2198     if (!theSFace->_is_nil())
2199       theFaceEntry = theSFace->GetID();
2200   }
2201   if (theFaceEntry.empty())
2202     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2203
2204   MESSAGE("IDL : GetName : " << theFace->GetName());
2205   MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
2206   try {
2207     return GetEnforcedVerticesEntry(theFaceEntry.c_str());
2208   } catch (SALOME_Exception& ex) {
2209     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2210   }
2211 }
2212
2213 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
2214     CORBA::Double z) throw (SALOME::SALOME_Exception) {
2215   ASSERT(myBaseImpl);
2216
2217   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2218     MESSAGE("theFace shape type is not FACE or COMPOUND");
2219     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2220   }
2221
2222   string theFaceEntry = theFace->GetStudyEntry();
2223   
2224   if (theFaceEntry.empty()) {
2225     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2226     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2227     string aName;
2228     if (theFace->GetShapeType() == GEOM::FACE)
2229       aName = "Face_";
2230     if (theFace->GetShapeType() == GEOM::COMPOUND)
2231       aName = "Compound_";
2232     aName += theFace->GetEntry();
2233     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2234     if (!theSFace->_is_nil())
2235       theFaceEntry = theSFace->GetID();
2236   }
2237   if (theFaceEntry.empty())
2238     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2239   MESSAGE("IDL : GetName : " << theFace->GetName());
2240   MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
2241
2242   try {
2243     return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
2244   } catch (SALOME_Exception& ex) {
2245     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2246   }
2247 }
2248
2249 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
2250     throw (SALOME::SALOME_Exception) {
2251   ASSERT(myBaseImpl);
2252
2253   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2254     MESSAGE("theFace shape type is not FACE or COMPOUND");
2255     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2256   }
2257   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2258     MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2259     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2260   }
2261
2262   //  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2263   //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
2264   //  if (CORBA::is_nil(measureOp))
2265   //    return false;
2266   //
2267   //  CORBA::Double x, y, z;
2268   //  x = y = z = 0.;
2269   //  measureOp->PointCoordinates(theVertex, x, y, z);
2270
2271   std::string theFaceEntry = theFace->GetStudyEntry();
2272   std::string theVertexEntry = theVertex->GetStudyEntry();
2273   
2274   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2275   SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2276   string aName;
2277   
2278   if (theFaceEntry.empty()) {
2279     if (theFace->GetShapeType() == GEOM::FACE)
2280       aName = "Face_";
2281     if (theFace->GetShapeType() == GEOM::COMPOUND)
2282       aName = "Compound_";
2283     aName += theFace->GetEntry();
2284     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2285     if (!theSFace->_is_nil())
2286       theFaceEntry = theSFace->GetID();
2287   }
2288   if (theFaceEntry.empty())
2289     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2290   
2291   if (theVertexEntry.empty()) {
2292     if (theVertex->GetShapeType() == GEOM::VERTEX)
2293       aName = "Vertex_";
2294     if (theVertex->GetShapeType() == GEOM::COMPOUND)
2295       aName = "Compound_";
2296     aName += theVertex->GetEntry();
2297     SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
2298     if (!theSVertex->_is_nil())
2299       theVertexEntry = theSVertex->GetID();
2300   }
2301   if (theVertexEntry.empty())
2302     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2303   
2304   MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
2305
2306   try {
2307     return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
2308   } catch (SALOME_Exception& ex) {
2309     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2310   }
2311 }
2312
2313 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception) {
2314   ASSERT(myBaseImpl);
2315
2316   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2317     MESSAGE("theFace shape type is not FACE or COMPOUND");
2318     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2319   }
2320
2321   string theFaceEntry = theFace->GetStudyEntry();
2322   
2323   if (theFaceEntry.empty()) {
2324     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2325     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2326     string aName;
2327     if (theFace->GetShapeType() == GEOM::FACE)
2328       aName = "Face_";
2329     if (theFace->GetShapeType() == GEOM::COMPOUND)
2330       aName = "Compound_";
2331     aName += theFace->GetEntry();
2332     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2333     if (!theSFace->_is_nil())
2334       theFaceEntry = theSFace->GetID();
2335   }
2336   if (theFaceEntry.empty())
2337     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2338   
2339   MESSAGE("IDL : GetName : " << theFace->GetName());
2340   MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
2341
2342   try {
2343     return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
2344   } catch (SALOME_Exception& ex) {
2345     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2346   }
2347 }
2348
2349 /*!
2350  * Set/get/unset an enforced vertex on geom object given by entry
2351  */
2352 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2353     CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
2354     throw (SALOME::SALOME_Exception) {
2355   ASSERT(myBaseImpl);
2356   MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
2357   bool newValue = false;
2358   if (string(theVertexEntry).empty()) {
2359     try {
2360       ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
2361         this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
2362       ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
2363       coords.push_back(x);
2364       coords.push_back(y);
2365       coords.push_back(z);
2366       if (coordsList.find(coords) == coordsList.end()) {
2367         MESSAGE("Coords not found: add it in coordsList");
2368         newValue = true;
2369       } else {
2370         MESSAGE("Coords already found, compare names");
2371         ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
2372         if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2373           MESSAGE("The names are different: update");
2374           //          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
2375           newValue = true;
2376         }
2377         else {
2378           MESSAGE("The names are identical");
2379         }
2380       }
2381     } catch (const std::invalid_argument& ex) {
2382       // no enforced vertex for entry
2383       MESSAGE("Face entry not found : add it to the list");
2384       newValue = true;
2385     }
2386     if (newValue) {
2387       if (string(theVertexName).empty()) {
2388         if (string(theGroupName).empty())
2389           SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
2390         else
2391           SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
2392       }
2393       else {
2394         if (string(theGroupName).empty())
2395           SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
2396         else
2397           SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \""
2398                                << theVertexName << "\", \"" << theGroupName << "\")";
2399       }
2400     }
2401   } else {
2402     try {
2403       ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
2404       ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
2405       if ( it == enfVertexEntryList.end()) {
2406         MESSAGE("Geom entry not found: add it in enfVertexEntryList");
2407         newValue = true;
2408       }
2409       else {
2410         MESSAGE("Geom entry already found, compare names");
2411         ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
2412         if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2413           MESSAGE("The names are different: update");
2414 //          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
2415           newValue = true;
2416         }
2417         else {
2418           MESSAGE("The names are identical");
2419         }
2420       }
2421     } catch (const std::invalid_argument& ex) {
2422       // no enforced vertex for entry
2423       MESSAGE("Face entry not found : add it to the list");
2424       newValue = true;
2425     }
2426     if (newValue) {
2427       if (string(theGroupName).empty())
2428         SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
2429       else
2430         SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
2431     }
2432   }
2433
2434   if (newValue)
2435     this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
2436
2437   MESSAGE("IDL : SetEnforcedVertexEntry END");
2438   return newValue;
2439 }
2440
2441 //Enable internal enforced vertices on specific face if requested by user
2442 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
2443 //    throw (SALOME::SALOME_Exception) {
2444 //  ASSERT(myBaseImpl);
2445 //  try {
2446 //    return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
2447 //  } catch (const std::exception& ex) {
2448 //    std::cout << "Exception: " << ex.what() << std::endl;
2449 //    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2450 //  }
2451 //}
2452   
2453 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
2454     throw (SALOME::SALOME_Exception) {
2455   ASSERT(myBaseImpl);
2456   MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
2457
2458   try {
2459     BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
2460     ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
2461     vertexList->length(_vList.size());
2462     MESSAGE("Number of enforced vertices: " << vertexList->length());
2463     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
2464     for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
2465       ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
2466
2467       BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2468
2469       // Name
2470       enfVertex->name = CORBA::string_dup(_enfVertex->name.c_str());
2471       // Geom Vertex Entry
2472       enfVertex->geomEntry = CORBA::string_dup(_enfVertex->geomEntry.c_str());
2473       // Coords
2474       BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2475       coords->length(_enfVertex->coords.size());
2476       for ( CORBA::ULong ind = 0; ind < coords->length(); ind++ )
2477         coords[ind] = _enfVertex->coords[ind];
2478       enfVertex->coords = coords;
2479       // Group Name
2480       enfVertex->grpName = CORBA::string_dup(_enfVertex->grpName.c_str());
2481       // Face entry list
2482       BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2483       faceEntryList->length(_enfVertex->faceEntries.size());
2484       ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = _enfVertex->faceEntries.begin();
2485       for (int ind = 0; it_entry != _enfVertex->faceEntries.end();++it_entry, ++ind)
2486         faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2487       enfVertex->faceEntries = faceEntryList;
2488
2489       vertexList[i] = enfVertex;
2490     }
2491     MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
2492     return vertexList._retn();
2493   } catch (const std::invalid_argument& ex) {
2494     SALOME::ExceptionStruct ExDescription;
2495     ExDescription.text = ex.what();
2496     ExDescription.type = SALOME::BAD_PARAM;
2497     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
2498     ExDescription.lineNumber = 1385;
2499     throw SALOME::SALOME_Exception(ExDescription);
2500   } catch (const std::exception& ex) {
2501     std::cout << "Exception: " << ex.what() << std::endl;
2502     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2503   }
2504 }
2505
2506 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2507     CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
2508   ASSERT(myBaseImpl);
2509   MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
2510
2511   bool res = false;
2512   try {
2513     res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
2514
2515     if (string(theVertexEntry).empty())
2516       SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
2517           << ")";
2518     else
2519       SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
2520
2521   } catch (const std::invalid_argument& ex) {
2522     return false;
2523   } catch (const std::exception& ex) {
2524     std::cout << "Exception: " << ex.what() << std::endl;
2525     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2526   }
2527
2528   MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
2529   return res;
2530 }
2531
2532 //bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
2533 //    CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
2534 //  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
2535 //
2536 //  bool ret = false;
2537 //
2538 //  try {
2539 //    ret = _unsetEnfVertex(theFaceEntry, x, y, z);
2540 //  } catch (SALOME_Exception& ex) {
2541 //    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2542 //  }
2543 //
2544 //  if (ret)
2545 //    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
2546 //        << ")";
2547 //
2548 //  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
2549 //  return ret;
2550 //}
2551
2552 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
2553   ASSERT(myBaseImpl);
2554   MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
2555
2556   try {
2557     this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
2558     SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
2559   } catch (const std::invalid_argument& ex) {
2560     return false;
2561   } catch (const std::exception& ex) {
2562     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2563   }
2564
2565   MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
2566   return true;
2567 }
2568
2569 //=============================================================================
2570 /*!
2571  *  BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces
2572  *
2573  *  Set true or false
2574  */
2575 //=============================================================================
2576 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
2577   MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
2578   ASSERT(myBaseImpl);
2579   this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
2580   std::string theValueStr = theValue ? "True" : "False";
2581   SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFaces( " << theValueStr.c_str() << " )";
2582 }
2583
2584 //=============================================================================
2585 /*!
2586  *  BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces
2587  *
2588  *  Get true or false
2589  */
2590 //=============================================================================
2591 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
2592   MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
2593   ASSERT(myBaseImpl);
2594   return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
2595 }
2596
2597 //=============================================================================
2598 /*!
2599  *  BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup
2600  *
2601  *  Set group name
2602  */
2603 //=============================================================================
2604 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char*  groupName) {
2605   MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
2606   ASSERT(myBaseImpl);
2607   this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
2608   SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
2609 }
2610
2611 //=============================================================================
2612 /*!
2613  *  BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup
2614  *
2615  *  Get group name
2616  */
2617 //=============================================================================
2618 char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
2619   MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
2620   ASSERT(myBaseImpl);
2621   return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
2622 }
2623
2624 /*
2625  * Enable internal enforced vertices on specific face if requested by user
2626  *
2627 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
2628  throw (SALOME::SALOME_Exception)
2629 {
2630   MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
2631   try {
2632     SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
2633   } catch (SALOME_Exception& ex) {
2634     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2635   }
2636 }
2637
2638 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
2639  throw (SALOME::SALOME_Exception)
2640 {
2641   MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
2642
2643   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2644     MESSAGE("theFace shape type is not FACE or COMPOUND");
2645     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2646   }
2647
2648   string theFaceEntry = theFace->GetStudyEntry();
2649
2650   if (theFaceEntry.empty()) {
2651     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2652     SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2653     string aName;
2654     if (theFace->GetShapeType() == GEOM::FACE)
2655       aName = "Face_";
2656     if (theFace->GetShapeType() == GEOM::COMPOUND)
2657       aName = "Compound_";
2658     aName += theFace->GetEntry();
2659     SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2660     if (!theSFace->_is_nil())
2661       theFaceEntry = theSFace->GetID();
2662   }
2663   if (theFaceEntry.empty())
2664     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2665
2666   MESSAGE("IDL : GetName : " << theFace->GetName());
2667   MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2668   try {
2669     SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
2670   } catch (SALOME_Exception& ex) {
2671     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2672   }
2673 }
2674
2675 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
2676     throw (SALOME::SALOME_Exception)
2677 {
2678   MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
2679   ASSERT(myBaseImpl);
2680   try {
2681     this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
2682     std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
2683     if (string(theGroupName).empty())
2684       SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
2685     else
2686       SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
2687   } catch (const std::exception& ex) {
2688     std::cout << "Exception: " << ex.what() << std::endl;
2689     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2690   }
2691 }
2692
2693 */
2694
2695 /* TODO GROUPS
2696  char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
2697  throw (SALOME::SALOME_Exception)
2698  {
2699  ASSERT(myBaseImpl);
2700  MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
2701  try {
2702  return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
2703  }
2704  catch (const std::invalid_argument& ex) {
2705  SALOME::ExceptionStruct ExDescription;
2706  ExDescription.text = ex.what();
2707  ExDescription.type = SALOME::BAD_PARAM;
2708  ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
2709  ExDescription.lineNumber = 1146;
2710  throw SALOME::SALOME_Exception(ExDescription);
2711  }
2712  catch (SALOME_Exception& ex) {
2713  THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2714  }
2715  MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
2716  return 0;
2717  }
2718
2719
2720  void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
2721  throw (SALOME::SALOME_Exception)
2722  {
2723  ASSERT(myBaseImpl);
2724  MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
2725  try {
2726  this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
2727  }
2728  catch (const std::invalid_argument& ex) {
2729  SALOME::ExceptionStruct ExDescription;
2730  ExDescription.text = ex.what();
2731  ExDescription.type = SALOME::BAD_PARAM;
2732  ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
2733  ExDescription.lineNumber = 1170;
2734  throw SALOME::SALOME_Exception(ExDescription);
2735  }
2736  catch (SALOME_Exception& ex) {
2737  THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2738  }
2739
2740  SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
2741  << x << ", " << y << ", " << z << ", '" << groupName << "' )";
2742
2743  MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
2744  }
2745  */
2746 ///////////////////////
2747
2748 ///////////////////////
2749 // PERIODICITY       //
2750 ///////////////////////
2751
2752
2753 std::string BLSURFPlugin_Hypothesis_i::ShapeTypeToString(GEOM::shape_type theShapeType)
2754 {
2755 //enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE /*, __max_shape_type=0xffffffff */ };
2756   std::map<GEOM::shape_type, std::string> MapShapeTypeToString;
2757   MapShapeTypeToString[GEOM::COMPOUND] = std::string("COMPOUND");
2758   MapShapeTypeToString[GEOM::COMPSOLID] = std::string("COMPSOLID");
2759   MapShapeTypeToString[GEOM::SOLID] = std::string("SOLID");
2760   MapShapeTypeToString[GEOM::SHELL] = std::string("SHELL");
2761   MapShapeTypeToString[GEOM::FACE] = std::string("FACE");
2762   MapShapeTypeToString[GEOM::WIRE] = std::string("WIRE");
2763   MapShapeTypeToString[GEOM::EDGE] = std::string("EDGE");
2764   MapShapeTypeToString[GEOM::VERTEX] = std::string("VERTEX");
2765   MapShapeTypeToString[GEOM::SHAPE] = std::string("SHAPE");
2766   std::string txtShapeType = MapShapeTypeToString[theShapeType];
2767   return txtShapeType;
2768 }
2769
2770 void BLSURFPlugin_Hypothesis_i::CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes)
2771 {
2772   // Check shape types
2773   bool ok = false;
2774   std::stringstream typesTxt;
2775   for (std::size_t i=0; i<theShapeTypes.size(); i++)
2776     {
2777       GEOM::shape_type theShapeType = theShapeTypes[i];
2778       if (shape->GetShapeType() == theShapeType)
2779         ok = true;
2780       typesTxt << ShapeTypeToString(theShapeType);
2781       if (i < theShapeTypes.size()-1 )
2782         typesTxt << ", ";
2783     }
2784   if (!ok){
2785     std::stringstream msg;
2786     msg << "shape shape type is not in" << typesTxt.str();
2787     MESSAGE(msg);
2788     THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
2789   }
2790 }
2791
2792 void BLSURFPlugin_Hypothesis_i::CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType)
2793 {
2794   // Check shape type
2795   if (shape->GetShapeType() != theShapeType) {
2796     std::stringstream msg;
2797     msg << "shape shape type is not " << ShapeTypeToString(theShapeType);
2798     MESSAGE(msg);
2799     THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
2800   }
2801 }
2802
2803 std::string BLSURFPlugin_Hypothesis_i::PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix)
2804 {
2805   // Check shape is published in the object browser
2806   string shapeEntry = shape->GetStudyEntry();
2807
2808   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2809   SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2810   string aName;
2811
2812   // Publish shape if needed
2813   if (shapeEntry.empty()) {
2814     if (shape->GetShapeType() == theShapeType)
2815       aName = prefix;
2816     aName += shape->GetEntry();
2817     SALOMEDS::SObject_wrap theSFace1 = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, shape, aName.c_str());
2818     if (!theSFace1->_is_nil())
2819       shapeEntry = theSFace1->GetID();
2820   }
2821   if (shapeEntry.empty())
2822     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2823   return shapeEntry;
2824 }
2825
2826 // Format the output of two vectors to use it in MESSAGE and PythonDump
2827 std::string BLSURFPlugin_Hypothesis_i::FormatVerticesEntries(vector<string> &theSourceVerticesEntries, vector<string> &theTargetVerticesEntries)
2828 {
2829   std::stringstream listEntriesTxt;
2830
2831   if (!theSourceVerticesEntries.empty())
2832     {
2833       listEntriesTxt << ", [" ;
2834       size_t i =0;
2835       for (std::vector<std::string>::const_iterator it = theSourceVerticesEntries.begin(); it != theSourceVerticesEntries.end(); it++, i++)
2836         {
2837           if (i>0)
2838             listEntriesTxt << ", ";
2839           listEntriesTxt << *it;
2840         }
2841
2842       listEntriesTxt << "], [" ;
2843       i =0;
2844       for (std::vector<std::string>::const_iterator it = theTargetVerticesEntries.begin(); it != theTargetVerticesEntries.end(); it++, i++)
2845         {
2846           if (i>0)
2847             listEntriesTxt << ", ";
2848           listEntriesTxt << *it;
2849         }
2850       listEntriesTxt << "]" ;
2851     }
2852   return listEntriesTxt.str();
2853 }
2854
2855 /**
2856  * Erase all PreCad periodicity associations
2857  */
2858 void BLSURFPlugin_Hypothesis_i::ClearPreCadPeriodicityVectors() {
2859   ASSERT(myBaseImpl);
2860   this->GetImpl()->ClearPreCadPeriodicityVectors();
2861   SMESH::TPythonDump() << _this() << ".ClearPreCadPeriodicityVectors()";
2862 }
2863
2864 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector()
2865 {
2866   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector");
2867   const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
2868       this->GetImpl()->_GetPreCadFacesPeriodicityVector();
2869
2870   BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
2871
2872   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector end");
2873   return periodicityList._retn();
2874 }
2875
2876 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector()
2877 {
2878   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector");
2879   const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
2880       this->GetImpl()->_GetPreCadEdgesPeriodicityVector();
2881
2882   BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
2883
2884   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector end");
2885   return periodicityList._retn();
2886 }
2887
2888 // convert a vector preCadPeriodicityVector into TPeriodicityList Corba sequence
2889 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector)
2890 {
2891   MESSAGE("BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence");
2892   BLSURFPlugin::TPeriodicityList_var periodicityList = new BLSURFPlugin::TPeriodicityList();
2893
2894     periodicityList->length(preCadPeriodicityVector.size());
2895
2896     for (size_t i = 0; i<preCadPeriodicityVector.size(); i++)
2897       {
2898         ::BLSURFPlugin_Hypothesis::TPreCadPeriodicity preCadPeriodicityVector_i = preCadPeriodicityVector[i];
2899
2900         BLSURFPlugin::TPreCadPeriodicity_var myPreCadPeriodicity = new BLSURFPlugin::TPreCadPeriodicity();
2901         myPreCadPeriodicity->shape1Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape1Entry.c_str());
2902         myPreCadPeriodicity->shape2Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape2Entry.c_str());
2903
2904         BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
2905         if (! preCadPeriodicityVector_i.theSourceVerticesEntries.empty())
2906           {
2907             sourceVertices->length(preCadPeriodicityVector_i.theSourceVerticesEntries.size());
2908             for (size_t j=0; j<preCadPeriodicityVector_i.theSourceVerticesEntries.size(); j++)
2909               sourceVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theSourceVerticesEntries[j].c_str());
2910           }
2911
2912         myPreCadPeriodicity->theSourceVerticesEntries = sourceVertices;
2913
2914         BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
2915         if (! preCadPeriodicityVector_i.theTargetVerticesEntries.empty())
2916            {
2917             targetVertices->length(preCadPeriodicityVector_i.theTargetVerticesEntries.size());
2918              for (size_t j=0; j<preCadPeriodicityVector_i.theTargetVerticesEntries.size(); j++)
2919                targetVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theTargetVerticesEntries[j].c_str());
2920            }
2921
2922         myPreCadPeriodicity->theTargetVerticesEntries = targetVertices;
2923
2924         periodicityList[i] = myPreCadPeriodicity;
2925       }
2926
2927
2928   return periodicityList._retn();
2929 }
2930
2931
2932 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
2933 throw (SALOME::SALOME_Exception)
2934 {
2935   ASSERT(myBaseImpl);
2936   const GEOM::ListOfGO theSourceVertices;
2937   const GEOM::ListOfGO theTargetVertices;
2938   AddPreCadFacesPeriodicityWithVertices(theFace1, theFace2, theSourceVertices, theTargetVertices);
2939 }
2940
2941
2942 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
2943     const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
2944 throw (SALOME::SALOME_Exception)
2945 {
2946   ASSERT(myBaseImpl);
2947   MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices");
2948
2949   size_t theLength = theSourceVertices.length();
2950   if (theLength != theTargetVertices.length())
2951     THROW_SALOME_CORBA_EXCEPTION( "The sizes of theSourceVertices and theTargetVertices must be the same" ,SALOME::BAD_PARAM );
2952
2953   std::vector<GEOM::shape_type> allowedShapeTypes;
2954   allowedShapeTypes.push_back(GEOM::FACE);
2955   allowedShapeTypes.push_back(GEOM::COMPOUND);
2956
2957   string prefix1 = "Source_face_";
2958   CheckShapeTypes(theFace1, allowedShapeTypes);
2959   string theFace1Entry = PublishIfNeeded(theFace1, GEOM::FACE, prefix1);
2960
2961   string prefix2 = "Target_face_";
2962   CheckShapeTypes(theFace2, allowedShapeTypes);
2963   string theFace2Entry = PublishIfNeeded(theFace2, GEOM::FACE, prefix2);
2964
2965   string prefix3 = "Source_vertex_";
2966   BLSURFPlugin::TEntryList_var theSourceVerticesEntries = new BLSURFPlugin::TEntryList();
2967   theSourceVerticesEntries->length(theLength);
2968   GEOM::GEOM_Object_ptr theVtx_i;
2969   string theEntry_i;
2970   for (size_t ind = 0; ind < theLength; ind++) {
2971       theVtx_i = theSourceVertices[ind];
2972       theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
2973       theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
2974   }
2975
2976   string prefix4 = "Target_vertex_";
2977   BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
2978   theTargetVerticesEntries->length(theLength);
2979   for (size_t ind = 0; ind < theLength; ind++) {
2980       theVtx_i = theTargetVertices[ind];
2981       theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
2982       theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
2983   }
2984
2985   string theFace2Name = theFace2->GetName();
2986   MESSAGE("IDL : theFace1->GetName : " << theFace1->GetName());
2987   MESSAGE("IDL : theFace2->GetName : " << theFace2->GetName());
2988   MESSAGE("IDL : AddPreCadFacesPeriodicity( "<< theFace1Entry << ", " << theFace2Entry <<  ")");
2989   try {
2990       AddPreCadFacesPeriodicityEntry(theFace1Entry.c_str(), theFace2Entry.c_str(),
2991           theSourceVerticesEntries, theTargetVerticesEntries);
2992   } catch (SALOME_Exception& ex) {
2993     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2994   }
2995 }
2996
2997
2998 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
2999     const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
3000     throw (SALOME::SALOME_Exception)
3001 {
3002
3003   ASSERT(myBaseImpl);
3004
3005   // Convert BLSURFPlugin::TEntryList to vector<string>
3006   vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
3007   for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
3008       theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
3009       theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
3010   }
3011
3012   string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
3013
3014   MESSAGE("IDL : AddPreCadFacesPeriodicityEntry(" << theFace1Entry << ", " << theFace2Entry << listEntriesTxt.c_str() << ")");
3015
3016   this->GetImpl()->AddPreCadFacesPeriodicity(theFace1Entry, theFace2Entry,
3017       theSourceVerticesEntries, theTargetVerticesEntries);
3018
3019   SMESH::TPythonDump pd;
3020   if (!theSourceVerticesEntries.empty())
3021     {
3022       pd << _this() << ".AddPreCadFacesPeriodicityWithVertices(" << theFace1Entry << ", " << theFace2Entry;
3023       pd << listEntriesTxt.c_str();
3024       pd << ")";
3025     }
3026   else
3027     pd << _this() << ".AddPreCadFacesPeriodicity(" << theFace1Entry << ", " << theFace2Entry << ")";
3028   MESSAGE("IDL : AddPreCadFacesPeriodicityEntry END");
3029 }
3030
3031 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
3032       throw (SALOME::SALOME_Exception)
3033 {
3034   ASSERT(myBaseImpl);
3035   const GEOM::ListOfGO theSourceVertices;
3036   const GEOM::ListOfGO theTargetVertices;
3037   AddPreCadEdgesPeriodicityWithVertices(theEdge1, theEdge2, theSourceVertices, theTargetVertices);
3038 }
3039
3040 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
3041     const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
3042       throw (SALOME::SALOME_Exception)
3043 {
3044   MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices");
3045   ASSERT(myBaseImpl);
3046
3047   size_t theLength = theSourceVertices.length();
3048   if (theLength != theTargetVertices.length())
3049     THROW_SALOME_CORBA_EXCEPTION( "The sizes of theSourceVertices and theTargetVertices must be the same" ,SALOME::BAD_PARAM );
3050
3051   std::vector<GEOM::shape_type> allowedShapeTypes;
3052   allowedShapeTypes.push_back(GEOM::EDGE);
3053   allowedShapeTypes.push_back(GEOM::COMPOUND);
3054
3055   string prefix1 = "Source_edge_";
3056   CheckShapeTypes(theEdge1, allowedShapeTypes);
3057   string theEdge1Entry = PublishIfNeeded(theEdge1, GEOM::EDGE, prefix1);
3058
3059   string prefix2 = "Target_edge_";
3060   CheckShapeTypes(theEdge2, allowedShapeTypes);
3061   string theEdge2Entry = PublishIfNeeded(theEdge2, GEOM::EDGE, prefix2);
3062
3063   string prefix3 = "Source_vertex_";
3064   BLSURFPlugin::TEntryList_var theSourceVerticesEntries = new BLSURFPlugin::TEntryList();
3065   theSourceVerticesEntries->length(theLength);
3066   GEOM::GEOM_Object_ptr theVtx_i;
3067   string theEntry_i;
3068   for (size_t ind = 0; ind < theLength; ind++) {
3069       theVtx_i = theSourceVertices[ind];
3070       theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
3071       theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
3072   }
3073
3074   string prefix4 = "Target_vertex_";
3075   BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
3076   theTargetVerticesEntries->length(theLength);
3077   for (size_t ind = 0; ind < theLength; ind++) {
3078       theVtx_i = theTargetVertices[ind];
3079       theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
3080       theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
3081   }
3082
3083   string theEdge2Name = theEdge2->GetName();
3084   MESSAGE("IDL : theEdge1->GetName : " << theEdge1->GetName());
3085   MESSAGE("IDL : theEdge2->GetName : " << theEdge2->GetName());
3086   MESSAGE("IDL : AddPreCadEdgesPeriodicity( "<< theEdge1Entry << ", " << theEdge2Entry << ")");
3087   try {
3088       AddPreCadEdgesPeriodicityEntry(theEdge1Entry.c_str(), theEdge2Entry.c_str(),
3089           theSourceVerticesEntries, theTargetVerticesEntries);
3090   } catch (SALOME_Exception& ex) {
3091     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3092   }
3093 }
3094
3095
3096 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
3097     const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
3098     throw (SALOME::SALOME_Exception)
3099 {
3100
3101   ASSERT(myBaseImpl);
3102
3103   // Convert BLSURFPlugin::TEntryList to vector<string>
3104   vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
3105   for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
3106       theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
3107       theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
3108   }
3109
3110   string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
3111
3112   MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry(" << theEdge1Entry << ", " << theEdge2Entry << listEntriesTxt.c_str() << ")");
3113   this->GetImpl()->AddPreCadEdgesPeriodicity(theEdge1Entry, theEdge2Entry,
3114       theSourceVerticesEntries, theTargetVerticesEntries);
3115
3116   SMESH::TPythonDump pd;
3117   if (!theSourceVerticesEntries.empty())
3118     {
3119       pd << _this() << ".AddPreCadEdgesPeriodicityWithVertices(" << theEdge1Entry << ", " << theEdge2Entry;
3120       pd << listEntriesTxt.c_str();
3121       pd << ")";
3122     }
3123   else
3124     pd << _this() << ".AddPreCadEdgesPeriodicity(" << theEdge1Entry << ", " << theEdge2Entry << ")";
3125
3126   MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry END");
3127 }
3128
3129
3130 //================================================================================
3131 /*!
3132  * \brief Sets the file for export resulting mesh in GMF format
3133  * \param theFileName - full name of the file (.mesh, .meshb)
3134  * 
3135  * After compute, export the resulting mesh in the given file with the GMF format (.mesh)
3136  */
3137 //================================================================================  
3138 // void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
3139 void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
3140   ASSERT(myBaseImpl);
3141   MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
3142   bool valueChanged/*, modeChanged*/ = false;
3143   try {
3144     valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
3145 //     modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
3146     if (valueChanged)// or (!valueChanged && modeChanged))
3147       this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
3148   } catch (const std::exception& ex) {
3149     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3150   }
3151   if (valueChanged)// or (!valueChanged && modeChanged))
3152     SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
3153   MESSAGE("IDL : SetGMFFile END ");
3154 }
3155
3156 //================================================================================
3157 /*!
3158  * \brief Gets the file name for export resulting mesh in GMF format
3159  * \retval char* - The file name
3160  * 
3161  * Returns the GMF file name
3162  */
3163 //================================================================================  
3164 char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
3165   ASSERT(myBaseImpl);
3166 //   MESSAGE("IDL : GetGMFFile()");
3167   return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
3168 }
3169
3170 // //================================================================================
3171 // /*!
3172 //  * \brief Gets the file mode for export resulting mesh in GMF format
3173 //  * \retval CORBA::Boolean - TRUE if binary mode, FALSE if ascii mode
3174 //  * 
3175 //  * Returns the GMF file mode
3176 //  */
3177 // //================================================================================  
3178 // CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
3179 //   ASSERT(myBaseImpl);
3180 //   MESSAGE("IDL : GetGMFFileMode()");
3181 //   return this->GetImpl()->GetGMFFileMode();
3182 // }
3183
3184 //=============================================================================
3185 /*!
3186  *  BLSURFPlugin_Hypothesis_i::GetImpl
3187  *
3188  *  Get implementation
3189  */
3190 //=============================================================================
3191 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
3192   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
3193   return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
3194 }
3195
3196 //================================================================================
3197 /*!
3198  * \brief Verify whether hypothesis supports given entity type 
3199  * \param type - dimension (see SMESH::Dimension enumeration)
3200  * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
3201  * 
3202  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
3203  */
3204 //================================================================================  
3205 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported(SMESH::Dimension type) {
3206   return type == SMESH::DIM_2D;
3207 }
3208
3209 //
3210 // Obsolete methods - To be removed in V7
3211 //
3212
3213 void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) {
3214   this->SetMinSize(theMinSize);
3215 }
3216 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() {
3217   return this->GetMinSize();
3218 }
3219 void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) {
3220   this->SetMaxSize(theMaxSize);
3221 }
3222 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() {
3223   return this->GetMaxSize();
3224 }
3225 void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) {
3226   this->SetMinSize(theMinSize);
3227 }
3228 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() {
3229   return this->GetMinSize();
3230 }
3231 void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) {
3232   this->SetMaxSize(theMaxSize);
3233 }
3234 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() {
3235   return this->GetMaxSize();
3236 }
3237 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS(CORBA::Double theValue) {
3238   this->SetAngleMesh(theValue);
3239 }
3240 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() {
3241   return this->GetAngleMesh();
3242 }
3243 void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double theValue) {
3244   this->SetAngleMesh(theValue);
3245 }
3246 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() {
3247   return this->GetAngleMesh();
3248 }
3249 void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
3250   std::string theValueStr = theValue ? "1" : "0";
3251   this->SetOptionValue("respect_geometry",theValueStr.c_str());
3252 }
3253 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
3254   std::string theValueStr = this->GetOptionValue("respect_geometry");
3255   if (theValueStr.empty() || theValueStr == "respect")
3256       return true;
3257   return false;
3258 }
3259 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
3260   std::string theValueStr = theValue ? "1" : "0";
3261   this->SetPreCADOptionValue("remove_tiny_edges",theValueStr.c_str());
3262 }
3263 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
3264   std::string theValueStr = this->GetPreCADOptionValue("remove_tiny_edges");
3265   if (theValueStr == "1")
3266       return true;
3267   return false;
3268 }
3269 void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
3270   std::ostringstream theValueStr;
3271   theValueStr << theValue;
3272   this->SetPreCADOptionValue("tiny_edge_length",theValueStr.str().c_str());
3273 }
3274 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() {
3275   std::istringstream theValueStr(this->GetPreCADOptionValue("tiny_edge_length"));
3276   double result;
3277   theValueStr >> result;
3278   return result;
3279 }