Salome HOME
Copyrights update 2015.
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis.hxx
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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   : GHS3DPRLPlugin_Hypothesis.hxx
22 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
23 // ---
24 //
25 #ifndef _GHS3DPRLPlugin_Hypothesis_HXX_
26 #define _GHS3DPRLPlugin_Hypothesis_HXX_
27
28 #include "GHS3DPRLPlugin_Defs.hxx"
29
30 #include "SMESH_Hypothesis.hxx"
31 #include "Utils_SALOME_Exception.hxx"
32
33 //  Parameters for work of GHS3DPRL
34 //
35
36 class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis
37 {
38 public:
39
40   GHS3DPRLPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
41
42   static const char* GetHypType() { return "MG-Tetra Parallel Parameters"; }
43
44   void                  SetMEDName(std::string theVal);
45   std::string           GetMEDName() const { return _MEDName; }
46
47   void                  SetNbPart(int theVal);
48   int                   GetNbPart() const { return _NbPart; }
49
50   void                  SetKeepFiles(bool theVal);
51   bool                  GetKeepFiles() const { return _KeepFiles; }
52
53   void                  SetBackground(bool theVal);
54   bool                  GetBackground() const { return _Background; }
55   
56   //ToMergeSubdomains ToTagSubdomains ToOutputInterfaces ToDiscardSubdomains
57   void                  SetToMergeSubdomains(bool theVal);
58   bool                  GetToMergeSubdomains() const { return _ToMergeSubdomains; }
59   
60   void                  SetToTagSubdomains(bool theVal);
61   bool                  GetToTagSubdomains() const { return _ToTagSubdomains; }
62   
63   void                  SetToOutputInterfaces(bool theVal);
64   bool                  GetToOutputInterfaces() const { return _ToOutputInterfaces; }
65   
66   void                  SetToDiscardSubdomains(bool theVal);
67   bool                  GetToDiscardSubdomains() const { return _ToDiscardSubdomains; }
68
69   // the parameters default values
70
71   static std::string    GetDefaultMEDName();
72   static int            GetDefaultNbPart();
73   static bool           GetDefaultKeepFiles();
74   static bool           GetDefaultBackground();
75   static bool           GetDefaultToMergeSubdomains();
76   static bool           GetDefaultToTagSubdomains();
77   static bool           GetDefaultToOutputInterfaces();
78   static bool           GetDefaultToDiscardSubdomains();
79
80   // Persistence
81   virtual std::ostream& SaveTo(std::ostream& save);
82   virtual std::istream& LoadFrom(std::istream& load);
83   friend std::ostream&  operator <<(std::ostream& save, GHS3DPRLPlugin_Hypothesis& hyp);
84   friend std::istream&  operator >>(std::istream& load, GHS3DPRLPlugin_Hypothesis& hyp);
85
86   /*!
87    * \brief Does nothing
88    * \param theMesh - the built mesh
89    * \param theShape - the geometry of interest
90    * \retval bool - always false
91    */
92   virtual bool          SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
93   /*!
94    * \brief Initialize my parameter values by default parameters.
95    *  \retval bool - true if parameter values have been successfully defined
96    */
97   virtual bool          SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
98
99 private:
100   int          _countSubMesh;
101   int          _countTotal;
102   int          _nodeRefNumber;
103
104   std::string  _MEDName;     // generic path/name of med files
105   int          _NbPart;      // number of partitions
106   bool         _KeepFiles;   // keep intermediates tepal files or not
107   bool         _Background;  // tepal in background
108   bool         _ToMergeSubdomains;
109   bool         _ToTagSubdomains;
110   bool         _ToOutputInterfaces;
111   bool         _ToDiscardSubdomains;
112   };
113
114 #endif