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, SMESH_Gen * gen, bool hasgeom);
63 GeometricalGlobalSize,
67 static const char* GetHypType(bool hasgeom)
68 { return hasgeom ? "MG-CADSurf Parameters" : "MG-CADSurf Parameters_NOGEOM"; }
70 TopoDS_Shape entryToShape(std::string entry);
72 void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
73 PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
75 void SetGeometricMesh(GeometricMesh theGeometricMesh);
76 GeometricMesh GetGeometricMesh() const { return _geometricMesh; }
78 void SetPhySize(double thePhySize, bool isRelative = false);
79 double GetPhySize() const { return _phySize; }
80 bool IsPhySizeRel() const { return _phySizeRel; }
82 void SetMinSize(double theMinSize, bool isRelative = false);
83 double GetMinSize() const { return _minSize; }
84 bool IsMinSizeRel() const { return _minSizeRel; }
86 void SetMaxSize(double theMaxSize, bool isRelative = false);
87 double GetMaxSize() const { return _maxSize; }
88 bool IsMaxSizeRel() const { return _maxSizeRel; }
90 void SetUseGradation(bool toUse);
91 bool GetUseGradation() const { return _useGradation; }
92 void SetGradation(double theGradation);
93 double GetGradation() const { return _gradation; }
95 void SetUseVolumeGradation(bool toUse);
96 bool GetUseVolumeGradation() const { return _useVolumeGradation; }
97 void SetVolumeGradation(double theGradation);
98 double GetVolumeGradation() const { return _volumeGradation; }
100 void SetQuadAllowed(bool theVal);
101 bool GetQuadAllowed() const { return _quadAllowed; }
103 void SetAngleMesh(double theAngle);
104 double GetAngleMesh() const { return _angleMesh; }
106 void SetChordalError(double theDistance);
107 double GetChordalError() const { return _chordalError; }
109 void SetAnisotropic(bool theVal);
110 bool GetAnisotropic() const { return _anisotropic; }
112 void SetAnisotropicRatio(double theVal);
113 double GetAnisotropicRatio() const { return _anisotropicRatio; }
115 void SetRemoveTinyEdges(bool theVal);
116 bool GetRemoveTinyEdges() const { return _removeTinyEdges; }
118 void SetTinyEdgeLength(double theVal);
119 double GetTinyEdgeLength() const { return _tinyEdgeLength; }
121 void SetOptimiseTinyEdges(bool theVal);
122 bool GetOptimiseTinyEdges() const { return _optimiseTinyEdges; }
124 void SetTinyEdgeOptimisationLength(double theVal);
125 double GetTinyEdgeOptimisationLength() const { return _tinyEdgeOptimisationLength; }
127 void SetCorrectSurfaceIntersection(bool theVal);
128 bool GetCorrectSurfaceIntersection() const { return _correctSurfaceIntersec; }
130 void SetCorrectSurfaceIntersectionMaxCost(double theVal);
131 double GetCorrectSurfaceIntersectionMaxCost() const { return _corrSurfaceIntersCost; }
133 void SetBadElementRemoval(bool theVal);
134 bool GetBadElementRemoval() const { return _badElementRemoval; }
136 void SetBadElementAspectRatio(double theVal);
137 double GetBadElementAspectRatio() const { return _badElementAspectRatio; }
139 void SetOptimizeMesh(bool theVal);
140 bool GetOptimizeMesh() const { return _optimizeMesh; }
142 void SetQuadraticMesh(bool theVal);
143 bool GetQuadraticMesh() const { return _quadraticMesh; }
145 void SetTopology(Topology theTopology);
146 Topology GetTopology() const { return _topology; }
148 void SetVerbosity(int theVal);
149 int GetVerbosity() const { return _verb; }
151 void ClearEntry(const std::string& entry, const char * attEntry = 0);
152 void ClearSizeMaps();
154 void SetEnforceCadEdgesSize( bool toEnforce );
155 bool GetEnforceCadEdgesSize();
157 void SetJacobianRectificationRespectGeometry( bool allowRectification );
158 bool GetJacobianRectificationRespectGeometry();
160 void SetUseDeprecatedPatchMesher( bool useDeprecatedPatchMesher );
161 bool GetUseDeprecatedPatchMesher();
163 void SetJacobianRectification( bool allowRectification );
164 bool GetJacobianRectification();
166 void SetMaxNumberOfPointsPerPatch( int nb ) throw (std::invalid_argument);
167 int GetMaxNumberOfPointsPerPatch();
169 void SetMaxNumberOfThreads( int nb ) throw (std::invalid_argument);
170 int GetMaxNumberOfThreads();
172 void SetRespectGeometry( bool toRespect );
173 bool GetRespectGeometry();
175 void SetTinyEdgesAvoidSurfaceIntersections( bool toAvoidIntersection );
176 bool GetTinyEdgesAvoidSurfaceIntersections();
178 void SetClosedGeometry( bool isClosed );
179 bool GetClosedGeometry();
181 void SetDebug( bool isDebug );
184 void SetPeriodicTolerance( double tol ) throw (std::invalid_argument);
185 double GetPeriodicTolerance();
187 void SetRequiredEntities( const std::string& howToTreat ) throw (std::invalid_argument);
188 std::string GetRequiredEntities();
190 void SetSewingTolerance( double tol ) throw (std::invalid_argument);
191 double GetSewingTolerance();
193 void SetTags( const std::string& howToTreat ) throw (std::invalid_argument);
194 std::string GetTags();
197 typedef std::set< int > THyperPatchTags;
198 typedef std::vector< THyperPatchTags > THyperPatchList;
200 void SetHyperPatches(const THyperPatchList& hpl);
201 const THyperPatchList& GetHyperPatches() const { return _hyperPatchList; }
202 static int GetHyperPatchTag( int faceTag, const BLSURFPlugin_Hypothesis* hyp, int* iPatch=0 );
204 void SetPreCADMergeEdges(bool theVal);
205 bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
207 void SetPreCADRemoveDuplicateCADFaces(bool theVal);
208 bool GetPreCADRemoveDuplicateCADFaces() const { return _preCADRemoveDuplicateCADFaces; }
210 void SetPreCADProcess3DTopology(bool theVal);
211 bool GetPreCADProcess3DTopology() const { return _preCADProcess3DTopology; }
213 void SetPreCADDiscardInput(bool theVal);
214 bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
216 static bool HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp);
218 typedef std::map<std::string,std::string> TSizeMap;
220 void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
221 std::string GetSizeMapEntry(const std::string& entry);
222 const TSizeMap& _GetSizeMapEntries() const { return _sizeMap; }
224 * \brief Return the size maps
226 static TSizeMap GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp);
229 void SetAttractorEntry(const std::string& entry,const std::string& attractor );
230 std::string GetAttractorEntry(const std::string& entry);
231 const TSizeMap& _GetAttractorEntries() const { return _attractors; };
233 * \brief Return the attractors
235 static TSizeMap GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
239 void SetCustomSizeMapEntry(const std::string& entry,const std::string& sizeMap );
240 std::string GetCustomSizeMapEntry(const std::string& entry);
241 void UnsetCustomSizeMap(const std::string& entry);
242 const TSizeMap& GetCustomSizeMapEntries() const { return _customSizeMap; }
245 typedef std::multimap< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
246 typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO ?? finir
248 void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
249 std::string GetClassAttractorEntry(const std::string& entry);
250 const TAttractorMap& _GetClassAttractorEntries() const { return _classAttractors; }
252 * \brief Return the attractors entries
254 static TAttractorMap GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
257 * To set/get/unset an enforced vertex
260 typedef std::string TEnfName;
262 typedef std::string TEntry;
264 typedef std::set<TEntry> TEntryList;
266 typedef std::string TEnfGroupName;
268 typedef std::vector<double> TEnfVertexCoords;
269 typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
275 TEnfVertexCoords coords;
276 TEnfGroupName grpName;
277 TEntryList faceEntries;
278 TopoDS_Vertex vertex;
281 struct CompareEnfVertices
283 bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
285 if (e1->coords.size() && e2->coords.size())
286 return (e1->coords < e2->coords);
288 return (e1->geomEntry < e2->geomEntry);
294 // PreCad Face and Edge periodicity
295 struct TPreCadPeriodicity {
298 std::vector<std::string> theSourceVerticesEntries;
299 std::vector<std::string> theTargetVerticesEntries;
303 struct TEdgePeriodicity {
304 TEntry theFace1Entry;
305 TEntry theEdge1Entry;
306 TEntry theFace2Entry;
307 TEntry theEdge2Entry;
308 int edge_orientation;
311 // Vertex periodicity
312 struct TVertexPeriodicity {
313 TEntry theEdge1Entry;
314 TEntry theVertex1Entry;
315 TEntry theEdge2Entry;
316 TEntry theVertex2Entry;
319 typedef std::pair< TEntry, TEntry > TFacesPeriodicity;
321 // List of enforced vertices
322 typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
324 // Map Face Entry / List of enforced vertices
325 typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
327 // List of Face Entry with internal enforced vertices activated
328 typedef std::set< TEntry > TFaceEntryInternalVerticesList;
330 // Map Face Entry / List of coords
331 typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap;
333 // Map Face Entry / List of Vertex entry
334 typedef std::map< TEntry, TEntryList > TFaceEntryEnfVertexEntryListMap;
336 // Map Coords / Enforced vertex
337 typedef std::map< TEnfVertexCoords, TEnfVertex* > TCoordsEnfVertexMap;
339 // Map Vertex entry / Enforced vertex
340 typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
342 typedef std::map< TEnfGroupName, std::set<int> > TGroupNameNodeIDMap;
344 // Map Group Name / List of enforced vertices
345 typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
348 // Vector of pairs of entries
349 typedef std::vector< TPreCadPeriodicity > TPreCadPeriodicityVector;
350 typedef std::vector< TFacesPeriodicity > TFacesPeriodicityVector;
351 typedef std::vector< TEdgePeriodicity > TEdgesPeriodicityVector;
352 typedef std::vector< TVertexPeriodicity > TVerticesPeriodicityVector;
355 bool SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName,
356 double x = 0.0, double y = 0.0, double z = 0.0);
357 TEnfVertexList GetEnfVertexList(const TEntry& theFaceEntry) throw (std::invalid_argument);
358 TEnfVertexCoordsList GetEnfVertexCoordsList(const TEntry& theFaceEntry) throw (std::invalid_argument);
359 TEntryList GetEnfVertexEntryList (const TEntry& theFaceEntry) throw (std::invalid_argument);
360 TEnfVertex* GetEnfVertex(TEnfVertexCoords coords) throw (std::invalid_argument);
361 TEnfVertex* GetEnfVertex(const TEntry& theEnfVertexEntry) throw (std::invalid_argument);
362 void AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID);
363 std::set<int> GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument);
364 void RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument);
366 bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") throw (std::invalid_argument);
367 bool ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument);
369 void ClearAllEnforcedVertices();
371 const TFaceEntryEnfVertexListMap _GetAllEnforcedVerticesByFace() const { return _faceEntryEnfVertexListMap; }
372 const TEnfVertexList _GetAllEnforcedVertices() const { return _enfVertexList; }
374 const TFaceEntryCoordsListMap _GetAllCoordsByFace() const { return _faceEntryCoordsListMap; }
375 const TCoordsEnfVertexMap _GetAllEnforcedVerticesByCoords() const { return _coordsEnfVertexMap; }
377 const TFaceEntryEnfVertexEntryListMap _GetAllEnfVertexEntriesByFace() const { return _faceEntryEnfVertexEntryListMap; }
378 const TEnfVertexEntryEnfVertexMap _GetAllEnforcedVerticesByEnfVertexEntry() const { return _enfVertexEntryEnfVertexMap; }
381 // const TEnfVertexGroupNameMap _GetEnforcedVertexGroupNameMap() const { return _enfVertexGroupNameMap; }
385 * \brief Return the enforced vertices
387 static TFaceEntryEnfVertexListMap GetAllEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
388 static TEnfVertexList GetAllEnforcedVertices(const BLSURFPlugin_Hypothesis* hyp);
390 static TFaceEntryCoordsListMap GetAllCoordsByFace(const BLSURFPlugin_Hypothesis* hyp);
391 static TCoordsEnfVertexMap GetAllEnforcedVerticesByCoords(const BLSURFPlugin_Hypothesis* hyp);
393 static TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp);
394 static TEnfVertexEntryEnfVertexMap GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp);
397 * \brief Internal enforced vertices
399 void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
400 const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
401 static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
402 void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
403 const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
404 static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp );
406 // Enable internal enforced vertices on specific face if requested by user
407 // static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); }
408 // const TFaceEntryInternalVerticesList _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; }
409 // static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
410 // void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName);
411 // bool GetInternalEnforcedVertex(const TEntry& theFaceEntry);
413 static PhysicalMesh GetDefaultPhysicalMesh() { return PhysicalGlobalSize; }
414 static GeometricMesh GetDefaultGeometricMesh() { return GeometricalGlobalSize; }
415 static double GetDefaultPhySize(double diagonal, double bbSegmentation);
416 static double GetDefaultPhySize() { return undefinedDouble(); }
417 static bool GetDefaultPhySizeRel() { return false; }
418 static double GetDefaultMinSize(double diagonal);
419 static double GetDefaultMinSize() { return undefinedDouble(); }
420 static bool GetDefaultMinSizeRel() { return false; }
421 static double GetDefaultMaxSize(double diagonal);
422 static double GetDefaultMaxSize() { return undefinedDouble(); }
423 static bool GetDefaultMaxSizeRel() { return false; }
424 static bool GetDefaultUseGradation() { return true; }
425 static double GetDefaultGradation() { return 1.3; }
426 static bool GetDefaultUseVolumeGradation() { return false; }
427 static double GetDefaultVolumeGradation() { return 2; }
428 static bool GetDefaultQuadAllowed() { return false; }
429 static double GetDefaultAngleMesh() { return 8.0; }
431 static double GetDefaultChordalError(double diagonal);
432 static double GetDefaultChordalError() { return undefinedDouble(); }
433 static bool GetDefaultAnisotropic() { return false; }
434 static double GetDefaultAnisotropicRatio() { return 0.0; }
435 static bool GetDefaultRemoveTinyEdges() { return false; }
436 static double GetDefaultTinyEdgeLength(double diagonal);
437 static double GetDefaultTinyEdgeLength() { return undefinedDouble(); }
438 static bool GetDefaultOptimiseTinyEdges() { return false; }
439 static double GetDefaultTinyEdgeOptimisationLength(double diagonal);
440 static double GetDefaultTinyEdgeOptimisationLength() { return undefinedDouble(); }
441 static bool GetDefaultCorrectSurfaceIntersection() { return true; }
442 static double GetDefaultCorrectSurfaceIntersectionMaxCost() { return 15.; }
443 static bool GetDefaultBadElementRemoval() { return false; }
444 static double GetDefaultBadElementAspectRatio() {return 1000.0; }
445 static bool GetDefaultOptimizeMesh() { return true; }
446 static bool GetDefaultQuadraticMesh() { return false; }
448 static int GetDefaultVerbosity() { return 3; }
449 static Topology GetDefaultTopology() { return FromCAD; }
451 static bool GetDefaultPreCADMergeEdges() { return false; }
452 static bool GetDefaultPreCADRemoveDuplicateCADFaces() { return false; }
453 static bool GetDefaultPreCADProcess3DTopology() { return false; }
454 static bool GetDefaultPreCADDiscardInput() { return false; }
456 static TSizeMap GetDefaultSizeMap() { return TSizeMap();}
457 static TAttractorMap GetDefaultAttractorMap() { return TAttractorMap(); }
459 static TFaceEntryEnfVertexListMap GetDefaultFaceEntryEnfVertexListMap() { return TFaceEntryEnfVertexListMap(); }
460 static TEnfVertexList GetDefaultEnfVertexList() { return TEnfVertexList(); }
461 static TFaceEntryCoordsListMap GetDefaultFaceEntryCoordsListMap() { return TFaceEntryCoordsListMap(); }
462 static TCoordsEnfVertexMap GetDefaultCoordsEnfVertexMap() { return TCoordsEnfVertexMap(); }
463 static TFaceEntryEnfVertexEntryListMap GetDefaultFaceEntryEnfVertexEntryListMap() { return TFaceEntryEnfVertexEntryListMap(); }
464 static TEnfVertexEntryEnfVertexMap GetDefaultEnfVertexEntryEnfVertexMap() { return TEnfVertexEntryEnfVertexMap(); }
465 static TGroupNameNodeIDMap GetDefaultGroupNameNodeIDMap() { return TGroupNameNodeIDMap(); }
467 static bool GetDefaultInternalEnforcedVertex() { return false; }
470 static TGroupNameEnfVertexListMap GetDefaultGroupNameEnfVertexListMap() { return TGroupNameEnfVertexListMap(); }
471 static TEnfVertexGroupNameMap GetDefaultEnfVertexGroupNameMap() { return TEnfVertexGroupNameMap(); }
474 // const TPreCadPeriodicityEntriesVector _GetPreCadFacesPeriodicityEntries() const { return _preCadFacesPeriodicityEntriesVector; }
476 static TPreCadPeriodicityVector GetDefaultPreCadFacesPeriodicityVector() { return TPreCadPeriodicityVector(); }
477 const TPreCadPeriodicityVector _GetPreCadFacesPeriodicityVector() const { return _preCadFacesPeriodicityVector; }
478 static TPreCadPeriodicityVector GetPreCadFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
480 static TPreCadPeriodicityVector GetDefaultPreCadEdgesPeriodicityVector() { return TPreCadPeriodicityVector(); }
481 const TPreCadPeriodicityVector _GetPreCadEdgesPeriodicityVector() const { return _preCadEdgesPeriodicityVector; }
482 static TPreCadPeriodicityVector GetPreCadEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
484 static TFacesPeriodicityVector GetDefaultFacesPeriodicityVector() { return TFacesPeriodicityVector(); }
485 const TFacesPeriodicityVector _GetFacesPeriodicityVector() const { return _facesPeriodicityVector; }
486 static TFacesPeriodicityVector GetFacesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
488 static TEdgesPeriodicityVector GetDefaultEdgesPeriodicityVector() { return TEdgesPeriodicityVector(); }
489 const TEdgesPeriodicityVector _GetEdgesPeriodicityVector() const { return _edgesPeriodicityVector; }
490 static TEdgesPeriodicityVector GetEdgesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
492 static TVerticesPeriodicityVector GetDefaultVerticesPeriodicityVector() { return TVerticesPeriodicityVector(); }
493 const TVerticesPeriodicityVector _GetVerticesPeriodicityVector() const { return _verticesPeriodicityVector; }
494 static TVerticesPeriodicityVector GetVerticesPeriodicityVector(const BLSURFPlugin_Hypothesis* hyp);
496 void ClearPreCadPeriodicityVectors();
498 void AddPreCadFacesPeriodicity(TEntry theFace1Entry, TEntry theFace2Entry,
499 std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
500 void AddPreCadEdgesPeriodicity(TEntry theEdge1Entry, TEntry theEdge2Entry,
501 std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
503 static double undefinedDouble() { return -1.0; }
505 typedef std::map< std::string, std::string > TOptionValues;
506 typedef std::set< std::string > TOptionNames;
508 void SetOptionValue(const std::string& optionName,
509 const std::string& optionValue) throw (std::invalid_argument);
510 void SetPreCADOptionValue(const std::string& optionName,
511 const std::string& optionValue) throw (std::invalid_argument);
512 std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const throw (std::invalid_argument);
513 std::string GetPreCADOptionValue(const std::string& optionName, bool* isDefault=0) const throw (std::invalid_argument);
514 void ClearOption(const std::string& optionName);
515 void ClearPreCADOption(const std::string& optionName);
516 TOptionValues GetOptionValues() const;
517 TOptionValues GetPreCADOptionValues() const;
518 const TOptionValues& GetCustomOptionValues() const { return _customOption2value; }
520 void AddOption(const std::string& optionName, const std::string& optionValue);
521 void AddPreCADOption(const std::string& optionName, const std::string& optionValue);
522 std::string GetOption(const std::string& optionName) const;
523 std::string GetPreCADOption(const std::string& optionName) const;
525 static bool ToBool(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
526 static double ToDbl(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
527 static int ToInt(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
530 * Sets the file for export resulting mesh in GMF format
532 // void SetGMFFile(const std::string& theFileName, bool isBinary);
533 void SetGMFFile(const std::string& theFileName);
534 std::string GetGMFFile() const { return _GMFFileName; }
535 static std::string GetDefaultGMFFile() { return "";}
536 // bool GetGMFFileMode() const { return _GMFFileMode; }
539 virtual std::ostream & SaveTo(std::ostream & save);
540 virtual std::istream & LoadFrom(std::istream & load);
541 friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp);
542 friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp);
545 * \brief Does nothing
546 * \param theMesh - the built mesh
547 * \param theShape - the geometry of interest
548 * \retval bool - always false
550 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
553 * \brief Initialize my parameter values by default parameters.
554 * \retval bool - true if parameter values have been successfully defined
556 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
560 PhysicalMesh _physicalMesh;
561 GeometricMesh _geometricMesh;
564 double _minSize, _maxSize;
565 bool _minSizeRel, _maxSizeRel;
568 bool _useVolumeGradation;
569 double _volumeGradation;
572 double _chordalError;
574 double _anisotropicRatio;
575 bool _removeTinyEdges;
576 double _tinyEdgeLength;
577 bool _optimiseTinyEdges;
578 double _tinyEdgeOptimisationLength;
579 bool _correctSurfaceIntersec;
580 double _corrSurfaceIntersCost;
581 bool _badElementRemoval;
582 double _badElementAspectRatio;
588 bool _preCADMergeEdges;
589 bool _preCADRemoveDuplicateCADFaces;
590 bool _preCADProcess3DTopology;
591 bool _preCADDiscardInput;
592 double _preCADEpsNano;
594 TOptionValues _option2value, _preCADoption2value, _customOption2value; // user defined values
595 TOptionValues _defaultOptionValues; // default values
596 TOptionNames _doubleOptions, _charOptions, _boolOptions; // to find a type of option
597 TOptionNames _preCADdoubleOptions, _preCADcharOptions;
600 TSizeMap _attractors;
601 TAttractorMap _classAttractors;
603 TParamsMap _attParams;
605 TFaceEntryEnfVertexListMap _faceEntryEnfVertexListMap;
606 TEnfVertexList _enfVertexList;
607 // maps to get "manual" enf vertex (through their coordinates)
608 TFaceEntryCoordsListMap _faceEntryCoordsListMap;
609 TCoordsEnfVertexMap _coordsEnfVertexMap;
610 // maps to get "geom" enf vertex (through their geom entries)
611 TFaceEntryEnfVertexEntryListMap _faceEntryEnfVertexEntryListMap;
612 TEnfVertexEntryEnfVertexMap _enfVertexEntryEnfVertexMap;
613 TGroupNameNodeIDMap _groupNameNodeIDMap;
615 // Enable internal enforced vertices on specific face if requested by user
616 // TFaceEntryInternalVerticesList _faceEntryInternalVerticesList;
617 bool _enforcedInternalVerticesAllFaces;
618 TEnfGroupName _enforcedInternalVerticesAllFacesGroup;
620 TPreCadPeriodicityVector _preCadFacesPeriodicityVector;
621 TPreCadPeriodicityVector _preCadEdgesPeriodicityVector;
623 TFacesPeriodicityVector _facesPeriodicityVector;
624 TEdgesPeriodicityVector _edgesPeriodicityVector;
625 TVerticesPeriodicityVector _verticesPeriodicityVector;
627 THyperPatchList _hyperPatchList;
629 // Called by SaveTo to store content of _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
630 void SavePreCADPeriodicity(std::ostream & save, const char* shapeType);
632 // Called by LoadFrom to fill _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
633 void LoadPreCADPeriodicity(std::istream & load, const char* shapeType);
635 // Called by LoadFrom to fill _facesPeriodicityVector
636 void LoadFacesPeriodicity(std::istream & load);
638 // Called by LoadFrom to fill _edgesPeriodicityVector
639 void LoadEdgesPeriodicity(std::istream & load);
641 // Called by LoadFrom to fill _verticesPeriodicityVector
642 void LoadVerticesPeriodicity(std::istream & load);
644 // Called by SaveTo to store content of _facesPeriodicityVector
645 void SaveFacesPeriodicity(std::ostream & save);
647 // Called by SaveTo to store content of _edgesPeriodicityVector
648 void SaveEdgesPeriodicity(std::ostream & save);
650 // Called by SaveTo to store content of _verticesPeriodicityVector
651 void SaveVerticesPeriodicity(std::ostream & save);
653 std::string _GMFFileName;
654 // bool _GMFFileMode;
656 // TSizeMap _customSizeMap;