Salome HOME
Import a new plugin, sent by Stephane LIAUZU
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis.hxx
1 //  BLSURFPlugin : 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
20 //
21 //
22 // File      : BLSURFPlugin_Hypothesis.hxx
23 // Authors   : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
24 // Date      : 27/03/2006
25 // Project   : SALOME
26 // $Header$
27 //=============================================================================
28
29 #ifndef _BLSURFPlugin_Hypothesis_HXX_
30 #define _BLSURFPlugin_Hypothesis_HXX_
31
32 #include "SMESH_Hypothesis.hxx"
33 #include "Utils_SALOME_Exception.hxx"
34
35 //  Parameters for work of BLSURF
36
37 class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
38 {
39 public:
40   BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
41
42   enum PhysicalMesh {
43     DefaultSize,
44     PhysicalUserDefined
45   };
46
47   enum GeometricMesh {
48     DefaultGeom,
49     UserDefined
50   };
51
52   void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
53   PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
54
55   void SetPhySize(double thePhySize);
56   double GetPhySize() const { return _phySize; }
57
58   void SetGeometricMesh(GeometricMesh theGeometricMesh);
59   GeometricMesh GetGeometricMesh() const { return _geometricMesh; }
60
61   void SetAngleMeshS(double theAngle);
62   double GetAngleMeshS() const { return _angleMeshS; }
63
64   void SetGradation(double theGradation);
65   double GetGradation() const { return _gradation; }
66
67   void SetQuadAllowed(bool theVal);
68   bool GetQuadAllowed() const { return _quadAllowed; }
69
70   void SetDecimesh(bool theVal);
71   bool GetDecimesh() const { return _decimesh; }
72
73   static PhysicalMesh GetDefaultPhysicalMesh();
74   static double GetDefaultPhySize();
75   static GeometricMesh GetDefaultGeometricMesh();
76   static double GetDefaultAngleMeshS();
77   static double GetDefaultGradation();
78   static bool GetDefaultQuadAllowed();
79   static bool GetDefaultDecimesh();
80
81   // Persistence
82   virtual ostream & SaveTo(ostream & save);
83   virtual istream & LoadFrom(istream & load);
84   friend ostream & operator <<(ostream & save, BLSURFPlugin_Hypothesis & hyp);
85   friend istream & operator >>(istream & load, BLSURFPlugin_Hypothesis & hyp);
86
87   /*!
88    * \brief Does nothing
89    * \param theMesh - the built mesh
90    * \param theShape - the geometry of interest
91    * \retval bool - always false
92    */
93   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
94
95 private:
96   PhysicalMesh  _physicalMesh;
97   double        _phySize;
98   GeometricMesh _geometricMesh;
99   double        _angleMeshS;
100   double        _gradation;
101   bool          _quadAllowed;
102   bool          _decimesh;
103 };
104
105 #endif