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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : StdMeshers_Hexa_3D.hxx
25 // Moved here from SMESH_Hexa_3D.hxx
26 // Author : Paul RASCLE, EDF
30 #ifndef _SMESH_HEXA_3D_HXX_
31 #define _SMESH_HEXA_3D_HXX_
33 #include "SMESH_3D_Algo.hxx"
34 #include "SMESH_Mesh.hxx"
35 #include "StdMeshers_Quadrangle_2D.hxx"
36 #include "Utils_SALOME_Exception.hxx"
38 #include "StdMeshers_Helper.hxx"
40 typedef struct point3Dstruct
42 const SMDS_MeshNode * node;
45 typedef double Pt3[3];
47 typedef struct conv2dstruct
49 double a1; // X = a1*x + b1*y + c1
50 double b1; // Y = a2*x + b2*y + c2
51 double c1; // a1, b1 a2, b2 in {-1,0,1}
52 double a2; // c1, c2 in {0,1}
55 int ia; // I = ia*i + ib*j + ic
58 int ja; // J = ja*i + jb*j + jc
63 typedef struct cubeStruct
73 faceQuadStruct* quad_X0;
74 faceQuadStruct* quad_X1;
75 faceQuadStruct* quad_Y0;
76 faceQuadStruct* quad_Y1;
77 faceQuadStruct* quad_Z0;
78 faceQuadStruct* quad_Z1;
79 Point3DStruct* np; // normalised 3D coordinates
82 class StdMeshers_Hexa_3D:
86 StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
87 virtual ~StdMeshers_Hexa_3D();
89 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
90 const TopoDS_Shape& aShape,
91 SMESH_Hypothesis::Hypothesis_Status& aStatus);
93 virtual bool Compute(SMESH_Mesh& aMesh,
94 const TopoDS_Shape& aShape)
95 throw (SALOME_Exception);
97 ostream & SaveTo(ostream & save);
98 istream & LoadFrom(istream & load);
99 friend ostream & operator << (ostream & save, StdMeshers_Hexa_3D & hyp);
100 friend istream & operator >> (istream & load, StdMeshers_Hexa_3D & hyp);
104 EdgeNotInFace(SMESH_Mesh& aMesh,
105 const TopoDS_Shape& aShape,
106 const TopoDS_Face& aFace,
107 const TopoDS_Vertex& aVertex,
108 const TopTools_IndexedDataMapOfShapeListOfShape& MS);
110 int GetFaceIndex(SMESH_Mesh& aMesh,
111 const TopoDS_Shape& aShape,
112 const vector<SMESH_subMesh*>& meshFaces,
113 const TopoDS_Vertex& V0,
114 const TopoDS_Vertex& V1,
115 const TopoDS_Vertex& V2,
116 const TopoDS_Vertex& V3);
118 void GetConv2DCoefs(const faceQuadStruct& quad,
119 const TopoDS_Shape& aShape,
120 const TopoDS_Vertex& V0,
121 const TopoDS_Vertex& V1,
122 const TopoDS_Vertex& V2,
123 const TopoDS_Vertex& V3,
128 int nbx, int nby, int nbz,
130 const SMESHDS_Mesh* meshDS);
132 bool ClearAndReturn(const bool res);
135 FaceQuadStruct* _quads[6];
143 bool myCreateQuadratic;
144 StdMeshers_Helper* myTool; // toll for working with quadratic elements