1 // Copyright (C) 2007-2008 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.
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
20 // File : BLSURFPlugin_Hypothesis.hxx
21 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
22 // & Aurelien ALLEAUME (DISTENE)
25 #ifndef _BLSURFPlugin_Hypothesis_HXX_
26 #define _BLSURFPlugin_Hypothesis_HXX_
28 #include "SMESH_Hypothesis.hxx"
34 // Parameters for work of BLSURF
36 class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
39 BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
57 void SetTopology(Topology theTopology);
58 Topology GetTopology() const { return _topology; }
60 void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
61 PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
63 void SetPhySize(double thePhySize);
64 double GetPhySize() const { return _phySize; }
66 void SetPhyMin(double theMinSize);
67 double GetPhyMin() const { return _phyMin; }
69 void SetPhyMax(double theMaxSize);
70 double GetPhyMax() const { return _phyMax; }
72 void SetGeometricMesh(GeometricMesh theGeometricMesh);
73 GeometricMesh GetGeometricMesh() const { return _geometricMesh; }
75 void SetAngleMeshS(double theAngle);
76 double GetAngleMeshS() const { return _angleMeshS; }
78 void SetAngleMeshC(double theAngle);
79 double GetAngleMeshC() const { return _angleMeshC; }
81 void SetGeoMin(double theMinSize);
82 double GetGeoMin() const { return _hgeoMin; }
84 void SetGeoMax(double theMaxSize);
85 double GetGeoMax() const { return _hgeoMax; }
87 void SetGradation(double theGradation);
88 double GetGradation() const { return _gradation; }
90 void SetQuadAllowed(bool theVal);
91 bool GetQuadAllowed() const { return _quadAllowed; }
93 void SetDecimesh(bool theVal);
94 bool GetDecimesh() const { return _decimesh; }
96 void SetVerbosity(int theVal);
97 int GetVerbosity() const { return _verb; }
100 typedef std::map<std::string,std::string> TSizeMap;
101 void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
102 std::string GetSizeMapEntry(const std::string& entry);
103 void ClearEntry(const std::string& entry);
104 void ClearSizeMaps();
106 const TSizeMap& GetSizeMapEntries() const { return _sizeMap; }
108 static Topology GetDefaultTopology();
109 static PhysicalMesh GetDefaultPhysicalMesh();
110 static double GetDefaultPhySize();
111 static double GetDefaultMaxSize();
112 static double GetDefaultMinSize();
113 static GeometricMesh GetDefaultGeometricMesh();
114 static double GetDefaultAngleMeshS();
115 static double GetDefaultAngleMeshC() { return GetDefaultAngleMeshS(); }
116 static double GetDefaultGradation();
117 static bool GetDefaultQuadAllowed();
118 static bool GetDefaultDecimesh();
119 static int GetDefaultVerbosity() { return 10; }
121 static double undefinedDouble() { return -1.0; }
123 typedef std::map< std::string, std::string > TOptionValues;
124 typedef std::set< std::string > TOptionNames;
126 void SetOptionValue(const std::string& optionName,
127 const std::string& optionValue) throw (std::invalid_argument);
128 std::string GetOptionValue(const std::string& optionName) throw (std::invalid_argument);
129 void ClearOption(const std::string& optionName);
130 const TOptionValues& GetOptionValues() const { return _option2value; }
133 virtual std::ostream & SaveTo(std::ostream & save);
134 virtual std::istream & LoadFrom(std::istream & load);
135 friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp);
136 friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp);
139 * \brief Does nothing
140 * \param theMesh - the built mesh
141 * \param theShape - the geometry of interest
142 * \retval bool - always false
144 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
147 * \brief Initialize my parameter values by default parameters.
148 * \retval bool - true if parameter values have been successfully defined
150 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
154 PhysicalMesh _physicalMesh;
155 double _phySize, _phyMin, _phyMax;
156 GeometricMesh _geometricMesh;
157 double _angleMeshS, _angleMeshC, _hgeoMin, _hgeoMax;
162 TOptionValues _option2value;
163 TOptionNames _doubleOptions, _charOptions;