Salome HOME
d880c50081c5f9a7dcd368deb0c72873e837da46
[modules/smesh.git] / src / StdMeshers / StdMeshers_QuadrangleParams.hxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
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 //  SMESH SMESH : implementaion of SMESH idl descriptions
20 //  File   : StdMeshers_QuadrangleParams.hxx
21 //  Author : Sergey KUUL, OCC
22 //  Module : SMESH
23
24 #ifndef _SMESH_QUADRANGLEPARAMS_HXX_
25 #define _SMESH_QUADRANGLEPARAMS_HXX_
26
27 #include "SMESH_StdMeshers.hxx"
28
29 #include "SMESH_Hypothesis.hxx"
30 #include "Utils_SALOME_Exception.hxx"
31
32 enum StdMeshers_QuadType
33   {
34     QUAD_STANDARD,
35     QUAD_TRIANGLE_PREF,
36     QUAD_QUADRANGLE_PREF,
37     QUAD_QUADRANGLE_PREF_REVERSED,
38     QUAD_REDUCED,
39     QUAD_NB_TYPES
40   };
41
42 class STDMESHERS_EXPORT StdMeshers_QuadrangleParams:
43   public SMESH_Hypothesis
44 {
45 public:
46   StdMeshers_QuadrangleParams(int hypId, int studyId, SMESH_Gen* gen);
47   virtual ~StdMeshers_QuadrangleParams();
48
49   void SetTriaVertex (int id);
50   int GetTriaVertex() const { return _triaVertexID; }
51
52   void SetObjectEntry (const char* entry) { _objEntry = entry; }
53   const char* GetObjectEntry() { return _objEntry.c_str(); }
54
55   void SetQuadType (StdMeshers_QuadType type);
56   StdMeshers_QuadType GetQuadType() const { return _quadType; }
57
58   virtual std::ostream & SaveTo(std::ostream & save);
59   virtual std::istream & LoadFrom(std::istream & load);
60   friend std::ostream& operator << (std::ostream & save,
61                                     StdMeshers_QuadrangleParams & hyp);
62   friend std::istream& operator >> (std::istream & load,
63                                     StdMeshers_QuadrangleParams & hyp);
64
65   /*!
66    * \brief Initialize start and end length by the mesh built on the geometry
67     * \param theMesh - the built mesh
68     * \param theShape - the geometry of interest
69     * \retval bool - true if parameter values have been successfully defined
70    */
71   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh,
72                                    const TopoDS_Shape& theShape);
73
74   /*!
75    * \brief Initialize my parameter values by default parameters.
76    *  \retval bool - true if parameter values have been successfully defined
77    */
78   virtual bool SetParametersByDefaults(const TDefaults& dflts,
79                                        const SMESH_Mesh* theMesh=0);
80
81 protected:
82   int                 _triaVertexID;
83   std::string         _objEntry;
84   StdMeshers_QuadType _quadType;
85 };
86
87 #endif