Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/smesh.git] / src / SMESH / SMESH_Hexa_3D.hxx
1 //=============================================================================
2 // File      : SMESH_Hexa_3D.hxx
3 // Created   : sam mai 18 23:15:26 CEST 2002
4 // Author    : Paul RASCLE, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2002
7 // $Header$
8 //=============================================================================
9
10 #ifndef _SMESH_HEXA_3D_HXX_
11 #define _SMESH_HEXA_3D_HXX_
12
13 #include "SMESH_3D_Algo.hxx"
14 #include "SMESH_Mesh.hxx"
15 #include "SMESH_Quadrangle_2D.hxx"
16 #include "Utils_SALOME_Exception.hxx"
17
18 typedef struct point3Dstruct
19 {
20   int nodeId;
21 } Point3DStruct;
22
23 typedef double Pt3[3];
24
25 typedef struct conv2dstruct
26 {
27   double a1; // X = a1*x + b1*y + c1 
28   double b1; // Y = a2*x + b2*y + c2
29   double c1; // a1, b1 a2, b2 in {-1,0,1}
30   double a2; // c1, c2 in {0,1}
31   double b2;
32   double c2;
33   int ia;    // I = ia*i + ib*j + ic
34   int ib;
35   int ic;
36   int ja;    // J = ja*i + jb*j + jc
37   int jb;
38   int jc;
39 } Conv2DStruct;
40
41 typedef struct cubeStruct
42 {
43   TopoDS_Vertex V000;
44   TopoDS_Vertex V001;
45   TopoDS_Vertex V010;
46   TopoDS_Vertex V011;
47   TopoDS_Vertex V100;
48   TopoDS_Vertex V101;
49   TopoDS_Vertex V110;
50   TopoDS_Vertex V111;
51   faceQuadStruct* quad_X0;
52   faceQuadStruct* quad_X1;
53   faceQuadStruct* quad_Y0;
54   faceQuadStruct* quad_Y1;
55   faceQuadStruct* quad_Z0;
56   faceQuadStruct* quad_Z1;
57   Point3DStruct* np; // normalised 3D coordinates
58 } CubeStruct;
59
60 class SMESH_Hexa_3D:
61   public SMESH_3D_Algo
62 {
63 public:
64   SMESH_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
65   virtual ~SMESH_Hexa_3D();
66
67   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
68                                const TopoDS_Shape& aShape);
69
70   virtual bool Compute(SMESH_Mesh& aMesh,
71                        const TopoDS_Shape& aShape)
72     throw (SALOME_Exception);
73
74   ostream & SaveTo(ostream & save);
75   istream & LoadFrom(istream & load);
76   friend ostream & operator << (ostream & save, SMESH_Hexa_3D & hyp);
77   friend istream & operator >> (istream & load, SMESH_Hexa_3D & hyp);
78
79 protected:
80   TopoDS_Edge
81   EdgeNotInFace(SMESH_Mesh& aMesh,
82                 const TopoDS_Shape& aShape,
83                 const TopoDS_Face& aFace,
84                 const TopoDS_Vertex& aVertex,
85                 const TopTools_IndexedDataMapOfShapeListOfShape& MS);
86
87   int GetFaceIndex(SMESH_Mesh& aMesh,
88                    const TopoDS_Shape& aShape,
89                    const vector<SMESH_subMesh*>& meshFaces,
90                    const TopoDS_Vertex& V0,
91                    const TopoDS_Vertex& V1,
92                    const TopoDS_Vertex& V2,
93                    const TopoDS_Vertex& V3);
94
95   void GetConv2DCoefs(const faceQuadStruct& quad,
96                       const TopoDS_Shape& aShape,
97                       const TopoDS_Vertex& V0,
98                       const TopoDS_Vertex& V1,
99                       const TopoDS_Vertex& V2,
100                       const TopoDS_Vertex& V3,
101                       Conv2DStruct& conv);
102
103   void GetPoint(Pt3 p,
104                 int i, int j, int k,
105                 int nbx, int nby, int nbz,
106                 Point3DStruct *np,
107                 const Handle(SMESHDS_Mesh)& meshDS);
108
109   CubeStruct _cube;
110   FaceQuadStruct* _quads[6];
111   int _indX0;
112   int _indX1;
113   int _indY0;
114   int _indY1;
115   int _indZ0;
116   int _indZ1;
117 };
118
119 #endif