1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : StdMeshers_Quadrangle_2D.hxx
25 // Moved here from SMESH_Quadrangle_2D.hxx
26 // Author : Paul RASCLE, EDF
30 #ifndef _SMESH_QUADRANGLE_2D_HXX_
31 #define _SMESH_QUADRANGLE_2D_HXX_
33 #include "SMESH_StdMeshers.hxx"
35 #include "SMESH_2D_Algo.hxx"
36 #include "SMESH_Mesh.hxx"
37 #include "Utils_SALOME_Exception.hxx"
41 #include "SMESH_MesherHelper.hxx"
43 //class SMDS_MeshNode;
45 typedef struct uvPtStruct
49 double u; // original 2d parameter
51 double x; // 2d parameter, normalized [0,1]
53 const SMDS_MeshNode * node;
56 typedef struct faceQuadStruct
62 bool isEdgeForward[4];
63 bool isEdgeOut[4]; // true, if an edge has more nodes, than the opposite
64 UVPtStruct* uv_edges[4];
68 class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D:
72 StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
73 virtual ~StdMeshers_Quadrangle_2D();
75 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
76 const TopoDS_Shape& aShape,
77 SMESH_Hypothesis::Hypothesis_Status& aStatus);
79 virtual bool Compute(SMESH_Mesh& aMesh,
80 const TopoDS_Shape& aShape)
81 throw (SALOME_Exception);
83 FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
84 const TopoDS_Shape& aShape,
85 const bool CreateQuadratic)
86 throw (SALOME_Exception);
88 static void QuadDelete(FaceQuadStruct* quad);
91 * Returns NLinkNodeMap from myTool
93 const NLinkNodeMap& GetNLinkNodeMap() { return myTool->GetNLinkNodeMap(); }
95 ostream & SaveTo(ostream & save);
96 istream & LoadFrom(istream & load);
97 friend ostream & operator << (ostream & save, StdMeshers_Quadrangle_2D & hyp);
98 friend istream & operator >> (istream & load, StdMeshers_Quadrangle_2D & hyp);
102 FaceQuadStruct* CheckNbEdges(SMESH_Mesh& aMesh,
103 const TopoDS_Shape& aShape)
104 throw (SALOME_Exception);
106 void SetNormalizedGrid(SMESH_Mesh& aMesh,
107 const TopoDS_Shape& aShape,
108 FaceQuadStruct*& quad)
109 throw (SALOME_Exception);
112 * Special function for creation only quandrangle faces
114 bool ComputeQuadPref(SMESH_Mesh& aMesh,
115 const TopoDS_Shape& aShape,
116 FaceQuadStruct* quad)
117 throw (SALOME_Exception);
119 UVPtStruct* LoadEdgePoints2(SMESH_Mesh& aMesh,
120 const TopoDS_Face& F, const TopoDS_Edge& E,
123 UVPtStruct* LoadEdgePoints(SMESH_Mesh& aMesh,
124 const TopoDS_Face& F, const TopoDS_Edge& E,
125 double first, double last);
127 UVPtStruct* MakeEdgePoints(SMESH_Mesh& aMesh,
128 const TopoDS_Face& F, const TopoDS_Edge& E,
129 double first, double last, int nb_segm);
131 // true if QuadranglePreference hypothesis is assigned that forces
132 // construction of quadrangles if the number of nodes on opposite edges
133 // is not the same in the case where the global number of nodes on edges is even
134 bool myQuadranglePreference;
136 SMESH_MesherHelper* myTool; // toll for working with quadratic elements