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_Builder_HeaderFile
19 #define _BOPAlgo_Builder_HeaderFile
21 #include <Standard.hxx>
22 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Handle.hxx>
25 #include <BOPCol_ListOfShape.hxx>
26 #include <BOPCol_MapOfShape.hxx>
27 #include <BOPAlgo_PPaveFiller.hxx>
28 #include <BOPAlgo_GlueEnum.hxx>
29 #include <BOPDS_PDS.hxx>
30 #include <Standard_Integer.hxx>
31 #include <BOPCol_DataMapOfShapeListOfShape.hxx>
32 #include <BOPCol_DataMapOfShapeShape.hxx>
33 #include <Standard_Real.hxx>
34 #include <BOPAlgo_BuilderShape.hxx>
35 #include <BOPCol_BaseAllocator.hxx>
36 #include <TopTools_ListOfShape.hxx>
37 #include <Standard_Boolean.hxx>
38 #include <TopAbs_ShapeEnum.hxx>
39 class IntTools_Context;
41 class BOPAlgo_PaveFiller;
45 class BOPAlgo_Builder : public BOPAlgo_BuilderShape
52 Standard_EXPORT BOPAlgo_Builder();
53 Standard_EXPORT virtual ~BOPAlgo_Builder();
55 Standard_EXPORT BOPAlgo_Builder(const BOPCol_BaseAllocator& theAllocator);
57 Standard_EXPORT virtual void Clear();
59 Standard_EXPORT BOPAlgo_PPaveFiller PPaveFiller();
61 Standard_EXPORT BOPDS_PDS PDS();
63 Standard_EXPORT virtual void AddArgument (const TopoDS_Shape& theShape);
65 Standard_EXPORT virtual void SetArguments (const BOPCol_ListOfShape& theLS);
67 Standard_EXPORT const BOPCol_ListOfShape& Arguments() const;
69 Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
71 Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller);
73 //! Returns the list of shapes generated from the
75 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& theS) Standard_OVERRIDE;
77 //! Returns the list of shapes modified from the shape
79 Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& theS) Standard_OVERRIDE;
81 //! Returns true if the shape theS has been deleted.
82 Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& theS) Standard_OVERRIDE;
84 Standard_EXPORT const BOPCol_DataMapOfShapeListOfShape& Images() const;
86 Standard_EXPORT Standard_Boolean IsInterferred (const TopoDS_Shape& theS) const;
88 //! Returns myOrigins.
89 Standard_EXPORT const BOPCol_DataMapOfShapeListOfShape& Origins() const;
91 //! Returns myShapesSD.
92 Standard_EXPORT const BOPCol_DataMapOfShapeShape& ShapesSD() const;
95 Standard_EXPORT const BOPCol_DataMapOfShapeListOfShape& Splits() const;
98 //! Sets the flag that defines the mode of treatment.
99 //! In non-destructive mode the argument shapes are not modified. Instead
100 //! a copy of a sub-shape is created in the result if it is needed to be updated.
101 //! This flag is taken into account if internal PaveFiller is used only.
102 //! In the case of calling PerformWithFiller the corresponding flag of that PaveFiller
104 Standard_EXPORT void SetNonDestructive(const Standard_Boolean theFlag);
106 //! Returns the flag that defines the mode of treatment.
107 //! In non-destructive mode the argument shapes are not modified. Instead
108 //! a copy of a sub-shape is created in the result if it is needed to be updated.
109 Standard_EXPORT Standard_Boolean NonDestructive() const;
111 //! Sets the glue option for the algorithm
112 Standard_EXPORT void SetGlue(const BOPAlgo_GlueEnum theGlue);
114 //! Returns the glue option of the algorithm
115 Standard_EXPORT BOPAlgo_GlueEnum Glue() const;
119 //! Prepare information for history support
120 Standard_EXPORT virtual void PrepareHistory() Standard_OVERRIDE;
122 Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF);
124 Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF);
126 Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
128 Standard_EXPORT virtual void Prepare();
130 Standard_EXPORT void FillImagesVertices();
132 Standard_EXPORT void FillImagesEdges();
134 Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType);
136 Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType);
138 Standard_EXPORT void FillImagesCompounds();
140 Standard_EXPORT void FillImagesContainer (const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType);
142 Standard_EXPORT void FillImagesCompound (const TopoDS_Shape& theS, BOPCol_MapOfShape& theMF);
144 Standard_EXPORT void FillImagesFaces();
146 Standard_EXPORT virtual void BuildSplitFaces();
148 Standard_EXPORT void FillSameDomainFaces();
150 Standard_EXPORT void FillImagesFaces1();
152 Standard_EXPORT void FillImagesSolids();
154 Standard_EXPORT void BuildDraftSolid (const TopoDS_Shape& theSolid, TopoDS_Shape& theDraftSolid, BOPCol_ListOfShape& theLIF);
156 Standard_EXPORT virtual void FillIn3DParts (BOPCol_DataMapOfShapeListOfShape& theInParts, BOPCol_DataMapOfShapeShape& theDraftSolids, const BOPCol_BaseAllocator& theAllocator);
158 Standard_EXPORT void BuildSplitSolids (BOPCol_DataMapOfShapeListOfShape& theInParts, BOPCol_DataMapOfShapeShape& theDraftSolids, const BOPCol_BaseAllocator& theAllocator);
160 Standard_EXPORT void FillInternalShapes();
162 Standard_EXPORT virtual void PostTreat();
165 BOPCol_ListOfShape myArguments;
166 BOPCol_MapOfShape myMapFence;
167 BOPAlgo_PPaveFiller myPaveFiller;
169 Handle(IntTools_Context) myContext;
170 Standard_Integer myEntryPoint;
171 BOPCol_DataMapOfShapeListOfShape myImages;
172 BOPCol_DataMapOfShapeShape myShapesSD;
173 BOPCol_DataMapOfShapeListOfShape mySplits;
174 BOPCol_DataMapOfShapeListOfShape myOrigins;
175 Standard_Boolean myNonDestructive;
176 BOPAlgo_GlueEnum myGlue;
183 #endif // _BOPAlgo_Builder_HeaderFile