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; }
99 static Topology GetDefaultTopology();
100 static PhysicalMesh GetDefaultPhysicalMesh();
101 static double GetDefaultPhySize();
102 static double GetDefaultMaxSize();
103 static double GetDefaultMinSize();
104 static GeometricMesh GetDefaultGeometricMesh();
105 static double GetDefaultAngleMeshS();
106 static double GetDefaultAngleMeshC() { return GetDefaultAngleMeshS(); }
107 static double GetDefaultGradation();
108 static bool GetDefaultQuadAllowed();
109 static bool GetDefaultDecimesh();
110 static int GetDefaultVerbosity() { return 10; }
112 static double undefinedDouble() { return -1.0; }
114 typedef std::map< std::string, std::string > TOptionValues;
115 typedef std::set< std::string > TOptionNames;
117 void SetOptionValue(const std::string& optionName,
118 const std::string& optionValue) throw (std::invalid_argument);
119 std::string GetOptionValue(const std::string& optionName) throw (std::invalid_argument);
120 void ClearOption(const std::string& optionName);
121 const TOptionValues& GetOptionValues() const { return _option2value; }
124 virtual std::ostream & SaveTo(std::ostream & save);
125 virtual std::istream & LoadFrom(std::istream & load);
126 friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp);
127 friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp);
130 * \brief Does nothing
131 * \param theMesh - the built mesh
132 * \param theShape - the geometry of interest
133 * \retval bool - always false
135 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
138 * \brief Initialize my parameter values by default parameters.
139 * \retval bool - true if parameter values have been successfully defined
141 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
145 PhysicalMesh _physicalMesh;
146 double _phySize, _phyMin, _phyMax;
147 GeometricMesh _geometricMesh;
148 double _angleMeshS, _angleMeshC, _hgeoMin, _hgeoMax;
153 TOptionValues _option2value;
154 TOptionNames _doubleOptions, _charOptions;