]> SALOME platform Git repositories - plugins/blsurfplugin.git/blob - src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
Salome HOME
Adding the preprocessor option remove_tiny_uv_edges to the user interface.
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis.hxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File    : BLSURFPlugin_Hypothesis.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 SetPreCADRemoveTinyUVEdges(bool theVal);
138   bool GetPreCADRemoveTinyUVEdges() const { return _preCADRemoveTinyUVEdges; }
139
140   void SetPreCADRemoveDuplicateCADFaces(bool theVal);
141   bool GetPreCADRemoveDuplicateCADFaces() const { return _preCADRemoveDuplicateCADFaces; }
142
143   void SetPreCADProcess3DTopology(bool theVal);
144   bool GetPreCADProcess3DTopology() const { return _preCADProcess3DTopology; }
145
146   void SetPreCADDiscardInput(bool theVal);
147   bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
148     
149   typedef std::map<std::string,std::string> TSizeMap;
150
151   void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
152   std::string  GetSizeMapEntry(const std::string& entry);
153   const TSizeMap& _GetSizeMapEntries() const { return _sizeMap; }
154   /*!
155    * \brief Return the size maps
156    */
157   static TSizeMap GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp);
158
159
160   void SetAttractorEntry(const std::string& entry,const std::string& attractor );
161   std::string GetAttractorEntry(const std::string& entry);
162   const TSizeMap& _GetAttractorEntries() const { return _attractors; };
163   /*!
164    * \brief Return the attractors
165    */
166   static TSizeMap GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
167
168
169 /*
170   void SetCustomSizeMapEntry(const std::string& entry,const std::string& sizeMap );
171   std::string  GetCustomSizeMapEntry(const std::string& entry);
172   void UnsetCustomSizeMap(const std::string& entry);
173   const TSizeMap& GetCustomSizeMapEntries() const { return _customSizeMap; }
174  */
175   
176   typedef std::multimap< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
177   typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO à finir 
178   
179   void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
180   std::string  GetClassAttractorEntry(const std::string& entry);
181   const TAttractorMap& _GetClassAttractorEntries() const { return _classAttractors; }
182   /*!
183    * \brief Return the attractors entries
184    */
185   static TAttractorMap GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
186
187   /*!
188    * To set/get/unset an enforced vertex
189    */
190   // Name
191   typedef std::string TEnfName;
192   // Entry
193   typedef std::string TEntry;
194   // List of entries
195   typedef std::set<TEntry> TEntryList;
196   // Group name
197   typedef std::string TEnfGroupName;
198   // Coordinates
199   typedef std::vector<double> TEnfVertexCoords;
200   typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
201
202   // Enforced vertex
203   struct TEnfVertex {
204     TEnfName name;
205     TEntry geomEntry;
206     TEnfVertexCoords coords;
207     TEnfGroupName grpName;
208     TEntryList faceEntries;
209     TopoDS_Vertex vertex;
210   };
211     
212   struct CompareEnfVertices
213   {
214     bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
215       if (e1 && e2) {
216         if (e1->coords.size() && e2->coords.size())
217           return (e1->coords < e2->coords);
218         else
219           return (e1->geomEntry < e2->geomEntry);
220       }
221       return false;
222     }
223   };
224
225   // PreCad Face and Edge periodicity
226   struct TPreCadPeriodicity {
227     TEntry shape1Entry;
228     TEntry shape2Entry;
229     std::vector<std::string> theSourceVerticesEntries;
230     std::vector<std::string> theTargetVerticesEntries;
231   };
232
233   // Edge periodicity
234   struct TEdgePeriodicity {
235     TEntry theFace1Entry;
236     TEntry theEdge1Entry;
237     TEntry theFace2Entry;
238     TEntry theEdge2Entry;
239     int edge_orientation;
240   };
241
242   // Vertex periodicity
243   struct TVertexPeriodicity {
244     TEntry theEdge1Entry;
245     TEntry theVertex1Entry;
246     TEntry theEdge2Entry;
247     TEntry theVertex2Entry;
248   };
249
250   typedef std::pair< TEntry, TEntry > TFacesPeriodicity;
251
252   // List of enforced vertices
253   typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
254
255   // Map Face Entry / List of enforced vertices
256   typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
257
258   // List of Face Entry with internal enforced vertices activated
259   typedef std::set< TEntry > TFaceEntryInternalVerticesList;
260
261   // Map Face Entry / List of coords
262   typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap;
263
264   // Map Face Entry / List of Vertex entry
265   typedef std::map< TEntry, TEntryList > TFaceEntryEnfVertexEntryListMap;
266   
267   // Map Coords / Enforced vertex
268   typedef std::map< TEnfVertexCoords, TEnfVertex* > TCoordsEnfVertexMap;
269
270   // Map Vertex entry / Enforced vertex
271   typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
272
273   typedef std::map< TEnfGroupName, std::set<int> > TGroupNameNodeIDMap;
274   /* TODO GROUPS
275   // Map Group Name / List of enforced vertices
276   typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
277   */
278
279   // Vector of pairs of entries
280   typedef std::vector< TPreCadPeriodicity > TPreCadPeriodicityVector;
281   typedef std::vector< TFacesPeriodicity > TFacesPeriodicityVector;
282   typedef std::vector< TEdgePeriodicity > TEdgesPeriodicityVector;
283   typedef std::vector< TVertexPeriodicity > TVerticesPeriodicityVector;
284   
285
286   bool                  SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName,
287                                           double x = 0.0, double y = 0.0, double z = 0.0);
288   TEnfVertexList        GetEnfVertexList(const TEntry& theFaceEntry) throw (std::invalid_argument);
289   TEnfVertexCoordsList  GetEnfVertexCoordsList(const TEntry& theFaceEntry) throw (std::invalid_argument);
290   TEntryList            GetEnfVertexEntryList (const TEntry& theFaceEntry) throw (std::invalid_argument);
291   TEnfVertex*           GetEnfVertex(TEnfVertexCoords coords) throw (std::invalid_argument);
292   TEnfVertex*           GetEnfVertex(const TEntry& theEnfVertexEntry) throw (std::invalid_argument);
293   void                  AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID);
294   std::set<int>         GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument);
295   void                  RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument);
296   
297   bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") throw (std::invalid_argument);
298   bool ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument);
299
300   void ClearAllEnforcedVertices();
301
302   const TFaceEntryEnfVertexListMap  _GetAllEnforcedVerticesByFace() const { return _faceEntryEnfVertexListMap; }
303   const TEnfVertexList              _GetAllEnforcedVertices() const { return _enfVertexList; }
304
305   const TFaceEntryCoordsListMap     _GetAllCoordsByFace() const { return _faceEntryCoordsListMap; }
306   const TCoordsEnfVertexMap         _GetAllEnforcedVerticesByCoords() const { return _coordsEnfVertexMap; }
307
308   const TFaceEntryEnfVertexEntryListMap _GetAllEnfVertexEntriesByFace() const { return _faceEntryEnfVertexEntryListMap; }
309   const TEnfVertexEntryEnfVertexMap     _GetAllEnforcedVerticesByEnfVertexEntry() const { return _enfVertexEntryEnfVertexMap; }
310
311 //   TODO GROUPS
312 //   const TEnfVertexGroupNameMap _GetEnforcedVertexGroupNameMap() const { return _enfVertexGroupNameMap; }
313   
314
315   /*!
316    * \brief Return the enforced vertices
317    */
318   static TFaceEntryEnfVertexListMap       GetAllEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
319   static TEnfVertexList                   GetAllEnforcedVertices(const BLSURFPlugin_Hypothesis* hyp);
320
321   static TFaceEntryCoordsListMap          GetAllCoordsByFace(const BLSURFPlugin_Hypothesis* hyp);
322   static TCoordsEnfVertexMap              GetAllEnforcedVerticesByCoords(const BLSURFPlugin_Hypothesis* hyp);
323
324   static TFaceEntryEnfVertexEntryListMap  GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp);
325   static TEnfVertexEntryEnfVertexMap      GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp);
326
327   /*!
328    * \brief Internal enforced vertices
329    */
330   void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
331   const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
332   static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
333   void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
334   const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
335   static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp );
336
337 //  Enable internal enforced vertices on specific face if requested by user
338 //  static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); }
339 //  const TFaceEntryInternalVerticesList  _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; }
340 //  static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
341 //  void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName);
342 //  bool GetInternalEnforcedVertex(const TEntry& theFaceEntry);
343
344   static PhysicalMesh    GetDefaultPhysicalMesh() { return PhysicalGlobalSize; }
345   static GeometricMesh   GetDefaultGeometricMesh() { return DefaultGeom; }
346   static double          GetDefaultPhySize(double diagonal, double bbSegmentation);
347   static double          GetDefaultPhySize() { return undefinedDouble(); }
348   static bool            GetDefaultPhySizeRel() { return false; }
349   static double          GetDefaultMinSize(double diagonal);
350   static double          GetDefaultMinSize() { return undefinedDouble(); }
351   static bool            GetDefaultMinSizeRel() { return false; }
352   static double          GetDefaultMaxSize(double diagonal);
353   static double          GetDefaultMaxSize() { return undefinedDouble(); }
354   static bool            GetDefaultMaxSizeRel() { return false; }
355   static double          GetDefaultGradation() { return 1.3; }
356   static bool            GetDefaultQuadAllowed() { return false; }
357   static double          GetDefaultAngleMesh() { return 22.0; }
358   
359   static double          GetDefaultChordalError(double diagonal);
360   static double          GetDefaultChordalError() { return undefinedDouble(); }
361   static bool            GetDefaultAnisotropic() { return false; }
362   static double          GetDefaultAnisotropicRatio() { return 0.0; }
363   static bool            GetDefaultRemoveTinyEdges() { return false; }
364   static double          GetDefaultTinyEdgeLength(double diagonal);
365   static double          GetDefaultTinyEdgeLength() { return undefinedDouble(); }
366   static bool            GetDefaultBadElementRemoval() { return false; }
367   static double          GetDefaultBadElementAspectRatio() {return 1000.0; } 
368   static bool            GetDefaultOptimizeMesh() { return true; }
369   static bool            GetDefaultQuadraticMesh() { return false; }
370   
371   static int             GetDefaultVerbosity() { return 3; }
372   static Topology        GetDefaultTopology() { return FromCAD; }
373   // PreCAD
374   static bool            GetDefaultPreCADMergeEdges() { return false; }
375   static bool            GetDefaultPreCADRemoveTinyUVEdges() { return false; }
376   static bool            GetDefaultPreCADRemoveDuplicateCADFaces() { return false; }
377   static bool            GetDefaultPreCADProcess3DTopology() { return false; }
378   static bool            GetDefaultPreCADDiscardInput() { return false; }
379   
380   static TSizeMap        GetDefaultSizeMap() { return TSizeMap();}
381   static TAttractorMap   GetDefaultAttractorMap() { return TAttractorMap(); }
382
383   static TFaceEntryEnfVertexListMap       GetDefaultFaceEntryEnfVertexListMap() { return TFaceEntryEnfVertexListMap(); }
384   static TEnfVertexList                   GetDefaultEnfVertexList() { return TEnfVertexList(); }
385   static TFaceEntryCoordsListMap          GetDefaultFaceEntryCoordsListMap() { return TFaceEntryCoordsListMap(); }
386   static TCoordsEnfVertexMap              GetDefaultCoordsEnfVertexMap() { return TCoordsEnfVertexMap(); }
387   static TFaceEntryEnfVertexEntryListMap  GetDefaultFaceEntryEnfVertexEntryListMap() { return TFaceEntryEnfVertexEntryListMap(); }
388   static TEnfVertexEntryEnfVertexMap      GetDefaultEnfVertexEntryEnfVertexMap() { return TEnfVertexEntryEnfVertexMap(); }
389   static TGroupNameNodeIDMap              GetDefaultGroupNameNodeIDMap() { return TGroupNameNodeIDMap(); }
390
391   static bool            GetDefaultInternalEnforcedVertex() { return false; }
392
393   /* TODO GROUPS
394   static TGroupNameEnfVertexListMap GetDefaultGroupNameEnfVertexListMap() { return TGroupNameEnfVertexListMap(); }
395   static TEnfVertexGroupNameMap     GetDefaultEnfVertexGroupNameMap() { return TEnfVertexGroupNameMap(); }
396   */
397
398 //  const TPreCadPeriodicityEntriesVector _GetPreCadFacesPeriodicityEntries() const { return _preCadFacesPeriodicityEntriesVector; }
399
400   static TPreCadPeriodicityVector GetDefaultPreCadFacesPeriodicityVector() { return TPreCadPeriodicityVector(); }
401   const TPreCadPeriodicityVector  _GetPreCadFacesPeriodicityVector() const { return _preCadFacesPeriodicityVector; }
402   static TPreCadPeriodicityVector GetPreCadFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
403
404   static TPreCadPeriodicityVector GetDefaultPreCadEdgesPeriodicityVector() { return TPreCadPeriodicityVector(); }
405   const TPreCadPeriodicityVector  _GetPreCadEdgesPeriodicityVector() const { return _preCadEdgesPeriodicityVector; }
406   static TPreCadPeriodicityVector GetPreCadEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
407
408   static TFacesPeriodicityVector GetDefaultFacesPeriodicityVector() { return TFacesPeriodicityVector(); }
409   const TFacesPeriodicityVector  _GetFacesPeriodicityVector() const { return _facesPeriodicityVector; }
410   static TFacesPeriodicityVector GetFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
411
412   static TEdgesPeriodicityVector GetDefaultEdgesPeriodicityVector() { return TEdgesPeriodicityVector(); }
413   const TEdgesPeriodicityVector  _GetEdgesPeriodicityVector() const { return _edgesPeriodicityVector; }
414   static TEdgesPeriodicityVector GetEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
415
416   static TVerticesPeriodicityVector GetDefaultVerticesPeriodicityVector() { return TVerticesPeriodicityVector(); }
417   const TVerticesPeriodicityVector  _GetVerticesPeriodicityVector() const { return _verticesPeriodicityVector; }
418   static TVerticesPeriodicityVector GetVerticesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
419
420   void ClearPreCadPeriodicityVectors();
421
422   void AddPreCadFacesPeriodicity(TEntry theFace1Entry, TEntry theFace2Entry,
423       std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
424   void AddPreCadEdgesPeriodicity(TEntry theEdge1Entry, TEntry theEdge2Entry,
425       std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
426
427   static double undefinedDouble() { return -1.0; }
428
429   typedef std::map< std::string, std::string > TOptionValues;
430   typedef std::set< std::string >              TOptionNames;
431
432   void SetOptionValue(const std::string& optionName,
433                       const std::string& optionValue) throw (std::invalid_argument);
434   void SetPreCADOptionValue(const std::string& optionName,
435                             const std::string& optionValue) throw (std::invalid_argument);
436   std::string GetOptionValue(const std::string& optionName) throw (std::invalid_argument);
437   std::string GetPreCADOptionValue(const std::string& optionName) throw (std::invalid_argument);
438   void ClearOption(const std::string& optionName);
439   void ClearPreCADOption(const std::string& optionName);
440   const TOptionValues& GetOptionValues() const { return _option2value; }
441   const TOptionValues& GetPreCADOptionValues() const { return _preCADoption2value; }
442   const TOptionValues& GetCustomOptionValues() const { return _customOption2value; }
443   const TOptionValues& GetCustomPreCADOptionValues() const { return _customPreCADOption2value; }
444
445   void AddOption(const std::string& optionName, const std::string& optionValue);
446   void AddPreCADOption(const std::string& optionName, const std::string& optionValue);
447   std::string GetOption(const std::string& optionName);
448   std::string GetPreCADOption(const std::string& optionName);
449
450   /*!
451     * Sets the file for export resulting mesh in GMF format
452     */
453 //   void SetGMFFile(const std::string& theFileName, bool isBinary);
454   void SetGMFFile(const std::string& theFileName);
455   std::string GetGMFFile() const { return _GMFFileName; }
456   static std::string GetDefaultGMFFile() { return "";}
457 //   bool GetGMFFileMode() const { return _GMFFileMode; }
458   
459   // Persistence
460   virtual std::ostream & SaveTo(std::ostream & save);
461   virtual std::istream & LoadFrom(std::istream & load);
462   friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp);
463   friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp);
464
465   /*!
466    * \brief Does nothing
467    * \param theMesh - the built mesh
468    * \param theShape - the geometry of interest
469    * \retval bool - always false
470    */
471   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
472
473   /*!
474    * \brief Initialize my parameter values by default parameters.
475    *  \retval bool - true if parameter values have been successfully defined
476    */
477   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
478
479
480 private:
481   PhysicalMesh    _physicalMesh;
482   GeometricMesh   _geometricMesh;
483   double          _phySize;
484   bool            _phySizeRel;
485   double          _minSize, _maxSize;
486   bool            _minSizeRel, _maxSizeRel;
487   double          _gradation;
488   bool            _quadAllowed;
489   double          _angleMesh;
490   double          _chordalError;
491   bool            _anisotropic;
492   double          _anisotropicRatio;
493   bool            _removeTinyEdges;
494   double          _tinyEdgeLength;
495   bool            _badElementRemoval;
496   double          _badElementAspectRatio;
497   bool            _optimizeMesh;
498   bool            _quadraticMesh;
499   int             _verb;
500   Topology        _topology;
501   
502   bool            _preCADMergeEdges;
503   bool            _preCADRemoveTinyUVEdges;
504   bool            _preCADRemoveDuplicateCADFaces;
505   bool            _preCADProcess3DTopology;
506   bool            _preCADDiscardInput;
507   double          _preCADEpsNano;
508   
509   TOptionValues   _option2value, _preCADoption2value;
510   TOptionValues   _customOption2value, _customPreCADOption2value;
511   TOptionNames    _doubleOptions, _charOptions;
512   TOptionNames    _preCADdoubleOptions, _preCADcharOptions;
513   TSizeMap        _sizeMap;
514   TSizeMap        _attractors;
515   TAttractorMap   _classAttractors;
516   TSizeMap        _attEntry;
517   TParamsMap      _attParams;
518
519   TFaceEntryEnfVertexListMap  _faceEntryEnfVertexListMap;
520   TEnfVertexList              _enfVertexList;
521   // maps to get "manual" enf vertex (through their coordinates)
522   TFaceEntryCoordsListMap     _faceEntryCoordsListMap;
523   TCoordsEnfVertexMap         _coordsEnfVertexMap;
524   // maps to get "geom" enf vertex (through their geom entries)
525   TFaceEntryEnfVertexEntryListMap _faceEntryEnfVertexEntryListMap;
526   TEnfVertexEntryEnfVertexMap     _enfVertexEntryEnfVertexMap;
527   TGroupNameNodeIDMap             _groupNameNodeIDMap;
528   
529 //  Enable internal enforced vertices on specific face if requested by user
530 //  TFaceEntryInternalVerticesList  _faceEntryInternalVerticesList;
531   bool            _enforcedInternalVerticesAllFaces;
532   TEnfGroupName   _enforcedInternalVerticesAllFacesGroup;
533   
534   TPreCadPeriodicityVector _preCadFacesPeriodicityVector;
535   TPreCadPeriodicityVector _preCadEdgesPeriodicityVector;
536
537   TFacesPeriodicityVector _facesPeriodicityVector;
538   TEdgesPeriodicityVector _edgesPeriodicityVector;
539   TVerticesPeriodicityVector _verticesPeriodicityVector;
540
541   // Called by SaveTo to store content of _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
542   void SavePreCADPeriodicity(std::ostream & save, const char* shapeType);
543
544   // Called by LoadFrom to fill _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
545   void LoadPreCADPeriodicity(std::istream & load, const char* shapeType);
546
547   // Called by LoadFrom to fill _facesPeriodicityVector
548   void LoadFacesPeriodicity(std::istream & load);
549
550   // Called by LoadFrom to fill _edgesPeriodicityVector
551   void LoadEdgesPeriodicity(std::istream & load);
552
553   // Called by LoadFrom to fill _verticesPeriodicityVector
554   void LoadVerticesPeriodicity(std::istream & load);
555
556   // Called by SaveTo to store content of _facesPeriodicityVector
557   void SaveFacesPeriodicity(std::ostream & save);
558
559   // Called by SaveTo to store content of _edgesPeriodicityVector
560   void SaveEdgesPeriodicity(std::ostream & save);
561
562   // Called by SaveTo to store content of _verticesPeriodicityVector
563   void SaveVerticesPeriodicity(std::ostream & save);
564
565   std::string     _GMFFileName;
566 //   bool            _GMFFileMode;
567
568 //   TSizeMap      _customSizeMap;
569 };
570
571 #endif