| 1 |
// Copyright (C) 2007-2015 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, or (at your option) any later version. |
| 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 : [email protected] |
| 18 |
// |
| 19 |
|
| 20 |
// File : StdMeshers_QuadToTriaAdaptor.hxx |
| 21 |
// Module : SMESH |
| 22 |
// |
| 23 |
#ifndef _SMESH_QuadToTriaAdaptor_HXX_ |
| 24 |
#define _SMESH_QuadToTriaAdaptor_HXX_ |
| 25 |
|
| 26 |
#include "SMESH_StdMeshers.hxx" |
| 27 |
|
| 28 |
#include "SMESH_ProxyMesh.hxx" |
| 29 |
#include <TColgp_HArray1OfPnt.hxx> |
| 30 |
#include <TColgp_HArray1OfVec.hxx> |
| 31 |
class SMESH_Mesh; |
| 32 |
struct SMESH_ElementSearcher; |
| 33 |
class SMDS_MeshElement; |
| 34 |
class SMDS_MeshNode; |
| 35 |
class SMDS_MeshFace; |
| 36 |
// class Handle(TColgp_HArray1OfPnt); |
| 37 |
// class Handle(TColgp_HArray1OfVec); |
| 38 |
class gp_Pnt; |
| 39 |
class gp_Vec; |
| 40 |
|
| 41 |
|
| 42 |
#include <set> |
| 43 |
#include <list> |
| 44 |
#include <vector> |
| 45 |
|
| 46 |
#include <TopoDS_Shape.hxx> |
| 47 |
|
| 48 |
/*! |
| 49 |
* \brief "Transforms" quadrilateral faces into triangular ones by creation of pyramids |
| 50 |
*/ |
| 51 |
class STDMESHERS_EXPORT StdMeshers_QuadToTriaAdaptor : public SMESH_ProxyMesh |
| 52 |
{ |
| 53 |
public: |
| 54 |
StdMeshers_QuadToTriaAdaptor(); |
| 55 |
|
| 56 |
~StdMeshers_QuadToTriaAdaptor(); |
| 57 |
|
| 58 |
bool Compute(SMESH_Mesh& aMesh, |
| 59 |
const TopoDS_Shape& aShape, |
| 60 |
SMESH_ProxyMesh* aProxyMesh=0); |
| 61 |
|
| 62 |
bool Compute(SMESH_Mesh& aMesh); |
| 63 |
|
| 64 |
const TopoDS_Shape& GetShape() const { return myShape; } |
| 65 |
|
| 66 |
protected: |
| 67 |
|
| 68 |
int Preparation(const SMDS_MeshElement* face, |
| 69 |
Handle(TColgp_HArray1OfPnt)& PN, |
| 70 |
Handle(TColgp_HArray1OfVec)& VN, |
| 71 |
std::vector<const SMDS_MeshNode*>& FNodes, |
| 72 |
gp_Pnt& PC, gp_Vec& VNorm, |
| 73 |
const SMDS_MeshElement** volumes=0); |
| 74 |
|
| 75 |
bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC, |
| 76 |
gp_Pnt& Pint, SMESH_Mesh& aMesh, |
| 77 |
const TopoDS_Shape& aShape, |
| 78 |
const SMDS_MeshElement* NotCheckedFace); |
| 79 |
|
| 80 |
bool Compute2ndPart(SMESH_Mesh& aMesh, |
| 81 |
const std::vector<const SMDS_MeshElement*>& pyramids); |
| 82 |
|
| 83 |
|
| 84 |
void MergePiramids( const SMDS_MeshElement* PrmI, |
| 85 |
const SMDS_MeshElement* PrmJ, |
| 86 |
std::set<const SMDS_MeshNode*> & nodesToMove); |
| 87 |
|
| 88 |
void MergeAdjacent(const SMDS_MeshElement* PrmI, |
| 89 |
std::set<const SMDS_MeshNode*>& nodesToMove); |
| 90 |
|
| 91 |
|
| 92 |
TopoDS_Shape myShape; |
| 93 |
std::set<const SMDS_MeshElement*> myRemovedTrias; |
| 94 |
std::list< const SMDS_MeshNode* > myDegNodes; |
| 95 |
const SMESH_ElementSearcher* myElemSearcher; |
| 96 |
}; |
| 97 |
|
| 98 |
#endif |