]> SALOME platform Git repositories - plugins/netgenplugin.git/blob - src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx
Salome HOME
Win32 Porting.
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis.hxx
1 //  NETGENPlugin : C++ implementation
2 //
3 //  Copyright (C) 2006  OPEN CASCADE, CEA/DEN, EDF R&D
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 //
22 // File      : NETGENPlugin_Hypothesis.hxx
23 // Author    : Michael Sazonov (OCN)
24 // Date      : 27/03/2006
25 // Project   : SALOME
26 // $Header$
27 //=============================================================================
28
29 #ifndef _NETGENPlugin_Hypothesis_HXX_
30 #define _NETGENPlugin_Hypothesis_HXX_
31
32 #include "NETGENPlugin_Defs.hxx"
33
34 #include "SMESH_Hypothesis.hxx"
35 #include "Utils_SALOME_Exception.hxx"
36
37 //  Parameters for work of NETGEN
38 //
39
40 class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis: public SMESH_Hypothesis
41 {
42 public:
43
44   NETGENPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
45
46   void SetMaxSize(double theSize);
47   double GetMaxSize() const { return _maxSize; }
48
49   void SetSecondOrder(bool theVal);
50   bool GetSecondOrder() const { return _secondOrder; }
51
52   void SetOptimize(bool theVal);
53   bool GetOptimize() const { return _optimize; }
54
55   enum Fineness
56   {
57     VeryCoarse,
58     Coarse,
59     Moderate,
60     Fine,
61     VeryFine,
62     UserDefined
63   };
64
65   void SetFineness(Fineness theFineness);
66   Fineness GetFineness() const { return _fineness; }
67
68   // the following parameters are controlled by Fineness
69
70   void SetGrowthRate(double theRate);
71   double GetGrowthRate() const { return _growthRate; }
72
73   void SetNbSegPerEdge(double theVal);
74   double GetNbSegPerEdge() const { return _nbSegPerEdge; }
75
76   void SetNbSegPerRadius(double theVal);
77   double GetNbSegPerRadius() const { return _nbSegPerRadius; }
78
79   // the default values (taken from NETGEN 4.5 sources)
80
81   static double GetDefaultMaxSize();
82   static Fineness GetDefaultFineness();
83   static double GetDefaultGrowthRate();
84   static double GetDefaultNbSegPerEdge();
85   static double GetDefaultNbSegPerRadius();
86   static bool GetDefaultSecondOrder();
87   static bool GetDefaultOptimize();
88
89   // Persistence
90   virtual std::ostream & SaveTo(std::ostream & save);
91   virtual std::istream & LoadFrom(std::istream & load);
92   friend NETGENPLUGIN_EXPORT std::ostream & operator <<(std::ostream & save, NETGENPlugin_Hypothesis & hyp);
93   friend NETGENPLUGIN_EXPORT std::istream & operator >>(std::istream & load, NETGENPlugin_Hypothesis & hyp);
94
95   /*!
96    * \brief Does nothing
97    * \param theMesh - the built mesh
98    * \param theShape - the geometry of interest
99    * \retval bool - always false
100    */
101   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
102
103 private:
104   double        _maxSize;
105   double        _growthRate;
106   double        _nbSegPerEdge;
107   double        _nbSegPerRadius;
108   Fineness      _fineness;
109   bool          _secondOrder;
110   bool          _optimize;
111 };
112
113 #endif