Salome HOME
Merge from V6_main_20120808 08Aug12
[plugins/hybridplugin.git] / src / GHS3DPlugin / GHS3DPlugin_Hypothesis.cxx
1 // Copyright (C) 2004-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //=============================================================================
21 // File      : GHS3DPlugin_Hypothesis.cxx
22 // Created   : Wed Apr  2 12:36:29 2008
23 // Author    : Edward AGAPOV (eap)
24 //=============================================================================
25 //
26 #include "GHS3DPlugin_Hypothesis.hxx"
27 #include <SMESH_ProxyMesh.hxx>
28 #include <SMESH_Group.hxx>
29 #include <StdMeshers_QuadToTriaAdaptor.hxx>
30
31 #include <TCollection_AsciiString.hxx>
32
33 #ifdef WNT
34 #include <process.h>
35 #define getpid _getpid
36 #endif
37
38 //=======================================================================
39 //function : GHS3DPlugin_Hypothesis
40 //=======================================================================
41
42 GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
43   : SMESH_Hypothesis(hypId, studyId, gen),
44   myToMeshHoles(DefaultMeshHoles()),
45   myMaximumMemory(-1),
46   myInitialMemory(-1),
47   myOptimizationLevel(DefaultOptimizationLevel()),
48   myWorkingDirectory(DefaultWorkingDirectory()),
49   myKeepFiles(DefaultKeepFiles()),
50   myVerboseLevel(DefaultVerboseLevel()),
51   myToCreateNewNodes(DefaultToCreateNewNodes()),
52   myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()),
53   myToUseFemCorrection(DefaultToUseFEMCorrection()),
54   myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
55   _enfVertexList(DefaultGHS3DEnforcedVertexList()),
56   _enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
57   _enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
58   _coordsEnfVertexMap(DefaultCoordsGHS3DEnforcedVertexMap()),
59   _geomEntryEnfVertexMap(DefaultGeomEntryGHS3DEnforcedVertexMap()),
60   _enfMeshList(DefaultGHS3DEnforcedMeshList()),
61   _entryEnfMeshMap(DefaultEntryGHS3DEnforcedMeshListMap()),
62   _enfNodes(TIDSortedNodeGroupMap()),
63   _enfEdges(TIDSortedElemGroupMap()),
64   _enfTriangles(TIDSortedElemGroupMap()),
65   _nodeIDToSizeMap(DefaultID2SizeMap()),
66   _elementIDToSizeMap(DefaultID2SizeMap()),
67   _groupsToRemove(DefaultGroupsToRemove())
68 {
69   _name = "GHS3D_Parameters";
70   _param_algo_dim = 3;
71 }
72
73 //=======================================================================
74 //function : SetToMeshHoles
75 //=======================================================================
76
77 void GHS3DPlugin_Hypothesis::SetToMeshHoles(bool toMesh)
78 {
79   if ( myToMeshHoles != toMesh ) {
80     myToMeshHoles = toMesh;
81     NotifySubMeshesHypothesisModification();
82   }
83 }
84
85 //=======================================================================
86 //function : GetToMeshHoles
87 //=======================================================================
88
89 bool GHS3DPlugin_Hypothesis::GetToMeshHoles(bool checkFreeOption) const
90 {
91   if (checkFreeOption && !myTextOption.empty()) {
92     if ( myTextOption.find("-c 0"))
93       return true;
94     if ( myTextOption.find("-c 1"))
95       return false;
96   }
97   return myToMeshHoles;
98 }
99
100 //=======================================================================
101 //function : SetMaximumMemory
102 //=======================================================================
103
104 void GHS3DPlugin_Hypothesis::SetMaximumMemory(short MB)
105 {
106   if ( myMaximumMemory != MB ) {
107     myMaximumMemory = MB;
108     NotifySubMeshesHypothesisModification();
109   }
110 }
111
112 //=======================================================================
113 //function : GetMaximumMemory
114 //           * automatic memory adjustment mode. Default is zero
115 //=======================================================================
116
117 short GHS3DPlugin_Hypothesis::GetMaximumMemory() const
118 {
119   return myMaximumMemory;
120 }
121
122 //=======================================================================
123 //function : SetInitialMemory
124 //=======================================================================
125
126 void GHS3DPlugin_Hypothesis::SetInitialMemory(short MB)
127 {
128   if ( myInitialMemory != MB ) {
129     myInitialMemory = MB;
130     NotifySubMeshesHypothesisModification();
131   }
132 }
133
134 //=======================================================================
135 //function : GetInitialMemory
136 //=======================================================================
137
138 short GHS3DPlugin_Hypothesis::GetInitialMemory() const
139 {
140   return myInitialMemory;
141 }
142
143 //=======================================================================
144 //function : SetOptimizationLevel
145 //=======================================================================
146
147 void GHS3DPlugin_Hypothesis::SetOptimizationLevel(OptimizationLevel level)
148 {
149   if ( myOptimizationLevel != level ) {
150     myOptimizationLevel = level;
151     NotifySubMeshesHypothesisModification();
152   }
153 }
154
155 //=======================================================================
156 //function : GetOptimizationLevel
157 //=======================================================================
158
159 GHS3DPlugin_Hypothesis::OptimizationLevel GHS3DPlugin_Hypothesis::GetOptimizationLevel() const
160 {
161   return (OptimizationLevel) myOptimizationLevel;
162 }
163
164 //=======================================================================
165 //function : SetWorkingDirectory
166 //=======================================================================
167
168 void GHS3DPlugin_Hypothesis::SetWorkingDirectory(const std::string& path)
169 {
170   if ( myWorkingDirectory != path ) {
171     myWorkingDirectory = path;
172     NotifySubMeshesHypothesisModification();
173   }
174 }
175
176 //=======================================================================
177 //function : GetWorkingDirectory
178 //=======================================================================
179
180 std::string GHS3DPlugin_Hypothesis::GetWorkingDirectory() const
181 {
182   return myWorkingDirectory;
183 }
184
185 //=======================================================================
186 //function : SetKeepFiles
187 //=======================================================================
188
189 void GHS3DPlugin_Hypothesis::SetKeepFiles(bool toKeep)
190 {
191   if ( myKeepFiles != toKeep ) {
192     myKeepFiles = toKeep;
193     NotifySubMeshesHypothesisModification();
194   }
195 }
196
197 //=======================================================================
198 //function : GetKeepFiles
199 //=======================================================================
200
201 bool GHS3DPlugin_Hypothesis::GetKeepFiles() const
202 {
203   return myKeepFiles;
204 }
205
206 //=======================================================================
207 //function : SetVerboseLevel
208 //=======================================================================
209
210 void GHS3DPlugin_Hypothesis::SetVerboseLevel(short level)
211 {
212   if ( myVerboseLevel != level ) {
213     myVerboseLevel = level;
214     NotifySubMeshesHypothesisModification();
215   }
216 }
217
218 //=======================================================================
219 //function : GetVerboseLevel
220 //=======================================================================
221
222 short GHS3DPlugin_Hypothesis::GetVerboseLevel() const
223 {
224   return myVerboseLevel;
225 }
226
227 //=======================================================================
228 //function : SetToCreateNewNodes
229 //=======================================================================
230
231 void GHS3DPlugin_Hypothesis::SetToCreateNewNodes(bool toCreate)
232 {
233   if ( myToCreateNewNodes != toCreate ) {
234     myToCreateNewNodes = toCreate;
235     NotifySubMeshesHypothesisModification();
236   }
237 }
238
239 //=======================================================================
240 //function : GetToCreateNewNodes
241 //=======================================================================
242
243 bool GHS3DPlugin_Hypothesis::GetToCreateNewNodes() const
244 {
245   return myToCreateNewNodes;
246 }
247
248 //=======================================================================
249 //function : SetToUseBoundaryRecoveryVersion
250 //=======================================================================
251
252 void GHS3DPlugin_Hypothesis::SetToUseBoundaryRecoveryVersion(bool toUse)
253 {
254   if ( myToUseBoundaryRecoveryVersion != toUse ) {
255     myToUseBoundaryRecoveryVersion = toUse;
256     NotifySubMeshesHypothesisModification();
257   }
258 }
259
260 //=======================================================================
261 //function : GetToUseBoundaryRecoveryVersion
262 //=======================================================================
263
264 bool GHS3DPlugin_Hypothesis::GetToUseBoundaryRecoveryVersion() const
265 {
266   return myToUseBoundaryRecoveryVersion;
267 }
268
269 //=======================================================================
270 //function : SetFEMCorrection
271 //=======================================================================
272
273 void GHS3DPlugin_Hypothesis::SetFEMCorrection(bool toUseFem)
274 {
275   if ( myToUseFemCorrection != toUseFem ) {
276     myToUseFemCorrection = toUseFem;
277     NotifySubMeshesHypothesisModification();
278   }
279 }
280
281 //=======================================================================
282 //function : GetFEMCorrection
283 //=======================================================================
284
285 bool GHS3DPlugin_Hypothesis::GetFEMCorrection() const
286 {
287   return myToUseFemCorrection;
288 }
289
290 //=======================================================================
291 //function : SetToRemoveCentralPoint
292 //=======================================================================
293
294 void GHS3DPlugin_Hypothesis::SetToRemoveCentralPoint(bool toRemove)
295 {
296   if ( myToRemoveCentralPoint != toRemove ) {
297     myToRemoveCentralPoint = toRemove;
298     NotifySubMeshesHypothesisModification();
299   }
300 }
301
302 //=======================================================================
303 //function : GetToRemoveCentralPoint
304 //=======================================================================
305
306 bool GHS3DPlugin_Hypothesis::GetToRemoveCentralPoint() const
307 {
308   return myToRemoveCentralPoint;
309 }
310
311 //=======================================================================
312 //function : SetTextOption
313 //=======================================================================
314
315 void GHS3DPlugin_Hypothesis::SetTextOption(const std::string& option)
316 {
317   if ( myTextOption != option ) {
318     myTextOption = option;
319     NotifySubMeshesHypothesisModification();
320   }
321 }
322
323 //=======================================================================
324 //function : GetTextOption
325 //=======================================================================
326
327 std::string GHS3DPlugin_Hypothesis::GetTextOption() const
328 {
329   return myTextOption;
330 }
331
332 //=======================================================================
333 //function : SetEnforcedVertex
334 //=======================================================================
335
336 bool GHS3DPlugin_Hypothesis::SetEnforcedVertex(std::string theName, std::string theEntry, std::string theGroupName,
337                                                double size, double x, double y, double z, bool isCompound)
338 {
339   MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedVertex(\""<< theName << "\", \""<< theEntry << "\", \"" << theGroupName << "\", "
340                                                       << size << ", " << x << ", " << y << ", " << z  << ", "<< isCompound << ")");
341
342   bool toNotify = false;
343   bool toCreate = true;
344
345   TGHS3DEnforcedVertex *oldEnVertex;
346   TGHS3DEnforcedVertex *newEnfVertex = new TGHS3DEnforcedVertex();
347   newEnfVertex->name = theName;
348   newEnfVertex->geomEntry = theEntry;
349   newEnfVertex->coords.clear();
350   if (!isCompound) {
351     newEnfVertex->coords.push_back(x);
352     newEnfVertex->coords.push_back(y);
353     newEnfVertex->coords.push_back(z);
354   }
355   newEnfVertex->groupName = theGroupName;
356   newEnfVertex->size = size;
357   newEnfVertex->isCompound = isCompound;
358   
359   
360   // update _enfVertexList
361   TGHS3DEnforcedVertexList::iterator it = _enfVertexList.find(newEnfVertex);
362   if (it != _enfVertexList.end()) {
363     toCreate = false;
364     oldEnVertex = (*it);
365     MESSAGE("Enforced Vertex was found => Update");
366     if (oldEnVertex->name != theName) {
367       MESSAGE("Update name from \"" << oldEnVertex->name << "\" to \"" << theName << "\"");
368       oldEnVertex->name = theName;
369       toNotify = true;
370     }
371     if (oldEnVertex->groupName != theGroupName) {
372       MESSAGE("Update group name from \"" << oldEnVertex->groupName << "\" to \"" << theGroupName << "\"");
373       oldEnVertex->groupName = theGroupName;
374       toNotify = true;
375     }
376     if (oldEnVertex->size != size) {
377       MESSAGE("Update size from \"" << oldEnVertex->size << "\" to \"" << size << "\"");
378       oldEnVertex->size = size;
379       toNotify = true;
380     }
381     if (toNotify) {
382       // update map coords / enf vertex if needed
383       if (oldEnVertex->coords.size()) {
384         _coordsEnfVertexMap[oldEnVertex->coords] = oldEnVertex;
385         _enfVertexCoordsSizeList[oldEnVertex->coords] = size;
386       }
387
388       // update map geom entry / enf vertex if needed
389       if (oldEnVertex->geomEntry != "") {
390         _geomEntryEnfVertexMap[oldEnVertex->geomEntry] = oldEnVertex;
391         _enfVertexEntrySizeList[oldEnVertex->geomEntry] = size;
392       }
393     }
394   }
395
396 //   //////// CREATE ////////////
397   if (toCreate) {
398     toNotify = true;
399     MESSAGE("Creating new enforced vertex");
400     _enfVertexList.insert(newEnfVertex);
401     if (theEntry == "") {
402       _coordsEnfVertexMap[newEnfVertex->coords] = newEnfVertex;
403       _enfVertexCoordsSizeList[newEnfVertex->coords] = size;
404     }
405     else {
406       _geomEntryEnfVertexMap[newEnfVertex->geomEntry] = newEnfVertex;
407       _enfVertexEntrySizeList[newEnfVertex->geomEntry] = size;
408     }
409   }
410
411   if (toNotify)
412     NotifySubMeshesHypothesisModification();
413
414   MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedVertex END");
415   return toNotify;
416 }
417
418
419 //=======================================================================
420 //function : SetEnforcedMesh
421 //=======================================================================
422 bool GHS3DPlugin_Hypothesis::SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, double size, std::string groupName)
423 {
424   TIDSortedElemSet theElemSet;
425   SMDS_ElemIteratorPtr eIt = theMesh.GetMeshDS()->elementsIterator(SMDSAbs_ElementType(elementType));
426   while ( eIt->more() )
427     theElemSet.insert( eIt->next() );
428   MESSAGE("Add "<<theElemSet.size()<<" types["<<elementType<<"] from source mesh");
429   bool added = SetEnforcedElements( theElemSet, elementType, size, groupName);
430   if (added) {
431     TGHS3DEnforcedMesh* newEnfMesh = new TGHS3DEnforcedMesh();
432     newEnfMesh->name = name;
433     newEnfMesh->entry = entry;
434     newEnfMesh->elementType = elementType;
435     newEnfMesh->size = size;
436     newEnfMesh->groupName = groupName;
437     
438     TGHS3DEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
439     if (it == _enfMeshList.end()) {
440       _entryEnfMeshMap[entry].insert(newEnfMesh);
441       _enfMeshList.insert(newEnfMesh);
442     }
443   }
444   return added;
445 }
446
447 //=======================================================================
448 //function : SetEnforcedGroup
449 //=======================================================================
450 bool GHS3DPlugin_Hypothesis::SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::long_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, double size, std::string groupName)
451 {
452   MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedGroup");
453   TIDSortedElemSet theElemSet;
454     if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");}
455     for (int i=0; i < theIDs->length(); i++) {
456       CORBA::Long ind = theIDs[i];
457       if (elementType == SMESH::NODE)
458       {
459         const SMDS_MeshNode * node = theMeshDS->FindNode(ind);
460         if (node)
461           theElemSet.insert( node );
462       }
463       else
464       {
465         const SMDS_MeshElement * elem = theMeshDS->FindElement(ind);
466         if (elem)
467           theElemSet.insert( elem );
468       }
469     }
470
471 //   SMDS_ElemIteratorPtr it = theGroup->GetGroupDS()->GetElements();
472 //   while ( it->more() ) 
473 //     theElemSet.insert( it->next() );
474
475   MESSAGE("Add "<<theElemSet.size()<<" types["<<elementType<<"] from source group ");
476   bool added = SetEnforcedElements( theElemSet, elementType, size, groupName);
477   if (added) {
478     TGHS3DEnforcedMesh* newEnfMesh = new TGHS3DEnforcedMesh();
479     newEnfMesh->name = name;
480     newEnfMesh->entry = entry;
481     newEnfMesh->elementType = elementType;
482     newEnfMesh->size = size;
483     newEnfMesh->groupName = groupName;
484     
485     TGHS3DEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
486     if (it == _enfMeshList.end()) {
487       _entryEnfMeshMap[entry].insert(newEnfMesh);
488       _enfMeshList.insert(newEnfMesh);
489     }
490   }
491   return added;
492 }
493
494 //=======================================================================
495 //function : SetEnforcedElements
496 //=======================================================================
497 bool GHS3DPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, double size, std::string groupName)
498 {
499   MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedElements");
500   TIDSortedElemSet::const_iterator it = theElemSet.begin();
501   const SMDS_MeshElement* elem;
502   const SMDS_MeshNode* node;
503   bool added = false;
504   for (;it != theElemSet.end();++it)
505   {
506     elem = (*it);
507     switch (elementType) {
508       case SMESH::NODE:
509         node = dynamic_cast<const SMDS_MeshNode*>(elem);
510         if (node) {
511           _enfNodes.insert(make_pair(node,groupName));
512           _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
513           added = true;
514         }
515         else {
516           SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
517           for (;nodeIt->more();) {
518             node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
519             _enfNodes.insert(make_pair(node,groupName));
520             _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
521           }
522           added = true;
523         }
524         break;
525       case SMESH::EDGE:
526         if (elem->GetType() == SMDSAbs_Edge) {
527           _enfEdges.insert(make_pair(elem,groupName));
528           _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
529           added = true;
530         }
531         else if (elem->GetType() > SMDSAbs_Edge) {
532           SMDS_ElemIteratorPtr it = elem->edgesIterator();
533           for (;it->more();) {
534             const SMDS_MeshElement* anEdge = it->next();
535             _enfEdges.insert(make_pair(anEdge,groupName));
536             _elementIDToSizeMap.insert(make_pair(anEdge->GetID(), size));
537           }
538           added = true;
539         }
540         break;
541       case SMESH::FACE:
542         if (elem->GetType() == SMDSAbs_Face)
543         {
544           if (elem->NbCornerNodes() == 3) {
545             _enfTriangles.insert(make_pair(elem,groupName));
546             _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
547             added = true;
548           }
549         }
550         else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
551           SMDS_ElemIteratorPtr it = elem->facesIterator();
552           for (;it->more();) {
553             const SMDS_MeshElement* aFace = it->next();
554             if (aFace->NbCornerNodes() == 3) {
555               _enfTriangles.insert(make_pair(aFace,groupName));
556               _elementIDToSizeMap.insert(make_pair(aFace->GetID(), size));
557               added = true;
558             }
559           }
560         }
561         break;
562       default:
563         break;
564     };
565   }
566   if (added)
567     NotifySubMeshesHypothesisModification();
568   return added;
569 }
570
571
572 //=======================================================================
573 //function : GetEnforcedVertex
574 //=======================================================================
575
576 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(double x, double y, double z)
577   throw (std::invalid_argument)
578 {
579   std::vector<double> coord(3);
580   coord[0] = x;
581   coord[1] = y;
582   coord[2] = z;
583   if (_coordsEnfVertexMap.count(coord)>0)
584     return _coordsEnfVertexMap[coord];
585   std::ostringstream msg ;
586   msg << "No enforced vertex at " << x << ", " << y << ", " << z;
587   throw std::invalid_argument(msg.str());
588 }
589
590 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(const std::string theEntry)
591   throw (std::invalid_argument)
592 {
593   if (_geomEntryEnfVertexMap.count(theEntry)>0)
594     return _geomEntryEnfVertexMap[theEntry];
595   
596   std::ostringstream msg ;
597   msg << "No enforced vertex with entry " << theEntry;
598   throw std::invalid_argument(msg.str());
599 }
600
601 //=======================================================================
602 //function : RemoveEnforcedVertex
603 //=======================================================================
604
605 bool GHS3DPlugin_Hypothesis::RemoveEnforcedVertex(double x, double y, double z, const std::string theEntry)
606   throw (std::invalid_argument)
607 {
608   bool toNotify = false;
609   std::ostringstream msg;
610   TGHS3DEnforcedVertex *oldEnfVertex;
611   std::vector<double> coords(3);
612   coords[0] = x;
613   coords[1] = y;
614   coords[2] = z;
615   
616   // check that enf vertex with given enf vertex entry exists
617   TGeomEntryGHS3DEnforcedVertexMap::iterator it_enfVertexEntry = _geomEntryEnfVertexMap.find(theEntry);
618   if (it_enfVertexEntry != _geomEntryEnfVertexMap.end()) {
619     // Success
620     MESSAGE("Found enforced vertex with geom entry " << theEntry);
621     oldEnfVertex = it_enfVertexEntry->second;
622     _geomEntryEnfVertexMap.erase(it_enfVertexEntry);
623   } else {
624     // Fail
625     MESSAGE("Enforced vertex with geom entry " << theEntry << " not found");
626     // check that enf vertex with given coords exists
627     TCoordsGHS3DEnforcedVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
628     if (it_coords_enf != _coordsEnfVertexMap.end()) {
629       // Success
630       MESSAGE("Found enforced vertex with coords " << x << ", " << y << ", " << z);
631       oldEnfVertex = it_coords_enf->second;
632       _coordsEnfVertexMap.erase(it_coords_enf);
633       _enfVertexCoordsSizeList.erase(_enfVertexCoordsSizeList.find(coords));
634     } else {
635       // Fail
636       MESSAGE("Enforced vertex with coords " << x << ", " << y << ", " << z << " not found");
637       throw std::invalid_argument(msg.str());
638     }
639   }
640
641   MESSAGE("Remove enf vertex from _enfVertexList");
642
643   // update _enfVertexList
644   TGHS3DEnforcedVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
645   if (it != _enfVertexList.end()) {
646     if ((*it)->groupName != "")
647       _groupsToRemove.insert((*it)->groupName);
648     _enfVertexList.erase(it);
649     toNotify = true;
650     MESSAGE("Done");
651   }
652
653   if (toNotify)
654     NotifySubMeshesHypothesisModification();
655
656   return toNotify;
657 }
658
659 //=======================================================================
660 //function : ClearEnforcedVertices
661 //=======================================================================
662 void GHS3DPlugin_Hypothesis::ClearEnforcedVertices()
663 {
664   TGHS3DEnforcedVertexList::const_iterator it = _enfVertexList.begin();
665   for(;it != _enfVertexList.end();++it) {
666     if ((*it)->groupName != "")
667       _groupsToRemove.insert((*it)->groupName);
668   }
669   _enfVertexList.clear();
670   _coordsEnfVertexMap.clear();
671   _geomEntryEnfVertexMap.clear();
672   _enfVertexCoordsSizeList.clear();
673   _enfVertexEntrySizeList.clear();
674   NotifySubMeshesHypothesisModification();
675 }
676
677 //=======================================================================
678 //function : ClearEnforcedMeshes
679 //=======================================================================
680 void GHS3DPlugin_Hypothesis::ClearEnforcedMeshes()
681 {
682   TGHS3DEnforcedMeshList::const_iterator it = _enfMeshList.begin();
683   for(;it != _enfMeshList.end();++it) {
684     if ((*it)->groupName != "")
685       _groupsToRemove.insert((*it)->groupName);
686   }
687   _enfNodes.clear();
688   _enfEdges.clear();
689   _enfTriangles.clear();
690   _nodeIDToSizeMap.clear();
691   _elementIDToSizeMap.clear();
692   _enfMeshList.clear();
693   _entryEnfMeshMap.clear();
694   NotifySubMeshesHypothesisModification();
695 }
696
697
698 //=======================================================================
699 //function : SetGroupsToRemove
700 //=======================================================================
701
702 void GHS3DPlugin_Hypothesis::ClearGroupsToRemove()
703 {
704   _groupsToRemove.clear();
705 }
706
707
708 //=======================================================================
709 //function : DefaultMeshHoles
710 //=======================================================================
711
712 bool GHS3DPlugin_Hypothesis::DefaultMeshHoles()
713 {
714   return false; // PAL19680
715 }
716
717 //=======================================================================
718 //function : DefaultMaximumMemory
719 //=======================================================================
720
721 #ifndef WIN32
722 #include <sys/sysinfo.h>
723 #else
724 #include <windows.h>
725 #endif
726
727 short  GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
728 {
729 #ifndef WIN32
730   struct sysinfo si;
731   int err = sysinfo( &si );
732   if ( err == 0 ) {
733     int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
734     return (int) ( 0.7 * ramMB );
735   }
736 #else
737   // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
738   MEMORYSTATUSEX statex;
739   statex.dwLength = sizeof (statex);
740   int err = GlobalMemoryStatusEx (&statex);
741   if (err != 0) {
742     int totMB = 
743       statex.ullTotalPhys / 1024 / 1024 +
744       statex.ullTotalPageFile / 1024 / 1024 +
745       statex.ullTotalVirtual / 1024 / 1024;
746     return (int) ( 0.7 * totMB );
747   }
748 #endif
749   return 1024;
750 }
751
752 //=======================================================================
753 //function : DefaultInitialMemory
754 //=======================================================================
755
756 short  GHS3DPlugin_Hypothesis::DefaultInitialMemory()
757 {
758   return DefaultMaximumMemory();
759 }
760
761 //=======================================================================
762 //function : DefaultOptimizationLevel
763 //=======================================================================
764
765 short  GHS3DPlugin_Hypothesis::DefaultOptimizationLevel()
766 {
767   return Medium;
768 }
769
770 //=======================================================================
771 //function : DefaultWorkingDirectory
772 //=======================================================================
773
774 std::string GHS3DPlugin_Hypothesis::DefaultWorkingDirectory()
775 {
776   TCollection_AsciiString aTmpDir;
777
778   char *Tmp_dir = getenv("SALOME_TMP_DIR");
779   if(Tmp_dir != NULL) {
780     aTmpDir = Tmp_dir;
781   }
782   else {
783 #ifdef WIN32
784     aTmpDir = TCollection_AsciiString("C:\\");
785 #else
786     aTmpDir = TCollection_AsciiString("/tmp/");
787 #endif
788   }
789   return aTmpDir.ToCString();
790 }
791
792 //=======================================================================
793 //function : DefaultKeepFiles
794 //=======================================================================
795
796 bool   GHS3DPlugin_Hypothesis::DefaultKeepFiles()
797 {
798   return false;
799 }
800
801 //=======================================================================
802 //function : DefaultVerboseLevel
803 //=======================================================================
804
805 short  GHS3DPlugin_Hypothesis::DefaultVerboseLevel()
806 {
807   return 10;
808 }
809
810 //=======================================================================
811 //function : DefaultToCreateNewNodes
812 //=======================================================================
813
814 bool GHS3DPlugin_Hypothesis::DefaultToCreateNewNodes()
815 {
816   return true;
817 }
818
819 //=======================================================================
820 //function : DefaultToUseBoundaryRecoveryVersion
821 //=======================================================================
822
823 bool GHS3DPlugin_Hypothesis::DefaultToUseBoundaryRecoveryVersion()
824 {
825   return false;
826 }
827
828 //=======================================================================
829 //function : DefaultToUseFEMCorrection
830 //=======================================================================
831
832 bool GHS3DPlugin_Hypothesis::DefaultToUseFEMCorrection()
833 {
834   return false;
835 }
836
837 //=======================================================================
838 //function : DefaultToRemoveCentralPoint
839 //=======================================================================
840
841 bool GHS3DPlugin_Hypothesis::DefaultToRemoveCentralPoint()
842 {
843   return false;
844 }
845
846 // //=======================================================================
847 // //function : DefaultID2SizeMap
848 // //=======================================================================
849 // 
850 // GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::DefaultID2SizeMap()
851 // {
852 //   return GHS3DPlugin_Hypothesis::TID2SizeMap();
853 // }
854
855
856 //=======================================================================
857 //function : SaveTo
858 //=======================================================================
859
860 std::ostream & GHS3DPlugin_Hypothesis::SaveTo(std::ostream & save)
861 {
862   save << (int) myToMeshHoles                 << " ";
863   save << myMaximumMemory                     << " ";
864   save << myInitialMemory                     << " ";
865   save << myOptimizationLevel                 << " ";
866   save << myWorkingDirectory                  << " ";
867   save << (int)myKeepFiles                    << " ";
868   save << myVerboseLevel                      << " ";
869   save << (int)myToCreateNewNodes             << " ";
870   save << (int)myToUseBoundaryRecoveryVersion << " ";
871   save << (int)myToUseFemCorrection           << " ";
872   save << (int)myToRemoveCentralPoint         << " ";
873   if (!myTextOption.empty()) {
874     save << "__OPTIONS_BEGIN__ ";
875     save << myTextOption                      << " ";
876     save << "__OPTIONS_END__ ";
877   }
878   
879
880   TGHS3DEnforcedVertexList::iterator it  = _enfVertexList.begin();
881   if (it != _enfVertexList.end()) {
882     save << "__ENFORCED_VERTICES_BEGIN__ ";
883     for ( ; it != _enfVertexList.end(); ++it ) {
884       TGHS3DEnforcedVertex *enfVertex = (*it);
885       save << " " << "__BEGIN_VERTEX__";
886       if (!enfVertex->name.empty()) {
887         save << " " << "__BEGIN_NAME__";
888         save << " " << enfVertex->name;
889         save << " " << "__END_NAME__";
890       }
891       if (!enfVertex->geomEntry.empty()) {
892         save << " " << "__BEGIN_ENTRY__";
893         save << " " << enfVertex->geomEntry;
894         save << " " << enfVertex->isCompound;
895         save << " " << "__END_ENTRY__";
896       }
897       if (!enfVertex->groupName.empty()) {
898         save << " " << "__BEGIN_GROUP__";
899         save << " " << enfVertex->groupName;
900         save << " " << "__END_GROUP__";
901       }
902       if (enfVertex->coords.size()) {
903         save << " " << "__BEGIN_COORDS__";
904         for (int i=0;i<enfVertex->coords.size();i++)
905           save << " " << enfVertex->coords[i];
906         save << " " << "__END_COORDS__";
907       }
908       save << " " << "__BEGIN_SIZE__";
909       save << " " << enfVertex->size;
910       save << " " << "__END_SIZE__";
911       save << " " << "__END_VERTEX__";
912     }
913     save << "__ENFORCED_VERTICES_END__ ";
914   }
915
916   return save;
917 }
918
919 //=======================================================================
920 //function : LoadFrom
921 //=======================================================================
922
923 std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load)
924 {
925   bool isOK = true;
926   int i;
927   
928   isOK = (load >> i);
929   if (isOK)
930     myToMeshHoles = i;
931   else
932     load.clear(ios::badbit | load.rdstate());
933   
934   isOK = (load >> i);
935   if (isOK)
936     myMaximumMemory = i;
937   else
938     load.clear(ios::badbit | load.rdstate());
939   
940   isOK = (load >> i);
941   if (isOK)
942     myInitialMemory = i;
943   else
944     load.clear(ios::badbit | load.rdstate());
945   
946   isOK = (load >> i);
947   if (isOK)
948     myOptimizationLevel = i;
949   else
950     load.clear(ios::badbit | load.rdstate());
951   
952   isOK = (load >> myWorkingDirectory);
953   if (isOK) {
954     if ( myWorkingDirectory == "0") { // myWorkingDirectory was empty
955       myKeepFiles = false;
956       myWorkingDirectory.clear();
957     }
958     else if ( myWorkingDirectory == "1" ) {
959       myKeepFiles = true;
960       myWorkingDirectory.clear();
961     }
962   }
963   else
964     load.clear(ios::badbit | load.rdstate());
965   
966   if ( !myWorkingDirectory.empty() ) {
967     isOK = (load >> i);
968     if (isOK)
969       myKeepFiles = i;
970     else
971       load.clear(ios::badbit | load.rdstate());
972   }
973   
974   isOK = (load >> i);
975   if (isOK)
976     myVerboseLevel = (short) i;
977   else
978     load.clear(ios::badbit | load.rdstate());
979   
980   isOK = (load >> i);
981   if (isOK)
982     myToCreateNewNodes = (bool) i;
983   else
984     load.clear(ios::badbit | load.rdstate());
985   
986   isOK = (load >> i);
987   if (isOK)
988     myToUseBoundaryRecoveryVersion = (bool) i;
989   else
990     load.clear(ios::badbit | load.rdstate());
991   
992   isOK = (load >> i);
993   if (isOK)
994     myToUseFemCorrection = (bool) i;
995   else
996     load.clear(ios::badbit | load.rdstate());
997   
998   isOK = (load >> i);
999   if (isOK)
1000     myToRemoveCentralPoint = (bool) i;
1001   else
1002     load.clear(ios::badbit | load.rdstate());
1003   
1004   std::string separator;
1005   bool hasOptions = false;
1006   bool hasEnforcedVertices = false;
1007   isOK = (load >> separator);
1008
1009   if (isOK) {
1010     if (separator == "__OPTIONS_BEGIN__")
1011       hasOptions = true;
1012     else if (separator == "__ENFORCED_VERTICES_BEGIN__")
1013       hasEnforcedVertices = true;
1014   }
1015
1016   if (hasOptions) {
1017     std::string txt;
1018     while (isOK) {
1019       isOK = (load >> txt);
1020       if (isOK) {
1021         if (txt == "__OPTIONS_END__") {
1022           if (!myTextOption.empty()) {
1023             // Remove last space
1024             myTextOption.erase(myTextOption.end()-1);
1025           }
1026           isOK = false;
1027           break;
1028         }
1029         myTextOption += txt;
1030         myTextOption += " ";
1031       }
1032     }
1033   }
1034
1035   if (hasOptions) {
1036     isOK = (load >> separator);
1037     if (isOK && separator == "__ENFORCED_VERTICES_BEGIN__")
1038       hasEnforcedVertices = true;
1039   }
1040
1041   if (hasEnforcedVertices) {
1042     std::string txt, name, entry, groupName;
1043     double size, coords[3];
1044     bool isCompound;
1045     bool hasCoords = false;
1046     while (isOK) {
1047       isOK = (load >> txt);  // __BEGIN_VERTEX__
1048       if (isOK) {
1049         if (txt == "__ENFORCED_VERTICES_END__")
1050           isOK = false;
1051
1052         TGHS3DEnforcedVertex *enfVertex = new TGHS3DEnforcedVertex();
1053         while (isOK) {
1054           isOK = (load >> txt);
1055           if (txt == "__END_VERTEX__") {
1056             enfVertex->name = name;
1057             enfVertex->geomEntry = entry;
1058             enfVertex->isCompound = isCompound;
1059             enfVertex->groupName = groupName;
1060             enfVertex->coords.clear();
1061             if (hasCoords)
1062               enfVertex->coords.assign(coords,coords+3);
1063             
1064             _enfVertexList.insert(enfVertex);
1065             
1066             if (enfVertex->coords.size())
1067               _coordsEnfVertexMap[enfVertex->coords] = enfVertex;
1068             if (!enfVertex->geomEntry.empty())
1069               _geomEntryEnfVertexMap[enfVertex->geomEntry] = enfVertex;
1070             
1071             name.clear();
1072             entry.clear();
1073             groupName.clear();
1074             hasCoords = false;
1075             isOK = false;
1076           }
1077           
1078           if (txt == "__BEGIN_NAME__") {  // __BEGIN_NAME__
1079             while (isOK && (txt != "__END_NAME__")) {
1080               isOK = (load >> txt);
1081               if (txt != "__END_NAME__") {
1082                 if (!name.empty())
1083                   name += " ";
1084                 name += txt;
1085               }
1086             }
1087             MESSAGE("name: " <<name);
1088           }
1089             
1090           if (txt == "__BEGIN_ENTRY__") {  // __BEGIN_ENTRY__
1091             isOK = (load >> entry);
1092             isOK = (load >> isCompound);
1093             isOK = (load >> txt); // __END_ENTRY__
1094             if (txt != "__END_ENTRY__")
1095               throw std::exception();
1096             MESSAGE("entry: " << entry);
1097           }
1098             
1099           if (txt == "__BEGIN_GROUP__") {  // __BEGIN_GROUP__
1100             while (isOK && (txt != "__END_GROUP__")) {
1101               isOK = (load >> txt);
1102               if (txt != "__END_GROUP__") {
1103                 if (!groupName.empty())
1104                   groupName += " ";
1105                 groupName += txt;
1106               }
1107             }
1108             MESSAGE("groupName: " << groupName);
1109           }
1110             
1111           if (txt == "__BEGIN_COORDS__") {  // __BEGIN_COORDS__
1112             hasCoords = true;
1113             isOK = (load >> coords[0] >> coords[1] >> coords[2]);
1114             isOK = (load >> txt); // __END_COORDS__
1115             if (txt != "__END_COORDS__")
1116               throw std::exception();
1117             MESSAGE("coords: " << coords[0] <<","<< coords[1] <<","<< coords[2]);
1118           } 
1119             
1120           if (txt == "__BEGIN_SIZE__") {  // __BEGIN_ENTRY__
1121             isOK = (load >> size);
1122             isOK = (load >> txt); // __END_ENTRY__
1123             if (txt != "__END_SIZE__") {
1124               throw std::exception();
1125             }
1126             MESSAGE("size: " << size);
1127           }
1128         }
1129       }
1130     }
1131   }
1132
1133   return load;
1134 }
1135
1136 //=======================================================================
1137 //function : SetParametersByMesh
1138 //=======================================================================
1139
1140 bool GHS3DPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS_Shape&)
1141 {
1142   return false;
1143 }
1144
1145
1146 //================================================================================
1147 /*!
1148  * \brief Return false
1149  */
1150 //================================================================================
1151
1152 bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  /*dflts*/,
1153                                                      const SMESH_Mesh* /*theMesh*/)
1154 {
1155   return false;
1156 }
1157
1158 //================================================================================
1159 /*!
1160  * \brief Return command to run ghs3d mesher excluding file prefix (-f)
1161  */
1162 //================================================================================
1163
1164 std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* hyp,
1165                                             const bool                    hasShapeToMesh)
1166 {
1167   TCollection_AsciiString cmd;
1168   if (hasShapeToMesh)
1169     cmd = "ghs3d-41"; // to use old mesh2 format
1170   else
1171     cmd = "ghs3d"; // to use new mesh format
1172   // check if any option is overridden by hyp->myTextOption
1173   bool m   = hyp ? ( hyp->myTextOption.find("-m")  == std::string::npos ) : true;
1174   bool M   = hyp ? ( hyp->myTextOption.find("-M")  == std::string::npos ) : true;
1175   bool c   = hyp ? ( hyp->myTextOption.find("-c")  == std::string::npos ) : true;
1176   bool o   = hyp ? ( hyp->myTextOption.find("-o")  == std::string::npos ) : true;
1177   bool p0  = hyp ? ( hyp->myTextOption.find("-p0") == std::string::npos ) : true;
1178   bool C   = hyp ? ( hyp->myTextOption.find("-C")  == std::string::npos ) : true;
1179   bool v   = hyp ? ( hyp->myTextOption.find("-v")  == std::string::npos ) : true;
1180   bool fem = hyp ? ( hyp->myTextOption.find("-FEM")== std::string::npos ) : true;
1181   bool rem = hyp ? ( hyp->myTextOption.find("-no_initial_central_point")== std::string::npos ) : true;
1182
1183   // if use boundary recovery version, few options are allowed
1184   bool useBndRecovery = !C;
1185   if ( !useBndRecovery && hyp )
1186     useBndRecovery = hyp->myToUseBoundaryRecoveryVersion;
1187
1188   // ghs3d needs to know amount of memory it may use (MB).
1189   // Default memory is defined at ghs3d installation but it may be not enough,
1190   // so allow to use about all available memory
1191   if ( m ) {
1192     short aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
1193     cmd += " -m ";
1194     if ( aMaximumMemory < 0 )
1195       cmd += DefaultMaximumMemory();
1196     else
1197       cmd += aMaximumMemory;
1198   }
1199   if ( M && !useBndRecovery ) {
1200     short aInitialMemory = hyp ? hyp->myInitialMemory : -1;
1201     cmd += " -M ";
1202     if ( aInitialMemory > 0 )
1203       cmd += aInitialMemory;
1204     else
1205       cmd += "100";
1206   }
1207   // component to mesh
1208   // 0 , all components to be meshed
1209   // 1 , only the main ( outermost ) component to be meshed
1210   if ( c && !useBndRecovery ) {
1211     // We always run GHS3D with "to mesh holes'==TRUE (see PAL19680)
1212     if ( hasShapeToMesh )
1213       cmd += " -c 0";
1214     else {
1215       bool aToMeshHoles = hyp ? hyp->myToMeshHoles : DefaultMeshHoles();
1216       if ( aToMeshHoles )
1217         cmd += " -c 0";
1218       else
1219         cmd += " -c 1";
1220     }
1221   }
1222
1223   // optimization level
1224   if ( o && hyp && !useBndRecovery ) {
1225     if ( hyp->myOptimizationLevel >= 0 && hyp->myOptimizationLevel < 5 ) {
1226       const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1227       cmd += " -o ";
1228       cmd += level[ hyp->myOptimizationLevel ];
1229     }
1230   }
1231
1232   // to create internal nodes
1233   if ( p0 && hyp && !hyp->myToCreateNewNodes ) {
1234     cmd += " -p0";
1235   }
1236
1237   // verbose mode
1238   if ( v && hyp ) {
1239     cmd += " -v ";
1240     cmd += hyp->myVerboseLevel;
1241   }
1242
1243   // boundary recovery version
1244   if ( useBndRecovery ) {
1245     cmd += " -C";
1246   }
1247
1248   // to use FEM correction
1249   if ( fem && hyp && hyp->myToUseFemCorrection) {
1250     cmd += " -FEM";
1251   }
1252
1253   // to remove initial central point.
1254   if ( rem && hyp && hyp->myToRemoveCentralPoint) {
1255     cmd += " -no_initial_central_point";
1256   }
1257
1258   // options as text
1259   if ( hyp && !hyp->myTextOption.empty() ) {
1260     cmd += " ";
1261     cmd += (char*) hyp->myTextOption.c_str();
1262   }
1263
1264 #ifdef WNT
1265   cmd += " < NUL";
1266 #endif
1267
1268   return cmd.ToCString();
1269 }
1270
1271 //================================================================================
1272 /*!
1273  * \brief Return a unique file name
1274  */
1275 //================================================================================
1276
1277 std::string GHS3DPlugin_Hypothesis::GetFileName(const GHS3DPlugin_Hypothesis* hyp)
1278 {
1279   std::string aTmpDir = hyp ? hyp->GetWorkingDirectory() : DefaultWorkingDirectory();
1280   const char lastChar = *aTmpDir.rbegin();
1281 #ifdef WIN32
1282     if(lastChar != '\\') aTmpDir+='\\';
1283 #else
1284     if(lastChar != '/') aTmpDir+='/';
1285 #endif      
1286
1287   TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str();
1288   aGenericName += "GHS3D_";
1289   aGenericName += getpid();
1290   aGenericName += "_";
1291   aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString());
1292
1293   return aGenericName.ToCString();
1294 }
1295
1296
1297 //================================================================================
1298 /*!
1299 * \brief Return the enforced vertices
1300 */
1301 //================================================================================
1302
1303 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList GHS3DPlugin_Hypothesis::GetEnforcedVertices(const GHS3DPlugin_Hypothesis* hyp)
1304 {
1305   return hyp ? hyp->_GetEnforcedVertices():DefaultGHS3DEnforcedVertexList();
1306 }
1307
1308 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexCoordsValues GHS3DPlugin_Hypothesis::GetEnforcedVerticesCoordsSize (const GHS3DPlugin_Hypothesis* hyp)
1309 {  
1310   return hyp ? hyp->_GetEnforcedVerticesCoordsSize(): DefaultGHS3DEnforcedVertexCoordsValues();
1311 }
1312
1313 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexEntryValues GHS3DPlugin_Hypothesis::GetEnforcedVerticesEntrySize (const GHS3DPlugin_Hypothesis* hyp)
1314 {  
1315   return hyp ? hyp->_GetEnforcedVerticesEntrySize(): DefaultGHS3DEnforcedVertexEntryValues();
1316 }
1317
1318 GHS3DPlugin_Hypothesis::TCoordsGHS3DEnforcedVertexMap GHS3DPlugin_Hypothesis::GetEnforcedVerticesByCoords (const GHS3DPlugin_Hypothesis* hyp)
1319 {  
1320   return hyp ? hyp->_GetEnforcedVerticesByCoords(): DefaultCoordsGHS3DEnforcedVertexMap();
1321 }
1322
1323 GHS3DPlugin_Hypothesis::TGeomEntryGHS3DEnforcedVertexMap GHS3DPlugin_Hypothesis::GetEnforcedVerticesByEntry (const GHS3DPlugin_Hypothesis* hyp)
1324 {  
1325   return hyp ? hyp->_GetEnforcedVerticesByEntry(): DefaultGeomEntryGHS3DEnforcedVertexMap();
1326 }
1327
1328 GHS3DPlugin_Hypothesis::TIDSortedNodeGroupMap GHS3DPlugin_Hypothesis::GetEnforcedNodes(const GHS3DPlugin_Hypothesis* hyp)
1329 {
1330   return hyp ? hyp->_GetEnforcedNodes():DefaultIDSortedNodeGroupMap();
1331 }
1332
1333 GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap GHS3DPlugin_Hypothesis::GetEnforcedEdges(const GHS3DPlugin_Hypothesis* hyp)
1334 {
1335   return hyp ? hyp->_GetEnforcedEdges():DefaultIDSortedElemGroupMap();
1336 }
1337
1338 GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap GHS3DPlugin_Hypothesis::GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp)
1339 {
1340   return hyp ? hyp->_GetEnforcedTriangles():DefaultIDSortedElemGroupMap();
1341 }
1342
1343 GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp)
1344 {
1345   return hyp ? hyp->_GetNodeIDToSizeMap(): DefaultID2SizeMap();
1346 }
1347
1348 GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::GetElementIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp)
1349 {
1350   return hyp ? hyp->_GetElementIDToSizeMap(): DefaultID2SizeMap();
1351 }
1352
1353 GHS3DPlugin_Hypothesis::TSetStrings GHS3DPlugin_Hypothesis::GetGroupsToRemove(const GHS3DPlugin_Hypothesis* hyp)
1354 {
1355   return hyp ? hyp->_GetGroupsToRemove(): DefaultGroupsToRemove();
1356 }