Back to index

salome-smesh  6.5.0
StdMeshers_QuadToTriaAdaptor.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  SMESH SMESH : implementaion of SMESH idl descriptions
00021 //  File   : StdMeshers_QuadToTriaAdaptor.hxx
00022 //  Module : SMESH
00023 //
00024 #ifndef _SMESH_QuadToTriaAdaptor_HXX_
00025 #define _SMESH_QuadToTriaAdaptor_HXX_
00026 
00027 #include "SMESH_StdMeshers.hxx"
00028 
00029 #include "SMESH_ProxyMesh.hxx"
00030 
00031 class SMESH_Mesh;
00032 class SMESH_ElementSearcher;
00033 class SMDS_MeshElement;
00034 class SMDS_MeshNode;
00035 class SMDS_MeshFace;
00036 class Handle_TColgp_HArray1OfPnt;
00037 class Handle_TColgp_HArray1OfVec;
00038 class gp_Pnt;
00039 class gp_Vec;
00040 
00041 
00042 #include <set>
00043 #include <list>
00044 #include <vector>
00045 
00046 #include <TopoDS_Shape.hxx>
00047 
00051 class STDMESHERS_EXPORT StdMeshers_QuadToTriaAdaptor : public SMESH_ProxyMesh
00052 {
00053 public:
00054   StdMeshers_QuadToTriaAdaptor();
00055 
00056   ~StdMeshers_QuadToTriaAdaptor();
00057 
00058   bool Compute(SMESH_Mesh&         aMesh,
00059                const TopoDS_Shape& aShape,
00060                SMESH_ProxyMesh*    aProxyMesh=0);
00061 
00062   bool Compute(SMESH_Mesh& aMesh);
00063 
00064 protected:
00065 
00066   int Preparation(const SMDS_MeshElement* face,
00067                   Handle_TColgp_HArray1OfPnt& PN,
00068                   Handle_TColgp_HArray1OfVec& VN,
00069                   std::vector<const SMDS_MeshNode*>& FNodes,
00070                   gp_Pnt& PC, gp_Vec& VNorm,
00071                   const SMDS_MeshElement** volumes=0);
00072 
00073   bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC,
00074                          gp_Pnt& Pint, SMESH_Mesh& aMesh,
00075                          const TopoDS_Shape& aShape,
00076                          const SMDS_MeshElement* NotCheckedFace);
00077 
00078   bool Compute2ndPart(SMESH_Mesh&                                 aMesh,
00079                       const std::vector<const SMDS_MeshElement*>& pyramids);
00080 
00081 
00082   void MergePiramids( const SMDS_MeshElement*          PrmI,
00083                       const SMDS_MeshElement*          PrmJ,
00084                       std::set<const SMDS_MeshNode*> & nodesToMove);
00085 
00086   void MergeAdjacent(const SMDS_MeshElement*         PrmI,
00087                      std::set<const SMDS_MeshNode*>& nodesToMove);
00088 
00089 
00090   std::set<const SMDS_MeshElement*> myRemovedTrias;
00091 
00092   std::list< const SMDS_MeshNode* > myDegNodes;
00093 
00094   const SMESH_ElementSearcher* myElemSearcher;
00095 };
00096 
00097 #endif