Salome HOME
Merge from BR_V5_DEV 16Feb09
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPlugin_Hypothesis.hxx
1 //  Copyright (C) 2007-2008 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 // File   : GHS3DPRLPlugin_Hypothesis.hxx
21 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
22 // ---
23
24 #ifndef _GHS3DPRLPlugin_Hypothesis_HXX_
25 #define _GHS3DPRLPlugin_Hypothesis_HXX_
26
27 #include "SMESH_Hypothesis.hxx"
28 #include "Utils_SALOME_Exception.hxx"
29
30 //  Parameters for work of GHS3DPRL
31 //
32
33 class GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis
34 {
35 public:
36
37   GHS3DPRLPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
38
39   void                  SetMEDName(std::string theVal);
40   std::string           GetMEDName() const { return _MEDName; }
41
42   void                  SetNbPart(int theVal);
43   int                   GetNbPart() const { return _NbPart; }
44
45   void                  SetKeepFiles(bool theVal);
46   bool                  GetKeepFiles() const { return _KeepFiles; }
47
48   void                  SetBackground(bool theVal);
49   bool                  GetBackground() const { return _Background; }
50
51   void                  SetToMeshHoles(bool theVal);
52   bool                  GetToMeshHoles() const { return _ToMeshHoles; }
53
54   // the parameters default values
55
56   static std::string    GetDefaultMEDName();
57   static int            GetDefaultNbPart();
58   static bool           GetDefaultKeepFiles();
59   static bool           GetDefaultBackground();
60   static bool           GetDefaultToMeshHoles();
61
62   // Persistence
63   virtual std::ostream& SaveTo(std::ostream& save);
64   virtual std::istream& LoadFrom(std::istream& load);
65   friend std::ostream&  operator <<(std::ostream& save, GHS3DPRLPlugin_Hypothesis& hyp);
66   friend std::istream&  operator >>(std::istream& load, GHS3DPRLPlugin_Hypothesis& hyp);
67
68   /*!
69    * \brief Does nothing
70    * \param theMesh - the built mesh
71    * \param theShape - the geometry of interest
72    * \retval bool - always false
73    */
74   virtual bool          SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
75   /*!
76    * \brief Initialize my parameter values by default parameters.
77    *  \retval bool - true if parameter values have been successfully defined
78    */
79   virtual bool          SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
80
81 private:
82   int          _countSubMesh;
83   int          _countTotal;
84   int          _nodeRefNumber;
85
86   std::string  _MEDName;     // generic path/name of med files
87   int          _NbPart;      // number of partitions
88   bool         _KeepFiles;   // keep intermediates tepal files or not
89   bool         _Background;  // tepal in background
90   bool         _ToMeshHoles;
91 };
92
93 #endif