1 // Copyright (C) 2012-2013 ALNEOS
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.alneos.com/ or email : contact@alneos.fr
19 #ifndef _GMSHPlugin_Hypothesis_HXX_
20 #define _GMSHPlugin_Hypothesis_HXX_
22 #include "GMSHPlugin_Defs.hxx"
24 #include "SMESH_Hypothesis.hxx"
25 #include "Utils_SALOME_Exception.hxx"
29 // Parameters for work of GMSH
34 class GMSHPLUGIN_EXPORT GMSHPlugin_Hypothesis: public SMESH_Hypothesis
38 GMSHPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
49 void Set2DAlgo(Algo2D the2DAlgo);
50 Algo2D Get2DAlgo() const { return _algo2d; }
61 void Set3DAlgo(Algo3D the3DAlgo);
62 Algo3D Get3DAlgo() const { return _algo3d; }
70 void SetRecomb2DAlgo(Recomb2DAlgo theRecomb2DAlgo);
71 Recomb2DAlgo GetRecomb2DAlgo() const { return _recomb2DAlgo; }
73 void SetRecombineAll(bool theRecombineAll);
74 bool GetRecombineAll() const { return _recombineAll; }
83 void SetSubdivAlgo(SubdivAlgo theSubdivAlgo);
84 SubdivAlgo GetSubdivAlgo() const { return _subdivAlgo; }
93 void SetRemeshAlgo(RemeshAlgo theRemeshAlgo);
94 RemeshAlgo GetRemeshAlgo() const { return _remeshAlgo; }
103 void SetRemeshPara(RemeshPara theRemeshPara);
104 RemeshPara GetRemeshPara() const { return _remeshPara; }
106 void SetSmouthSteps(double theSmouthSteps);
107 double GetSmouthSteps() const { return _smouthSteps; }
109 void SetSizeFactor(double theSizeFactor);
110 double GetSizeFactor() const { return _sizeFactor; }
112 void SetUseIncomplElem(bool theUseIncomplElem);
113 bool GetUseIncomplElem() const { return _useIncomplElem; }
115 void SetMaxSize(double theSize);
116 double GetMaxSize() const { return _maxSize; }
118 void SetMinSize(double theSize);
119 double GetMinSize() const { return _minSize; }
121 void SetSecondOrder(bool theVal);
122 bool GetSecondOrder() const { return _secondOrder; }
124 void SetIs2d(bool theIs2d);
125 bool GetIs2d() const { return _is2d; }
127 typedef std::set<std::string> TCompound;
128 void SetCompoundOnEntry(const std::string& entry);
129 const TCompound& GetCompoundOnEntries() const { return _compounds; }
130 void UnsetCompoundOnEntry(const std::string& entry);
133 virtual ostream & SaveTo(ostream & save);
134 virtual istream & LoadFrom(istream & load);
135 friend GMSHPLUGIN_EXPORT ostream & operator <<(ostream & save, GMSHPlugin_Hypothesis & hyp);
136 friend GMSHPLUGIN_EXPORT istream & operator >>(istream & load, GMSHPlugin_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);
155 Recomb2DAlgo _recomb2DAlgo;
157 SubdivAlgo _subdivAlgo;
158 RemeshAlgo _remeshAlgo;
159 RemeshPara _remeshPara;
162 double _minSize, _maxSize;
163 bool _secondOrder, _useIncomplElem;
165 TCompound _compounds;