b311480e |
1 | // Created by: Peter KURNEV |
973c2be1 |
2 | // Copyright (c) 2010-2014 OPEN CASCADE SAS |
4e57c75e |
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 |
b311480e |
6 | // |
973c2be1 |
7 | // This file is part of Open CASCADE Technology software library. |
b311480e |
8 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
14 | // |
973c2be1 |
15 | // Alternatively, this file may be used under the terms of Open CASCADE |
16 | // commercial license or contractual agreement. |
7fd59977 |
17 | |
4e57c75e |
18 | #include <BOPAlgo_BuilderArea.ixx> |
7fd59977 |
19 | |
4e57c75e |
20 | #include <BOPCol_ListOfShape.hxx> |
21 | #include <TopoDS_Shape.hxx> |
22 | #include <NCollection_BaseAllocator.hxx> |
7fd59977 |
23 | |
24 | //======================================================================= |
4e57c75e |
25 | //function : |
26 | //purpose : |
7fd59977 |
27 | //======================================================================= |
1e143abb |
28 | BOPAlgo_BuilderArea::BOPAlgo_BuilderArea() |
7fd59977 |
29 | : |
4e57c75e |
30 | BOPAlgo_Algo(), |
4e57c75e |
31 | myShapes(myAllocator), |
32 | myLoops(myAllocator), |
33 | myLoopsInternal(myAllocator), |
34 | myAreas(myAllocator), |
35 | myShapesToAvoid(100, myAllocator) |
7fd59977 |
36 | { |
7fd59977 |
37 | } |
7fd59977 |
38 | //======================================================================= |
4e57c75e |
39 | //function : |
40 | //purpose : |
7fd59977 |
41 | //======================================================================= |
1e143abb |
42 | BOPAlgo_BuilderArea::BOPAlgo_BuilderArea |
43 | (const Handle(NCollection_BaseAllocator)& theAllocator) |
4e57c75e |
44 | : |
45 | BOPAlgo_Algo(theAllocator), |
4e57c75e |
46 | myShapes(myAllocator), |
47 | myLoops(myAllocator), |
48 | myLoopsInternal(myAllocator), |
49 | myAreas(myAllocator), |
50 | myShapesToAvoid(100, myAllocator) |
7fd59977 |
51 | { |
7fd59977 |
52 | } |
7fd59977 |
53 | //======================================================================= |
4e57c75e |
54 | //function : ~ |
55 | //purpose : |
7fd59977 |
56 | //======================================================================= |
1e143abb |
57 | BOPAlgo_BuilderArea::~BOPAlgo_BuilderArea() |
7fd59977 |
58 | { |
7fd59977 |
59 | } |
60 | //======================================================================= |
4e57c75e |
61 | //function : SetContext |
62 | //purpose : |
7fd59977 |
63 | //======================================================================= |
1e143abb |
64 | void BOPAlgo_BuilderArea::SetContext |
65 | (const Handle(IntTools_Context)& theContext) |
7fd59977 |
66 | { |
4e57c75e |
67 | myContext=theContext; |
7fd59977 |
68 | } |
7fd59977 |
69 | //======================================================================= |
4e57c75e |
70 | //function : SetShapes |
71 | //purpose : |
7fd59977 |
72 | //======================================================================= |
4e57c75e |
73 | void BOPAlgo_BuilderArea::SetShapes(const BOPCol_ListOfShape& theLF) |
7fd59977 |
74 | { |
4e57c75e |
75 | BOPCol_ListIteratorOfListOfShape aIt; |
76 | // |
77 | myShapes.Clear(); |
78 | aIt.Initialize(theLF); |
79 | for(; aIt.More(); aIt.Next()) { |
80 | const TopoDS_Shape& aF=aIt.Value(); |
81 | myShapes.Append(aF); |
82 | } |
7fd59977 |
83 | } |
84 | //======================================================================= |
4e57c75e |
85 | //function : Shapes |
86 | //purpose : |
7fd59977 |
87 | //======================================================================= |
1e143abb |
88 | const BOPCol_ListOfShape& BOPAlgo_BuilderArea::Shapes()const |
7fd59977 |
89 | { |
4e57c75e |
90 | return myShapes; |
7fd59977 |
91 | } |
92 | //======================================================================= |
4e57c75e |
93 | //function : Loops |
94 | //purpose : |
7fd59977 |
95 | //======================================================================= |
1e143abb |
96 | const BOPCol_ListOfShape& BOPAlgo_BuilderArea::Loops()const |
7fd59977 |
97 | { |
4e57c75e |
98 | return myLoops; |
7fd59977 |
99 | } |
100 | //======================================================================= |
4e57c75e |
101 | //function : Areas |
102 | //purpose : |
7fd59977 |
103 | //======================================================================= |
4e57c75e |
104 | const BOPCol_ListOfShape& BOPAlgo_BuilderArea::Areas()const |
7fd59977 |
105 | { |
4e57c75e |
106 | return myAreas; |
7fd59977 |
107 | } |