Salome HOME
First version of SizeMap for BLSurf :
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // ---
20 // File    : BLSURFPlugin_Hypothesis.cxx
21 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
22 // ---
23 //
24 #include "BLSURFPlugin_Hypothesis_i.hxx"
25 #include "SMESH_Gen.hxx"
26 #include "SMESH_PythonDump.hxx"
27 #include "GEOM_Object.hxx"
28
29 #include "Utils_CorbaException.hxx"
30 #include "utilities.h"
31
32 #include <stdexcept>
33
34 //=============================================================================
35 /*!
36  *  BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
37  *
38  *  Constructor
39  */
40 //=============================================================================
41 BLSURFPlugin_Hypothesis_i::
42 BLSURFPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
43                            int                     theStudyId,
44                            ::SMESH_Gen*            theGenImpl)
45   : SALOME::GenericObj_i( thePOA ), 
46     SMESH_Hypothesis_i( thePOA )
47 {
48   MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
49   myBaseImpl = new ::BLSURFPlugin_Hypothesis (theGenImpl->GetANewId(),
50                                               theStudyId,
51                                               theGenImpl);
52 }
53
54 //=============================================================================
55 /*!
56  *  BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
57  *
58  *  Destructor
59  */
60 //=============================================================================
61 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
62 {
63   MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
64 }
65
66 /*!
67  *  BLSURFPlugin_Hypothesis_i::SetTopology
68  *
69  *  Set topology
70  */
71
72 //=============================================================================
73 void BLSURFPlugin_Hypothesis_i::SetTopology (CORBA::Long theValue)
74 {
75   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
76   ASSERT(myBaseImpl);
77   this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology)theValue);
78   SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
79 }
80
81 //=============================================================================
82 /*!
83  *  BLSURFPlugin_Hypothesis_i::GetTopology
84  *
85  *  Get Topology
86  */
87 //=============================================================================
88 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology()
89 {
90   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
91   ASSERT(myBaseImpl);
92   return this->GetImpl()->GetTopology();
93 }
94
95 //=============================================================================
96
97 //=============================================================================
98 /*!
99  *  BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
100  *
101  *  Set PhysicalMesh
102  */
103
104 //=============================================================================
105 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh (CORBA::Long theValue)
106 {
107   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
108   ASSERT(myBaseImpl);
109   this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh)theValue);
110   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
111 }
112
113 //=============================================================================
114 /*!
115  *  BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
116  *
117  *  Get PhysicalMesh
118  */
119 //=============================================================================
120 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
121 {
122   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
123   ASSERT(myBaseImpl);
124   return this->GetImpl()->GetPhysicalMesh();
125 }
126
127 //=============================================================================
128 /*!
129  *  BLSURFPlugin_Hypothesis_i::SetPhySize
130  *
131  *  Set PhySize
132  */
133 //=============================================================================
134 void BLSURFPlugin_Hypothesis_i::SetPhySize (CORBA::Double theValue)
135 {
136   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
137   ASSERT(myBaseImpl);
138   this->GetImpl()->SetPhySize(theValue);
139   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
140 }
141
142 //=============================================================================
143 /*!
144  *  BLSURFPlugin_Hypothesis_i::GetPhySize
145  *
146  *  Get PhySize
147  */
148 //=============================================================================
149 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize()
150 {
151   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
152   ASSERT(myBaseImpl);
153   return this->GetImpl()->GetPhySize();
154 }
155
156 //=============================================================================
157 void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize)
158 {
159   ASSERT(myBaseImpl);
160   if ( GetPhyMin() != theMinSize ) {
161     this->GetImpl()->SetPhyMin(theMinSize);
162     SMESH::TPythonDump() << _this() << ".SetPhyMin( " << theMinSize << " )";
163   }
164 }
165
166 //=============================================================================
167 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin()
168 {
169   ASSERT(myBaseImpl);
170   return this->GetImpl()->GetPhyMin();
171 }
172
173
174 //=============================================================================
175 void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize)
176 {
177   ASSERT(myBaseImpl);
178   if ( GetPhyMax() != theMaxSize ) {
179     this->GetImpl()->SetPhyMax(theMaxSize);
180     SMESH::TPythonDump() << _this() << ".SetPhyMax( " << theMaxSize << " )";
181   }
182 }
183
184 //=============================================================================
185 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax()
186 {
187   ASSERT(myBaseImpl);
188   return this->GetImpl()->GetPhyMax();
189 }
190
191
192 //=============================================================================
193 /*!
194  *  BLSURFPlugin_Hypothesis_i::SetGeometricMesh
195  *
196  *  Set GeometricMesh
197  */
198
199 //=============================================================================
200 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh (CORBA::Long theValue)
201 {
202   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
203   ASSERT(myBaseImpl);
204   this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh)theValue);
205   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
206 }
207
208 //=============================================================================
209 /*!
210  *  BLSURFPlugin_Hypothesis_i::GetGeometricMesh
211  *
212  *  Get GeometricMesh
213  */
214 //=============================================================================
215 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
216 {
217   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
218   ASSERT(myBaseImpl);
219   return this->GetImpl()->GetGeometricMesh();
220 }
221
222 //=============================================================================
223 /*!
224  *  BLSURFPlugin_Hypothesis_i::SetAngleMeshS
225  *
226  *  Set AngleMeshS
227  */
228 //=============================================================================
229 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS (CORBA::Double theValue)
230 {
231   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMeshS");
232   ASSERT(myBaseImpl);
233   this->GetImpl()->SetAngleMeshS(theValue);
234   SMESH::TPythonDump() << _this() << ".SetAngleMeshS( " << theValue << " )";
235 }
236
237 //=============================================================================
238 /*!
239  *  BLSURFPlugin_Hypothesis_i::GetAngleMeshS
240  *
241  *  Get AngleMeshS
242  */
243 //=============================================================================
244 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS()
245 {
246   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMeshS");
247   ASSERT(myBaseImpl);
248   return this->GetImpl()->GetAngleMeshS();
249 }
250
251 //=============================================================================
252 void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double angle)
253 {
254   ASSERT(myBaseImpl);
255   this->GetImpl()->SetAngleMeshC(angle);
256   SMESH::TPythonDump() << _this() << ".SetAngleMeshC( " << angle << " )";
257 }
258
259 //=============================================================================
260 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC()
261 {
262   ASSERT(myBaseImpl);
263   return this->GetImpl()->GetAngleMeshC();
264 }
265
266 //=============================================================================
267 void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize)
268 {
269   ASSERT(myBaseImpl);
270   if ( GetGeoMin() != theMinSize ) {
271     this->GetImpl()->SetGeoMin(theMinSize);
272     SMESH::TPythonDump() << _this() << ".SetGeoMin( " << theMinSize << " )";
273   }
274 }
275
276 //=============================================================================
277 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin()
278 {
279   ASSERT(myBaseImpl);
280   return this->GetImpl()->GetGeoMin();
281 }
282
283 //=============================================================================
284 void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize)
285 {
286   ASSERT(myBaseImpl);
287   if ( GetGeoMax() != theMaxSize ) {
288     this->GetImpl()->SetGeoMax(theMaxSize);
289     SMESH::TPythonDump() << _this() << ".SetGeoMax( " << theMaxSize << " )";
290   }
291 }
292
293 //=============================================================================
294 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax()
295 {
296   ASSERT(myBaseImpl);
297   return this->GetImpl()->GetGeoMax();
298 }
299
300 //=============================================================================
301 /*!
302  *  BLSURFPlugin_Hypothesis_i::SetGradation
303  *
304  *  Set Gradation
305  */
306 //=============================================================================
307 void BLSURFPlugin_Hypothesis_i::SetGradation (CORBA::Double theValue)
308 {
309   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
310   ASSERT(myBaseImpl);
311   this->GetImpl()->SetGradation(theValue);
312   SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
313 }
314
315 //=============================================================================
316 /*!
317  *  BLSURFPlugin_Hypothesis_i::GetGradation
318  *
319  *  Get Gradation
320  */
321 //=============================================================================
322 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
323 {
324   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
325   ASSERT(myBaseImpl);
326   return this->GetImpl()->GetGradation();
327 }
328
329 //=============================================================================
330 /*!
331  *  BLSURFPlugin_Hypothesis_i::SetQuadAllowed
332  *
333  *  Set true or false
334  */
335 //=============================================================================
336 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed (CORBA::Boolean theValue)
337 {
338   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
339   ASSERT(myBaseImpl);
340   this->GetImpl()->SetQuadAllowed(theValue);
341   SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValue << " )";
342 }
343
344 //=============================================================================
345 /*!
346  *  BLSURFPlugin_Hypothesis_i::GetQuadAllowed
347  *
348  *  Get true or false
349  */
350 //=============================================================================
351 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
352 {
353   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
354   ASSERT(myBaseImpl);
355   return this->GetImpl()->GetQuadAllowed();
356 }
357
358 //=============================================================================
359 /*!
360  *  BLSURFPlugin_Hypothesis_i::SetDecimesh
361  *
362  *  Set true or false
363  */
364 //=============================================================================
365 void BLSURFPlugin_Hypothesis_i::SetDecimesh (CORBA::Boolean theValue)
366 {
367   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetDecimesh");
368   ASSERT(myBaseImpl);
369   this->GetImpl()->SetDecimesh(theValue);
370   SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValue << " )";
371 }
372
373 //=============================================================================
374 /*!
375  *  BLSURFPlugin_Hypothesis_i::GetDecimesh
376  *
377  *  Get true or false
378  */
379 //=============================================================================
380 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh()
381 {
382   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetDecimesh");
383   ASSERT(myBaseImpl);
384   return this->GetImpl()->GetDecimesh();
385 }
386
387 //=============================================================================
388 void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal)
389   throw (SALOME::SALOME_Exception)
390 {
391   ASSERT(myBaseImpl);
392   if ( theVal < 0 || theVal > 100 )
393     THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
394   this->GetImpl()->SetVerbosity(theVal);
395   SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
396 }
397
398 //=============================================================================
399
400 CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity()
401 {
402   ASSERT(myBaseImpl);
403   return (CORBA::Short) this->GetImpl()->GetVerbosity();
404 }
405
406 //=============================================================================
407
408 void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName,
409                                                const char* optionValue)
410   throw (SALOME::SALOME_Exception)
411 {
412   ASSERT(myBaseImpl);
413   bool valueChanged = false;
414   try {
415     valueChanged = ( this->GetImpl()->GetOptionValue(optionName) != optionValue );
416     if ( valueChanged )
417       this->GetImpl()->SetOptionValue(optionName, optionValue);
418   }
419   catch (const std::invalid_argument& ex) {
420     SALOME::ExceptionStruct ExDescription;
421     ExDescription.text = ex.what();
422     ExDescription.type = SALOME::BAD_PARAM;
423     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetOptionValue(name,value)";
424     ExDescription.lineNumber = 0;
425     throw SALOME::SALOME_Exception(ExDescription);
426   }
427   catch (SALOME_Exception& ex) {
428     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
429   }
430   if ( valueChanged )
431     SMESH::TPythonDump() << _this() << ".SetOptionValue( '"
432                          << optionName << "', '" << optionValue << "' )";
433 }
434
435 //=============================================================================
436
437 char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName)
438   throw (SALOME::SALOME_Exception)
439 {
440   ASSERT(myBaseImpl);
441   try {
442     return CORBA::string_dup( this->GetImpl()->GetOptionValue(optionName).c_str() );
443   }
444   catch (const std::invalid_argument& ex) {
445     SALOME::ExceptionStruct ExDescription;
446     ExDescription.text = ex.what();
447     ExDescription.type = SALOME::BAD_PARAM;
448     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetOptionValue(name)";
449     ExDescription.lineNumber = 0;
450     throw SALOME::SALOME_Exception(ExDescription);
451   }
452   catch (SALOME_Exception& ex) {
453     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
454   }
455   return 0;
456 }
457
458 //=============================================================================
459
460 void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName)
461 {
462   ASSERT(myBaseImpl);
463   this->GetImpl()->ClearOption(optionName);
464   SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
465 }
466
467 //=============================================================================
468
469 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues()
470 {
471   ASSERT(myBaseImpl);
472   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
473
474   const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues();
475   result->length( opts.size() );
476
477   ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
478   for ( int i = 0 ; opIt != opts.end(); ++opIt, ++i ) {
479     string name_value = opIt->first;
480     if ( !opIt->second.empty() ) {
481       name_value += ":";
482       name_value += opIt->second;
483     }
484     result[i] = CORBA::string_dup(name_value.c_str());
485   }
486   return result._retn();
487 }
488
489 //=============================================================================
490
491 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
492   throw (SALOME::SALOME_Exception)
493 {
494   ASSERT(myBaseImpl);
495   for (int i = 0; i < options.length(); ++i)
496   {
497     string name_value = options[i].in();
498     int colonPos = name_value.find( ':' );
499     string name, value;
500     if ( colonPos == string::npos ) // ':' not found
501       name = name_value;
502     else {
503       name = name_value.substr( 0, colonPos);
504       if ( colonPos < name_value.size()-1 && name_value[colonPos] != ' ')
505         value = name_value.substr( colonPos+1 );
506     }
507     SetOptionValue( name.c_str(), value.c_str() );
508   }
509 }
510
511 //=============================================================================
512
513 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry,const char* sizeMap)
514   throw (SALOME::SALOME_Exception)
515 {
516   ASSERT(myBaseImpl);
517   std::cout << "ENGINE : SETSIZEMAP START ENTRY : " << entry << std::endl; 
518   bool valueChanged = false;
519   try {
520     valueChanged = ( this->GetImpl()->GetSizeMapEntry(entry) != sizeMap );
521     if ( valueChanged )
522       this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
523   }
524   catch (const std::invalid_argument& ex) {
525     SALOME::ExceptionStruct ExDescription;
526     ExDescription.text = ex.what();
527     ExDescription.type = SALOME::BAD_PARAM;
528     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
529     ExDescription.lineNumber = 0;
530     throw SALOME::SALOME_Exception(ExDescription);
531   }
532   catch (SALOME_Exception& ex) {
533     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
534   }
535   std::cout << "ENGINE : SETSIZEMAP END ENTRY : " << entry << std::endl;
536   if ( valueChanged )
537     SMESH::TPythonDump() << _this() << ".SetSizeMap("
538                          << entry << ", '" << sizeMap << "' )";
539 }
540
541 //=============================================================================
542                                                              
543 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) 
544   throw (SALOME::SALOME_Exception)
545 {
546   ASSERT(myBaseImpl);
547   try {
548     return CORBA::string_dup( this->GetImpl()->GetSizeMapEntry(entry).c_str());
549   }
550   catch (const std::invalid_argument& ex) {
551     SALOME::ExceptionStruct ExDescription;
552     ExDescription.text = ex.what();
553     ExDescription.type = SALOME::BAD_PARAM;
554     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
555     ExDescription.lineNumber = 0;
556     throw SALOME::SALOME_Exception(ExDescription);
557   }
558   catch (SALOME_Exception& ex) {
559     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
560   }                             
561   return 0;
562 }
563
564 //=============================================================================
565                                                             
566 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry)
567 {
568   ASSERT(myBaseImpl);                                                                             
569   this->GetImpl()->ClearEntry(entry);                                                       
570   SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";                    
571 }                                                                                                 
572   
573 //=============================================================================
574
575 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries()
576 {
577   ASSERT(myBaseImpl);
578   BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
579
580   const ::BLSURFPlugin_Hypothesis::TSizeMap & sizeMaps= this->GetImpl()->GetSizeMapEntries();
581   result->length( sizeMaps.size() );
582
583   ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
584   for ( int i = 0 ; smIt != sizeMaps.end(); ++smIt, ++i ) {
585     string entry_sizemap = smIt->first;
586     if ( !smIt->second.empty() ) {
587       entry_sizemap += "|";
588       entry_sizemap += smIt->second;
589     }
590     result[i] = CORBA::string_dup(entry_sizemap.c_str());
591   }
592   return result._retn();
593 }
594
595 //=============================================================================                   
596                                                                                                   
597 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)        
598   throw (SALOME::SALOME_Exception)                                                                
599 {                                                                                                 
600   ASSERT(myBaseImpl);                                                                             
601   for (int i = 0; i < sizeMaps.length(); ++i)                                                      
602   {                                                                                               
603     string entry_sizemap = sizeMaps[i].in();                                                          
604     int colonPos = entry_sizemap.find( '|' );                                                        
605     string entry, sizemap;                                                                           
606     if ( colonPos == string::npos ) // '|' separator not found                                              
607       entry = entry_sizemap;                                                                          
608     else {                                                                                        
609       entry = entry_sizemap.substr( 0, colonPos);                                                     
610       if ( colonPos < entry_sizemap.size()-1 && entry_sizemap[colonPos] != ' ')                         
611         sizemap = entry_sizemap.substr( colonPos+1 );                                                  
612     }                                                                                             
613     this->GetImpl()->SetSizeMapEntry( entry.c_str(), sizemap.c_str() );                                                
614   }                                                                                               
615 }                                                                                                 
616
617 //=============================================================================
618
619 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps()
620 {
621   ASSERT(myBaseImpl);
622   this->GetImpl()->ClearSizeMaps();
623 }
624
625
626 //=============================================================================
627
628 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj,const char* sizeMap)
629 {
630   ASSERT(myBaseImpl);
631   string entry;
632   entry=GeomObj->GetStudyEntry();
633   std::cout << "IDL : GetName : " << GeomObj->GetName() << std::endl;
634   std::cout << "IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")" <<  std::endl; 
635   SetSizeMapEntry( entry.c_str(),sizeMap);
636 }
637   
638 //=============================================================================
639 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj)
640 {
641   ASSERT(myBaseImpl);
642   string entry;
643   entry=GeomObj->GetStudyEntry();
644   std::cout << "IDL : GetName : " << GeomObj->GetName() << std::endl;
645   std::cout << "IDL : UNSETSIZEMAP ( "<< entry << ")" << std::endl;
646   UnsetEntry( entry.c_str());
647 }
648
649
650      
651 //=============================================================================
652 /*!
653  *  BLSURFPlugin_Hypothesis_i::GetImpl
654  *
655  *  Get implementation
656  */
657 //=============================================================================
658 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl()
659 {
660   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
661   return (::BLSURFPlugin_Hypothesis*)myBaseImpl;
662 }
663
664 //================================================================================
665 /*!
666  * \brief Verify whether hypothesis supports given entity type 
667   * \param type - dimension (see SMESH::Dimension enumeration)
668   * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
669  * 
670  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
671  */
672 //================================================================================  
673 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
674 {
675   return type == SMESH::DIM_2D;
676 }