1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2014 OPEN CASCADE SAS
3 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This file is part of Open CASCADE Technology software library.
9 // This library is free software; you can redistribute it and/or modify it under
10 // the terms of the GNU Lesser General Public License version 2.1 as published
11 // by the Free Software Foundation, with special exception defined in the file
12 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 // distribution for complete text of the license and disclaimer of any warranty.
15 // Alternatively, this file may be used under the terms of Open CASCADE
16 // commercial license or contractual agreement.
18 #ifndef _BOPAlgo_BuilderShape_HeaderFile
19 #define _BOPAlgo_BuilderShape_HeaderFile
21 #include <Standard.hxx>
22 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Handle.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <TopTools_ListOfShape.hxx>
27 #include <BOPCol_MapOfShape.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
30 #include <BOPAlgo_Algo.hxx>
31 #include <BOPCol_BaseAllocator.hxx>
35 //! Root class for algorithms that has shape as result.<br>
36 //! The class provides the History mechanism, which allows
37 //! tracking the modification of the input shapes during
39 class BOPAlgo_BuilderShape : public BOPAlgo_Algo
46 //! Returns the result of algorithm
47 Standard_EXPORT const TopoDS_Shape& Shape() const;
49 //! Returns the list of shapes generated from the
51 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& theS);
53 //! Returns the list of shapes modified from the
55 Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& theS);
57 //! Returns true if the shape theS has been deleted.
58 Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& theS);
60 //! Returns true if the at least one shape(or subshape)
61 //! of arguments has been deleted.
62 Standard_EXPORT Standard_Boolean HasDeleted() const;
64 //! Returns true if the at least one shape(or subshape)
65 //! of arguments has generated shapes.
66 Standard_EXPORT Standard_Boolean HasGenerated() const;
68 //! Returns true if the at least one shape(or subshape)
69 //! of arguments has modified shapes.
70 Standard_EXPORT Standard_Boolean HasModified() const;
72 Standard_EXPORT const BOPCol_IndexedDataMapOfShapeListOfShape& ImagesResult() const;
80 Standard_EXPORT BOPAlgo_BuilderShape();
81 Standard_EXPORT virtual ~BOPAlgo_BuilderShape();
83 Standard_EXPORT BOPAlgo_BuilderShape(const BOPCol_BaseAllocator& theAllocator);
85 //! Prepare information for history support
86 Standard_EXPORT virtual void PrepareHistory();
90 TopTools_ListOfShape myHistShapes;
91 BOPCol_MapOfShape myMapShape;
92 Standard_Boolean myHasDeleted;
93 Standard_Boolean myHasGenerated;
94 Standard_Boolean myHasModified;
95 BOPCol_IndexedDataMapOfShapeListOfShape myImagesResult;
96 Standard_Boolean myFlagHistory;
113 #endif // _BOPAlgo_BuilderShape_HeaderFile