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