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