1 // Created on: 1991-03-27
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <TopoDS_Shape.hxx>
19 #include <TopoDS_ListIteratorOfListOfShape.hxx>
21 // Defined mask values
22 #define TopoDS_TShape_Flags_Free (1<<0)
23 #define TopoDS_TShape_Flags_Modified (1<<1)
24 #define TopoDS_TShape_Flags_Checked (1<<2)
25 #define TopoDS_TShape_Flags_Orientable (1<<3)
26 #define TopoDS_TShape_Flags_Closed (1<<4)
27 #define TopoDS_TShape_Flags_Infinite (1<<5)
28 #define TopoDS_TShape_Flags_Convex (1<<6)
31 //=======================================================================
32 //function : TopoDS_TShape
33 //purpose : Constructor, Empty TShape
34 //=======================================================================
36 inline TopoDS_TShape::TopoDS_TShape()
37 : myFlags(TopoDS_TShape_Flags_Free |
38 TopoDS_TShape_Flags_Modified |
39 TopoDS_TShape_Flags_Orientable)
43 //=======================================================================
46 //=======================================================================
48 inline Standard_Boolean TopoDS_TShape::Free() const
50 return ((myFlags & TopoDS_TShape_Flags_Free) != 0);
53 //=======================================================================
56 //=======================================================================
58 inline void TopoDS_TShape::Free(const Standard_Boolean F)
60 if (F) myFlags |= TopoDS_TShape_Flags_Free;
61 else myFlags &= ~TopoDS_TShape_Flags_Free;
64 //=======================================================================
67 //=======================================================================
69 inline Standard_Boolean TopoDS_TShape::Modified() const
71 return ((myFlags & TopoDS_TShape_Flags_Modified) != 0);
74 //=======================================================================
77 //=======================================================================
79 inline void TopoDS_TShape::Modified(const Standard_Boolean M)
83 myFlags |= TopoDS_TShape_Flags_Modified;
84 // When a TShape is modified it is also unchecked
85 myFlags &= ~TopoDS_TShape_Flags_Checked;
87 else myFlags &= ~TopoDS_TShape_Flags_Modified;
90 //=======================================================================
93 //=======================================================================
95 inline Standard_Boolean TopoDS_TShape::Checked() const
97 return ((myFlags & TopoDS_TShape_Flags_Checked) != 0);
100 //=======================================================================
103 //=======================================================================
105 inline void TopoDS_TShape::Checked(const Standard_Boolean M)
107 if (M) myFlags |= TopoDS_TShape_Flags_Checked;
108 else myFlags &= ~TopoDS_TShape_Flags_Checked;
111 //=======================================================================
112 //function : Orientable
114 //=======================================================================
116 inline Standard_Boolean TopoDS_TShape::Orientable() const
118 return ((myFlags & TopoDS_TShape_Flags_Orientable) != 0);
121 //=======================================================================
122 //function : Orientable
124 //=======================================================================
126 inline void TopoDS_TShape::Orientable(const Standard_Boolean M)
128 if (M) myFlags |= TopoDS_TShape_Flags_Orientable;
129 else myFlags &= ~TopoDS_TShape_Flags_Orientable;
132 //=======================================================================
135 //=======================================================================
137 inline Standard_Boolean TopoDS_TShape::Closed() const
139 return ((myFlags & TopoDS_TShape_Flags_Closed) != 0);
142 //=======================================================================
145 //=======================================================================
147 inline void TopoDS_TShape::Closed(const Standard_Boolean M)
149 if (M) myFlags |= TopoDS_TShape_Flags_Closed;
150 else myFlags &= ~TopoDS_TShape_Flags_Closed;
153 //=======================================================================
154 //function : Infinite
156 //=======================================================================
158 inline Standard_Boolean TopoDS_TShape::Infinite() const
160 return ((myFlags & TopoDS_TShape_Flags_Infinite) != 0);
163 //=======================================================================
164 //function : Infinite
166 //=======================================================================
168 inline void TopoDS_TShape::Infinite(const Standard_Boolean M)
170 if (M) myFlags |= TopoDS_TShape_Flags_Infinite;
171 else myFlags &= ~TopoDS_TShape_Flags_Infinite;
174 //=======================================================================
177 //=======================================================================
179 inline Standard_Boolean TopoDS_TShape::Convex() const
181 return ((myFlags & TopoDS_TShape_Flags_Convex) != 0);
184 //=======================================================================
187 //=======================================================================
189 inline void TopoDS_TShape::Convex(const Standard_Boolean M)
191 if (M) myFlags |= TopoDS_TShape_Flags_Convex;
192 else myFlags &= ~TopoDS_TShape_Flags_Convex;
195 //=======================================================================
198 //=======================================================================
200 inline const TopoDS_ListOfShape& TopoDS_TShape::Shapes() const
205 //=======================================================================
206 //function : ChangeShapes
208 //=======================================================================
210 inline TopoDS_ListOfShape& TopoDS_TShape::ChangeShapes()