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_CommonBlock_HeaderFile |
16 | #define _BOPDS_CommonBlock_HeaderFile |
17 | |
18 | #include <Standard.hxx> |
19 | #include <Standard_Type.hxx> |
20 | |
21 | #include <BOPDS_ListOfPaveBlock.hxx> |
22 | #include <BOPCol_ListOfInteger.hxx> |
23 | #include <MMgt_TShared.hxx> |
24 | #include <BOPCol_BaseAllocator.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | class BOPDS_PaveBlock; |
28 | |
29 | |
30 | class BOPDS_CommonBlock; |
31 | DEFINE_STANDARD_HANDLE(BOPDS_CommonBlock, MMgt_TShared) |
32 | |
33 | |
34 | //! The class BOPDS_CommonBlock is to store |
35 | //! the information about pave blocks that have |
36 | //! geometry coincidence (in terms of a tolerance) with |
37 | //! a) other pave block(s) |
38 | //! b) face(s) |
39 | class BOPDS_CommonBlock : public MMgt_TShared |
40 | { |
41 | |
42 | public: |
43 | |
44 | |
45 | |
46 | //! Empty contructor |
47 | Standard_EXPORT BOPDS_CommonBlock(); |
48 | |
49 | |
50 | //! Contructor |
51 | //! <theAllocator> - the allocator to manage the memory |
52 | Standard_EXPORT BOPDS_CommonBlock(const BOPCol_BaseAllocator& theAllocator); |
53 | |
54 | |
55 | //! Modifier |
56 | //! Adds the pave block <aPB> to the list of pave blocks |
57 | //! of the common block |
58 | Standard_EXPORT void AddPaveBlock (const Handle(BOPDS_PaveBlock)& aPB); |
59 | |
60 | |
61 | //! Modifier |
62 | //! Adds the list of pave blocks <aLPB> |
63 | //! to the list of pave blocks |
64 | //! of the common block |
65 | Standard_EXPORT void AddPaveBlocks (const BOPDS_ListOfPaveBlock& aLPB); |
66 | |
67 | |
68 | //! Modifier |
69 | //! Adds the index of the face <aF> |
70 | //! to the list of indices of faces |
71 | //! of the common block |
72 | Standard_EXPORT void AddFace (const Standard_Integer aF); |
73 | |
74 | |
75 | //! Modifier |
76 | //! Adds the list of indices of faces <aLF> |
77 | //! to the list of indices of faces |
78 | //! of the common block |
79 | Standard_EXPORT void AddFaces (const BOPCol_ListOfInteger& aLF); |
80 | |
81 | |
82 | //! Selector |
83 | //! Returns the list of pave blocks |
84 | //! of the common block |
85 | Standard_EXPORT const BOPDS_ListOfPaveBlock& PaveBlocks() const; |
86 | |
87 | |
88 | //! Selector |
89 | //! Returns the list of indices of faces |
90 | //! of the common block |
91 | Standard_EXPORT const BOPCol_ListOfInteger& Faces() const; |
92 | |
93 | |
94 | //! Selector |
95 | //! Returns the first pave block |
96 | //! of the common block |
97 | Standard_EXPORT const Handle(BOPDS_PaveBlock)& PaveBlock1() const; |
98 | |
99 | |
100 | //! Selector |
101 | //! Returns the pave block that belongs |
102 | //! to the edge with index <theIx> |
103 | Standard_EXPORT Handle(BOPDS_PaveBlock)& PaveBlockOnEdge (const Standard_Integer theIndex); |
104 | |
105 | |
106 | //! Query |
107 | //! Returns true if the common block contains |
108 | //! a pave block that belongs |
109 | //! to the face with index <theIx> |
110 | Standard_EXPORT Standard_Boolean IsPaveBlockOnFace (const Standard_Integer theIndex) const; |
111 | |
112 | |
113 | //! Query |
114 | //! Returns true if the common block contains |
115 | //! a pave block that belongs |
116 | //! to the edge with index <theIx> |
117 | Standard_EXPORT Standard_Boolean IsPaveBlockOnEdge (const Standard_Integer theIndex) const; |
118 | |
119 | |
120 | //! Query |
121 | //! Returns true if the common block contains |
122 | //! a pave block that is equal to <thePB> |
123 | Standard_EXPORT Standard_Boolean Contains (const Handle(BOPDS_PaveBlock)& thePB) const; |
124 | |
125 | |
126 | //! Query |
127 | //! Returns true if the common block contains |
128 | //! the face with index equal to <theF> |
129 | Standard_EXPORT Standard_Boolean Contains (const Standard_Integer theF) const; |
130 | |
131 | |
132 | //! Modifier |
133 | //! Assign the index <theEdge> as the edge index |
134 | //! to all pave blocks of the common block |
135 | Standard_EXPORT void SetEdge (const Standard_Integer theEdge); |
136 | |
137 | |
138 | //! Selector |
139 | //! Returns the index of the edge |
140 | //! of all pave blocks of the common block |
141 | Standard_EXPORT Standard_Integer Edge() const; |
142 | |
143 | Standard_EXPORT void Dump() const; |
144 | |
145 | |
146 | |
147 | |
92efcf78 |
148 | DEFINE_STANDARD_RTTIEXT(BOPDS_CommonBlock,MMgt_TShared) |
42cf5bc1 |
149 | |
150 | protected: |
151 | |
152 | |
153 | BOPDS_ListOfPaveBlock myPaveBlocks; |
154 | BOPCol_ListOfInteger myFaces; |
155 | |
156 | |
157 | private: |
158 | |
159 | |
160 | |
161 | |
162 | }; |
163 | |
164 | |
165 | |
166 | |
167 | |
168 | |
169 | |
170 | #endif // _BOPDS_CommonBlock_HeaderFile |