0025609: Clean up the duplicate classes in TKBO project
[occt.git] / src / BOPDS / BOPDS_ShapeInfo.lxx
CommitLineData
4e57c75e 1// Created by: Peter KURNEV
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
4e57c75e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
4e57c75e 5//
d5f74e42 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
973c2be1 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.
4e57c75e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
4e57c75e 14
ceaa5e27 15#include <BOPDS_Tools.hxx>
16
4e57c75e 17//=======================================================================
18//function :
19//purpose :
20//=======================================================================
ceaa5e27 21inline BOPDS_ShapeInfo::BOPDS_ShapeInfo()
4e57c75e 22:
23
24 myType(TopAbs_SHAPE),
25 myReference(-1),
26 myFlag(-1)
27{
28}
29//=======================================================================
30//function :
31//purpose :
32//=======================================================================
ceaa5e27 33inline BOPDS_ShapeInfo::BOPDS_ShapeInfo
34 (const Handle(NCollection_BaseAllocator)& theAllocator)
4e57c75e 35:
4e57c75e 36 myType(TopAbs_SHAPE),
258ff83b 37 mySubShapes(theAllocator),
4e57c75e 38 myReference(-1),
39 myFlag(-1)
40{
41}
42//=======================================================================
43//function : ~
44//purpose :
45//=======================================================================
ceaa5e27 46inline BOPDS_ShapeInfo::~BOPDS_ShapeInfo()
4e57c75e 47{
48}
49//=======================================================================
50//function : SetShape
51//purpose :
52//=======================================================================
ceaa5e27 53inline void BOPDS_ShapeInfo::SetShape(const TopoDS_Shape& theS)
4e57c75e 54{
55 myShape=theS;
56}
57//=======================================================================
58//function : Shape
59//purpose :
60//=======================================================================
ceaa5e27 61inline const TopoDS_Shape& BOPDS_ShapeInfo::Shape()const
4e57c75e 62{
63 return myShape;
64}
65//=======================================================================
66//function : SetShapeType
67//purpose :
68//=======================================================================
ceaa5e27 69inline void BOPDS_ShapeInfo::SetShapeType(const TopAbs_ShapeEnum theType)
4e57c75e 70{
71 myType=theType;
72}
73//=======================================================================
74//function : ShapeType
75//purpose :
76//=======================================================================
ceaa5e27 77inline TopAbs_ShapeEnum BOPDS_ShapeInfo::ShapeType()const
4e57c75e 78{
79 return myType;
80}
81//=======================================================================
82//function : SetBox
83//purpose :
84//=======================================================================
ceaa5e27 85inline void BOPDS_ShapeInfo::SetBox(const Bnd_Box& theBox)
4e57c75e 86{
87 myBox=theBox;
88}
89//=======================================================================
90//function : Box
91//purpose :
92//=======================================================================
ceaa5e27 93inline const Bnd_Box& BOPDS_ShapeInfo::Box()const
4e57c75e 94{
95 return myBox;
96}
97//=======================================================================
98//function : ChangeBox
99//purpose :
100//=======================================================================
ceaa5e27 101inline Bnd_Box& BOPDS_ShapeInfo::ChangeBox()
4e57c75e 102{
103 return myBox;
104}
105
106//=======================================================================
107//function : SubShapes
108//purpose :
109//=======================================================================
1155d05a 110inline const TColStd_ListOfInteger& BOPDS_ShapeInfo::SubShapes()const
4e57c75e 111{
112 return mySubShapes;
113}
114//=======================================================================
115//function : ChangeSubShapes
116//purpose :
117//=======================================================================
1155d05a 118inline TColStd_ListOfInteger& BOPDS_ShapeInfo::ChangeSubShapes()
4e57c75e 119{
120 return mySubShapes;
121}
122//=======================================================================
123//function : HasSubShape
124//purpose :
125//=======================================================================
ceaa5e27 126inline Standard_Boolean BOPDS_ShapeInfo::HasSubShape
127 (const Standard_Integer theI)const
4e57c75e 128{
129 Standard_Boolean bRet;
1155d05a 130 TColStd_ListIteratorOfListOfInteger aIt;
4e57c75e 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//=======================================================================
ceaa5e27 146inline Standard_Boolean BOPDS_ShapeInfo::HasReference()const
4e57c75e 147{
148 return (myReference>=0);
149}
150//=======================================================================
151//function : SetReference
152//purpose :
153//=======================================================================
ceaa5e27 154inline void BOPDS_ShapeInfo::SetReference(const Standard_Integer theI)
4e57c75e 155{
156 myReference=theI;
157}
158//=======================================================================
159//function : Reference
160//purpose :
161//=======================================================================
ceaa5e27 162inline Standard_Integer BOPDS_ShapeInfo::Reference()const
4e57c75e 163{
164 return myReference;
165}
166//=======================================================================
167//function : HasBRep
168//purpose :
169//=======================================================================
ceaa5e27 170inline Standard_Boolean BOPDS_ShapeInfo::HasBRep()const
171{
172 return (BOPDS_Tools::HasBRep(myType));
173}
174//=======================================================================
175//function : IsInterfering
176//purpose :
177//=======================================================================
178inline Standard_Boolean BOPDS_ShapeInfo::IsInterfering()const
4e57c75e 179{
ceaa5e27 180 return (HasBRep() || myType==TopAbs_SOLID);
4e57c75e 181}
182//=======================================================================
183//function : HasFlag
184//purpose :
185//=======================================================================
ceaa5e27 186inline Standard_Boolean BOPDS_ShapeInfo::HasFlag()const
4e57c75e 187{
188 return (myFlag>=0);
189}
190//=======================================================================
191//function : HasFlag
192//purpose :
193//=======================================================================
ceaa5e27 194inline Standard_Boolean BOPDS_ShapeInfo::HasFlag
195 (Standard_Integer& theFlag)const
4e57c75e 196{
197 theFlag=myFlag;
198 return (myFlag>=0);
199}
200//=======================================================================
201//function : SetFlag
202//purpose :
203//=======================================================================
ceaa5e27 204inline void BOPDS_ShapeInfo::SetFlag(const Standard_Integer theFlag)
4e57c75e 205{
206 myFlag=theFlag;
207}
208//=======================================================================
209//function : Flag
210//purpose :
211//=======================================================================
ceaa5e27 212inline Standard_Integer BOPDS_ShapeInfo::Flag()const
4e57c75e 213{
214 return myFlag;
215}