0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BOPDS / BOPDS_ShapeInfo.lxx
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 #include <BOPDS_Tools.hxx>
16
17 //=======================================================================
18 //function : 
19 //purpose  : 
20 //=======================================================================
21 inline BOPDS_ShapeInfo::BOPDS_ShapeInfo()
22 :
23   
24   myType(TopAbs_SHAPE),
25   myReference(-1),
26   myFlag(-1)
27 {
28 }
29 //=======================================================================
30 //function : 
31 //purpose  : 
32 //=======================================================================
33 inline BOPDS_ShapeInfo::BOPDS_ShapeInfo
34   (const Handle(NCollection_BaseAllocator)& theAllocator)
35 :
36   myType(TopAbs_SHAPE),
37   mySubShapes(theAllocator),
38   myReference(-1),
39   myFlag(-1)
40 {
41 }
42 //=======================================================================
43 //function : ~
44 //purpose  : 
45 //=======================================================================
46 inline BOPDS_ShapeInfo::~BOPDS_ShapeInfo()
47 {
48 }
49 //=======================================================================
50 //function : SetShape
51 //purpose  : 
52 //=======================================================================
53 inline void BOPDS_ShapeInfo::SetShape(const TopoDS_Shape& theS)
54 {
55   myShape=theS;
56 }
57 //=======================================================================
58 //function : Shape
59 //purpose  : 
60 //=======================================================================
61 inline const TopoDS_Shape& BOPDS_ShapeInfo::Shape()const
62 {
63   return myShape;
64 }
65 //=======================================================================
66 //function : SetShapeType
67 //purpose  : 
68 //=======================================================================
69 inline void BOPDS_ShapeInfo::SetShapeType(const TopAbs_ShapeEnum theType)
70 {
71   myType=theType;
72 }
73 //=======================================================================
74 //function : ShapeType
75 //purpose  : 
76 //=======================================================================
77 inline TopAbs_ShapeEnum BOPDS_ShapeInfo::ShapeType()const
78 {
79   return myType;
80 }
81 //=======================================================================
82 //function : SetBox
83 //purpose  : 
84 //=======================================================================
85 inline void BOPDS_ShapeInfo::SetBox(const Bnd_Box& theBox)
86 {
87   myBox=theBox;
88 }
89 //=======================================================================
90 //function : Box
91 //purpose  : 
92 //=======================================================================
93 inline const Bnd_Box& BOPDS_ShapeInfo::Box()const
94 {
95   return myBox;
96 }
97 //=======================================================================
98 //function : ChangeBox
99 //purpose  : 
100 //=======================================================================
101 inline Bnd_Box& BOPDS_ShapeInfo::ChangeBox()
102 {
103   return myBox;
104 }
105
106 //=======================================================================
107 //function : SubShapes
108 //purpose  : 
109 //=======================================================================
110 inline const BOPCol_ListOfInteger& BOPDS_ShapeInfo::SubShapes()const
111 {
112   return mySubShapes;
113 }
114 //=======================================================================
115 //function : ChangeSubShapes
116 //purpose  : 
117 //=======================================================================
118 inline BOPCol_ListOfInteger& BOPDS_ShapeInfo::ChangeSubShapes()
119 {
120   return mySubShapes;
121 }
122 //=======================================================================
123 //function : HasSubShape
124 //purpose  : 
125 //=======================================================================
126 inline Standard_Boolean BOPDS_ShapeInfo::HasSubShape
127   (const Standard_Integer theI)const
128 {
129   Standard_Boolean bRet;
130   BOPCol_ListIteratorOfListOfInteger aIt;
131   //
132   bRet=Standard_False;
133   aIt.Initialize(mySubShapes);
134   for (; aIt.More(); aIt.Next()) {
135     bRet=(theI==aIt.Value());
136     if (bRet) {
137       return bRet;
138     }
139   }
140   return bRet;
141 }
142 //=======================================================================
143 //function : HasReference
144 //purpose  : 
145 //=======================================================================
146 inline Standard_Boolean BOPDS_ShapeInfo::HasReference()const
147 {
148   return (myReference>=0);
149 }
150 //=======================================================================
151 //function : SetReference
152 //purpose  : 
153 //=======================================================================
154 inline void BOPDS_ShapeInfo::SetReference(const Standard_Integer theI)
155 {
156   myReference=theI;
157 }
158 //=======================================================================
159 //function : Reference
160 //purpose  : 
161 //=======================================================================
162 inline Standard_Integer BOPDS_ShapeInfo::Reference()const
163 {
164   return myReference;
165 }
166 //=======================================================================
167 //function : HasBRep
168 //purpose  : 
169 //=======================================================================
170 inline Standard_Boolean BOPDS_ShapeInfo::HasBRep()const
171 {
172   return (BOPDS_Tools::HasBRep(myType));
173 }
174 //=======================================================================
175 //function : IsInterfering
176 //purpose  : 
177 //=======================================================================
178 inline Standard_Boolean BOPDS_ShapeInfo::IsInterfering()const
179 {
180   return (HasBRep() || myType==TopAbs_SOLID);
181 }
182 //=======================================================================
183 //function : HasFlag
184 //purpose  : 
185 //=======================================================================
186 inline Standard_Boolean BOPDS_ShapeInfo::HasFlag()const
187 {
188   return (myFlag>=0);
189 }
190 //=======================================================================
191 //function : HasFlag
192 //purpose  : 
193 //=======================================================================
194 inline Standard_Boolean BOPDS_ShapeInfo::HasFlag
195   (Standard_Integer& theFlag)const
196 {
197   theFlag=myFlag;
198   return (myFlag>=0);
199 }
200 //=======================================================================
201 //function : SetFlag
202 //purpose  : 
203 //=======================================================================
204 inline void BOPDS_ShapeInfo::SetFlag(const Standard_Integer theFlag)
205 {
206   myFlag=theFlag;
207 }
208 //=======================================================================
209 //function : Flag
210 //purpose  : 
211 //=======================================================================
212 inline Standard_Integer BOPDS_ShapeInfo::Flag()const
213 {
214   return myFlag;
215 }