Salome HOME
Merge from V6_main_20120808 08Aug12
[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 SetHexoticQuadrangles(bool theVal);
49   bool GetHexoticQuadrangles() const { return _hexoticQuadrangles; }
50
51   void SetHexoticIgnoreRidges(bool theVal);
52   bool GetHexoticIgnoreRidges() const { return _hexoticIgnoreRidges; }
53
54   void SetHexoticInvalidElements(bool theVal);
55   bool GetHexoticInvalidElements() const { return _hexoticInvalidElements; }
56    
57   void SetHexoticSharpAngleThreshold(int theVal);
58   int GetHexoticSharpAngleThreshold() const { return _hexoticSharpAngleThreshold; }
59    
60   void SetHexoticNbProc(int theVal);
61   int GetHexoticNbProc() const { return _hexoticNbProc; }
62   
63   void SetHexoticWorkingDirectory(const std::string& path);
64   std::string GetHexoticWorkingDirectory() const { return _hexoticWorkingDirectory; }
65
66   // the parameters default values 
67
68   static int GetDefaultHexesMinLevel();
69   static int GetDefaultHexesMaxLevel();
70   static bool GetDefaultHexoticQuadrangles();
71   static bool GetDefaultHexoticIgnoreRidges();
72   static bool GetDefaultHexoticInvalidElements();
73   static int GetDefaultHexoticSharpAngleThreshold();
74   static int GetDefaultHexoticNbProc();
75   static std::string GetDefaultHexoticWorkingDirectory();
76
77   // Persistence
78   virtual std::ostream& SaveTo(std::ostream& save);
79   virtual std::istream& LoadFrom(std::istream& load);
80   friend  std::ostream& operator <<(std::ostream& save, HexoticPlugin_Hypothesis& hyp);
81   friend  std::istream& operator >>(std::istream& load, HexoticPlugin_Hypothesis& hyp);
82
83   /*!
84    * \brief Does nothing
85    * \param theMesh - the built mesh
86    * \param theShape - the geometry of interest
87    * \retval bool - always false
88    */
89   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
90
91   /*!
92    * \brief Initialize my parameter values by default parameters.
93    *  \retval bool - true if parameter values have been successfully defined
94    */
95   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
96
97 private:
98   int  _hexesMinLevel;
99   int  _hexesMaxLevel;
100   bool _hexoticQuadrangles;
101   bool _hexoticIgnoreRidges;
102   bool _hexoticInvalidElements;
103   int  _hexoticSharpAngleThreshold;
104   int  _hexoticNbProc;
105   std::string _hexoticWorkingDirectory ;
106 };
107
108 #endif