1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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)
27 #ifndef _BLSURFPlugin_Hypothesis_HXX_
28 #define _BLSURFPlugin_Hypothesis_HXX_
30 #include "SMESH_Hypothesis.hxx"
38 #include <utilities.h>
39 #include "BLSURFPlugin_Attractor.hxx"
41 // Parameters for work of MG-CADSurf
43 class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
46 BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
63 GeometricalGlobalSize,
67 static const char* GetHypType() { return "MG-CADSurf Parameters"; }
69 TopoDS_Shape entryToShape(std::string entry);
71 void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
72 PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
74 void SetGeometricMesh(GeometricMesh theGeometricMesh);
75 GeometricMesh GetGeometricMesh() const { return _geometricMesh; }
77 void SetPhySize(double thePhySize, bool isRelative = false);
78 double GetPhySize() const { return _phySize; }
79 bool IsPhySizeRel() const { return _phySizeRel; }
81 void SetMinSize(double theMinSize, bool isRelative = false);
82 double GetMinSize() const { return _minSize; }
83 bool IsMinSizeRel() const { return _minSizeRel; }
85 void SetMaxSize(double theMaxSize, bool isRelative = false);
86 double GetMaxSize() const { return _maxSize; }
87 bool IsMaxSizeRel() const { return _maxSizeRel; }
89 void SetUseGradation(bool toUse);
90 bool GetUseGradation() const { return _useGradation; }
91 void SetGradation(double theGradation);
92 double GetGradation() const { return _gradation; }
94 void SetUseVolumeGradation(bool toUse);
95 bool GetUseVolumeGradation() const { return _useVolumeGradation; }
96 void SetVolumeGradation(double theGradation);
97 double GetVolumeGradation() const { return _volumeGradation; }
99 void SetQuadAllowed(bool theVal);
100 bool GetQuadAllowed() const { return _quadAllowed; }
102 void SetAngleMesh(double theAngle);
103 double GetAngleMesh() const { return _angleMesh; }
105 void SetChordalError(double theDistance);
106 double GetChordalError() const { return _chordalError; }
108 void SetAnisotropic(bool theVal);
109 bool GetAnisotropic() const { return _anisotropic; }
111 void SetAnisotropicRatio(double theVal);
112 double GetAnisotropicRatio() const { return _anisotropicRatio; }
114 void SetRemoveTinyEdges(bool theVal);
115 bool GetRemoveTinyEdges() const { return _removeTinyEdges; }
117 void SetTinyEdgeLength(double theVal);
118 double GetTinyEdgeLength() const { return _tinyEdgeLength; }
120 void SetOptimiseTinyEdges(bool theVal);
121 bool GetOptimiseTinyEdges() const { return _optimiseTinyEdges; }
123 void SetTinyEdgeOptimisationLength(double theVal);
124 double GetTinyEdgeOptimisationLength() const { return _tinyEdgeOptimisationLength; }
126 void SetCorrectSurfaceIntersection(bool theVal);
127 bool GetCorrectSurfaceIntersection() const { return _correctSurfaceIntersec; }
129 void SetCorrectSurfaceIntersectionMaxCost(double theVal);
130 double GetCorrectSurfaceIntersectionMaxCost() const { return _corrSurfaceIntersCost; }
132 void SetBadElementRemoval(bool theVal);
133 bool GetBadElementRemoval() const { return _badElementRemoval; }
135 void SetBadElementAspectRatio(double theVal);
136 double GetBadElementAspectRatio() const { return _badElementAspectRatio; }
138 void SetOptimizeMesh(bool theVal);
139 bool GetOptimizeMesh() const { return _optimizeMesh; }
141 void SetQuadraticMesh(bool theVal);
142 bool GetQuadraticMesh() const { return _quadraticMesh; }
144 void SetTopology(Topology theTopology);
145 Topology GetTopology() const { return _topology; }
147 void SetVerbosity(int theVal);
148 int GetVerbosity() const { return _verb; }
150 void ClearEntry(const std::string& entry, const char * attEntry = 0);
151 void ClearSizeMaps();
153 void SetEnforceCadEdgesSize( bool toEnforce );
154 bool GetEnforceCadEdgesSize();
156 void SetJacobianRectificationRespectGeometry( bool allowRectification );
157 bool GetJacobianRectificationRespectGeometry();
159 void SetJacobianRectification( bool allowRectification );
160 bool GetJacobianRectification();
162 void SetMaxNumberOfPointsPerPatch( int nb ) throw (std::invalid_argument);
163 int GetMaxNumberOfPointsPerPatch();
165 void SetRespectGeometry( bool toRespect );
166 bool GetRespectGeometry();
168 void SetTinyEdgesAvoidSurfaceIntersections( bool toAvoidIntersection );
169 bool GetTinyEdgesAvoidSurfaceIntersections();
171 void SetClosedGeometry( bool isClosed );
172 bool GetClosedGeometry();
174 void SetDebug( bool isDebug );
177 void SetPeriodicTolerance( double tol ) throw (std::invalid_argument);
178 double GetPeriodicTolerance();
180 void SetRequiredEntities( const std::string& howToTreat ) throw (std::invalid_argument);
181 std::string GetRequiredEntities();
183 void SetSewingTolerance( double tol ) throw (std::invalid_argument);
184 double GetSewingTolerance();
186 void SetTags( const std::string& howToTreat ) throw (std::invalid_argument);
187 std::string GetTags();
190 typedef std::set< int > THyperPatchTags;
191 typedef std::vector< THyperPatchTags > THyperPatchList;
193 void SetHyperPatches(const THyperPatchList& hpl);
194 const THyperPatchList& GetHyperPatches() const { return _hyperPatchList; }
195 static int GetHyperPatchTag( int faceTag, const BLSURFPlugin_Hypothesis* hyp, int* iPatch=0 );
197 void SetPreCADMergeEdges(bool theVal);
198 bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
200 void SetPreCADRemoveTinyUVEdges(bool theVal);
201 bool GetPreCADRemoveTinyUVEdges() const { return _preCADRemoveTinyUVEdges; }
203 void SetPreCADRemoveDuplicateCADFaces(bool theVal);
204 bool GetPreCADRemoveDuplicateCADFaces() const { return _preCADRemoveDuplicateCADFaces; }
206 void SetPreCADProcess3DTopology(bool theVal);
207 bool GetPreCADProcess3DTopology() const { return _preCADProcess3DTopology; }
209 void SetPreCADDiscardInput(bool theVal);
210 bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
212 static bool HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp);
214 typedef std::map<std::string,std::string> TSizeMap;
216 void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
217 std::string GetSizeMapEntry(const std::string& entry);
218 const TSizeMap& _GetSizeMapEntries() const { return _sizeMap; }
220 * \brief Return the size maps
222 static TSizeMap GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp);
225 void SetAttractorEntry(const std::string& entry,const std::string& attractor );
226 std::string GetAttractorEntry(const std::string& entry);
227 const TSizeMap& _GetAttractorEntries() const { return _attractors; };
229 * \brief Return the attractors
231 static TSizeMap GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
235 void SetCustomSizeMapEntry(const std::string& entry,const std::string& sizeMap );
236 std::string GetCustomSizeMapEntry(const std::string& entry);
237 void UnsetCustomSizeMap(const std::string& entry);
238 const TSizeMap& GetCustomSizeMapEntries() const { return _customSizeMap; }
241 typedef std::multimap< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
242 typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO à finir
244 void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
245 std::string GetClassAttractorEntry(const std::string& entry);
246 const TAttractorMap& _GetClassAttractorEntries() const { return _classAttractors; }
248 * \brief Return the attractors entries
250 static TAttractorMap GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
253 * To set/get/unset an enforced vertex
256 typedef std::string TEnfName;
258 typedef std::string TEntry;
260 typedef std::set<TEntry> TEntryList;
262 typedef std::string TEnfGroupName;
264 typedef std::vector<double> TEnfVertexCoords;
265 typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
271 TEnfVertexCoords coords;
272 TEnfGroupName grpName;
273 TEntryList faceEntries;
274 TopoDS_Vertex vertex;
277 struct CompareEnfVertices
279 bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
281 if (e1->coords.size() && e2->coords.size())
282 return (e1->coords < e2->coords);
284 return (e1->geomEntry < e2->geomEntry);
290 // PreCad Face and Edge periodicity
291 struct TPreCadPeriodicity {
294 std::vector<std::string> theSourceVerticesEntries;
295 std::vector<std::string> theTargetVerticesEntries;
299 struct TEdgePeriodicity {
300 TEntry theFace1Entry;
301 TEntry theEdge1Entry;
302 TEntry theFace2Entry;
303 TEntry theEdge2Entry;
304 int edge_orientation;
307 // Vertex periodicity
308 struct TVertexPeriodicity {
309 TEntry theEdge1Entry;
310 TEntry theVertex1Entry;
311 TEntry theEdge2Entry;
312 TEntry theVertex2Entry;
315 typedef std::pair< TEntry, TEntry > TFacesPeriodicity;
317 // List of enforced vertices
318 typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
320 // Map Face Entry / List of enforced vertices
321 typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
323 // List of Face Entry with internal enforced vertices activated
324 typedef std::set< TEntry > TFaceEntryInternalVerticesList;
326 // Map Face Entry / List of coords
327 typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap;
329 // Map Face Entry / List of Vertex entry
330 typedef std::map< TEntry, TEntryList > TFaceEntryEnfVertexEntryListMap;
332 // Map Coords / Enforced vertex
333 typedef std::map< TEnfVertexCoords, TEnfVertex* > TCoordsEnfVertexMap;
335 // Map Vertex entry / Enforced vertex
336 typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
338 typedef std::map< TEnfGroupName, std::set<int> > TGroupNameNodeIDMap;
340 // Map Group Name / List of enforced vertices
341 typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
344 // Vector of pairs of entries
345 typedef std::vector< TPreCadPeriodicity > TPreCadPeriodicityVector;
346 typedef std::vector< TFacesPeriodicity > TFacesPeriodicityVector;
347 typedef std::vector< TEdgePeriodicity > TEdgesPeriodicityVector;
348 typedef std::vector< TVertexPeriodicity > TVerticesPeriodicityVector;
351 bool SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName,
352 double x = 0.0, double y = 0.0, double z = 0.0);
353 TEnfVertexList GetEnfVertexList(const TEntry& theFaceEntry) throw (std::invalid_argument);
354 TEnfVertexCoordsList GetEnfVertexCoordsList(const TEntry& theFaceEntry) throw (std::invalid_argument);
355 TEntryList GetEnfVertexEntryList (const TEntry& theFaceEntry) throw (std::invalid_argument);
356 TEnfVertex* GetEnfVertex(TEnfVertexCoords coords) throw (std::invalid_argument);
357 TEnfVertex* GetEnfVertex(const TEntry& theEnfVertexEntry) throw (std::invalid_argument);
358 void AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID);
359 std::set<int> GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument);
360 void RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument);
362 bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") throw (std::invalid_argument);
363 bool ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument);
365 void ClearAllEnforcedVertices();
367 const TFaceEntryEnfVertexListMap _GetAllEnforcedVerticesByFace() const { return _faceEntryEnfVertexListMap; }
368 const TEnfVertexList _GetAllEnforcedVertices() const { return _enfVertexList; }
370 const TFaceEntryCoordsListMap _GetAllCoordsByFace() const { return _faceEntryCoordsListMap; }
371 const TCoordsEnfVertexMap _GetAllEnforcedVerticesByCoords() const { return _coordsEnfVertexMap; }
373 const TFaceEntryEnfVertexEntryListMap _GetAllEnfVertexEntriesByFace() const { return _faceEntryEnfVertexEntryListMap; }
374 const TEnfVertexEntryEnfVertexMap _GetAllEnforcedVerticesByEnfVertexEntry() const { return _enfVertexEntryEnfVertexMap; }
377 // const TEnfVertexGroupNameMap _GetEnforcedVertexGroupNameMap() const { return _enfVertexGroupNameMap; }
381 * \brief Return the enforced vertices
383 static TFaceEntryEnfVertexListMap GetAllEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
384 static TEnfVertexList GetAllEnforcedVertices(const BLSURFPlugin_Hypothesis* hyp);
386 static TFaceEntryCoordsListMap GetAllCoordsByFace(const BLSURFPlugin_Hypothesis* hyp);
387 static TCoordsEnfVertexMap GetAllEnforcedVerticesByCoords(const BLSURFPlugin_Hypothesis* hyp);
389 static TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp);
390 static TEnfVertexEntryEnfVertexMap GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp);
393 * \brief Internal enforced vertices
395 void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
396 const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
397 static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
398 void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
399 const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
400 static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp );
402 // Enable internal enforced vertices on specific face if requested by user
403 // static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); }
404 // const TFaceEntryInternalVerticesList _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; }
405 // static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
406 // void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName);
407 // bool GetInternalEnforcedVertex(const TEntry& theFaceEntry);
409 static PhysicalMesh GetDefaultPhysicalMesh() { return PhysicalGlobalSize; }
410 static GeometricMesh GetDefaultGeometricMesh() { return GeometricalGlobalSize; }
411 static double GetDefaultPhySize(double diagonal, double bbSegmentation);
412 static double GetDefaultPhySize() { return undefinedDouble(); }
413 static bool GetDefaultPhySizeRel() { return false; }
414 static double GetDefaultMinSize(double diagonal);
415 static double GetDefaultMinSize() { return undefinedDouble(); }
416 static bool GetDefaultMinSizeRel() { return false; }
417 static double GetDefaultMaxSize(double diagonal);
418 static double GetDefaultMaxSize() { return undefinedDouble(); }
419 static bool GetDefaultMaxSizeRel() { return false; }
420 static bool GetDefaultUseGradation() { return true; }
421 static double GetDefaultGradation() { return 1.3; }
422 static bool GetDefaultUseVolumeGradation() { return false; }
423 static double GetDefaultVolumeGradation() { return 2; }
424 static bool GetDefaultQuadAllowed() { return false; }
425 static double GetDefaultAngleMesh() { return 8.0; }
427 static double GetDefaultChordalError(double diagonal);
428 static double GetDefaultChordalError() { return undefinedDouble(); }
429 static bool GetDefaultAnisotropic() { return false; }
430 static double GetDefaultAnisotropicRatio() { return 0.0; }
431 static bool GetDefaultRemoveTinyEdges() { return false; }
432 static double GetDefaultTinyEdgeLength(double diagonal);
433 static double GetDefaultTinyEdgeLength() { return undefinedDouble(); }
434 static bool GetDefaultOptimiseTinyEdges() { return false; }
435 static double GetDefaultTinyEdgeOptimisationLength(double diagonal);
436 static double GetDefaultTinyEdgeOptimisationLength() { return undefinedDouble(); }
437 static bool GetDefaultCorrectSurfaceIntersection() { return true; }
438 static double GetDefaultCorrectSurfaceIntersectionMaxCost() { return 15.; }
439 static bool GetDefaultBadElementRemoval() { return false; }
440 static double GetDefaultBadElementAspectRatio() {return 1000.0; }
441 static bool GetDefaultOptimizeMesh() { return true; }
442 static bool GetDefaultQuadraticMesh() { return false; }
444 static int GetDefaultVerbosity() { return 3; }
445 static Topology GetDefaultTopology() { return FromCAD; }
447 static bool GetDefaultPreCADMergeEdges() { return false; }
448 static bool GetDefaultPreCADRemoveTinyUVEdges() { return false; }
449 static bool GetDefaultPreCADRemoveDuplicateCADFaces() { return false; }
450 static bool GetDefaultPreCADProcess3DTopology() { return false; }
451 static bool GetDefaultPreCADDiscardInput() { return false; }
453 static TSizeMap GetDefaultSizeMap() { return TSizeMap();}
454 static TAttractorMap GetDefaultAttractorMap() { return TAttractorMap(); }
456 static TFaceEntryEnfVertexListMap GetDefaultFaceEntryEnfVertexListMap() { return TFaceEntryEnfVertexListMap(); }
457 static TEnfVertexList GetDefaultEnfVertexList() { return TEnfVertexList(); }
458 static TFaceEntryCoordsListMap GetDefaultFaceEntryCoordsListMap() { return TFaceEntryCoordsListMap(); }
459 static TCoordsEnfVertexMap GetDefaultCoordsEnfVertexMap() { return TCoordsEnfVertexMap(); }
460 static TFaceEntryEnfVertexEntryListMap GetDefaultFaceEntryEnfVertexEntryListMap() { return TFaceEntryEnfVertexEntryListMap(); }
461 static TEnfVertexEntryEnfVertexMap GetDefaultEnfVertexEntryEnfVertexMap() { return TEnfVertexEntryEnfVertexMap(); }
462 static TGroupNameNodeIDMap GetDefaultGroupNameNodeIDMap() { return TGroupNameNodeIDMap(); }
464 static bool GetDefaultInternalEnforcedVertex() { return false; }
467 static TGroupNameEnfVertexListMap GetDefaultGroupNameEnfVertexListMap() { return TGroupNameEnfVertexListMap(); }
468 static TEnfVertexGroupNameMap GetDefaultEnfVertexGroupNameMap() { return TEnfVertexGroupNameMap(); }
471 // const TPreCadPeriodicityEntriesVector _GetPreCadFacesPeriodicityEntries() const { return _preCadFacesPeriodicityEntriesVector; }
473 static TPreCadPeriodicityVector GetDefaultPreCadFacesPeriodicityVector() { return TPreCadPeriodicityVector(); }
474 const TPreCadPeriodicityVector _GetPreCadFacesPeriodicityVector() const { return _preCadFacesPeriodicityVector; }
475 static TPreCadPeriodicityVector GetPreCadFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
477 static TPreCadPeriodicityVector GetDefaultPreCadEdgesPeriodicityVector() { return TPreCadPeriodicityVector(); }
478 const TPreCadPeriodicityVector _GetPreCadEdgesPeriodicityVector() const { return _preCadEdgesPeriodicityVector; }
479 static TPreCadPeriodicityVector GetPreCadEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
481 static TFacesPeriodicityVector GetDefaultFacesPeriodicityVector() { return TFacesPeriodicityVector(); }
482 const TFacesPeriodicityVector _GetFacesPeriodicityVector() const { return _facesPeriodicityVector; }
483 static TFacesPeriodicityVector GetFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
485 static TEdgesPeriodicityVector GetDefaultEdgesPeriodicityVector() { return TEdgesPeriodicityVector(); }
486 const TEdgesPeriodicityVector _GetEdgesPeriodicityVector() const { return _edgesPeriodicityVector; }
487 static TEdgesPeriodicityVector GetEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
489 static TVerticesPeriodicityVector GetDefaultVerticesPeriodicityVector() { return TVerticesPeriodicityVector(); }
490 const TVerticesPeriodicityVector _GetVerticesPeriodicityVector() const { return _verticesPeriodicityVector; }
491 static TVerticesPeriodicityVector GetVerticesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
493 void ClearPreCadPeriodicityVectors();
495 void AddPreCadFacesPeriodicity(TEntry theFace1Entry, TEntry theFace2Entry,
496 std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
497 void AddPreCadEdgesPeriodicity(TEntry theEdge1Entry, TEntry theEdge2Entry,
498 std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
500 static double undefinedDouble() { return -1.0; }
502 typedef std::map< std::string, std::string > TOptionValues;
503 typedef std::set< std::string > TOptionNames;
505 void SetOptionValue(const std::string& optionName,
506 const std::string& optionValue) throw (std::invalid_argument);
507 void SetPreCADOptionValue(const std::string& optionName,
508 const std::string& optionValue) throw (std::invalid_argument);
509 std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const throw (std::invalid_argument);
510 std::string GetPreCADOptionValue(const std::string& optionName, bool* isDefault=0) const throw (std::invalid_argument);
511 void ClearOption(const std::string& optionName);
512 void ClearPreCADOption(const std::string& optionName);
513 TOptionValues GetOptionValues() const;
514 TOptionValues GetPreCADOptionValues() const;
515 const TOptionValues& GetCustomOptionValues() const { return _customOption2value; }
517 void AddOption(const std::string& optionName, const std::string& optionValue);
518 void AddPreCADOption(const std::string& optionName, const std::string& optionValue);
519 std::string GetOption(const std::string& optionName) const;
520 std::string GetPreCADOption(const std::string& optionName) const;
522 static bool ToBool(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
523 static double ToDbl(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
524 static int ToInt(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
527 * Sets the file for export resulting mesh in GMF format
529 // void SetGMFFile(const std::string& theFileName, bool isBinary);
530 void SetGMFFile(const std::string& theFileName);
531 std::string GetGMFFile() const { return _GMFFileName; }
532 static std::string GetDefaultGMFFile() { return "";}
533 // bool GetGMFFileMode() const { return _GMFFileMode; }
536 virtual std::ostream & SaveTo(std::ostream & save);
537 virtual std::istream & LoadFrom(std::istream & load);
538 friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp);
539 friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp);
542 * \brief Does nothing
543 * \param theMesh - the built mesh
544 * \param theShape - the geometry of interest
545 * \retval bool - always false
547 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
550 * \brief Initialize my parameter values by default parameters.
551 * \retval bool - true if parameter values have been successfully defined
553 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
557 PhysicalMesh _physicalMesh;
558 GeometricMesh _geometricMesh;
561 double _minSize, _maxSize;
562 bool _minSizeRel, _maxSizeRel;
565 bool _useVolumeGradation;
566 double _volumeGradation;
569 double _chordalError;
571 double _anisotropicRatio;
572 bool _removeTinyEdges;
573 double _tinyEdgeLength;
574 bool _optimiseTinyEdges;
575 double _tinyEdgeOptimisationLength;
576 bool _correctSurfaceIntersec;
577 double _corrSurfaceIntersCost;
578 bool _badElementRemoval;
579 double _badElementAspectRatio;
585 bool _preCADMergeEdges;
586 bool _preCADRemoveTinyUVEdges;
587 bool _preCADRemoveDuplicateCADFaces;
588 bool _preCADProcess3DTopology;
589 bool _preCADDiscardInput;
590 double _preCADEpsNano;
592 TOptionValues _option2value, _preCADoption2value, _customOption2value; // user defined values
593 TOptionValues _defaultOptionValues; // default values
594 TOptionNames _doubleOptions, _charOptions, _boolOptions; // to find a type of option
595 TOptionNames _preCADdoubleOptions, _preCADcharOptions;
598 TSizeMap _attractors;
599 TAttractorMap _classAttractors;
601 TParamsMap _attParams;
603 TFaceEntryEnfVertexListMap _faceEntryEnfVertexListMap;
604 TEnfVertexList _enfVertexList;
605 // maps to get "manual" enf vertex (through their coordinates)
606 TFaceEntryCoordsListMap _faceEntryCoordsListMap;
607 TCoordsEnfVertexMap _coordsEnfVertexMap;
608 // maps to get "geom" enf vertex (through their geom entries)
609 TFaceEntryEnfVertexEntryListMap _faceEntryEnfVertexEntryListMap;
610 TEnfVertexEntryEnfVertexMap _enfVertexEntryEnfVertexMap;
611 TGroupNameNodeIDMap _groupNameNodeIDMap;
613 // Enable internal enforced vertices on specific face if requested by user
614 // TFaceEntryInternalVerticesList _faceEntryInternalVerticesList;
615 bool _enforcedInternalVerticesAllFaces;
616 TEnfGroupName _enforcedInternalVerticesAllFacesGroup;
618 TPreCadPeriodicityVector _preCadFacesPeriodicityVector;
619 TPreCadPeriodicityVector _preCadEdgesPeriodicityVector;
621 TFacesPeriodicityVector _facesPeriodicityVector;
622 TEdgesPeriodicityVector _edgesPeriodicityVector;
623 TVerticesPeriodicityVector _verticesPeriodicityVector;
625 THyperPatchList _hyperPatchList;
627 // Called by SaveTo to store content of _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
628 void SavePreCADPeriodicity(std::ostream & save, const char* shapeType);
630 // Called by LoadFrom to fill _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
631 void LoadPreCADPeriodicity(std::istream & load, const char* shapeType);
633 // Called by LoadFrom to fill _facesPeriodicityVector
634 void LoadFacesPeriodicity(std::istream & load);
636 // Called by LoadFrom to fill _edgesPeriodicityVector
637 void LoadEdgesPeriodicity(std::istream & load);
639 // Called by LoadFrom to fill _verticesPeriodicityVector
640 void LoadVerticesPeriodicity(std::istream & load);
642 // Called by SaveTo to store content of _facesPeriodicityVector
643 void SaveFacesPeriodicity(std::ostream & save);
645 // Called by SaveTo to store content of _edgesPeriodicityVector
646 void SaveEdgesPeriodicity(std::ostream & save);
648 // Called by SaveTo to store content of _verticesPeriodicityVector
649 void SaveVerticesPeriodicity(std::ostream & save);
651 std::string _GMFFileName;
652 // bool _GMFFileMode;
654 // TSizeMap _customSizeMap;