Salome HOME
[bos #38521][EDF] Split Polyhedron with more than one volume.
[modules/smesh.git] / src / StdMeshers / StdMeshers_Cartesian_VL.hxx
1 // Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File      : StdMeshers_Cartesian_VL.hxx
23 // Created   : Tue May 24 12:32:01 2022
24 // Author    : Edward AGAPOV (eap)
25
26 #ifndef __StdMeshers_Cartesian_VL_HXX__
27 #define __StdMeshers_Cartesian_VL_HXX__
28
29 #include <BOPAlgo_Builder.hxx>
30 #include <BRepOffset_MakeOffset.hxx>
31 #include <BRepOffsetAPI_MakeOffset.hxx>
32
33 #include <set>
34 #include <map>
35 #include <vector>
36
37 class TopoDS_Face;
38 class StdMeshers_ViscousLayers;
39 class SMESH_Mesh;
40
41 namespace StdMeshers_Cartesian_VL
42 {
43   class ViscousBuilder
44   {
45   public:
46
47     ViscousBuilder( const StdMeshers_ViscousLayers* hypViscousLayers,
48                     const SMESH_Mesh &              theMesh,
49                     const TopoDS_Shape &            theShape);
50     ~ViscousBuilder();
51
52     TopoDS_Shape MakeOffsetShape(const TopoDS_Shape & theShape,
53                                  SMESH_Mesh &         theMesh,
54                                  std::string &        theError );                              
55
56     SMESH_Mesh*  MakeOffsetMesh();
57
58     bool         MakeViscousLayers( SMESH_Mesh &         offsetMesh,
59                                     SMESH_Mesh &         theMesh,
60                                     const TopoDS_Shape & theShape );                 
61     
62   private:
63     
64     TopoDS_Shape MakeOffsetSolid(const TopoDS_Shape & theShape,
65                                  SMESH_Mesh &         theMesh,
66                                  std::string &        theError );   
67
68     bool         CheckGeometryMaps( SMESH_Mesh &         offsetMesh,
69                                     const TopoDS_Shape & theShape );             
70
71     void getOffsetSubShape( const TopoDS_Shape& S, std::vector<TopoDS_Shape>& listOfShapes );
72
73     const StdMeshers_ViscousLayers* _hyp;
74     BRepOffset_MakeOffset           _makeOffset;
75     std::vector<BRepOffset_MakeOffset*> _makeOffsetCollection;  // collection to  
76     BRepOffsetAPI_MakeOffset        _makeFaceOffset;            // to define shrink of planar faces. The face is shrink in all 
77     BOPAlgo_Builder                 _solidCompound;             // to glue solids with common faces after shrinking then with BRepOffset_MakeOffset
78     SMESH_Mesh*                     _offsetMesh;
79     TopoDS_Shape                    _offsetShape;
80     std::set< int >                 _shapesWVL;                 // shapes with viscous layers
81     std::map< int, std::vector< int > > _edge2facesWOVL;        // EDGE 2 FACEs w/o VL
82   };
83 }
84
85 #endif