Salome HOME
Merge from V5_1_4_BR 07/05/2010
[modules/smesh.git] / src / StdMeshers / StdMeshers_QuadToTriaAdaptor.hxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  SMESH SMESH : implementaion of SMESH idl descriptions
21 //  File   : StdMeshers_QuadToTriaAdaptor.hxx
22 //  Module : SMESH
23 //
24 #ifndef _SMESH_QuadToTriaAdaptor_HXX_
25 #define _SMESH_QuadToTriaAdaptor_HXX_
26
27 #include "SMESH_StdMeshers.hxx"
28 #include "SMDS_FaceOfNodes.hxx"
29
30 class SMESH_Mesh;
31 class SMDS_MeshElement;
32 class SMDS_MeshNode;
33 class Handle(TColgp_HArray1OfPnt);
34 class Handle(TColgp_HArray1OfVec);
35 class TopoDS_Shape;
36 class gp_Pnt;
37 class gp_Vec;
38
39
40 #include <map>
41 #include <list>
42 #include <vector>
43
44 class STDMESHERS_EXPORT StdMeshers_QuadToTriaAdaptor
45 {
46 public:
47
48   ~StdMeshers_QuadToTriaAdaptor();
49
50   bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
51
52   bool Compute(SMESH_Mesh& aMesh);
53
54   const std::list<const SMDS_FaceOfNodes*>* GetTriangles(const SMDS_MeshElement* aFace);
55
56 protected:
57
58   //bool CheckDegenerate(const SMDS_MeshElement* aFace);
59
60   int Preparation(const SMDS_MeshElement* face,
61                   Handle(TColgp_HArray1OfPnt)& PN,
62                   Handle(TColgp_HArray1OfVec)& VN,
63                   std::vector<const SMDS_MeshNode*>& FNodes,
64                   gp_Pnt& PC, gp_Vec& VNorm,
65                   const SMDS_MeshElement** volumes=0);
66
67   bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC,
68                          gp_Pnt& Pint, SMESH_Mesh& aMesh,
69                          const TopoDS_Shape& aShape,
70                          const TopoDS_Shape& NotCheckedFace);
71
72   bool Compute2ndPart(SMESH_Mesh& aMesh);
73
74   typedef std::list<const SMDS_FaceOfNodes* >                        TTriaList;
75   typedef std::multimap<const SMDS_MeshElement*, TTriaList >         TQuad2Trias;
76   typedef std::map<const SMDS_MeshElement*, TTriaList *, TIDCompare> TPyram2Trias;
77
78   TQuad2Trias  myResMap;
79   TPyram2Trias myPyram2Trias;
80
81   std::list< const SMDS_MeshNode* > myDegNodes;
82
83 };
84
85 #endif