1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SMESH SMESH : implementaion of SMESH idl descriptions
21 // File : StdMeshers_QuadToTriaAdaptor.hxx
24 #ifndef _SMESH_QuadToTriaAdaptor_HXX_
25 #define _SMESH_QuadToTriaAdaptor_HXX_
27 #include "SMESH_StdMeshers.hxx"
28 #include "SMDS_FaceOfNodes.hxx"
31 class SMESH_ElementSearcher;
32 class SMDS_MeshElement;
34 class Handle(TColgp_HArray1OfPnt);
35 class Handle(TColgp_HArray1OfVec);
46 * \brief "Transforms" quadrilateral faces into triangular ones by creation of pyramids
48 class STDMESHERS_EXPORT StdMeshers_QuadToTriaAdaptor
51 StdMeshers_QuadToTriaAdaptor();
53 ~StdMeshers_QuadToTriaAdaptor();
55 bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
57 bool Compute(SMESH_Mesh& aMesh);
59 const std::list<const SMDS_FaceOfNodes*>* GetTriangles(const SMDS_MeshElement* aFace);
63 //bool CheckDegenerate(const SMDS_MeshElement* aFace);
65 int Preparation(const SMDS_MeshElement* face,
66 Handle(TColgp_HArray1OfPnt)& PN,
67 Handle(TColgp_HArray1OfVec)& VN,
68 std::vector<const SMDS_MeshNode*>& FNodes,
69 gp_Pnt& PC, gp_Vec& VNorm,
70 const SMDS_MeshElement** volumes=0);
72 bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC,
73 gp_Pnt& Pint, SMESH_Mesh& aMesh,
74 const TopoDS_Shape& aShape,
75 const TopoDS_Shape& NotCheckedFace);
77 bool Compute2ndPart(SMESH_Mesh& aMesh);
80 typedef std::list<const SMDS_FaceOfNodes* > TTriaList;
81 typedef std::multimap<const SMDS_MeshElement*, TTriaList > TQuad2Trias;
82 typedef std::map<const SMDS_MeshElement*, TTriaList *, TIDCompare> TPyram2Trias;
85 TPyram2Trias myPyram2Trias;
87 std::list< const SMDS_MeshNode* > myDegNodes;
89 const SMESH_ElementSearcher* myElemSearcher;