Salome HOME
Upgrade to MeshGems 1.3-8: activate PreCad by default
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File    : BLSURFPlugin_Hypothesis.hxx
22 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
23 //           & Aurelien ALLEAUME (DISTENE)
24 //           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
25 // ---
26 //
27 #ifndef _BLSURFPlugin_Hypothesis_HXX_
28 #define _BLSURFPlugin_Hypothesis_HXX_
29
30 #include "SMESH_Hypothesis.hxx"
31 #include <vector>
32 #include <map>
33 #include <set>
34 #include <stdexcept>
35 #include <string>
36 #include <cstring>
37 #include <sstream>
38 #include <utilities.h>
39 #include "BLSURFPlugin_Attractor.hxx"
40
41 //  Parameters for work of MG-CADSurf
42
43 class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
44 {
45 public:
46   BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
47
48   enum Topology {
49     FromCAD,
50     Process,
51     Process2,
52     PreCAD
53   };
54
55   enum PhysicalMesh {
56     DefaultSize,
57     PhysicalGlobalSize,
58     PhysicalLocalSize
59   };
60
61   enum GeometricMesh {
62     DefaultGeom,
63     GeometricalGlobalSize,
64     GeometricalLocalSize
65   };
66
67   static const char* GetHypType() { return "MG-CADSurf Parameters"; }
68   
69   TopoDS_Shape entryToShape(std::string entry);
70
71   void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
72   PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
73
74   void SetGeometricMesh(GeometricMesh theGeometricMesh);
75   GeometricMesh GetGeometricMesh() const { return _geometricMesh; }
76
77   void SetPhySize(double thePhySize, bool isRelative = false);
78   double GetPhySize() const { return _phySize; }
79   bool IsPhySizeRel() const { return _phySizeRel; }
80
81   void SetMinSize(double theMinSize, bool isRelative = false);
82   double GetMinSize() const { return _minSize; }
83   bool IsMinSizeRel() const { return _minSizeRel; }
84
85   void SetMaxSize(double theMaxSize, bool isRelative = false);
86   double GetMaxSize() const { return _maxSize; }
87   bool IsMaxSizeRel() const { return _maxSizeRel; }
88
89   void SetGradation(double theGradation);
90   double GetGradation() const { return _gradation; }
91
92   void SetQuadAllowed(bool theVal);
93   bool GetQuadAllowed() const { return _quadAllowed; }
94
95   void SetAngleMesh(double theAngle);
96   double GetAngleMesh() const { return _angleMesh; }
97
98   void SetChordalError(double theDistance);
99   double GetChordalError() const { return _chordalError; }
100
101   void SetAnisotropic(bool theVal);
102   bool GetAnisotropic() const { return _anisotropic; }
103
104   void SetAnisotropicRatio(double theVal);
105   double GetAnisotropicRatio() const { return _anisotropicRatio; }
106
107   void SetRemoveTinyEdges(bool theVal);
108   bool GetRemoveTinyEdges() const { return _removeTinyEdges; }
109
110   void SetTinyEdgeLength(double theVal);
111   double GetTinyEdgeLength() const { return _tinyEdgeLength; }
112
113   void SetBadElementRemoval(bool theVal);
114   bool GetBadElementRemoval() const { return _badElementRemoval; }
115
116   void SetBadElementAspectRatio(double theVal);
117   double GetBadElementAspectRatio() const { return _badElementAspectRatio; }
118
119   void SetOptimizeMesh(bool theVal);
120   bool GetOptimizeMesh() const { return _optimizeMesh; }
121
122   void SetQuadraticMesh(bool theVal);
123   bool GetQuadraticMesh() const { return _quadraticMesh; }
124
125   void SetTopology(Topology theTopology);
126   Topology GetTopology() const { return _topology; }
127
128   void SetVerbosity(int theVal);
129   int GetVerbosity() const { return _verb; }
130   
131   void ClearEntry(const std::string& entry, const char * attEntry = 0);
132   void ClearSizeMaps();
133
134   void SetPreCADMergeEdges(bool theVal);
135   bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
136
137   void SetPreCADProcess3DTopology(bool theVal);
138   bool GetPreCADProcess3DTopology() const { return _preCADProcess3DTopology; }
139
140   void SetPreCADDiscardInput(bool theVal);
141   bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
142     
143   typedef std::map<std::string,std::string> TSizeMap;
144
145   void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
146   std::string  GetSizeMapEntry(const std::string& entry);
147   const TSizeMap& _GetSizeMapEntries() const { return _sizeMap; }
148   /*!
149    * \brief Return the size maps
150    */
151   static TSizeMap GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp);
152
153
154   void SetAttractorEntry(const std::string& entry,const std::string& attractor );
155   std::string GetAttractorEntry(const std::string& entry);
156   const TSizeMap& _GetAttractorEntries() const { return _attractors; };
157   /*!
158    * \brief Return the attractors
159    */
160   static TSizeMap GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
161
162
163 /*
164   void SetCustomSizeMapEntry(const std::string& entry,const std::string& sizeMap );
165   std::string  GetCustomSizeMapEntry(const std::string& entry);
166   void UnsetCustomSizeMap(const std::string& entry);
167   const TSizeMap& GetCustomSizeMapEntries() const { return _customSizeMap; }
168  */
169   
170   typedef std::multimap< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
171   typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO à finir 
172   
173   void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
174   std::string  GetClassAttractorEntry(const std::string& entry);
175   const TAttractorMap& _GetClassAttractorEntries() const { return _classAttractors; }
176   /*!
177    * \brief Return the attractors entries
178    */
179   static TAttractorMap GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
180
181   /*!
182    * To set/get/unset an enforced vertex
183    */
184   // Name
185   typedef std::string TEnfName;
186   // Entry
187   typedef std::string TEntry;
188   // List of entries
189   typedef std::set<TEntry> TEntryList;
190   // Group name
191   typedef std::string TEnfGroupName;
192   // Coordinates
193   typedef std::vector<double> TEnfVertexCoords;
194   typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
195
196   // Enforced vertex
197   struct TEnfVertex {
198     TEnfName name;
199     TEntry geomEntry;
200     TEnfVertexCoords coords;
201     TEnfGroupName grpName;
202     TEntryList faceEntries;
203     TopoDS_Vertex vertex;
204   };
205     
206   struct CompareEnfVertices
207   {
208     bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
209       if (e1 && e2) {
210         if (e1->coords.size() && e2->coords.size())
211           return (e1->coords < e2->coords);
212         else
213           return (e1->geomEntry < e2->geomEntry);
214       }
215       return false;
216     }
217   };
218
219   // PreCad Face and Edge periodicity
220   struct TPreCadPeriodicity {
221     TEntry shape1Entry;
222     TEntry shape2Entry;
223     std::vector<std::string> theSourceVerticesEntries;
224     std::vector<std::string> theTargetVerticesEntries;
225   };
226
227   // Edge periodicity
228   struct TEdgePeriodicity {
229     TEntry theFace1Entry;
230     TEntry theEdge1Entry;
231     TEntry theFace2Entry;
232     TEntry theEdge2Entry;
233     int edge_orientation;
234   };
235
236   // Vertex periodicity
237   struct TVertexPeriodicity {
238     TEntry theEdge1Entry;
239     TEntry theVertex1Entry;
240     TEntry theEdge2Entry;
241     TEntry theVertex2Entry;
242   };
243
244   typedef std::pair< TEntry, TEntry > TFacesPeriodicity;
245
246   // List of enforced vertices
247   typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
248
249   // Map Face Entry / List of enforced vertices
250   typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
251
252   // List of Face Entry with internal enforced vertices activated
253   typedef std::set< TEntry > TFaceEntryInternalVerticesList;
254
255   // Map Face Entry / List of coords
256   typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap;
257
258   // Map Face Entry / List of Vertex entry
259   typedef std::map< TEntry, TEntryList > TFaceEntryEnfVertexEntryListMap;
260   
261   // Map Coords / Enforced vertex
262   typedef std::map< TEnfVertexCoords, TEnfVertex* > TCoordsEnfVertexMap;
263
264   // Map Vertex entry / Enforced vertex
265   typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
266
267   typedef std::map< TEnfGroupName, std::set<int> > TGroupNameNodeIDMap;
268   /* TODO GROUPS
269   // Map Group Name / List of enforced vertices
270   typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
271   */
272
273   // Vector of pairs of entries
274   typedef std::vector< TPreCadPeriodicity > TPreCadPeriodicityVector;
275   typedef std::vector< TFacesPeriodicity > TFacesPeriodicityVector;
276   typedef std::vector< TEdgePeriodicity > TEdgesPeriodicityVector;
277   typedef std::vector< TVertexPeriodicity > TVerticesPeriodicityVector;
278   
279
280   bool                  SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName,
281                                           double x = 0.0, double y = 0.0, double z = 0.0);
282   TEnfVertexList        GetEnfVertexList(const TEntry& theFaceEntry) throw (std::invalid_argument);
283   TEnfVertexCoordsList  GetEnfVertexCoordsList(const TEntry& theFaceEntry) throw (std::invalid_argument);
284   TEntryList            GetEnfVertexEntryList (const TEntry& theFaceEntry) throw (std::invalid_argument);
285   TEnfVertex*           GetEnfVertex(TEnfVertexCoords coords) throw (std::invalid_argument);
286   TEnfVertex*           GetEnfVertex(const TEntry& theEnfVertexEntry) throw (std::invalid_argument);
287   void                  AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID);
288   std::set<int>         GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument);
289   void                  RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument);
290   
291   bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") throw (std::invalid_argument);
292   bool ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument);
293
294   void ClearAllEnforcedVertices();
295
296   const TFaceEntryEnfVertexListMap  _GetAllEnforcedVerticesByFace() const { return _faceEntryEnfVertexListMap; }
297   const TEnfVertexList              _GetAllEnforcedVertices() const { return _enfVertexList; }
298
299   const TFaceEntryCoordsListMap     _GetAllCoordsByFace() const { return _faceEntryCoordsListMap; }
300   const TCoordsEnfVertexMap         _GetAllEnforcedVerticesByCoords() const { return _coordsEnfVertexMap; }
301
302   const TFaceEntryEnfVertexEntryListMap _GetAllEnfVertexEntriesByFace() const { return _faceEntryEnfVertexEntryListMap; }
303   const TEnfVertexEntryEnfVertexMap     _GetAllEnforcedVerticesByEnfVertexEntry() const { return _enfVertexEntryEnfVertexMap; }
304
305 //   TODO GROUPS
306 //   const TEnfVertexGroupNameMap _GetEnforcedVertexGroupNameMap() const { return _enfVertexGroupNameMap; }
307   
308
309   /*!
310    * \brief Return the enforced vertices
311    */
312   static TFaceEntryEnfVertexListMap       GetAllEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
313   static TEnfVertexList                   GetAllEnforcedVertices(const BLSURFPlugin_Hypothesis* hyp);
314
315   static TFaceEntryCoordsListMap          GetAllCoordsByFace(const BLSURFPlugin_Hypothesis* hyp);
316   static TCoordsEnfVertexMap              GetAllEnforcedVerticesByCoords(const BLSURFPlugin_Hypothesis* hyp);
317
318   static TFaceEntryEnfVertexEntryListMap  GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp);
319   static TEnfVertexEntryEnfVertexMap      GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp);
320
321   /*!
322    * \brief Internal enforced vertices
323    */
324   void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
325   const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
326   static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
327   void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
328   const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
329   static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp );
330
331 //  Enable internal enforced vertices on specific face if requested by user
332 //  static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); }
333 //  const TFaceEntryInternalVerticesList  _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; }
334 //  static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
335 //  void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName);
336 //  bool GetInternalEnforcedVertex(const TEntry& theFaceEntry);
337
338   static PhysicalMesh    GetDefaultPhysicalMesh() { return PhysicalGlobalSize; }
339   static GeometricMesh   GetDefaultGeometricMesh() { return DefaultGeom; }
340   static double          GetDefaultPhySize(double diagonal, double bbSegmentation);
341   static double          GetDefaultPhySize() { return undefinedDouble(); }
342   static bool            GetDefaultPhySizeRel() { return false; }
343   static double          GetDefaultMinSize(double diagonal);
344   static double          GetDefaultMinSize() { return undefinedDouble(); }
345   static bool            GetDefaultMinSizeRel() { return false; }
346   static double          GetDefaultMaxSize(double diagonal);
347   static double          GetDefaultMaxSize() { return undefinedDouble(); }
348   static bool            GetDefaultMaxSizeRel() { return false; }
349   static double          GetDefaultGradation() { return 1.3; }
350   static bool            GetDefaultQuadAllowed() { return false; }
351   static double          GetDefaultAngleMesh() { return 22.0; }
352   
353   static double          GetDefaultChordalError(double diagonal);
354   static double          GetDefaultChordalError() { return undefinedDouble(); }
355   static bool            GetDefaultAnisotropic() { return false; }
356   static double          GetDefaultAnisotropicRatio() { return 0.0; }
357   static bool            GetDefaultRemoveTinyEdges() { return false; }
358   static double          GetDefaultTinyEdgeLength(double diagonal);
359   static double          GetDefaultTinyEdgeLength() { return undefinedDouble(); }
360   static bool            GetDefaultBadElementRemoval() { return false; }
361   static double          GetDefaultBadElementAspectRatio() {return 1000.0; } 
362   static bool            GetDefaultOptimizeMesh() { return true; }
363   static bool            GetDefaultQuadraticMesh() { return false; }
364   
365   static int             GetDefaultVerbosity() { return 3; }
366   // Since Salome 7.5.0 and MeshGems 1.3, the default behaviour is to use PreCAD with all options at false
367   static Topology        GetDefaultTopology() { return PreCAD; }
368   // PreCAD
369   static bool            GetDefaultPreCADMergeEdges() { return false; }
370   static bool            GetDefaultPreCADProcess3DTopology() { return false; }
371   static bool            GetDefaultPreCADDiscardInput() { return false; }
372   
373   static TSizeMap        GetDefaultSizeMap() { return TSizeMap();}
374   static TAttractorMap   GetDefaultAttractorMap() { return TAttractorMap(); }
375
376   static TFaceEntryEnfVertexListMap       GetDefaultFaceEntryEnfVertexListMap() { return TFaceEntryEnfVertexListMap(); }
377   static TEnfVertexList                   GetDefaultEnfVertexList() { return TEnfVertexList(); }
378   static TFaceEntryCoordsListMap          GetDefaultFaceEntryCoordsListMap() { return TFaceEntryCoordsListMap(); }
379   static TCoordsEnfVertexMap              GetDefaultCoordsEnfVertexMap() { return TCoordsEnfVertexMap(); }
380   static TFaceEntryEnfVertexEntryListMap  GetDefaultFaceEntryEnfVertexEntryListMap() { return TFaceEntryEnfVertexEntryListMap(); }
381   static TEnfVertexEntryEnfVertexMap      GetDefaultEnfVertexEntryEnfVertexMap() { return TEnfVertexEntryEnfVertexMap(); }
382   static TGroupNameNodeIDMap              GetDefaultGroupNameNodeIDMap() { return TGroupNameNodeIDMap(); }
383
384   static bool            GetDefaultInternalEnforcedVertex() { return false; }
385
386   /* TODO GROUPS
387   static TGroupNameEnfVertexListMap GetDefaultGroupNameEnfVertexListMap() { return TGroupNameEnfVertexListMap(); }
388   static TEnfVertexGroupNameMap     GetDefaultEnfVertexGroupNameMap() { return TEnfVertexGroupNameMap(); }
389   */
390
391 //  const TPreCadPeriodicityEntriesVector _GetPreCadFacesPeriodicityEntries() const { return _preCadFacesPeriodicityEntriesVector; }
392
393   static TPreCadPeriodicityVector GetDefaultPreCadFacesPeriodicityVector() { return TPreCadPeriodicityVector(); }
394   const TPreCadPeriodicityVector  _GetPreCadFacesPeriodicityVector() const { return _preCadFacesPeriodicityVector; }
395   static TPreCadPeriodicityVector GetPreCadFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
396
397   static TPreCadPeriodicityVector GetDefaultPreCadEdgesPeriodicityVector() { return TPreCadPeriodicityVector(); }
398   const TPreCadPeriodicityVector  _GetPreCadEdgesPeriodicityVector() const { return _preCadEdgesPeriodicityVector; }
399   static TPreCadPeriodicityVector GetPreCadEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
400
401   static TFacesPeriodicityVector GetDefaultFacesPeriodicityVector() { return TFacesPeriodicityVector(); }
402   const TFacesPeriodicityVector  _GetFacesPeriodicityVector() const { return _facesPeriodicityVector; }
403   static TFacesPeriodicityVector GetFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
404
405   static TEdgesPeriodicityVector GetDefaultEdgesPeriodicityVector() { return TEdgesPeriodicityVector(); }
406   const TEdgesPeriodicityVector  _GetEdgesPeriodicityVector() const { return _edgesPeriodicityVector; }
407   static TEdgesPeriodicityVector GetEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
408
409   static TVerticesPeriodicityVector GetDefaultVerticesPeriodicityVector() { return TVerticesPeriodicityVector(); }
410   const TVerticesPeriodicityVector  _GetVerticesPeriodicityVector() const { return _verticesPeriodicityVector; }
411   static TVerticesPeriodicityVector GetVerticesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
412
413   void ClearPreCadPeriodicityVectors();
414
415   void AddPreCadFacesPeriodicity(TEntry theFace1Entry, TEntry theFace2Entry,
416       std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
417   void AddPreCadEdgesPeriodicity(TEntry theEdge1Entry, TEntry theEdge2Entry,
418       std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
419
420   void AddFacePeriodicity(TEntry theFace1Entry, TEntry theFace2Entry);
421   void AddEdgePeriodicity(TEntry theFace1Entry, TEntry theEdge1Entry, TEntry theFace2Entry, TEntry theEdge2Entry, int edge_orientation = 0);
422   void AddVertexPeriodicity(TEntry theEdge1Entry, TEntry theVertex1Entry, TEntry theEdge2Entry, TEntry theVertex2Entry);
423
424   static double undefinedDouble() { return -1.0; }
425
426   typedef std::map< std::string, std::string > TOptionValues;
427   typedef std::set< std::string >              TOptionNames;
428
429   void SetOptionValue(const std::string& optionName,
430                       const std::string& optionValue) throw (std::invalid_argument);
431   void SetPreCADOptionValue(const std::string& optionName,
432                             const std::string& optionValue) throw (std::invalid_argument);
433   std::string GetOptionValue(const std::string& optionName) throw (std::invalid_argument);
434   std::string GetPreCADOptionValue(const std::string& optionName) throw (std::invalid_argument);
435   void ClearOption(const std::string& optionName);
436   void ClearPreCADOption(const std::string& optionName);
437   const TOptionValues& GetOptionValues() const { return _option2value; }
438   const TOptionValues& GetPreCADOptionValues() const { return _preCADoption2value; }
439
440   /*!
441     * Sets the file for export resulting mesh in GMF format
442     */
443 //   void SetGMFFile(const std::string& theFileName, bool isBinary);
444   void SetGMFFile(const std::string& theFileName);
445   std::string GetGMFFile() const { return _GMFFileName; }
446   static std::string GetDefaultGMFFile() { return "";}
447 //   bool GetGMFFileMode() const { return _GMFFileMode; }
448   
449   // Persistence
450   virtual std::ostream & SaveTo(std::ostream & save);
451   virtual std::istream & LoadFrom(std::istream & load);
452   friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp);
453   friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp);
454
455   /*!
456    * \brief Does nothing
457    * \param theMesh - the built mesh
458    * \param theShape - the geometry of interest
459    * \retval bool - always false
460    */
461   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
462
463   /*!
464    * \brief Initialize my parameter values by default parameters.
465    *  \retval bool - true if parameter values have been successfully defined
466    */
467   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
468
469
470 private:
471   PhysicalMesh    _physicalMesh;
472   GeometricMesh   _geometricMesh;
473   double          _phySize;
474   bool            _phySizeRel;
475   double          _minSize, _maxSize;
476   bool            _minSizeRel, _maxSizeRel;
477   double          _gradation;
478   bool            _quadAllowed;
479   double          _angleMesh;
480   double          _chordalError;
481   bool            _anisotropic;
482   double          _anisotropicRatio;
483   bool            _removeTinyEdges;
484   double          _tinyEdgeLength;
485   bool            _badElementRemoval;
486   double          _badElementAspectRatio;
487   bool            _optimizeMesh;
488   bool            _quadraticMesh;
489   int             _verb;
490   Topology        _topology;
491   
492   bool            _preCADMergeEdges;
493   bool            _preCADProcess3DTopology;
494   bool            _preCADDiscardInput;
495   double          _preCADEpsNano;
496   
497   TOptionValues   _option2value, _preCADoption2value;
498   TOptionNames    _doubleOptions, _charOptions;
499   TOptionNames    _preCADdoubleOptions, _preCADcharOptions;
500   TSizeMap        _sizeMap;
501   TSizeMap        _attractors;
502   TAttractorMap   _classAttractors;
503   TSizeMap        _attEntry;
504   TParamsMap      _attParams;
505
506   TFaceEntryEnfVertexListMap  _faceEntryEnfVertexListMap;
507   TEnfVertexList              _enfVertexList;
508   // maps to get "manual" enf vertex (through their coordinates)
509   TFaceEntryCoordsListMap     _faceEntryCoordsListMap;
510   TCoordsEnfVertexMap         _coordsEnfVertexMap;
511   // maps to get "geom" enf vertex (through their geom entries)
512   TFaceEntryEnfVertexEntryListMap _faceEntryEnfVertexEntryListMap;
513   TEnfVertexEntryEnfVertexMap     _enfVertexEntryEnfVertexMap;
514   TGroupNameNodeIDMap             _groupNameNodeIDMap;
515   
516 //  Enable internal enforced vertices on specific face if requested by user
517 //  TFaceEntryInternalVerticesList  _faceEntryInternalVerticesList;
518   bool            _enforcedInternalVerticesAllFaces;
519   TEnfGroupName   _enforcedInternalVerticesAllFacesGroup;
520   
521   TPreCadPeriodicityVector _preCadFacesPeriodicityVector;
522   TPreCadPeriodicityVector _preCadEdgesPeriodicityVector;
523
524   TFacesPeriodicityVector _facesPeriodicityVector;
525   TEdgesPeriodicityVector _edgesPeriodicityVector;
526   TVerticesPeriodicityVector _verticesPeriodicityVector;
527
528   // Called by SaveTo to store content of _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
529   void SavePreCADPeriodicity(std::ostream & save, const char* shapeType);
530
531   // Called by LoadFrom to fill _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
532   void LoadPreCADPeriodicity(std::istream & load, const char* shapeType);
533
534   // Called by LoadFrom to fill _facesPeriodicityVector
535   void LoadFacesPeriodicity(std::istream & load);
536
537   // Called by LoadFrom to fill _edgesPeriodicityVector
538   void LoadEdgesPeriodicity(std::istream & load);
539
540   // Called by LoadFrom to fill _verticesPeriodicityVector
541   void LoadVerticesPeriodicity(std::istream & load);
542
543   // Called by SaveTo to store content of _facesPeriodicityVector
544   void SaveFacesPeriodicity(std::ostream & save);
545
546   // Called by SaveTo to store content of _edgesPeriodicityVector
547   void SaveEdgesPeriodicity(std::ostream & save);
548
549   // Called by SaveTo to store content of _verticesPeriodicityVector
550   void SaveVerticesPeriodicity(std::ostream & save);
551
552   std::string     _GMFFileName;
553 //   bool            _GMFFileMode;
554
555 //   TSizeMap      _customSizeMap;
556 };
557
558 #endif