42cf5bc1 |
1 | // Created by: Peter KURNEV |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
3 | // |
4 | // This file is part of Open CASCADE Technology software library. |
5 | // |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
11 | // |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
14 | |
15 | #ifndef _BOPDS_SubIterator_HeaderFile |
16 | #define _BOPDS_SubIterator_HeaderFile |
17 | |
18 | #include <Standard.hxx> |
19 | #include <Standard_DefineAlloc.hxx> |
20 | #include <Standard_Handle.hxx> |
21 | |
22 | #include <BOPCol_BaseAllocator.hxx> |
23 | #include <BOPDS_PDS.hxx> |
24 | #include <BOPDS_ListOfPassKeyBoolean.hxx> |
25 | #include <BOPDS_ListIteratorOfListOfPassKeyBoolean.hxx> |
26 | #include <BOPCol_PListOfInteger.hxx> |
27 | #include <BOPCol_ListOfInteger.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | #include <Standard_Integer.hxx> |
30 | class BOPDS_DS; |
31 | |
32 | |
33 | |
34 | //! The class BOPDS_SubIterator is |
35 | //! 1.to compute intersections between two sub-sets of |
36 | //! BRep sub-shapes |
37 | //! of arguments of an operation (see the class BOPDS_DS) |
38 | //! in terms of theirs bounding boxes |
39 | //! 2.provides interface to iterare the pairs of |
40 | //! intersected sub-shapes of given type |
41 | class BOPDS_SubIterator |
42 | { |
43 | public: |
44 | |
45 | DEFINE_STANDARD_ALLOC |
46 | |
47 | |
48 | |
49 | //! Empty contructor |
50 | Standard_EXPORT BOPDS_SubIterator(); |
51 | Standard_EXPORT virtual ~BOPDS_SubIterator(); |
52 | |
53 | |
54 | //! Contructor |
55 | //! theAllocator - the allocator to manage the memory |
56 | Standard_EXPORT BOPDS_SubIterator(const BOPCol_BaseAllocator& theAllocator); |
57 | |
58 | |
59 | //! Modifier |
60 | //! Sets the data structure <pDS> to process |
61 | Standard_EXPORT void SetDS (const BOPDS_PDS& pDS); |
62 | |
63 | |
64 | //! Selector |
65 | //! Returns the data structure |
66 | Standard_EXPORT const BOPDS_DS& DS() const; |
67 | |
68 | |
69 | //! Modifier |
70 | //! Sets the first set of indices <theLI> to process |
71 | Standard_EXPORT void SetSubSet1 (const BOPCol_ListOfInteger& theLI); |
72 | |
73 | |
74 | //! Selector |
75 | //! Returns the first set of indices to process |
76 | Standard_EXPORT const BOPCol_ListOfInteger& SubSet1() const; |
77 | |
78 | |
79 | //! Modifier |
80 | //! Sets the second set of indices <theLI> to process |
81 | Standard_EXPORT void SetSubSet2 (const BOPCol_ListOfInteger& theLI); |
82 | |
83 | |
84 | //! Selector |
85 | //! Returns the second set of indices to process |
86 | Standard_EXPORT const BOPCol_ListOfInteger& SubSet2() const; |
87 | |
88 | |
89 | //! Initializes the iterator |
90 | Standard_EXPORT void Initialize(); |
91 | |
92 | |
93 | //! Returns true if still there are pairs |
94 | //! of intersected shapes |
95 | Standard_EXPORT Standard_Boolean More() const; |
96 | |
97 | |
98 | //! Moves iterations ahead |
99 | Standard_EXPORT void Next(); |
100 | |
101 | |
102 | //! Returns indices (DS) of intersected shapes |
103 | //! theIndex1 - the index of the first shape |
104 | //! theIndex2 - the index of the second shape |
105 | Standard_EXPORT void Value (Standard_Integer& theIndex1, Standard_Integer& theIndex2) const; |
106 | |
107 | |
108 | //! Perform the intersection algorithm and prepare |
109 | //! the results to be used |
110 | Standard_EXPORT virtual void Prepare(); |
111 | |
112 | |
113 | |
114 | |
115 | protected: |
116 | |
117 | |
118 | Standard_EXPORT virtual void Intersect(); |
119 | |
120 | |
121 | BOPCol_BaseAllocator myAllocator; |
122 | BOPDS_PDS myDS; |
123 | BOPDS_ListOfPassKeyBoolean myList; |
124 | BOPDS_ListIteratorOfListOfPassKeyBoolean myIterator; |
125 | BOPCol_PListOfInteger mySubSet1; |
126 | BOPCol_PListOfInteger mySubSet2; |
127 | |
128 | |
129 | private: |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | }; |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | |
143 | #endif // _BOPDS_SubIterator_HeaderFile |