1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _BOPDS_CommonBlock_HeaderFile
16 #define _BOPDS_CommonBlock_HeaderFile
18 #include <Standard.hxx>
19 #include <Standard_Type.hxx>
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;
30 class BOPDS_CommonBlock;
31 DEFINE_STANDARD_HANDLE(BOPDS_CommonBlock, MMgt_TShared)
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>
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
49 Standard_EXPORT BOPDS_CommonBlock();
53 //! <theAllocator> - the allocator to manage the memory
54 Standard_EXPORT BOPDS_CommonBlock(const BOPCol_BaseAllocator& theAllocator);
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);
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);
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);
78 //! Sets the list of indices of faces <aLF>
79 //! of the common block
80 Standard_EXPORT void SetFaces (const BOPCol_ListOfInteger& aLF);
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);
90 //! Returns the list of pave blocks
91 //! of the common block
92 Standard_EXPORT const BOPDS_ListOfPaveBlock& PaveBlocks() const;
96 //! Returns the list of indices of faces
97 //! of the common block
98 Standard_EXPORT const BOPCol_ListOfInteger& Faces() const;
102 //! Returns the first pave block
103 //! of the common block
104 Standard_EXPORT const Handle(BOPDS_PaveBlock)& PaveBlock1() const;
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);
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;
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;
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;
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;
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);
146 //! Returns the index of the edge
147 //! of all pave blocks of the common block
148 Standard_EXPORT Standard_Integer Edge() const;
150 Standard_EXPORT void Dump() const;
155 DEFINE_STANDARD_RTTIEXT(BOPDS_CommonBlock,MMgt_TShared)
160 BOPDS_ListOfPaveBlock myPaveBlocks;
161 BOPCol_ListOfInteger myFaces;
177 #endif // _BOPDS_CommonBlock_HeaderFile