Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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 //             & Aurelien ALLEAUME (DISTENE)
25 // Date      : 27/03/2006
26 // Project   : SALOME
27 // $Header$
28 //=============================================================================
29
30 #ifndef _BLSURFPlugin_Hypothesis_HXX_
31 #define _BLSURFPlugin_Hypothesis_HXX_
32
33 #include "SMESH_Hypothesis.hxx"
34 #include "Utils_SALOME_Exception.hxx"
35
36 //  Parameters for work of BLSURF
37
38 class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
39 {
40 public:
41   BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
42
43   enum Topology {
44     FromCAD,
45     Process,
46     Process2
47   };
48
49   enum PhysicalMesh {
50     DefaultSize,
51     PhysicalUserDefined
52   };
53
54   enum GeometricMesh {
55     DefaultGeom,
56     UserDefined
57   };
58
59   void SetTopology(Topology theTopology);
60   Topology GetTopology() const { return _topology; }
61
62   void SetPhysicalMesh(PhysicalMesh thePhysicalMesh);
63   PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; }
64
65   void SetPhySize(double thePhySize);
66   double GetPhySize() const { return _phySize; }
67
68   void SetGeometricMesh(GeometricMesh theGeometricMesh);
69   GeometricMesh GetGeometricMesh() const { return _geometricMesh; }
70
71   void SetAngleMeshS(double theAngle);
72   double GetAngleMeshS() const { return _angleMeshS; }
73
74   void SetGradation(double theGradation);
75   double GetGradation() const { return _gradation; }
76
77   void SetQuadAllowed(bool theVal);
78   bool GetQuadAllowed() const { return _quadAllowed; }
79
80   void SetDecimesh(bool theVal);
81   bool GetDecimesh() const { return _decimesh; }
82
83   static Topology GetDefaultTopology();
84   static PhysicalMesh GetDefaultPhysicalMesh();
85   static double GetDefaultPhySize();
86   static GeometricMesh GetDefaultGeometricMesh();
87   static double GetDefaultAngleMeshS();
88   static double GetDefaultGradation();
89   static bool GetDefaultQuadAllowed();
90   static bool GetDefaultDecimesh();
91
92   // Persistence
93   virtual ostream & SaveTo(ostream & save);
94   virtual istream & LoadFrom(istream & load);
95   friend ostream & operator <<(ostream & save, BLSURFPlugin_Hypothesis & hyp);
96   friend istream & operator >>(istream & load, BLSURFPlugin_Hypothesis & hyp);
97
98   /*!
99    * \brief Does nothing
100    * \param theMesh - the built mesh
101    * \param theShape - the geometry of interest
102    * \retval bool - always false
103    */
104   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
105
106 private:
107   Topology      _topology;
108   PhysicalMesh  _physicalMesh;
109   double        _phySize;
110   GeometricMesh _geometricMesh;
111   double        _angleMeshS;
112   double        _gradation;
113   bool          _quadAllowed;
114   bool          _decimesh;
115 };
116
117 #endif