Salome HOME
f069d71a9df7d3526513e80d549239a6f2f97bee
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer2.hxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, 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 <Standard.hxx>
30 #include <Standard_Macro.hxx>
31 #include <Standard_Boolean.hxx>
32
33 #include <TopAbs_ShapeEnum.hxx>
34
35 #include <TopTools_DataMapOfShapeListOfShape.hxx>
36 #include <TopTools_DataMapOfShapeShape.hxx>
37
38 #include <GEOMAlgo_GluerAlgo.hxx>
39 #include <GEOMAlgo_BuilderShape.hxx>
40 #include <GEOMAlgo_GlueDetector.hxx>
41 #include <GEOMAlgo_CoupleOfShapes.hxx>
42 #include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
43
44 //=======================================================================
45 //class : GEOMAlgo_Gluer2
46 //purpose  :
47 //=======================================================================
48 class GEOMAlgo_Gluer2  : public GEOMAlgo_GluerAlgo,
49                          public GEOMAlgo_BuilderShape {
50 public:
51
52   Standard_EXPORT
53     GEOMAlgo_Gluer2();
54
55   Standard_EXPORT
56     virtual ~GEOMAlgo_Gluer2();
57
58   Standard_EXPORT
59     void SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM) ;
60
61   Standard_EXPORT
62     const TopTools_DataMapOfShapeListOfShape& ShapesToGlue() const;
63
64   Standard_EXPORT
65     void SetKeepNonSolids(const Standard_Boolean theFlag) ;
66
67   Standard_EXPORT
68     Standard_Boolean KeepNonSolids() const;
69
70   Standard_EXPORT   virtual  void Clear() ;
71
72   Standard_EXPORT
73     virtual  void Perform() ;
74
75   Standard_EXPORT
76     virtual  void CheckData() ;
77
78   Standard_EXPORT
79     void Detect() ;
80
81   Standard_EXPORT
82     const TopTools_DataMapOfShapeListOfShape& ShapesDetected() const;
83
84   Standard_EXPORT
85     const TopTools_DataMapOfShapeListOfShape& ImagesToWork() const;
86
87   Standard_EXPORT
88     virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
89
90   Standard_EXPORT
91     virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
92
93   Standard_EXPORT
94     virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
95
96   Standard_EXPORT
97     static void MakeVertex(const TopTools_ListOfShape& theLV,
98                            TopoDS_Vertex& theV) ;
99
100   Standard_EXPORT
101     static void MapBRepShapes(const TopoDS_Shape& theS,
102                               TopTools_MapOfShape& theM) ;
103
104   Standard_EXPORT
105     static void MapShapes(const TopoDS_Shape& theS,
106                           TopTools_MapOfShape& theM) ;
107
108 //modified by NIZNHY-PKV Tue Mar 13 12:23:20 2012f
109   Standard_EXPORT
110     const TopTools_IndexedDataMapOfShapeListOfShape& StickedShapes();
111 //modified by NIZNHY-PKV Tue Mar 13 12:23:26 2012t
112 //------------------------------------------------
113 protected:
114   Standard_EXPORT
115     void PerformShapesToWork() ;
116
117   Standard_EXPORT
118     void FillVertices() ;
119
120   Standard_EXPORT
121     void FillEdges() ;
122
123   Standard_EXPORT
124     void FillWires() ;
125
126   Standard_EXPORT
127     void FillFaces() ;
128
129   Standard_EXPORT
130     void FillShells() ;
131
132   Standard_EXPORT
133     void FillSolids() ;
134
135   Standard_EXPORT
136     void FillCompSolids() ;
137
138   Standard_EXPORT
139     void FillCompounds() ;
140
141   Standard_EXPORT
142     void BuildResult() ;
143
144   Standard_EXPORT
145     void FillBRepShapes(const TopAbs_ShapeEnum theType) ;
146
147   Standard_EXPORT
148     void FillContainers(const TopAbs_ShapeEnum theType) ;
149
150   Standard_EXPORT
151     void FillCompound(const TopoDS_Shape& theC) ;
152
153   Standard_EXPORT
154     virtual  void PrepareHistory() ;
155
156   Standard_EXPORT
157     Standard_Boolean HasImage(const TopoDS_Shape& theC) ;
158
159   Standard_EXPORT
160     void MakeBRepShapes(const TopoDS_Shape& theS,
161                         TopoDS_Shape& theSnew) ;
162
163   Standard_EXPORT
164     void MakeEdge(const TopoDS_Edge& theE,
165                   TopoDS_Edge& theEnew) ;
166
167   Standard_EXPORT
168     void MakeFace(const TopoDS_Face& theF,
169                   TopoDS_Face& theFnew) ;
170
171   Standard_EXPORT
172     void TreatPair(const GEOMAlgo_CoupleOfShapes& theCS,
173                    GEOMAlgo_ListOfCoupleOfShapes& theLCS) ;
174
175 protected:
176   TopTools_DataMapOfShapeListOfShape myShapesToGlue;
177   TopTools_DataMapOfShapeListOfShape myImagesDetected;
178   TopTools_DataMapOfShapeShape myOriginsDetected;
179   TopTools_DataMapOfShapeListOfShape myImagesToWork;
180   TopTools_DataMapOfShapeShape myOriginsToWork;
181   Standard_Boolean myKeepNonSolids;
182   GEOMAlgo_GlueDetector myDetector;
183
184 private:
185 };
186 #endif