Salome HOME
c4225bd1c16e3348d46fbdcec90515027e305598
[modules/shaper.git] / src / GeomAlgoImpl / GEOMAlgo_BuilderShape.hxx
1 // Copyright (C) 2007-2023  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_BuilderShape.hxx
24 // Created:
25 // Author:      Peter KURNEV
26 //
27 #ifndef _GEOMAlgo_BuilderShape_HeaderFile
28 #define _GEOMAlgo_BuilderShape_HeaderFile
29
30 #include <GeomAlgoImpl.h>
31
32 #include <Standard.hxx>
33 #include <Standard_Macro.hxx>
34 #include <Standard_Boolean.hxx>
35
36 #include <TopoDS_Shape.hxx>
37
38 #include <TopTools_ListOfShape.hxx>
39 #include <TopTools_MapOfShape.hxx>
40 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
41
42 #include <GEOMAlgo_Algo.hxx>
43
44
45 //! Root class for algorithms that has shape as result <br>
46 //=======================================================================
47 //class    : GEOMAlgo_BuilderShape
48 //purpose  :
49 //=======================================================================
50 class GEOMAlgo_BuilderShape  : public GEOMAlgo_Algo
51 {
52  public:
53   //!  Returns the result of algorithm <br>
54   GEOMALGOIMPL_EXPORT
55     const TopoDS_Shape& Shape() const;
56
57   //! Returns the list of shapes generated from the <br>
58   //!          shape theS. <br>
59   GEOMALGOIMPL_EXPORT
60     virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
61
62   //! Returns the list of shapes modified from the <br>
63   //!          shape theS. <br>
64   GEOMALGOIMPL_EXPORT
65     virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
66
67   //! Returns true if the shape theS has been deleted. <br>
68   GEOMALGOIMPL_EXPORT
69     virtual  Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
70
71   //! Returns true if the at least one shape(or sub-shape) <br>
72   //!          of arguments has been deleted. <br>
73   GEOMALGOIMPL_EXPORT
74     Standard_Boolean HasDeleted() const;
75
76   //! Returns true if the at least one shape(or sub-shape) <br>
77   //!          of arguments has generated shapes. <br>
78   GEOMALGOIMPL_EXPORT
79     Standard_Boolean HasGenerated() const;
80
81   //! Returns true if the at least one shape(or sub-shape) <br>
82   //!          of arguments has modified shapes. <br>
83   GEOMALGOIMPL_EXPORT
84     Standard_Boolean HasModified() const;
85
86   GEOMALGOIMPL_EXPORT
87     const TopTools_IndexedDataMapOfShapeListOfShape& ImagesResult() const;
88
89 protected:
90   //! Empty constructor <br>
91   GEOMALGOIMPL_EXPORT
92     GEOMAlgo_BuilderShape();
93
94   GEOMALGOIMPL_EXPORT
95     virtual ~GEOMAlgo_BuilderShape();
96
97   //!  Prepare information for history support <br>
98   GEOMALGOIMPL_EXPORT
99     virtual  void PrepareHistory() ;
100
101
102   TopoDS_Shape         myShape;
103   TopTools_ListOfShape myHistShapes;
104   TopTools_MapOfShape  myMapShape;
105   Standard_Boolean     myHasDeleted;
106   Standard_Boolean     myHasGenerated;
107   Standard_Boolean     myHasModified;
108   TopTools_IndexedDataMapOfShapeListOfShape myImagesResult;
109 };
110
111 #endif