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