0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BOPDS / BOPDS_ShapeInfo.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_ShapeInfo_HeaderFile
16 #define _BOPDS_ShapeInfo_HeaderFile
17
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
21
22 #include <TopoDS_Shape.hxx>
23 #include <TopAbs_ShapeEnum.hxx>
24 #include <Bnd_Box.hxx>
25 #include <BOPCol_ListOfInteger.hxx>
26 #include <Standard_Integer.hxx>
27 #include <BOPCol_BaseAllocator.hxx>
28 #include <Standard_Boolean.hxx>
29 class TopoDS_Shape;
30 class Bnd_Box;
31
32
33
34 //! The class BOPDS_ShapeInfo is to store
35 //! handy information about shape
36 class BOPDS_ShapeInfo 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   
43
44   //! Empty contructor
45     BOPDS_ShapeInfo();
46 virtual ~BOPDS_ShapeInfo();
47   
48
49   //! Contructor
50   //! theAllocator - the allocator to manage the memory
51     BOPDS_ShapeInfo(const BOPCol_BaseAllocator& theAllocator);
52   
53
54   //! Modifier
55   //! Sets the shape <theS>
56     void SetShape (const TopoDS_Shape& theS);
57   
58
59   //! Selector
60   //! Returns the shape
61     const TopoDS_Shape& Shape() const;
62   
63
64   //! Modifier
65   //! Sets the type of shape theType
66     void SetShapeType (const TopAbs_ShapeEnum theType);
67   
68
69   //! Selector
70   //! Returns the type of shape
71     TopAbs_ShapeEnum ShapeType() const;
72   
73
74   //! Modifier
75   //! Sets the boundung box of the shape theBox
76     void SetBox (const Bnd_Box& theBox);
77   
78
79   //! Selector
80   //! Returns the boundung box of the shape
81     const Bnd_Box& Box() const;
82   
83
84   //! Selector/Modifier
85   //! Returns the boundung box of the shape
86     Bnd_Box& ChangeBox();
87   
88
89   //! Selector
90   //! Returns the list of indices of sub-shapes
91     const BOPCol_ListOfInteger& SubShapes() const;
92   
93
94   //! Selector/ Modifier
95   //! Returns the list of indices of sub-shapes
96     BOPCol_ListOfInteger& ChangeSubShapes();
97   
98
99   //! Query
100   //! Returns true if the shape has sub-shape with
101   //! index theI
102     Standard_Boolean HasSubShape (const Standard_Integer theI) const;
103   
104     Standard_Boolean HasReference() const;
105   
106
107   //! Modifier
108   //! Sets the index of a reference information
109     void SetReference (const Standard_Integer theI);
110   
111
112   //! Selector
113   //! Returns the index of a reference information
114     Standard_Integer Reference() const;
115   
116
117   //! Query
118   //! Returns true if the shape has boundary representation
119     Standard_Boolean HasBRep() const;
120   
121
122   //! Returns true if the shape can be participant of
123   //! an interference
124   //!
125   //! Flag
126     Standard_Boolean IsInterfering() const;
127   
128
129   //! Query
130   //! Returns true if there is flag.
131     Standard_Boolean HasFlag() const;
132   
133
134   //! Query
135   //! Returns true if there is flag.
136   //! Returns the the  flag theFlag
137     Standard_Boolean HasFlag (Standard_Integer& theFlag) const;
138   
139
140   //! Modifier
141   //! Sets the flag
142     void SetFlag (const Standard_Integer theI);
143   
144
145   //! Returns the flag
146     Standard_Integer Flag() const;
147   
148   Standard_EXPORT void Dump() const;
149
150
151
152
153 protected:
154
155
156
157   TopoDS_Shape myShape;
158   TopAbs_ShapeEnum myType;
159   Bnd_Box myBox;
160   BOPCol_ListOfInteger mySubShapes;
161   Standard_Integer myReference;
162   Standard_Integer myFlag;
163
164
165 private:
166
167
168
169
170
171 };
172
173
174 #include <BOPDS_ShapeInfo.lxx>
175
176
177
178
179
180 #endif // _BOPDS_ShapeInfo_HeaderFile