Salome HOME
SALOME PAL V1_4_1
[modules/smesh.git] / src / StdMeshers / StdMeshers_Quadrangle_2D.hxx
1 //  SMESH SMESH : implementaion of SMESH idl descriptions
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : StdMeshers_Quadrangle_2D.hxx
25 //           Moved here from SMESH_Quadrangle_2D.hxx
26 //  Author : Paul RASCLE, EDF
27 //  Module : SMESH
28 //  $Header$
29
30 #ifndef _SMESH_QUADRANGLE_2D_HXX_
31 #define _SMESH_QUADRANGLE_2D_HXX_
32
33 #include "SMESH_2D_Algo.hxx"
34 #include "SMESH_Mesh.hxx"
35 #include "Utils_SALOME_Exception.hxx"
36
37 typedef struct uvPtStruct
38 {
39   double param;
40   double normParam;
41   double u; // original 2d parameter
42   double v;
43   double x; // 2d parameter, normalized [0,1]
44   double y; 
45         const SMDS_MeshNode * node;
46 } UVPtStruct;
47
48 typedef struct faceQuadStruct
49 {
50   int nbPts[4];
51   TopoDS_Edge edge[4];
52   double first[4];
53   double last[4];
54   bool isEdgeForward[4];
55   UVPtStruct* uv_edges[4];
56   UVPtStruct* uv_grid;
57 } FaceQuadStruct;
58
59 class StdMeshers_Quadrangle_2D:
60   public SMESH_2D_Algo
61 {
62 public:
63   StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
64   virtual ~StdMeshers_Quadrangle_2D();
65
66   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
67                                const TopoDS_Shape& aShape,
68                                SMESH_Hypothesis::Hypothesis_Status& aStatus);
69
70   virtual bool Compute(SMESH_Mesh& aMesh,
71                        const TopoDS_Shape& aShape)
72     throw (SALOME_Exception);
73
74   FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
75                                     const TopoDS_Shape& aShape)
76     throw (SALOME_Exception);
77
78   void QuadDelete(FaceQuadStruct* quad);
79
80   ostream & SaveTo(ostream & save);
81   istream & LoadFrom(istream & load);
82   friend ostream & operator << (ostream & save, StdMeshers_Quadrangle_2D & hyp);
83   friend istream & operator >> (istream & load, StdMeshers_Quadrangle_2D & hyp);
84
85 protected:
86
87   void SetNormalizedGrid(SMESH_Mesh& aMesh,
88                          const TopoDS_Shape& aShape,
89                          FaceQuadStruct* quad)
90     throw (SALOME_Exception);
91
92   UVPtStruct* LoadEdgePoints(SMESH_Mesh& aMesh,
93                              const TopoDS_Face& F,
94                              const TopoDS_Edge& E,
95                              double first,
96                              double last);
97 //                           bool isForward);
98
99 //   FaceQuadStruct _quadDesc;
100 };
101
102 #endif