Salome HOME
cd0f7be359f6456c7a2153e156b74986e4a4496d
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hypothesis.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File   : HexoticPlugin_Hypothesis.hxx
22 // Author : Lioka RAZAFINDRAZAKA (CEA)
23 // ---
24 //
25 #ifndef _HexoticPlugin_Hypothesis_HXX_
26 #define _HexoticPlugin_Hypothesis_HXX_
27
28 #include "HexoticPlugin_Defs.hxx"
29
30 #include "SMESH_Hypothesis.hxx"
31 #include "Utils_SALOME_Exception.hxx"
32
33 //  Parameters for work of Hexotic
34 //
35
36 class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis: public SMESH_Hypothesis
37 {
38 public:
39
40   HexoticPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
41
42   void SetHexesMinLevel(int theVal);
43   int GetHexesMinLevel() const { return _hexesMinLevel; }
44
45   void SetHexesMaxLevel(int theVal);
46   int GetHexesMaxLevel() const { return _hexesMaxLevel; }
47
48   void SetMinSize(double theVal);
49   double GetMinSize() const { return _minSize; }
50
51   void SetMaxSize(double theVal);
52   double GetMaxSize() const { return _maxSize; }
53
54   void SetHexoticIgnoreRidges(bool theVal);
55   bool GetHexoticIgnoreRidges() const { return _hexoticIgnoreRidges; }
56
57   void SetHexoticInvalidElements(bool theVal);
58   bool GetHexoticInvalidElements() const { return _hexoticInvalidElements; }
59    
60   void SetHexoticSharpAngleThreshold(double theVal);
61   double GetHexoticSharpAngleThreshold() const { return _hexoticSharpAngleThreshold; }
62    
63   void SetHexoticNbProc(int theVal);
64   int GetHexoticNbProc() const { return _hexoticNbProc; }
65   
66   void SetHexoticWorkingDirectory(const std::string& path);
67   std::string GetHexoticWorkingDirectory() const { return _hexoticWorkingDirectory; }
68
69   void SetHexoticSdMode(int theVal);
70   int GetHexoticSdMode() const { return _hexoticSdMode; }
71
72   void SetHexoticVerbosity(int theVal);
73   int GetHexoticVerbosity() const { return _hexoticVerbosity; }
74
75   void SetHexoticMaxMemory(int theVal);
76   int GetHexoticMaxMemory() const { return _hexoticMaxMemory; }
77
78   // the parameters default values 
79
80   static int GetDefaultHexesMinLevel();
81   static int GetDefaultHexesMaxLevel();
82   static double GetDefaultMinSize();
83   static double GetDefaultMaxSize();
84   static bool GetDefaultHexoticIgnoreRidges();
85   static bool GetDefaultHexoticInvalidElements();
86   static double GetDefaultHexoticSharpAngleThreshold();
87   static int GetDefaultHexoticNbProc();
88   static std::string GetDefaultHexoticWorkingDirectory();
89   static int GetDefaultHexoticSdMode();
90   static int GetDefaultHexoticVerbosity();
91   static int GetDefaultHexoticMaxMemory();
92
93   // Persistence
94   virtual std::ostream& SaveTo(std::ostream& save);
95   virtual std::istream& LoadFrom(std::istream& load);
96   friend  std::ostream& operator <<(std::ostream& save, HexoticPlugin_Hypothesis& hyp);
97   friend  std::istream& operator >>(std::istream& load, HexoticPlugin_Hypothesis& hyp);
98
99   /*!
100    * \brief Does nothing
101    * \param theMesh - the built mesh
102    * \param theShape - the geometry of interest
103    * \retval bool - always false
104    */
105   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
106
107   /*!
108    * \brief Initialize my parameter values by default parameters.
109    *  \retval bool - true if parameter values have been successfully defined
110    */
111   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
112
113 private:
114   int    _hexesMinLevel;
115   int    _hexesMaxLevel;
116   double _minSize;
117   double _maxSize;
118   bool   _hexoticIgnoreRidges;
119   bool   _hexoticInvalidElements;
120   double _hexoticSharpAngleThreshold;
121   int    _hexoticNbProc;
122   int    _hexoticSdMode;
123   int    _hexoticVerbosity;
124   int    _hexoticMaxMemory;
125   std::string _hexoticWorkingDirectory ;
126 };
127
128 #endif