SALOME - SMESH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
StdMeshers_Hexa_3D.hxx
Go to the documentation of this file.
00001 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 //  This library is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU Lesser General Public
00008 //  License as published by the Free Software Foundation; either
00009 //  version 2.1 of the License.
00010 //
00011 //  This library is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 //  Lesser General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU Lesser General Public
00017 //  License along with this library; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  SMESH SMESH : implementaion of SMESH idl descriptions
00023 //  File   : StdMeshers_Hexa_3D.hxx
00024 //           Moved here from SMESH_Hexa_3D.hxx
00025 //  Author : Paul RASCLE, EDF
00026 //  Module : SMESH
00027 //
00028 #ifndef _SMESH_HEXA_3D_HXX_
00029 #define _SMESH_HEXA_3D_HXX_
00030 
00031 #include "SMESH_StdMeshers.hxx"
00032 
00033 #include "SMESH_3D_Algo.hxx"
00034 #include "SMESH_Mesh.hxx"
00035 #include "StdMeshers_Quadrangle_2D.hxx"
00036 #include "Utils_SALOME_Exception.hxx"
00037 
00038 #include "SMESH_MesherHelper.hxx"
00039 
00040 class TopTools_IndexedMapOfShape;
00041 
00042 typedef struct point3Dstruct
00043 {
00044   const SMDS_MeshNode * node;
00045 } Point3DStruct;
00046 
00047 typedef double Pt3[3];
00048 
00049 typedef struct conv2dstruct
00050 {
00051   double a1; // X = a1*x + b1*y + c1 
00052   double b1; // Y = a2*x + b2*y + c2
00053   double c1; // a1, b1 a2, b2 in {-1,0,1}
00054   double a2; // c1, c2 in {0,1}
00055   double b2;
00056   double c2;
00057   int ia;    // I = ia*i + ib*j + ic
00058   int ib;
00059   int ic;
00060   int ja;    // J = ja*i + jb*j + jc
00061   int jb;
00062   int jc;
00063 } Conv2DStruct;
00064 
00065 class STDMESHERS_EXPORT StdMeshers_Hexa_3D:
00066   public SMESH_3D_Algo
00067 {
00068 public:
00069   StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
00070   virtual ~StdMeshers_Hexa_3D();
00071 
00072   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
00073                                const TopoDS_Shape& aShape,
00074                                SMESH_Hypothesis::Hypothesis_Status& aStatus);
00075 
00076   virtual bool Compute(SMESH_Mesh& aMesh,
00077                  const TopoDS_Shape& aShape)
00078     /*throw (SALOME_Exception)*/;
00079 
00080   virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
00081                         MapShapeNbElems& aResMap);
00082 
00083   static TopoDS_Vertex OppositeVertex(const TopoDS_Vertex& aVertex,
00084                                       const TopTools_IndexedMapOfShape& aQuads0Vertices,
00085                                       FaceQuadStruct* aQuads[6]);
00086 
00087 protected:
00088   TopoDS_Edge
00089   EdgeNotInFace(SMESH_Mesh& aMesh,
00090           const TopoDS_Shape& aShape,
00091           const TopoDS_Face& aFace,
00092           const TopoDS_Vertex& aVertex,
00093           const TopTools_IndexedDataMapOfShapeListOfShape& MS);
00094 
00095   int GetFaceIndex(SMESH_Mesh& aMesh,
00096              const TopoDS_Shape& aShape,
00097              const std::vector<SMESH_subMesh*>& meshFaces,
00098              const TopoDS_Vertex& V0,
00099              const TopoDS_Vertex& V1,
00100              const TopoDS_Vertex& V2,
00101              const TopoDS_Vertex& V3);
00102 
00103   void GetConv2DCoefs(const faceQuadStruct& quad,
00104                 const TopoDS_Shape& aShape,
00105                 const TopoDS_Vertex& V0,
00106                 const TopoDS_Vertex& V1,
00107                 const TopoDS_Vertex& V2,
00108                 const TopoDS_Vertex& V3,
00109                 Conv2DStruct& conv);
00110 
00111   void GetPoint(Pt3 p,
00112           int i, int j, int k,
00113           int nbx, int nby, int nbz,
00114           Point3DStruct *np,
00115           const SMESHDS_Mesh* meshDS);
00116 
00117   bool ClearAndReturn(FaceQuadStruct* theQuads[6], const bool res);
00118 };
00119 
00120 #endif