Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAlgoImpl / GEOMAlgo_Gluer2.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
23 // File:        GEOMAlgo_Gluer2.hxx
24 // Author:      Peter KURNEV
25
26 #ifndef _GEOMAlgo_Gluer2_HeaderFile
27 #define _GEOMAlgo_Gluer2_HeaderFile
28
29 #include <GeomAlgoImpl.h>
30
31 #include <Standard.hxx>
32 #include <Standard_Macro.hxx>
33 #include <Standard_Boolean.hxx>
34
35 #include <TopAbs_ShapeEnum.hxx>
36
37 #include <TopTools_DataMapOfShapeListOfShape.hxx>
38 #include <TopTools_DataMapOfShapeShape.hxx>
39
40 #include <GEOMAlgo_GluerAlgo.hxx>
41 #include <GEOMAlgo_BuilderShape.hxx>
42 #include <GEOMAlgo_GlueDetector.hxx>
43 #include <GEOMAlgo_CoupleOfShapes.hxx>
44 #include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
45
46 //=======================================================================
47 //class : GEOMAlgo_Gluer2
48 //purpose  :
49 //=======================================================================
50 class GEOMAlgo_Gluer2  : public GEOMAlgo_GluerAlgo,
51                          public GEOMAlgo_BuilderShape {
52 public:
53
54   GEOMALGOIMPL_EXPORT GEOMAlgo_Gluer2();
55
56   GEOMALGOIMPL_EXPORT virtual ~GEOMAlgo_Gluer2();
57
58   GEOMALGOIMPL_EXPORT void SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM);
59
60   GEOMALGOIMPL_EXPORT const TopTools_DataMapOfShapeListOfShape& ShapesToGlue() const;
61
62   GEOMALGOIMPL_EXPORT void SetKeepNonSolids(const Standard_Boolean theFlag);
63
64   GEOMALGOIMPL_EXPORT Standard_Boolean KeepNonSolids() const;
65
66   GEOMALGOIMPL_EXPORT virtual void Clear();
67
68   GEOMALGOIMPL_EXPORT virtual void Perform();
69
70   GEOMALGOIMPL_EXPORT virtual void CheckData();
71
72   GEOMALGOIMPL_EXPORT void Detect();
73
74   GEOMALGOIMPL_EXPORT const TopTools_DataMapOfShapeListOfShape& ShapesDetected() const;
75
76   GEOMALGOIMPL_EXPORT const TopTools_DataMapOfShapeListOfShape& ImagesToWork() const;
77
78   GEOMALGOIMPL_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS);
79
80   GEOMALGOIMPL_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS);
81
82   GEOMALGOIMPL_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS);
83
84
85   GEOMALGOIMPL_EXPORT static void MakeVertex(const TopTools_ListOfShape& theLV,
86                                              TopoDS_Vertex& theV);
87
88   GEOMALGOIMPL_EXPORT static void MapBRepShapes(const TopoDS_Shape& theS,
89                                                 TopTools_MapOfShape& theM);
90
91   GEOMALGOIMPL_EXPORT static void MapShapes(const TopoDS_Shape& theS,
92                                             TopTools_MapOfShape& theM);
93
94 //modified by NIZNHY-PKV Tue Mar 13 12:23:20 2012f
95   GEOMALGOIMPL_EXPORT const TopTools_IndexedDataMapOfShapeListOfShape& StickedShapes();
96 //modified by NIZNHY-PKV Tue Mar 13 12:23:26 2012t
97 //------------------------------------------------
98 protected:
99   GEOMALGOIMPL_EXPORT void PerformShapesToWork() ;
100
101   GEOMALGOIMPL_EXPORT void FillVertices();
102   GEOMALGOIMPL_EXPORT void FillEdges();
103   GEOMALGOIMPL_EXPORT void FillWires();
104   GEOMALGOIMPL_EXPORT void FillFaces();
105   GEOMALGOIMPL_EXPORT void FillShells();
106   GEOMALGOIMPL_EXPORT void FillSolids();
107   GEOMALGOIMPL_EXPORT void FillCompSolids();
108   GEOMALGOIMPL_EXPORT void FillCompounds();
109
110   GEOMALGOIMPL_EXPORT void BuildResult();
111
112   GEOMALGOIMPL_EXPORT void FillBRepShapes(const TopAbs_ShapeEnum theType);
113   GEOMALGOIMPL_EXPORT void FillContainers(const TopAbs_ShapeEnum theType);
114   GEOMALGOIMPL_EXPORT void FillCompound(const TopoDS_Shape& theC);
115
116   GEOMALGOIMPL_EXPORT virtual void PrepareHistory();
117
118   GEOMALGOIMPL_EXPORT Standard_Boolean HasImage(const TopoDS_Shape& theC);
119
120   GEOMALGOIMPL_EXPORT void MakeBRepShapes(const TopoDS_Shape& theS,
121                                           TopoDS_Shape& theSnew);
122
123   GEOMALGOIMPL_EXPORT void MakeEdge(const TopoDS_Edge& theE,
124                                     TopoDS_Edge& theEnew);
125
126   GEOMALGOIMPL_EXPORT void MakeFace(const TopoDS_Face& theF,
127                                     TopoDS_Face& theFnew);
128
129   GEOMALGOIMPL_EXPORT void TreatPair(const GEOMAlgo_CoupleOfShapes& theCS,
130                                      GEOMAlgo_ListOfCoupleOfShapes& theLCS);
131
132 protected:
133   TopTools_DataMapOfShapeListOfShape myShapesToGlue;
134   TopTools_DataMapOfShapeListOfShape myImagesDetected;
135   TopTools_DataMapOfShapeShape       myOriginsDetected;
136   TopTools_DataMapOfShapeListOfShape myImagesToWork;
137   TopTools_DataMapOfShapeShape       myOriginsToWork;
138   Standard_Boolean                   myKeepNonSolids;
139   GEOMAlgo_GlueDetector              myDetector;
140 };
141
142 #endif