]> SALOME platform Git repositories - plugins/hybridplugin.git/blob - src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx
Salome HOME
Fix persistence of the HYBRID hypothesis
[plugins/hybridplugin.git] / src / HYBRIDPlugin / HYBRIDPlugin_Hypothesis.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      : HYBRIDPlugin_Hypothesis.cxx
22 // Created   : Wed Apr  2 12:36:29 2008
23 // Author    : Edward AGAPOV (eap)
24 //=============================================================================
25 //
26 #include "HYBRIDPlugin_Hypothesis.hxx"
27
28 #include <SMESHDS_Mesh.hxx>
29
30 #include <TopExp_Explorer.hxx>
31
32 #ifdef WIN32
33 #include <process.h>
34 #define getpid _getpid
35 #endif
36
37 //=======================================================================
38 //function : HYBRIDPlugin_Hypothesis
39 //=======================================================================
40
41 HYBRIDPlugin_Hypothesis::HYBRIDPlugin_Hypothesis(int hypId, SMESH_Gen * gen)
42   : SMESH_Hypothesis(hypId, gen),
43   myToMeshHoles(DefaultMeshHoles()),
44   myLayersOnAllWrap(DefaultLayersOnAllWrap()),
45   myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()),
46   myMaximumMemory(-1),
47   myInitialMemory(-1),
48   myOptimizationLevel(DefaultOptimizationLevel()),
49   myCollisionMode(DefaultCollisionMode()),
50   myBoundaryLayersGrowth(DefaultBoundaryLayersGrowth()),
51   myElementGeneration(DefaultElementGeneration()),
52   myKeepFiles(DefaultKeepFiles()),
53   myWorkingDirectory(DefaultWorkingDirectory()),
54   myVerboseLevel(DefaultVerboseLevel()),
55   myToCreateNewNodes(DefaultToCreateNewNodes()),
56   myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()),
57   myToUseFemCorrection(DefaultToUseFEMCorrection()),
58   myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
59   myLogInStandardOutput(DefaultStandardOutputLog()),
60   myGradation(DefaultGradation()),
61   myAddMultinormals(DefaultAddMultinormals()),
62   mySmoothNormals(DefaultSmoothNormals()),
63   myHeightFirstLayer(DefaultHeightFirstLayer()),
64   myBoundaryLayersProgression(DefaultBoundaryLayersProgression()),
65   myCoreSize(DefaultCoreSize()),
66   myMultinormalsAngle(DefaultMultinormalsAngle()),
67   myNbOfBoundaryLayers(DefaultNbOfBoundaryLayers()),
68   _enfVertexList(DefaultHYBRIDEnforcedVertexList()),
69   _enfVertexCoordsSizeList(DefaultHYBRIDEnforcedVertexCoordsValues()),
70   _enfVertexEntrySizeList(DefaultHYBRIDEnforcedVertexEntryValues()),
71   _coordsEnfVertexMap(DefaultCoordsHYBRIDEnforcedVertexMap()),
72   _geomEntryEnfVertexMap(DefaultGeomEntryHYBRIDEnforcedVertexMap()),
73   _enfMeshList(DefaultHYBRIDEnforcedMeshList()),
74   _entryEnfMeshMap(DefaultEntryHYBRIDEnforcedMeshListMap()),
75   _enfNodes(TIDSortedNodeGroupMap()),
76   _enfEdges(TIDSortedElemGroupMap()),
77   _enfTriangles(TIDSortedElemGroupMap()),
78   _nodeIDToSizeMap(DefaultID2SizeMap()),
79   _groupsToRemove(DefaultGroupsToRemove())
80 {
81   _name = "HYBRID_Parameters";
82   _param_algo_dim = 3;
83 }
84
85 //=======================================================================
86 //function : SetLayersOnAllWrap
87 //=======================================================================
88
89 void HYBRIDPlugin_Hypothesis::SetLayersOnAllWrap(bool toMesh)
90 {
91   if ( myLayersOnAllWrap != toMesh ) {
92     myLayersOnAllWrap = toMesh;
93     NotifySubMeshesHypothesisModification();
94   }
95 }
96
97 //=======================================================================
98 //function : GetLayersOnAllWrap
99 //=======================================================================
100
101 bool HYBRIDPlugin_Hypothesis::GetLayersOnAllWrap(bool checkFreeOption) const
102 {
103   return myLayersOnAllWrap;
104 }
105
106 //=======================================================================
107 //function : SetFacesWithLayers
108 //purpose  : Set IDs of faces to grow the layers on
109 //=======================================================================
110
111 bool HYBRIDPlugin_Hypothesis::SetFacesWithLayers(const std::vector<int>& theVal)
112 {
113   if ( myFacesWithLayers != theVal )
114   {
115     myFacesWithLayers = theVal;
116     NotifySubMeshesHypothesisModification();
117     return true;
118   }
119   return false;
120 }
121
122 //=======================================================================
123 //function : GetFacesWithLayers
124 //purpose  : Return IDs of faces to grow the layers on
125 //=======================================================================
126
127 const std::vector<int>& HYBRIDPlugin_Hypothesis::GetFacesWithLayers() const
128 {
129   return myFacesWithLayers;
130 }
131
132 //=======================================================================
133 //function : SetFacesWithImprinting
134 //purpose  : Set IDs of faces to grow the layers on
135 //=======================================================================
136
137 bool HYBRIDPlugin_Hypothesis::SetFacesWithImprinting(const std::vector<int>& theVal)
138 {
139   if ( myFacesWithImprinting != theVal )
140   {
141     myFacesWithImprinting = theVal;
142     NotifySubMeshesHypothesisModification();
143     return true;
144   }
145   return false;
146 }
147
148 //=======================================================================
149 //function : GetFacesWithImprinting
150 //purpose  : Return IDs of faces to grow the layers on
151 //=======================================================================
152
153 const std::vector<int>& HYBRIDPlugin_Hypothesis::GetFacesWithImprinting() const
154 {
155   return myFacesWithImprinting;
156 }
157
158 //=======================================================================
159 //function : SetToMeshHoles
160 //=======================================================================
161
162 void HYBRIDPlugin_Hypothesis::SetToMeshHoles(bool toMesh)
163 {
164   if ( myToMeshHoles != toMesh ) {
165     myToMeshHoles = toMesh;
166     NotifySubMeshesHypothesisModification();
167   }
168 }
169
170 //=======================================================================
171 //function : GetToMeshHoles
172 //=======================================================================
173
174 bool HYBRIDPlugin_Hypothesis::GetToMeshHoles(bool checkFreeOption) const
175 {
176   if (checkFreeOption && !myTextOption.empty()) {
177     if ( myTextOption.find("-c 0"))
178       return true;
179     if ( myTextOption.find("-c 1"))
180       return false;
181   }
182   return myToMeshHoles;
183 }
184
185 //=======================================================================
186 //function : SetToMakeGroupsOfDomains
187 //=======================================================================
188
189 void HYBRIDPlugin_Hypothesis::SetToMakeGroupsOfDomains(bool toMakeGroups)
190 {
191   if ( myToMakeGroupsOfDomains != toMakeGroups ) {
192     myToMakeGroupsOfDomains = toMakeGroups;
193     NotifySubMeshesHypothesisModification();
194   }
195 }
196
197 //=======================================================================
198 //function : GetToMakeGroupsOfDomains
199 //=======================================================================
200
201 bool HYBRIDPlugin_Hypothesis::GetToMakeGroupsOfDomains() const
202 {
203   return myToMakeGroupsOfDomains;
204 }
205
206 //=======================================================================
207 //function : GetToMakeGroupsOfDomains
208 //=======================================================================
209
210 bool HYBRIDPlugin_Hypothesis::GetToMakeGroupsOfDomains(const HYBRIDPlugin_Hypothesis* hyp)
211 {
212   bool res;
213   if ( hyp ) res = /*hyp->GetToMeshHoles(true) &&*/ hyp->GetToMakeGroupsOfDomains();
214   else       res = /*DefaultMeshHoles()        &&*/ DefaultToMakeGroupsOfDomains();
215   return res;
216 }
217
218 //=======================================================================
219 //function : SetMaximumMemory
220 //=======================================================================
221
222 void HYBRIDPlugin_Hypothesis::SetMaximumMemory(double MB)
223 {
224   if ( myMaximumMemory != MB ) {
225     myMaximumMemory = MB;
226     NotifySubMeshesHypothesisModification();
227   }
228 }
229
230 //=======================================================================
231 //function : GetMaximumMemory
232 //           * automatic memory adjustment mode. Default is zero
233 //=======================================================================
234
235 double HYBRIDPlugin_Hypothesis::GetMaximumMemory() const
236 {
237   return myMaximumMemory;
238 }
239
240 //=======================================================================
241 //function : SetInitialMemory
242 //=======================================================================
243
244 void HYBRIDPlugin_Hypothesis::SetInitialMemory(double MB)
245 {
246   if ( myInitialMemory != MB ) {
247     myInitialMemory = MB;
248     NotifySubMeshesHypothesisModification();
249   }
250 }
251
252 //=======================================================================
253 //function : GetInitialMemory
254 //=======================================================================
255
256 double HYBRIDPlugin_Hypothesis::GetInitialMemory() const
257 {
258   return myInitialMemory;
259 }
260
261 //=======================================================================
262 //function : SetOptimizationLevel
263 //=======================================================================
264
265 void HYBRIDPlugin_Hypothesis::SetOptimizationLevel(OptimizationLevel level)
266 {
267   if ( myOptimizationLevel != level ) {
268     myOptimizationLevel = level;
269     NotifySubMeshesHypothesisModification();
270   }
271 }
272
273 //=======================================================================
274 //function : GetOptimizationLevel
275 //=======================================================================
276 HYBRIDPlugin_Hypothesis::OptimizationLevel HYBRIDPlugin_Hypothesis::GetOptimizationLevel() const
277 {
278   return (OptimizationLevel) myOptimizationLevel;
279 }
280
281 //=======================================================================
282 //function : SetCollisionMode
283 //=======================================================================
284 void HYBRIDPlugin_Hypothesis::SetCollisionMode(CollisionMode mode)
285 {
286   if ( myCollisionMode != mode ) {
287     myCollisionMode = mode;
288     NotifySubMeshesHypothesisModification();
289   }
290 }
291
292 //=======================================================================
293 //function : GetCollisionMode
294 //=======================================================================
295 HYBRIDPlugin_Hypothesis::CollisionMode HYBRIDPlugin_Hypothesis::GetCollisionMode() const
296 {
297   return (CollisionMode) myCollisionMode;
298 }
299
300 //=======================================================================
301 //function : SetBoundaryLayersGrowth
302 //=======================================================================
303 void HYBRIDPlugin_Hypothesis::SetBoundaryLayersGrowth(BoundaryLayersGrowth mode)
304 {
305   if ( myBoundaryLayersGrowth != mode ) {
306     myBoundaryLayersGrowth = mode;
307     NotifySubMeshesHypothesisModification();
308   }
309 }
310
311 //=======================================================================
312 //function : GetBoundaryLayersGrowth
313 //=======================================================================
314 HYBRIDPlugin_Hypothesis::BoundaryLayersGrowth HYBRIDPlugin_Hypothesis::GetBoundaryLayersGrowth() const
315 {
316   return (BoundaryLayersGrowth) myBoundaryLayersGrowth;
317 }
318
319 //=======================================================================
320 //function : SetElementGeneration
321 //=======================================================================
322 void HYBRIDPlugin_Hypothesis::SetElementGeneration(ElementGeneration mode)
323 {
324   if ( myElementGeneration != mode ) {
325     myElementGeneration = mode;
326     NotifySubMeshesHypothesisModification();
327   }
328 }
329
330 //=======================================================================
331 //function : GetElementGeneration
332 //=======================================================================
333 HYBRIDPlugin_Hypothesis::ElementGeneration HYBRIDPlugin_Hypothesis::GetElementGeneration() const
334 {
335   return (ElementGeneration) myElementGeneration;
336 }
337
338 //=======================================================================
339 //function : SetAddMultinormals
340 //=======================================================================
341 void HYBRIDPlugin_Hypothesis::SetAddMultinormals(bool toAddMultinormals)
342 {
343   if ( myAddMultinormals != toAddMultinormals ) {
344     myAddMultinormals = toAddMultinormals;
345     NotifySubMeshesHypothesisModification();
346   }
347 }
348
349 //=======================================================================
350 //function : GetAddMultinormals
351 //=======================================================================
352
353 bool HYBRIDPlugin_Hypothesis::GetAddMultinormals() const
354 {
355   return myAddMultinormals;
356 }
357
358 //=======================================================================
359 //function : SetSmoothNormals
360 //=======================================================================
361
362 void HYBRIDPlugin_Hypothesis::SetSmoothNormals(bool toSmoothNormals)
363 {
364   if ( mySmoothNormals != toSmoothNormals ) {
365     mySmoothNormals = toSmoothNormals;
366     NotifySubMeshesHypothesisModification();
367   }
368 }
369
370 //=======================================================================
371 //function : GetSmoothNormals
372 //=======================================================================
373
374 bool HYBRIDPlugin_Hypothesis::GetSmoothNormals() const
375 {
376   return mySmoothNormals;
377 }
378
379 //=======================================================================
380 //function : SetHeightFirstLayer
381 //=======================================================================
382
383 void HYBRIDPlugin_Hypothesis::SetHeightFirstLayer(double toHeightFirstLayer)
384 {
385   if ( myHeightFirstLayer != toHeightFirstLayer ) {
386     myHeightFirstLayer = toHeightFirstLayer;
387     NotifySubMeshesHypothesisModification();
388   }
389 }
390
391 //=======================================================================
392 //function : GetHeightFirstLayer
393 //=======================================================================
394
395 double HYBRIDPlugin_Hypothesis::GetHeightFirstLayer() const
396 {
397   return myHeightFirstLayer;
398 }
399
400 //=======================================================================
401 //function : SetBoundaryLayersProgression
402 //=======================================================================
403
404 void HYBRIDPlugin_Hypothesis::SetBoundaryLayersProgression(double toBoundaryLayersProgression)
405 {
406   if ( myBoundaryLayersProgression != toBoundaryLayersProgression ) {
407     myBoundaryLayersProgression = toBoundaryLayersProgression;
408     NotifySubMeshesHypothesisModification();
409   }
410 }
411
412 //=======================================================================
413 //function : GetBoundaryLayersProgression
414 //=======================================================================
415
416 double HYBRIDPlugin_Hypothesis::GetBoundaryLayersProgression() const
417 {
418   return myBoundaryLayersProgression;
419 }
420
421 //=======================================================================
422 //function : SetCoreSize
423 //=======================================================================
424
425 void HYBRIDPlugin_Hypothesis::SetCoreSize(double toCoreSize)
426 {
427   if ( myCoreSize != toCoreSize ) {
428     myCoreSize = toCoreSize;
429     NotifySubMeshesHypothesisModification();
430   }
431 }
432
433 //=======================================================================
434 //function : GetCoreSize
435 //=======================================================================
436
437 double HYBRIDPlugin_Hypothesis::GetCoreSize() const
438 {
439   return myCoreSize;
440 }
441
442 //=======================================================================
443 //function : SetMultinormalsAngle
444 //=======================================================================
445
446 void HYBRIDPlugin_Hypothesis::SetMultinormalsAngle(double toMultinormalsAngle)
447 {
448   if ( myMultinormalsAngle != toMultinormalsAngle ) {
449     myMultinormalsAngle = toMultinormalsAngle;
450     NotifySubMeshesHypothesisModification();
451   }
452 }
453
454 //=======================================================================
455 //function : GetMultinormalsAngle
456 //=======================================================================
457
458 double HYBRIDPlugin_Hypothesis::GetMultinormalsAngle() const
459 {
460   return myMultinormalsAngle;
461 }
462
463 //=======================================================================
464 //function : SetNbOfBoundaryLayers
465 //=======================================================================
466
467 void HYBRIDPlugin_Hypothesis::SetNbOfBoundaryLayers(short toNbOfBoundaryLayers)
468 {
469   if ( myNbOfBoundaryLayers != toNbOfBoundaryLayers ) {
470     myNbOfBoundaryLayers = toNbOfBoundaryLayers;
471     NotifySubMeshesHypothesisModification();
472   }
473 }
474
475 //=======================================================================
476 //function : GetCoreSize
477 //=======================================================================
478
479 short HYBRIDPlugin_Hypothesis::GetNbOfBoundaryLayers() const
480 {
481   return myNbOfBoundaryLayers;
482 }
483
484
485 /////////////////////////////////////////////////////////////////////////
486
487
488 //=======================================================================
489 //function : SetWorkingDirectory
490 //=======================================================================
491
492 void HYBRIDPlugin_Hypothesis::SetWorkingDirectory(const std::string& path)
493 {
494   if ( myWorkingDirectory != path ) {
495     myWorkingDirectory = path;
496     NotifySubMeshesHypothesisModification();
497   }
498 }
499
500 //=======================================================================
501 //function : GetWorkingDirectory
502 //=======================================================================
503
504 std::string HYBRIDPlugin_Hypothesis::GetWorkingDirectory() const
505 {
506   return myWorkingDirectory;
507 }
508
509 //=======================================================================
510 //function : SetKeepFiles
511 //=======================================================================
512
513 void HYBRIDPlugin_Hypothesis::SetKeepFiles(bool toKeep)
514 {
515   if ( myKeepFiles != toKeep ) {
516     myKeepFiles = toKeep;
517     NotifySubMeshesHypothesisModification();
518   }
519 }
520
521 //=======================================================================
522 //function : GetKeepFiles
523 //=======================================================================
524
525 bool HYBRIDPlugin_Hypothesis::GetKeepFiles() const
526 {
527   return myKeepFiles;
528 }
529
530 //=======================================================================
531 //function : SetVerboseLevel
532 //=======================================================================
533
534 void HYBRIDPlugin_Hypothesis::SetVerboseLevel(short level)
535 {
536   if ( myVerboseLevel != level ) {
537     myVerboseLevel = level;
538     NotifySubMeshesHypothesisModification();
539   }
540 }
541
542 //=======================================================================
543 //function : GetVerboseLevel
544 //=======================================================================
545
546 short HYBRIDPlugin_Hypothesis::GetVerboseLevel() const
547 {
548   return myVerboseLevel;
549 }
550
551 //=======================================================================
552 //function : SetToCreateNewNodes
553 //=======================================================================
554
555 void HYBRIDPlugin_Hypothesis::SetToCreateNewNodes(bool toCreate)
556 {
557   if ( myToCreateNewNodes != toCreate ) {
558     myToCreateNewNodes = toCreate;
559     NotifySubMeshesHypothesisModification();
560   }
561 }
562
563 //=======================================================================
564 //function : GetToCreateNewNodes
565 //=======================================================================
566
567 bool HYBRIDPlugin_Hypothesis::GetToCreateNewNodes() const
568 {
569   return myToCreateNewNodes;
570 }
571
572 //=======================================================================
573 //function : SetToUseBoundaryRecoveryVersion
574 //=======================================================================
575
576 void HYBRIDPlugin_Hypothesis::SetToUseBoundaryRecoveryVersion(bool toUse)
577 {
578   if ( myToUseBoundaryRecoveryVersion != toUse ) {
579     myToUseBoundaryRecoveryVersion = toUse;
580     NotifySubMeshesHypothesisModification();
581   }
582 }
583
584 //=======================================================================
585 //function : GetToUseBoundaryRecoveryVersion
586 //=======================================================================
587
588 bool HYBRIDPlugin_Hypothesis::GetToUseBoundaryRecoveryVersion() const
589 {
590   return myToUseBoundaryRecoveryVersion;
591 }
592
593 //=======================================================================
594 //function : SetFEMCorrection
595 //=======================================================================
596
597 void HYBRIDPlugin_Hypothesis::SetFEMCorrection(bool toUseFem)
598 {
599   if ( myToUseFemCorrection != toUseFem ) {
600     myToUseFemCorrection = toUseFem;
601     NotifySubMeshesHypothesisModification();
602   }
603 }
604
605 //=======================================================================
606 //function : GetFEMCorrection
607 //=======================================================================
608
609 bool HYBRIDPlugin_Hypothesis::GetFEMCorrection() const
610 {
611   return myToUseFemCorrection;
612 }
613
614 //=======================================================================
615 //function : SetToRemoveCentralPoint
616 //=======================================================================
617
618 void HYBRIDPlugin_Hypothesis::SetToRemoveCentralPoint(bool toRemove)
619 {
620   if ( myToRemoveCentralPoint != toRemove ) {
621     myToRemoveCentralPoint = toRemove;
622     NotifySubMeshesHypothesisModification();
623   }
624 }
625
626 //=======================================================================
627 //function : GetToRemoveCentralPoint
628 //=======================================================================
629
630 bool HYBRIDPlugin_Hypothesis::GetToRemoveCentralPoint() const
631 {
632   return myToRemoveCentralPoint;
633 }
634
635 //=======================================================================
636 //function : SetAdvancedOption
637 //=======================================================================
638
639 void HYBRIDPlugin_Hypothesis::SetAdvancedOption(const std::string& option)
640 {
641   if ( myTextOption != option ) {
642     myTextOption = option;
643     NotifySubMeshesHypothesisModification();
644   }
645 }
646
647 //=======================================================================
648 //function : GetAdvancedOption
649 //=======================================================================
650
651 std::string HYBRIDPlugin_Hypothesis::GetAdvancedOption() const
652 {
653   return myTextOption;
654 }
655
656 //=======================================================================
657 //function : SetGradation
658 //=======================================================================
659
660 void HYBRIDPlugin_Hypothesis::SetGradation(double gradation)
661 {
662   if ( myGradation != gradation ) {
663     myGradation = gradation;
664     NotifySubMeshesHypothesisModification();
665   }
666 }
667
668 //=======================================================================
669 //function : GetGradation
670 //=======================================================================
671
672 double HYBRIDPlugin_Hypothesis::GetGradation() const
673 {
674   return myGradation;
675 }
676
677 //=======================================================================
678 //function : SetStandardOutputLog
679 //=======================================================================
680
681 void HYBRIDPlugin_Hypothesis::SetStandardOutputLog(bool logInStandardOutput)
682 {
683   if ( myLogInStandardOutput != logInStandardOutput ) {
684     myLogInStandardOutput = logInStandardOutput;
685     NotifySubMeshesHypothesisModification();
686   }
687 }
688
689 //=======================================================================
690 //function : GetStandardOutputLog
691 //=======================================================================
692
693 bool HYBRIDPlugin_Hypothesis::GetStandardOutputLog() const
694 {
695   return myLogInStandardOutput;
696 }
697
698 //=======================================================================
699 //function : SetRemoveLogOnSuccess
700 //=======================================================================
701
702 void HYBRIDPlugin_Hypothesis::SetRemoveLogOnSuccess(bool removeLogOnSuccess)
703 {
704   if ( myRemoveLogOnSuccess != removeLogOnSuccess ) {
705     myRemoveLogOnSuccess = removeLogOnSuccess;
706     NotifySubMeshesHypothesisModification();
707   }
708 }
709
710 //=======================================================================
711 //function : GetRemoveLogOnSuccess
712 //=======================================================================
713
714 bool HYBRIDPlugin_Hypothesis::GetRemoveLogOnSuccess() const
715 {
716   return myRemoveLogOnSuccess;
717 }
718
719 //=======================================================================
720 //function : SetEnforcedVertex
721 //=======================================================================
722
723 bool HYBRIDPlugin_Hypothesis::SetEnforcedVertex(std::string theName, std::string theEntry, std::string theGroupName,
724                                                double size, double x, double y, double z, bool isCompound)
725 {
726   bool toNotify = false;
727   bool toCreate = true;
728
729   THYBRIDEnforcedVertex *oldEnVertex;
730   THYBRIDEnforcedVertex *newEnfVertex = new THYBRIDEnforcedVertex();
731   newEnfVertex->name = theName;
732   newEnfVertex->geomEntry = theEntry;
733   newEnfVertex->coords.clear();
734   if (!isCompound) {
735     newEnfVertex->coords.push_back(x);
736     newEnfVertex->coords.push_back(y);
737     newEnfVertex->coords.push_back(z);
738   }
739   newEnfVertex->groupName = theGroupName;
740   newEnfVertex->size = size;
741   newEnfVertex->isCompound = isCompound;
742   
743   
744   // update _enfVertexList
745   THYBRIDEnforcedVertexList::iterator it = _enfVertexList.find(newEnfVertex);
746   if (it != _enfVertexList.end()) {
747     toCreate = false;
748     oldEnVertex = (*it);
749     if (oldEnVertex->name != theName) {
750       oldEnVertex->name = theName;
751       toNotify = true;
752     }
753     if (oldEnVertex->groupName != theGroupName) {
754       oldEnVertex->groupName = theGroupName;
755       toNotify = true;
756     }
757     if (oldEnVertex->size != size) {
758       oldEnVertex->size = size;
759       toNotify = true;
760     }
761     if (toNotify) {
762       // update map coords / enf vertex if needed
763       if (oldEnVertex->coords.size()) {
764         _coordsEnfVertexMap[oldEnVertex->coords] = oldEnVertex;
765         _enfVertexCoordsSizeList[oldEnVertex->coords] = size;
766       }
767
768       // update map geom entry / enf vertex if needed
769       if (oldEnVertex->geomEntry != "") {
770         _geomEntryEnfVertexMap[oldEnVertex->geomEntry] = oldEnVertex;
771         _enfVertexEntrySizeList[oldEnVertex->geomEntry] = size;
772       }
773     }
774   }
775
776 //   //////// CREATE ////////////
777   if (toCreate) {
778     toNotify = true;
779     _enfVertexList.insert(newEnfVertex);
780     if (theEntry == "") {
781       _coordsEnfVertexMap[newEnfVertex->coords] = newEnfVertex;
782       _enfVertexCoordsSizeList[newEnfVertex->coords] = size;
783     }
784     else {
785       _geomEntryEnfVertexMap[newEnfVertex->geomEntry] = newEnfVertex;
786       _enfVertexEntrySizeList[newEnfVertex->geomEntry] = size;
787     }
788   }
789
790   if (toNotify)
791     NotifySubMeshesHypothesisModification();
792
793   return toNotify;
794 }
795
796
797 //=======================================================================
798 //function : SetEnforcedMesh
799 //=======================================================================
800 bool HYBRIDPlugin_Hypothesis::SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName)
801 {
802   TIDSortedElemSet theElemSet;
803   SMDS_ElemIteratorPtr eIt = theMesh.GetMeshDS()->elementsIterator(SMDSAbs_ElementType(elementType));
804   while ( eIt->more() )
805     theElemSet.insert( eIt->next() );
806   bool added = SetEnforcedElements( theElemSet, elementType, groupName);
807   if (added) {
808     THYBRIDEnforcedMesh* newEnfMesh = new THYBRIDEnforcedMesh();
809     newEnfMesh->persistID   = theMesh.GetMeshDS()->GetPersistentId();
810     newEnfMesh->name        = name;
811     newEnfMesh->entry       = entry;
812     newEnfMesh->elementType = elementType;
813     newEnfMesh->groupName   = groupName;
814     
815     THYBRIDEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
816     if (it == _enfMeshList.end()) {
817       _entryEnfMeshMap[entry].insert(newEnfMesh);
818       _enfMeshList.insert(newEnfMesh);
819     }
820     else {
821       delete newEnfMesh;
822     }
823   }
824   return added;
825 }
826
827 //=======================================================================
828 //function : SetEnforcedGroup
829 //=======================================================================
830 bool HYBRIDPlugin_Hypothesis::SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::long_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName)
831 {
832   TIDSortedElemSet theElemSet;
833     if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");}
834     for ( CORBA::ULong i = 0; i < theIDs->length(); i++) {
835       CORBA::Long ind = theIDs[i];
836       if (elementType == SMESH::NODE)
837       {
838         const SMDS_MeshNode * node = theMeshDS->FindNode(ind);
839         if (node)
840           theElemSet.insert( node );
841       }
842       else
843       {
844         const SMDS_MeshElement * elem = theMeshDS->FindElement(ind);
845         if (elem)
846           theElemSet.insert( elem );
847       }
848     }
849
850 //   SMDS_ElemIteratorPtr it = theGroup->GetGroupDS()->GetElements();
851 //   while ( it->more() ) 
852 //     theElemSet.insert( it->next() );
853
854   bool added = SetEnforcedElements( theElemSet, elementType, groupName);
855   if (added) {
856     THYBRIDEnforcedMesh* newEnfMesh = new THYBRIDEnforcedMesh();
857     newEnfMesh->name = name;
858     newEnfMesh->entry = entry;
859     newEnfMesh->elementType = elementType;
860     newEnfMesh->groupName = groupName;
861     
862     THYBRIDEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
863     if (it == _enfMeshList.end()) {
864       _entryEnfMeshMap[entry].insert(newEnfMesh);
865       _enfMeshList.insert(newEnfMesh);
866     }
867   }
868   return added;
869 }
870
871 //=======================================================================
872 //function : SetEnforcedElements
873 //=======================================================================
874 bool HYBRIDPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, std::string groupName)
875 {
876   TIDSortedElemSet::const_iterator it = theElemSet.begin();
877   const SMDS_MeshElement* elem;
878   const SMDS_MeshNode* node;
879   bool added = true;
880   std::pair<TIDSortedNodeGroupMap::iterator,bool> nodeRet;
881   std::pair<TIDSortedElemGroupMap::iterator,bool> elemRet;
882
883   for (;it != theElemSet.end();++it)
884   {
885     elem = (*it);
886     switch (elementType) {
887       case SMESH::NODE:
888         node = dynamic_cast<const SMDS_MeshNode*>(elem);
889         if (node) {
890           nodeRet = _enfNodes.insert(make_pair(node,groupName));
891           added = added && nodeRet.second;
892           std::string msg = added ? "yes":"no";
893         }
894         else {
895           SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
896           for (;nodeIt->more();) {
897             node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
898             nodeRet = _enfNodes.insert(make_pair(node,groupName));
899             added = added && nodeRet.second;
900           }
901 //          added = true;s
902         }
903         break;
904       case SMESH::EDGE:
905         if (elem->GetType() == SMDSAbs_Edge) {
906           elemRet = _enfEdges.insert(make_pair(elem,groupName));
907           added = added && elemRet.second;
908         }
909         break;
910       case SMESH::FACE:
911         if (elem->GetType() == SMDSAbs_Face)
912         {
913           if (elem->NbCornerNodes() == 3) {
914             elemRet = _enfTriangles.insert(make_pair(elem,groupName));
915             added = added && elemRet.second;
916           }
917         }
918         break;
919       default:
920         break;
921     };
922   }
923   if (added)
924     NotifySubMeshesHypothesisModification();
925   return added;
926 }
927
928
929 //=======================================================================
930 //function : GetEnforcedVertex
931 //=======================================================================
932
933 HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex* HYBRIDPlugin_Hypothesis::GetEnforcedVertex(double x, double y, double z)
934   throw (std::invalid_argument)
935 {
936   std::vector<double> coord(3);
937   coord[0] = x;
938   coord[1] = y;
939   coord[2] = z;
940   if (_coordsEnfVertexMap.count(coord)>0)
941     return _coordsEnfVertexMap[coord];
942   std::ostringstream msg ;
943   msg << "No enforced vertex at " << x << ", " << y << ", " << z;
944   throw std::invalid_argument(msg.str());
945 }
946
947 HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex* HYBRIDPlugin_Hypothesis::GetEnforcedVertex(const std::string theEntry)
948   throw (std::invalid_argument)
949 {
950   if (_geomEntryEnfVertexMap.count(theEntry)>0)
951     return _geomEntryEnfVertexMap[theEntry];
952   
953   std::ostringstream msg ;
954   msg << "No enforced vertex with entry " << theEntry;
955   throw std::invalid_argument(msg.str());
956 }
957
958 //=======================================================================
959 //function : RemoveEnforcedVertex
960 //=======================================================================
961
962 bool HYBRIDPlugin_Hypothesis::RemoveEnforcedVertex(double x, double y, double z, const std::string theEntry)
963   throw (std::invalid_argument)
964 {
965   bool toNotify = false;
966   std::ostringstream msg;
967   THYBRIDEnforcedVertex *oldEnfVertex;
968   std::vector<double> coords(3);
969   coords[0] = x;
970   coords[1] = y;
971   coords[2] = z;
972   
973   // check that enf vertex with given enf vertex entry exists
974   TGeomEntryHYBRIDEnforcedVertexMap::iterator it_enfVertexEntry = _geomEntryEnfVertexMap.find(theEntry);
975   if (it_enfVertexEntry != _geomEntryEnfVertexMap.end()) {
976     // Success
977     oldEnfVertex = it_enfVertexEntry->second;
978     _geomEntryEnfVertexMap.erase(it_enfVertexEntry);
979   } else {
980     // Fail
981     // check that enf vertex with given coords exists
982     TCoordsHYBRIDEnforcedVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
983     if (it_coords_enf != _coordsEnfVertexMap.end()) {
984       // Success
985       oldEnfVertex = it_coords_enf->second;
986       _coordsEnfVertexMap.erase(it_coords_enf);
987       _enfVertexCoordsSizeList.erase(_enfVertexCoordsSizeList.find(coords));
988     } else {
989       // Fail
990       throw std::invalid_argument(msg.str());
991     }
992   }
993
994
995   // update _enfVertexList
996   THYBRIDEnforcedVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
997   if (it != _enfVertexList.end()) {
998     if ((*it)->groupName != "")
999       _groupsToRemove.insert((*it)->groupName);
1000     _enfVertexList.erase(it);
1001     toNotify = true;
1002   }
1003
1004   if (toNotify)
1005     NotifySubMeshesHypothesisModification();
1006
1007   return toNotify;
1008 }
1009
1010 //=======================================================================
1011 //function : ClearEnforcedVertices
1012 //=======================================================================
1013 void HYBRIDPlugin_Hypothesis::ClearEnforcedVertices()
1014 {
1015   THYBRIDEnforcedVertexList::const_iterator it = _enfVertexList.begin();
1016   for(;it != _enfVertexList.end();++it) {
1017     if ((*it)->groupName != "")
1018       _groupsToRemove.insert((*it)->groupName);
1019   }
1020   _enfVertexList.clear();
1021   _coordsEnfVertexMap.clear();
1022   _geomEntryEnfVertexMap.clear();
1023   _enfVertexCoordsSizeList.clear();
1024   _enfVertexEntrySizeList.clear();
1025   NotifySubMeshesHypothesisModification();
1026 }
1027
1028 //=======================================================================
1029 //function : ClearEnforcedMeshes
1030 //=======================================================================
1031 void HYBRIDPlugin_Hypothesis::ClearEnforcedMeshes()
1032 {
1033   THYBRIDEnforcedMeshList::const_iterator it = _enfMeshList.begin();
1034   for(;it != _enfMeshList.end();++it) {
1035     if ((*it)->groupName != "")
1036       _groupsToRemove.insert((*it)->groupName);
1037   }
1038   _enfNodes.clear();
1039   _enfEdges.clear();
1040   _enfTriangles.clear();
1041   _nodeIDToSizeMap.clear();
1042   _enfMeshList.clear();
1043   _entryEnfMeshMap.clear();
1044   NotifySubMeshesHypothesisModification();
1045 }
1046
1047 //================================================================================
1048 /*!
1049  * \brief At mesh loading, restore enforced elements by just loaded enforced meshes
1050  */
1051 //================================================================================
1052
1053 void HYBRIDPlugin_Hypothesis::RestoreEnfElemsByMeshes()
1054 {
1055   THYBRIDEnforcedMeshList::const_iterator it = _enfMeshList.begin();
1056   for(;it != _enfMeshList.end();++it) {
1057     THYBRIDEnforcedMesh* enfMesh = *it;
1058     if ( SMESH_Mesh* mesh = GetMeshByPersistentID( enfMesh->persistID ))
1059       SetEnforcedMesh( *mesh,
1060                        enfMesh->elementType,
1061                        enfMesh->name,
1062                        enfMesh->entry,
1063                        enfMesh->groupName );
1064     enfMesh->persistID = -1; // not to restore again
1065   }
1066 }
1067
1068 //=======================================================================
1069 //function : SetGroupsToRemove
1070 //=======================================================================
1071
1072 void HYBRIDPlugin_Hypothesis::ClearGroupsToRemove()
1073 {
1074   _groupsToRemove.clear();
1075 }
1076
1077
1078 //=======================================================================
1079 //function : DefaultLayersOnAllWrap
1080 //=======================================================================
1081
1082 bool HYBRIDPlugin_Hypothesis::DefaultLayersOnAllWrap()
1083 {
1084   return true;
1085 }
1086
1087 //=======================================================================
1088 //function : DefaultMeshHoles
1089 //=======================================================================
1090
1091 bool HYBRIDPlugin_Hypothesis::DefaultMeshHoles()
1092 {
1093   return false; // PAL19680
1094 }
1095
1096 //=======================================================================
1097 //function : DefaultToMakeGroupsOfDomains
1098 //=======================================================================
1099
1100 bool HYBRIDPlugin_Hypothesis::DefaultToMakeGroupsOfDomains()
1101 {
1102   return false; // issue 0022172
1103 }
1104
1105 //=======================================================================
1106 //function : DefaultMaximumMemory
1107 //=======================================================================
1108
1109 #if defined(WIN32)
1110 #include <windows.h>
1111 #elif !defined(__APPLE__)
1112 #include <sys/sysinfo.h>
1113 #endif
1114
1115 double  HYBRIDPlugin_Hypothesis::DefaultMaximumMemory()
1116 {
1117 #if defined(WIN32)
1118   // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
1119   MEMORYSTATUSEX statex;
1120   statex.dwLength = sizeof (statex);
1121   int err = GlobalMemoryStatusEx (&statex);
1122   if (err != 0) {
1123     int totMB = 
1124       statex.ullTotalPhys / 1024 / 1024 +
1125       statex.ullTotalPageFile / 1024 / 1024 +
1126       statex.ullTotalVirtual / 1024 / 1024;
1127     return ( 0.7 * totMB );
1128   }
1129 #elif !defined(__APPLE__)
1130   struct sysinfo si;
1131   int err = sysinfo( &si );
1132   if ( err == 0 ) {
1133     int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
1134     return ( 0.7 * ramMB );
1135   }
1136 #endif
1137   return 1024;
1138 }
1139
1140 //=======================================================================
1141 //function : DefaultInitialMemory
1142 //=======================================================================
1143
1144 double  HYBRIDPlugin_Hypothesis::DefaultInitialMemory()
1145 {
1146   return DefaultMaximumMemory();
1147 }
1148
1149 //=======================================================================
1150 //function : DefaultCollisionMode
1151 //=======================================================================
1152 short  HYBRIDPlugin_Hypothesis::DefaultCollisionMode()
1153 {
1154   return Decrease;
1155 }
1156
1157 //=======================================================================
1158 //function : DefaultBoundaryLayersGrowth
1159 //=======================================================================
1160 short  HYBRIDPlugin_Hypothesis::DefaultBoundaryLayersGrowth()
1161 {
1162   return Layer_Growth_Inward;
1163 }
1164
1165 //=======================================================================
1166 //function : DefaultElementGeneration
1167 //=======================================================================
1168 short  HYBRIDPlugin_Hypothesis::DefaultElementGeneration()
1169 {
1170   return Generation_Tetra_Dominant;
1171 }
1172
1173 //=======================================================================
1174 //function : DefaultOptimizationLevel
1175 //=======================================================================
1176 short  HYBRIDPlugin_Hypothesis::DefaultOptimizationLevel()
1177 {
1178   return Medium;
1179 }
1180
1181 //=======================================================================
1182 //function : DefaultWorkingDirectory
1183 //=======================================================================
1184
1185 std::string HYBRIDPlugin_Hypothesis::DefaultWorkingDirectory()
1186 {
1187   std::string aTmpDir;
1188
1189   char *Tmp_dir = getenv("SALOME_TMP_DIR");
1190   if(Tmp_dir != NULL) {
1191     aTmpDir = Tmp_dir;
1192   }
1193   else {
1194 #ifdef WIN32
1195     aTmpDir = "C:\\";
1196 #else
1197     aTmpDir = "/tmp/";
1198 #endif
1199   }
1200   return aTmpDir;
1201 }
1202
1203 //=======================================================================
1204 //function : DefaultKeepFiles
1205 //=======================================================================
1206
1207 bool   HYBRIDPlugin_Hypothesis::DefaultKeepFiles()
1208 {
1209   return false;
1210 }
1211
1212 //=======================================================================
1213 //function : DefaultRemoveLogOnSuccess
1214 //=======================================================================
1215
1216 bool   HYBRIDPlugin_Hypothesis::DefaultRemoveLogOnSuccess()
1217 {
1218   return false;
1219 }
1220
1221
1222 //=======================================================================
1223 //function : DefaultVerboseLevel
1224 //=======================================================================
1225
1226 short  HYBRIDPlugin_Hypothesis::DefaultVerboseLevel()
1227 {
1228   return 10;
1229 }
1230
1231 //=======================================================================
1232 //function : DefaultToCreateNewNodes
1233 //=======================================================================
1234
1235 bool HYBRIDPlugin_Hypothesis::DefaultToCreateNewNodes()
1236 {
1237   return true;
1238 }
1239
1240 //=======================================================================
1241 //function : DefaultToUseBoundaryRecoveryVersion
1242 //=======================================================================
1243
1244 bool HYBRIDPlugin_Hypothesis::DefaultToUseBoundaryRecoveryVersion()
1245 {
1246   return false;
1247 }
1248
1249 //=======================================================================
1250 //function : DefaultToUseFEMCorrection
1251 //=======================================================================
1252
1253 bool HYBRIDPlugin_Hypothesis::DefaultToUseFEMCorrection()
1254 {
1255   return false;
1256 }
1257
1258 //=======================================================================
1259 //function : DefaultToRemoveCentralPoint
1260 //=======================================================================
1261
1262 bool HYBRIDPlugin_Hypothesis::DefaultToRemoveCentralPoint()
1263 {
1264   return false;
1265 }
1266
1267 //=======================================================================
1268 //function : DefaultGradation
1269 //=======================================================================
1270
1271 double HYBRIDPlugin_Hypothesis::DefaultGradation()
1272 {
1273   return 1.05;
1274 }
1275
1276 //=======================================================================
1277 //function : DefaultStandardOutputLog
1278 //=======================================================================
1279
1280 bool HYBRIDPlugin_Hypothesis::DefaultStandardOutputLog()
1281 {
1282   return false;
1283 }
1284
1285 // //=======================================================================
1286 // //function : DefaultID2SizeMap
1287 // //=======================================================================
1288 // 
1289 // HYBRIDPlugin_Hypothesis::TID2SizeMap HYBRIDPlugin_Hypothesis::DefaultID2SizeMap()
1290 // {
1291 //   return HYBRIDPlugin_Hypothesis::TID2SizeMap();
1292 // }
1293
1294 //=======================================================================
1295 //function : DefaultAddMultinormals
1296 //=======================================================================
1297 bool HYBRIDPlugin_Hypothesis::DefaultAddMultinormals()
1298 {
1299   return false;
1300 }
1301
1302 //=======================================================================
1303 //function : DefaultSmoothNormals
1304 //=======================================================================
1305 bool HYBRIDPlugin_Hypothesis::DefaultSmoothNormals()
1306 {
1307   return false;
1308 }
1309
1310 //=======================================================================
1311 //function : DefaultHeightFirstLayer
1312 //=======================================================================
1313 double HYBRIDPlugin_Hypothesis::DefaultHeightFirstLayer()
1314 {
1315   return 0.0; //or epsilon?
1316 }
1317
1318 //=======================================================================
1319 //function : DefaultBoundaryLayersProgression
1320 //=======================================================================
1321 double HYBRIDPlugin_Hypothesis::DefaultBoundaryLayersProgression()
1322 {
1323   return 1.0;
1324 }
1325
1326 //=======================================================================
1327 //function : DefaultCoreSize
1328 //=======================================================================
1329 double HYBRIDPlugin_Hypothesis::DefaultCoreSize()
1330 {
1331   return 0.0;
1332 }
1333
1334 //=======================================================================
1335 //function : DefaultMultinormalsAngle
1336 //=======================================================================
1337 double HYBRIDPlugin_Hypothesis::DefaultMultinormalsAngle()
1338 {
1339   return 30.0;
1340 }
1341
1342 //=======================================================================
1343 //function : DefaultNbOfBoundaryLayers
1344 //=======================================================================
1345 short HYBRIDPlugin_Hypothesis::DefaultNbOfBoundaryLayers()
1346 {
1347   return 1;
1348 }
1349
1350 //=======================================================================
1351 //function : SaveTo
1352 //=======================================================================
1353
1354 std::ostream & HYBRIDPlugin_Hypothesis::SaveTo(std::ostream & save)
1355 {
1356   save << (int) myBoundaryLayersGrowth << " ";
1357   save << (int) myElementGeneration << " ";
1358   save << (int) myAddMultinormals << " ";
1359   save << (int) mySmoothNormals << " ";
1360   save << (int) myLayersOnAllWrap << " ";
1361
1362   save << myNbOfBoundaryLayers << " ";
1363   save << myHeightFirstLayer << " ";
1364   save << myBoundaryLayersProgression << " ";
1365   save << myMultinormalsAngle << " ";
1366
1367   save << (int) myKeepFiles << " ";
1368   save << myWorkingDirectory << " ";
1369   save << myVerboseLevel << " ";
1370   save << myCoreSize << " ";
1371
1372   if (!myTextOption.empty()) {
1373     save << "__OPTIONS_BEGIN__ ";
1374     save << myTextOption << " ";
1375     save << "__OPTIONS_END__ ";
1376   }
1377
1378
1379   THYBRIDEnforcedVertexList::iterator it  = _enfVertexList.begin();
1380   if (it != _enfVertexList.end()) {
1381     save << " " << "__ENFORCED_VERTICES_BEGIN__ ";
1382     for ( ; it != _enfVertexList.end(); ++it ) {
1383       THYBRIDEnforcedVertex *enfVertex = (*it);
1384       save << " " << "__BEGIN_VERTEX__";
1385       if (!enfVertex->name.empty()) {
1386         save << " " << "__BEGIN_NAME__";
1387         save << " " << enfVertex->name;
1388         save << " " << "__END_NAME__";
1389       }
1390       if (!enfVertex->geomEntry.empty()) {
1391         save << " " << "__BEGIN_ENTRY__";
1392         save << " " << enfVertex->geomEntry;
1393         save << " " << enfVertex->isCompound;
1394         save << " " << "__END_ENTRY__";
1395       }
1396       if (!enfVertex->groupName.empty()) {
1397         save << " " << "__BEGIN_GROUP__";
1398         save << " " << enfVertex->groupName;
1399         save << " " << "__END_GROUP__";
1400       }
1401       if (enfVertex->coords.size()) {
1402         save << " " << "__BEGIN_COORDS__";
1403         for ( size_t i = 0; i < enfVertex->coords.size(); i++ )
1404           save << " " << enfVertex->coords[i];
1405         save << " " << "__END_COORDS__";
1406       }
1407       save << " " << "__BEGIN_SIZE__";
1408       save << " " << enfVertex->size;
1409       save << " " << "__END_SIZE__";
1410       save << " " << "__END_VERTEX__";
1411     }
1412     save << " " << "__ENFORCED_VERTICES_END__ ";
1413   }
1414
1415   THYBRIDEnforcedMeshList::iterator it_mesh  = _enfMeshList.begin();
1416   if (it_mesh != _enfMeshList.end()) {
1417     save << " " << "__ENFORCED_MESHES_BEGIN__ ";
1418     for ( ; it_mesh != _enfMeshList.end(); ++it_mesh ) {
1419       THYBRIDEnforcedMesh *enfMesh = (*it_mesh);
1420       save << " " << "__BEGIN_ENF_MESH__";
1421
1422       save << " " << "__BEGIN_NAME__";
1423       save << " " << enfMesh->name;
1424       save << " " << "__END_NAME__";
1425
1426       save << " " << "__BEGIN_ENTRY__";
1427       save << " " << enfMesh->entry;
1428       save << " " << "__END_ENTRY__";
1429
1430       save << " " << "__BEGIN_ELEM_TYPE__";
1431       save << " " << (int)enfMesh->elementType;
1432       save << " " << "__END_ELEM_TYPE__";
1433
1434       if (!enfMesh->groupName.empty()) {
1435         save << " " << "__BEGIN_GROUP__";
1436         save << " " << enfMesh->groupName;
1437         save << " " << "__END_GROUP__";
1438       }
1439       save << " " << "__PERSIST_ID__";
1440       save << " " << enfMesh->persistID;
1441       save << " " << "__END_ENF_MESH__";
1442       std::cout << "Saving of enforced mesh " << enfMesh->name.c_str() << " done" << std::endl;
1443     }
1444     save << " "  << "__ENFORCED_MESHES_END__ ";
1445   }
1446
1447   save << " " << myFacesWithLayers.size();
1448   for ( size_t i = 0; i < myFacesWithLayers.size(); ++i )
1449     save << " " << myFacesWithLayers[i];
1450
1451   save << " " << myFacesWithImprinting.size();
1452   for ( size_t i = 0; i < myFacesWithImprinting.size(); ++i )
1453     save << " " << myFacesWithImprinting[i];
1454
1455   return save;
1456 }
1457
1458 //=======================================================================
1459 //function : LoadFrom
1460 //=======================================================================
1461
1462 std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load)
1463 {
1464   bool isOK = true;
1465   int i;
1466   double d;
1467
1468   isOK = static_cast<bool>(load >> i);
1469   if (isOK)
1470     myBoundaryLayersGrowth = (short) i;
1471   else
1472     load.clear(ios::badbit | load.rdstate());
1473
1474   isOK = static_cast<bool>(load >> i);
1475   if (isOK)
1476     myElementGeneration = (short) i;
1477   else
1478     load.clear(ios::badbit | load.rdstate());
1479
1480   isOK = static_cast<bool>(load >> i);
1481   if (isOK)
1482     myAddMultinormals = (bool) i;
1483   else
1484     load.clear(ios::badbit | load.rdstate());
1485
1486   isOK = static_cast<bool>(load >> i);
1487   if (isOK)
1488     mySmoothNormals = (bool) i;
1489   else
1490     load.clear(ios::badbit | load.rdstate());
1491
1492   isOK = static_cast<bool>(load >> i);
1493   if (isOK)
1494     myLayersOnAllWrap = (bool) i;
1495   else
1496     load.clear(ios::badbit | load.rdstate());
1497
1498   isOK = static_cast<bool>(load >> i);
1499   if (isOK)
1500     myNbOfBoundaryLayers = (short) i;
1501   else
1502     load.clear(ios::badbit | load.rdstate());
1503
1504   isOK = static_cast<bool>(load >> d);
1505   if (isOK)
1506     myHeightFirstLayer = d;
1507   else
1508     load.clear(ios::badbit | load.rdstate());
1509
1510   isOK = static_cast<bool>(load >> d);
1511   if (isOK)
1512     myBoundaryLayersProgression = d;
1513   else
1514     load.clear(ios::badbit | load.rdstate());
1515
1516   isOK = static_cast<bool>(load >> d);
1517   if (isOK)
1518     myMultinormalsAngle = d;
1519   else
1520     load.clear(ios::badbit | load.rdstate());
1521
1522   isOK = static_cast<bool>(load >> i);
1523   if (isOK)
1524     myKeepFiles = (bool) i;
1525   else
1526     load.clear(ios::badbit | load.rdstate());
1527
1528   isOK = static_cast<bool>(load >> myWorkingDirectory);
1529   if (isOK) {
1530     if ( myWorkingDirectory == "0") { // myWorkingDirectory was empty
1531       myKeepFiles = false;
1532       myWorkingDirectory.clear();
1533     }
1534     else if ( myWorkingDirectory == "1" ) {
1535       myKeepFiles = true;
1536       myWorkingDirectory.clear();
1537     }
1538   }
1539   else
1540     load.clear(ios::badbit | load.rdstate());
1541
1542   isOK = static_cast<bool>(load >> i);
1543   if (isOK)
1544     myVerboseLevel = (short) i;
1545   else
1546     load.clear(ios::badbit | load.rdstate());
1547
1548   isOK = static_cast<bool>(load >> d);
1549   if (isOK)
1550     myCoreSize = d;
1551   else
1552     load.clear(ios::badbit | load.rdstate());
1553
1554   std::string separator;
1555   bool hasOptions = false;
1556   bool hasEnforcedVertices = false;
1557   bool hasEnforcedMeshes = false;
1558   isOK = static_cast<bool>(load >> separator);
1559
1560   if ( isOK && ( separator == "0" || separator == "1" ))
1561   {
1562     myToMakeGroupsOfDomains = ( separator == "1" );
1563     isOK = static_cast<bool>(load >> separator);
1564   }
1565
1566   if (isOK) {
1567     if (separator == "__OPTIONS_BEGIN__")
1568       hasOptions = true;
1569     else if (separator == "__ENFORCED_VERTICES_BEGIN__")
1570       hasEnforcedVertices = true;
1571     else if (separator == "__ENFORCED_MESHES_BEGIN__")
1572       hasEnforcedMeshes = true;
1573   }
1574
1575   if (hasOptions) {
1576     std::string txt;
1577     while (isOK) {
1578       isOK = static_cast<bool>(load >> txt);
1579       if (isOK) {
1580         if (txt == "__OPTIONS_END__") {
1581           if (!myTextOption.empty()) {
1582             // Remove last space
1583             myTextOption.erase(myTextOption.end()-1);
1584           }
1585           isOK = false;
1586           break;
1587         }
1588         myTextOption += txt;
1589         myTextOption += " ";
1590       }
1591     }
1592   }
1593
1594   if (hasOptions) {
1595     isOK = static_cast<bool>(load >> separator);
1596     if (isOK && separator == "__ENFORCED_VERTICES_BEGIN__")
1597       hasEnforcedVertices = true;
1598     if (isOK && separator == "__ENFORCED_MESHES_BEGIN__")
1599       hasEnforcedMeshes = true;
1600   }
1601
1602   if (hasEnforcedVertices) {
1603     std::string txt, name, entry, groupName;
1604     double size, coords[3];
1605     bool isCompound;
1606     bool hasCoords = false;
1607     isOK = static_cast<bool>(load >> txt);  // __BEGIN_VERTEX__
1608     while (isOK) {
1609       if (txt == "__ENFORCED_VERTICES_END__")
1610         isOK = false;
1611
1612       THYBRIDEnforcedVertex *enfVertex = new THYBRIDEnforcedVertex();
1613       while (isOK) {
1614         isOK = static_cast<bool>(load >> txt);
1615         if (txt == "__END_VERTEX__") {
1616           enfVertex->name = name;
1617           enfVertex->geomEntry = entry;
1618           enfVertex->isCompound = isCompound;
1619           enfVertex->groupName = groupName;
1620           enfVertex->coords.clear();
1621           if (hasCoords)
1622             enfVertex->coords.assign(coords,coords+3);
1623
1624           _enfVertexList.insert(enfVertex);
1625
1626           if (enfVertex->coords.size())
1627             _coordsEnfVertexMap[enfVertex->coords] = enfVertex;
1628           if (!enfVertex->geomEntry.empty())
1629             _geomEntryEnfVertexMap[enfVertex->geomEntry] = enfVertex;
1630
1631           name.clear();
1632           entry.clear();
1633           groupName.clear();
1634           hasCoords = false;
1635           isOK = false;
1636         }
1637
1638         if (txt == "__BEGIN_NAME__") {  // __BEGIN_NAME__
1639           while (isOK && (txt != "__END_NAME__")) {
1640             isOK = static_cast<bool>(load >> txt);
1641             if (txt != "__END_NAME__") {
1642               if (!name.empty())
1643                 name += " ";
1644               name += txt;
1645             }
1646           }
1647         }
1648
1649         if (txt == "__BEGIN_ENTRY__") {  // __BEGIN_ENTRY__
1650           isOK = static_cast<bool>(load >> entry);
1651           isOK = static_cast<bool>(load >> isCompound);
1652           isOK = static_cast<bool>(load >> txt); // __END_ENTRY__
1653           if (txt != "__END_ENTRY__")
1654             throw std::exception();
1655         }
1656
1657         if (txt == "__BEGIN_GROUP__") {  // __BEGIN_GROUP__
1658           while (isOK && (txt != "__END_GROUP__")) {
1659             isOK = static_cast<bool>(load >> txt);
1660             if (txt != "__END_GROUP__") {
1661               if (!groupName.empty())
1662                 groupName += " ";
1663               groupName += txt;
1664             }
1665           }
1666         }
1667
1668         if (txt == "__BEGIN_COORDS__") {  // __BEGIN_COORDS__
1669           hasCoords = true;
1670           isOK = static_cast<bool>(load >> coords[0] >> coords[1] >> coords[2]);
1671           isOK = static_cast<bool>(load >> txt); // __END_COORDS__
1672           if (txt != "__END_COORDS__")
1673             throw std::exception();
1674         }
1675
1676         if (txt == "__BEGIN_SIZE__") {  // __BEGIN_ENTRY__
1677           isOK = static_cast<bool>(load >> size);
1678           isOK = static_cast<bool>(load >> txt); // __END_ENTRY__
1679           if (txt != "__END_SIZE__") {
1680             throw std::exception();
1681           }
1682         }
1683       }
1684       isOK = static_cast<bool>(load >> txt);  // __BEGIN_VERTEX__
1685     }
1686   }
1687
1688   if (hasEnforcedVertices) {
1689     isOK = static_cast<bool>(load >> separator);
1690     if (isOK && separator == "__ENFORCED_MESHES_BEGIN__")
1691       hasEnforcedMeshes = true;
1692   }
1693
1694   if (hasEnforcedMeshes) {
1695     std::string txt, name, entry, groupName;
1696     int elementType = -1, persistID = -1;
1697     isOK = static_cast<bool>(load >> txt);  // __BEGIN_ENF_MESH__
1698     while (isOK) {
1699       //                if (isOK) {
1700       if (txt == "__ENFORCED_MESHES_END__")
1701         isOK = false;
1702
1703       THYBRIDEnforcedMesh *enfMesh = new THYBRIDEnforcedMesh();
1704       while (isOK) {
1705         isOK = static_cast<bool>(load >> txt);
1706         if (txt == "__END_ENF_MESH__") {
1707           enfMesh->name = name;
1708           enfMesh->entry = entry;
1709           enfMesh->elementType = (SMESH::ElementType)elementType;
1710           enfMesh->groupName = groupName;
1711           enfMesh->persistID = persistID;
1712
1713           _enfMeshList.insert(enfMesh);
1714           std::cout << "Restoring of enforced mesh " <<name  << " done" << std::endl;
1715
1716           name.clear();
1717           entry.clear();
1718           elementType = -1;
1719           groupName.clear();
1720           persistID = -1;
1721           isOK = false;
1722         }
1723
1724         if (txt == "__BEGIN_NAME__") {  // __BEGIN_NAME__
1725           while (isOK && (txt != "__END_NAME__")) {
1726             isOK = static_cast<bool>(load >> txt);
1727             if (txt != "__END_NAME__") {
1728               if (!name.empty())
1729                 name += " ";
1730               name += txt;
1731             }
1732           }
1733         }
1734
1735         if (txt == "__BEGIN_ENTRY__") {  // __BEGIN_ENTRY__
1736           isOK = static_cast<bool>(load >> entry);
1737           isOK = static_cast<bool>(load >> txt); // __END_ENTRY__
1738           if (txt != "__END_ENTRY__")
1739             throw std::exception();
1740         }
1741
1742         if (txt == "__BEGIN_ELEM_TYPE__") {  // __BEGIN_ELEM_TYPE__
1743           isOK = static_cast<bool>(load >> elementType);
1744           isOK = static_cast<bool>(load >> txt); // __END_ELEM_TYPE__
1745           if (txt != "__END_ELEM_TYPE__")
1746             throw std::exception();
1747         }
1748
1749         if (txt == "__BEGIN_GROUP__") {  // __BEGIN_GROUP__
1750           while (isOK && (txt != "__END_GROUP__")) {
1751             isOK = static_cast<bool>(load >> txt);
1752             if (txt != "__END_GROUP__") {
1753               if (!groupName.empty())
1754                 groupName += " ";
1755               groupName += txt;
1756             }
1757           } // while
1758         } // if
1759
1760         if (txt == "__PERSIST_ID__") {
1761           isOK = static_cast<bool>(load >> persistID);
1762         }
1763         std::cout << "isOK: " << isOK << std::endl;
1764       } // while
1765       //                } // if
1766       isOK = static_cast<bool>(load >> txt);  // __BEGIN_ENF_MESH__
1767     } // while
1768   } // if
1769
1770   if ( hasEnforcedMeshes )
1771     isOK = static_cast<bool>(load >> separator);
1772
1773   if ( isOK )
1774   {
1775     i = atoi( separator.c_str() );
1776     isOK = ( i >= 0 );
1777     if ( isOK )
1778     {
1779       myFacesWithLayers.reserve( i );
1780       while (( myFacesWithLayers.size() < myFacesWithLayers.capacity() ) &&
1781              ( isOK = static_cast<bool>(load >> i)) )
1782         myFacesWithLayers.push_back( i );
1783     }
1784   }
1785
1786   isOK = static_cast<bool>(load >> separator);
1787   if ( isOK )
1788   {
1789     i = atoi( separator.c_str() );
1790     isOK = ( i >= 0 );
1791     if ( isOK )
1792     {
1793       myFacesWithImprinting.reserve( i );
1794       while (( myFacesWithImprinting.size() < myFacesWithImprinting.capacity() ) &&
1795              ( isOK = static_cast<bool>(load >> i)) )
1796         myFacesWithImprinting.push_back( i );
1797     }
1798   }
1799
1800   return load;
1801 }
1802
1803 //=======================================================================
1804 //function : SetParametersByMesh
1805 //=======================================================================
1806
1807 bool HYBRIDPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS_Shape&)
1808 {
1809   return false;
1810 }
1811
1812
1813 //================================================================================
1814 /*!
1815  * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not
1816  */
1817 //================================================================================
1818
1819 bool HYBRIDPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  dflts,
1820                                                      const SMESH_Mesh* /*theMesh*/)
1821 {
1822   myToMakeGroupsOfDomains = ( !dflts._shape || dflts._shape->IsNull() );
1823   return true;
1824 }
1825
1826 //================================================================================
1827 /*!
1828  * \brief Return command to run hybrid mesher excluding file prefix (-f)
1829  */
1830 //================================================================================
1831
1832 std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis* hyp,
1833                                                   SMESH_Mesh&                    mesh)
1834 {
1835   SMESH_Comment cmd = GetExeName();
1836   // check if any option is overridden by hyp->myTextOption
1837   bool p_h     = ( hyp && hyp->myTextOption.find("-h") != std::string::npos );
1838   bool p_v     = ( hyp && hyp->myTextOption.find("-v") != std::string::npos );
1839   bool p_i     = ( hyp && hyp->myTextOption.find("-i") != std::string::npos );
1840   bool p_o     = ( hyp && hyp->myTextOption.find("-o") != std::string::npos );
1841   bool p_mnot  = ( hyp && hyp->myTextOption.find("--max_number_of_threads ") != std::string::npos );
1842   bool p_blsi  = ( hyp && hyp->myTextOption.find("--boundary_layer_surface_tags ") != std::string::npos );
1843   bool p_blii  = ( hyp && hyp->myTextOption.find("--boundary_layer_imprint_tags ") != std::string::npos );
1844   bool p_blsd  = ( hyp && hyp->myTextOption.find("--normal_direction ") != std::string::npos );
1845   bool p_hotfl = ( hyp && hyp->myTextOption.find("--boundary_layer_global_initial_height ") != std::string::npos );
1846   bool p_nobl  = ( hyp && hyp->myTextOption.find("--number_of_boundary_layers ") != std::string::npos );
1847   bool p_blgp  = ( hyp && hyp->myTextOption.find("--boundary_layer_geometric_progression ") != std::string::npos );
1848   bool p_eg    = ( hyp && hyp->myTextOption.find("--element_generation ") != std::string::npos );
1849   bool p_cm    = ( hyp && hyp->myTextOption.find("--collision_mode ") != std::string::npos );
1850   bool p_am    = ( hyp && hyp->myTextOption.find("--add_multinormals ") != std::string::npos );
1851   bool p_cs    = ( hyp && hyp->myTextOption.find("--global_physical_size ") != std::string::npos );
1852   bool p_mat   = ( hyp && hyp->myTextOption.find("--multinormal_angle_threshold ") != std::string::npos );
1853   bool p_sn    = ( hyp && hyp->myTextOption.find("--smooth_normals ") != std::string::npos );
1854
1855   //missing options :
1856   //- boundary_layer_max_element_angle
1857
1858   bool nolayers = false;
1859   bool layersOnAllWrap = hyp ? hyp->myLayersOnAllWrap : DefaultLayersOnAllWrap();
1860
1861   //help mode
1862   if ( p_h ) {
1863     cmd << " --help ";
1864 #ifdef WIN32
1865     cmd << " < NUL";
1866 #endif
1867     std::cout << "!!!!! CommandToRun help only !!!! " << cmd << std::endl;
1868     return cmd;
1869   }
1870
1871   if ( !p_v && hyp )
1872     cmd << " --verbose " << hyp->myVerboseLevel;
1873
1874   if ( !p_mnot && hyp )
1875     cmd << " --max_number_of_threads " << 8; //TODO getenv NB CPU
1876
1877   //no layers?
1878   if ( !p_nobl && hyp ) {
1879     if ( hyp->myNbOfBoundaryLayers < 1 ) nolayers = true;
1880   }
1881   if ( !p_hotfl && hyp ) {
1882     if ( hyp->myHeightFirstLayer < 1e-50 ) nolayers = true;
1883   }
1884     
1885   if ( !p_blsd && hyp ) {
1886     if ( hyp->myBoundaryLayersGrowth >= 0 && hyp->myBoundaryLayersGrowth <= 1 ) {
1887       const char* value[] = { "-1" , "1" }; // -1 == inside
1888       cmd << " --normal_direction " << value[ hyp->myBoundaryLayersGrowth ];
1889     }
1890   }
1891   
1892   if ( !p_hotfl && hyp ) {
1893     cmd << " --boundary_layer_global_initial_height " << hyp->myHeightFirstLayer;
1894   }
1895   
1896   if ( !p_nobl && hyp ) {
1897     cmd << " --number_of_boundary_layers " << ( nolayers ? 0 :  hyp->myNbOfBoundaryLayers );
1898   }
1899
1900   if ( !p_blgp && hyp ) {
1901     cmd << " --boundary_layer_geometric_progression " << hyp->myBoundaryLayersProgression;
1902   }
1903
1904   if ( !nolayers && hyp )
1905   {
1906     cmd << " --boundary_layer_size_mode " << ( layersOnAllWrap ? "global" : "local" );
1907     
1908     if ( !layersOnAllWrap )
1909     {
1910       // faces with layers
1911       const std::vector<int>& faceLayersIDs = hyp->GetFacesWithLayers();
1912       if ( !faceLayersIDs.empty() )
1913         cmd << " --boundary_layer_surface_tags ";
1914       for ( size_t i = 0; i < faceLayersIDs.size(); ++i )
1915         cmd << faceLayersIDs[i] << ",";
1916       if ( !faceLayersIDs.empty() )
1917         cmd << " --boundary_layer_initial_height_on_surface_tags ";
1918       for ( size_t i = 0; i < faceLayersIDs.size(); ++i )
1919         cmd << hyp->myHeightFirstLayer << ",";
1920
1921       // faces with imprinting
1922       const std::vector<int>& faceImprintingIDs = hyp->GetFacesWithImprinting();
1923       if ( !faceImprintingIDs.empty() )
1924         cmd << " --boundary_layer_imprinting yes --boundary_layer_imprinting_tags ";
1925       for ( size_t i = 0; i < faceImprintingIDs.size(); ++i )
1926         cmd << faceImprintingIDs[i] << ",";
1927     }
1928   }
1929
1930   if ( !p_eg && hyp ) {
1931     if ( hyp->myElementGeneration >= 0 && hyp->myElementGeneration <= 2 ) {
1932       const char* value[] = { "tetra-dominant" , "hexa-dominant", "cartesian_core" };
1933       cmd << " --element_generation " << value[ hyp->myElementGeneration ];
1934     }
1935   }
1936
1937   if ( !p_cs && hyp ) {
1938     if ( hyp->myCoreSize >= 0 ) {
1939       cmd << " --global_physical_size " << hyp->myCoreSize;
1940     }
1941   }
1942
1943   if ( !p_cm && hyp ) {
1944     if ( hyp->myCollisionMode >= 0 && hyp->myCollisionMode <= 1 ) {
1945       const char* value[] = { "decrease" , "stop" };
1946       cmd << " --collision_mode " << value[ hyp->myCollisionMode ];
1947     }
1948   }
1949   
1950   if ( !p_am && hyp ) {
1951     int res = hyp->myAddMultinormals ? 0 : 1 ;
1952     const char* value[] = { "yes" , "no" };
1953     cmd << " --add_multinormals " << value[ res ];
1954   }
1955   
1956   if ( !p_mat && hyp ) {
1957     cmd << " --multinormal_angle_threshold " << hyp->myMultinormalsAngle;
1958   }
1959   
1960   if ( !p_sn && hyp ) {
1961     int res = hyp->mySmoothNormals ? 0 : 1 ;
1962     const char* value[] = { "yes" , "no" };
1963     cmd << " --smooth_normals " << value[ res ];
1964   }
1965
1966   // options as text
1967   if ( hyp && !hyp->myTextOption.empty() ) {
1968     cmd += " " + hyp->myTextOption;
1969   }
1970 #ifdef WIN32
1971   cmd << " < NUL";
1972 #endif
1973   //std::cout << "!!!!!CommandToRun end " << cmd << std::endl;
1974     
1975   return cmd;
1976 }
1977
1978 //================================================================================
1979 /*!
1980  * \brief Return a unique file name
1981  */
1982 //================================================================================
1983
1984 std::string HYBRIDPlugin_Hypothesis::GetFileName(const HYBRIDPlugin_Hypothesis* hyp)
1985 {
1986   std::string aTmpDir = hyp ? hyp->GetWorkingDirectory() : DefaultWorkingDirectory();
1987   const char lastChar = *aTmpDir.rbegin();
1988 #ifdef WIN32
1989   if(lastChar != '\\') aTmpDir+='\\';
1990 #else
1991   if(lastChar != '/') aTmpDir+='/';
1992 #endif
1993
1994   SMESH_Comment aGenericName = aTmpDir;
1995   aGenericName << "HYBRID_";
1996   aGenericName << getpid();
1997   aGenericName << "_";
1998   aGenericName << Abs((Standard_Integer)(long) aGenericName.c_str());
1999
2000   return aGenericName;
2001 }
2002
2003 //================================================================================
2004 /*
2005  * Return the name of executable
2006  */
2007 //================================================================================
2008
2009 std::string HYBRIDPlugin_Hypothesis::GetExeName()
2010 {
2011   //call mg-hybrid.bash is script which assumes new project version(s) mg-hybrid.exe in the prerequisite base and special? licence.
2012 #ifdef WIN32
2013   return "mg-hybrid.exe";
2014 #else
2015   return "mg-hybrid.bash";
2016 #endif
2017 }
2018
2019 //================================================================================
2020 /*!
2021 * \brief Return the enforced vertices
2022 */
2023 //================================================================================
2024
2025 HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexList HYBRIDPlugin_Hypothesis::GetEnforcedVertices(const HYBRIDPlugin_Hypothesis* hyp)
2026 {
2027   return hyp ? hyp->_GetEnforcedVertices():DefaultHYBRIDEnforcedVertexList();
2028 }
2029
2030 HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues HYBRIDPlugin_Hypothesis::GetEnforcedVerticesCoordsSize (const HYBRIDPlugin_Hypothesis* hyp)
2031 {  
2032   return hyp ? hyp->_GetEnforcedVerticesCoordsSize(): DefaultHYBRIDEnforcedVertexCoordsValues();
2033 }
2034
2035 HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexEntryValues HYBRIDPlugin_Hypothesis::GetEnforcedVerticesEntrySize (const HYBRIDPlugin_Hypothesis* hyp)
2036 {  
2037   return hyp ? hyp->_GetEnforcedVerticesEntrySize(): DefaultHYBRIDEnforcedVertexEntryValues();
2038 }
2039
2040 HYBRIDPlugin_Hypothesis::TCoordsHYBRIDEnforcedVertexMap HYBRIDPlugin_Hypothesis::GetEnforcedVerticesByCoords (const HYBRIDPlugin_Hypothesis* hyp)
2041 {  
2042   return hyp ? hyp->_GetEnforcedVerticesByCoords(): DefaultCoordsHYBRIDEnforcedVertexMap();
2043 }
2044
2045 HYBRIDPlugin_Hypothesis::TGeomEntryHYBRIDEnforcedVertexMap HYBRIDPlugin_Hypothesis::GetEnforcedVerticesByEntry (const HYBRIDPlugin_Hypothesis* hyp)
2046 {  
2047   return hyp ? hyp->_GetEnforcedVerticesByEntry(): DefaultGeomEntryHYBRIDEnforcedVertexMap();
2048 }
2049
2050 HYBRIDPlugin_Hypothesis::TIDSortedNodeGroupMap HYBRIDPlugin_Hypothesis::GetEnforcedNodes(const HYBRIDPlugin_Hypothesis* hyp)
2051 {
2052   return hyp ? hyp->_GetEnforcedNodes():DefaultIDSortedNodeGroupMap();
2053 }
2054
2055 HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap HYBRIDPlugin_Hypothesis::GetEnforcedEdges(const HYBRIDPlugin_Hypothesis* hyp)
2056 {
2057   return hyp ? hyp->_GetEnforcedEdges():DefaultIDSortedElemGroupMap();
2058 }
2059
2060 HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap HYBRIDPlugin_Hypothesis::GetEnforcedTriangles(const HYBRIDPlugin_Hypothesis* hyp)
2061 {
2062   return hyp ? hyp->_GetEnforcedTriangles():DefaultIDSortedElemGroupMap();
2063 }
2064
2065 HYBRIDPlugin_Hypothesis::TID2SizeMap HYBRIDPlugin_Hypothesis::GetNodeIDToSizeMap(const HYBRIDPlugin_Hypothesis* hyp)
2066 {
2067   return hyp ? hyp->_GetNodeIDToSizeMap(): DefaultID2SizeMap();
2068 }
2069
2070 HYBRIDPlugin_Hypothesis::TSetStrings HYBRIDPlugin_Hypothesis::GetGroupsToRemove(const HYBRIDPlugin_Hypothesis* hyp)
2071 {
2072   return hyp ? hyp->_GetGroupsToRemove(): DefaultGroupsToRemove();
2073 }