42cf5bc1 |
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 |
6 | // |
7 | // This file is part of Open CASCADE Technology software library. |
8 | // |
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. |
14 | // |
15 | // Alternatively, this file may be used under the terms of Open CASCADE |
16 | // commercial license or contractual agreement. |
17 | |
18 | #ifndef _BOPAlgo_BuilderArea_HeaderFile |
19 | #define _BOPAlgo_BuilderArea_HeaderFile |
20 | |
21 | #include <Standard.hxx> |
22 | #include <Standard_DefineAlloc.hxx> |
23 | #include <Standard_Handle.hxx> |
24 | |
42cf5bc1 |
25 | #include <BOPAlgo_Algo.hxx> |
1155d05a |
26 | #include <NCollection_BaseAllocator.hxx> |
27 | #include <TopTools_ListOfShape.hxx> |
28 | #include <TopTools_IndexedMapOfOrientedShape.hxx> |
42cf5bc1 |
29 | class IntTools_Context; |
30 | |
31 | |
32 | //! The root class for algorithms to build |
33 | //! faces/solids from set of edges/faces |
34 | class BOPAlgo_BuilderArea : public BOPAlgo_Algo |
35 | { |
36 | public: |
37 | |
38 | DEFINE_STANDARD_ALLOC |
39 | |
291fced1 |
40 | //! Sets the context for the algorithms |
0f57ab75 |
41 | void SetContext (const Handle(IntTools_Context)& theContext) { |
291fced1 |
42 | myContext = theContext; |
43 | } |
44 | |
45 | //! Returns the input shapes |
0f57ab75 |
46 | const TopTools_ListOfShape& Shapes() const { |
291fced1 |
47 | return myShapes; |
48 | } |
49 | |
50 | //! Sets the shapes for building areas |
0f57ab75 |
51 | void SetShapes(const TopTools_ListOfShape& theLS) { |
291fced1 |
52 | myShapes = theLS; |
53 | } |
54 | |
55 | //! Returns the found loops |
0f57ab75 |
56 | const TopTools_ListOfShape& Loops() const { |
291fced1 |
57 | return myLoops; |
58 | } |
59 | |
60 | //! Returns the found areas |
0f57ab75 |
61 | const TopTools_ListOfShape& Areas() const { |
291fced1 |
62 | return myAreas; |
63 | } |
64 | |
65 | //! Defines the preventing of addition of internal parts into result. |
66 | //! The default value is FALSE, i.e. the internal parts are added into result. |
0f57ab75 |
67 | void SetAvoidInternalShapes(const Standard_Boolean theAvoidInternal) { |
291fced1 |
68 | myAvoidInternalShapes = theAvoidInternal; |
69 | } |
70 | |
71 | //! Returns the AvoidInternalShapes flag |
0f57ab75 |
72 | Standard_Boolean IsAvoidInternalShapes() const { |
291fced1 |
73 | return myAvoidInternalShapes; |
74 | } |
42cf5bc1 |
75 | |
76 | protected: |
77 | |
42cf5bc1 |
78 | Standard_EXPORT BOPAlgo_BuilderArea(); |
291fced1 |
79 | Standard_EXPORT virtual ~BOPAlgo_BuilderArea(); |
42cf5bc1 |
80 | |
1155d05a |
81 | Standard_EXPORT BOPAlgo_BuilderArea(const Handle(NCollection_BaseAllocator)& theAllocator); |
42cf5bc1 |
82 | |
0f57ab75 |
83 | virtual void PerformShapesToAvoid() = 0; |
42cf5bc1 |
84 | |
0f57ab75 |
85 | virtual void PerformLoops() = 0; |
42cf5bc1 |
86 | |
0f57ab75 |
87 | virtual void PerformAreas() = 0; |
42cf5bc1 |
88 | |
0f57ab75 |
89 | virtual void PerformInternalShapes() = 0; |
42cf5bc1 |
90 | |
91 | |
92 | Handle(IntTools_Context) myContext; |
1155d05a |
93 | TopTools_ListOfShape myShapes; |
94 | TopTools_ListOfShape myLoops; |
95 | TopTools_ListOfShape myLoopsInternal; |
96 | TopTools_ListOfShape myAreas; |
97 | TopTools_IndexedMapOfOrientedShape myShapesToAvoid; |
291fced1 |
98 | Standard_Boolean myAvoidInternalShapes; |
42cf5bc1 |
99 | |
100 | private: |
101 | |
42cf5bc1 |
102 | }; |
103 | |
42cf5bc1 |
104 | #endif // _BOPAlgo_BuilderArea_HeaderFile |