1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1998-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // -------------------
19 //Version Date Purpose
20 // 0.0 Feb 4 1998 Creation
24 #include <PTopoDS_TShape1.ixx>
26 // Enum terms are better than statics, who need to be initialized.
29 // FreeMask has no sense in D.B. context; it is free for future use.
30 PTopoDS_ModifiedMask = 2,
31 PTopoDS_CheckedMask = 4,
32 PTopoDS_OrientableMask = 8,
33 PTopoDS_ClosedMask = 16,
34 PTopoDS_InfiniteMask = 32,
35 PTopoDS_ConvexMask = 64
39 //=======================================================================
40 //function : PTopoDS_TShape1
42 //=======================================================================
44 PTopoDS_TShape1::PTopoDS_TShape1()
46 // These two flags are always set to the Transient Value
47 //Modified(Standard_True);
48 //Orientable(Standard_True);
52 //=======================================================================
55 //=======================================================================
57 Standard_Boolean PTopoDS_TShape1::Modified() const
58 { return myFlags & PTopoDS_ModifiedMask; }
60 //=======================================================================
63 //=======================================================================
65 void PTopoDS_TShape1::Modified(const Standard_Boolean M)
67 if (M) myFlags |= PTopoDS_ModifiedMask;
68 else myFlags &= ~PTopoDS_ModifiedMask;
71 //=======================================================================
74 //=======================================================================
76 Standard_Boolean PTopoDS_TShape1::Checked() const
77 { return myFlags & PTopoDS_CheckedMask; }
79 //=======================================================================
82 //=======================================================================
84 void PTopoDS_TShape1::Checked(const Standard_Boolean M)
86 if (M) myFlags |= PTopoDS_CheckedMask;
87 else myFlags &= ~PTopoDS_CheckedMask;
90 //=======================================================================
91 //function : Orientable
93 //=======================================================================
95 Standard_Boolean PTopoDS_TShape1::Orientable() const
96 { return myFlags & PTopoDS_OrientableMask; }
98 //=======================================================================
99 //function : Orientable
101 //=======================================================================
103 void PTopoDS_TShape1::Orientable(const Standard_Boolean M)
105 if (M) myFlags |= PTopoDS_OrientableMask;
106 else myFlags &= ~PTopoDS_OrientableMask;
109 //=======================================================================
112 //=======================================================================
114 Standard_Boolean PTopoDS_TShape1::Closed() const
115 { return myFlags & PTopoDS_ClosedMask; }
117 //=======================================================================
120 //=======================================================================
122 void PTopoDS_TShape1::Closed(const Standard_Boolean M)
124 if (M) myFlags |= PTopoDS_ClosedMask;
125 else myFlags &= ~PTopoDS_ClosedMask;
128 //=======================================================================
129 //function : Infinite
131 //=======================================================================
133 Standard_Boolean PTopoDS_TShape1::Infinite() const
134 { return myFlags & PTopoDS_InfiniteMask; }
136 //=======================================================================
137 //function : Infinite
139 //=======================================================================
141 void PTopoDS_TShape1::Infinite(const Standard_Boolean M)
143 if (M) myFlags |= PTopoDS_InfiniteMask;
144 else myFlags &= ~PTopoDS_InfiniteMask;
147 //=======================================================================
150 //=======================================================================
152 Standard_Boolean PTopoDS_TShape1::Convex() const
153 { return myFlags & PTopoDS_ConvexMask; }
155 //=======================================================================
158 //=======================================================================
160 void PTopoDS_TShape1::Convex(const Standard_Boolean M)
162 if (M) myFlags |= PTopoDS_ConvexMask;
163 else myFlags &= ~PTopoDS_ConvexMask;
167 //=======================================================================
169 //purpose : returns the array of sub-shapes
170 //=======================================================================
172 Handle(PTopoDS_HArray1OfShape1) PTopoDS_TShape1::Shapes() const
175 //=======================================================================
177 //purpose : returns the Ith element of the array of sub-shapes
178 //=======================================================================
180 PTopoDS_Shape1 PTopoDS_TShape1::Shapes
181 (const Standard_Integer i) const
182 { return myShapes->Value(i); }
184 //=======================================================================
186 //purpose : Sets the array of sub-shapes
187 //=======================================================================
189 void PTopoDS_TShape1::Shapes(const Handle(PTopoDS_HArray1OfShape1)& S)
192 //=======================================================================
194 //purpose : Sets the Ith element of the array of sub-shapes
195 //=======================================================================
197 void PTopoDS_TShape1::Shapes
198 (const Standard_Integer i,
199 const PTopoDS_Shape1& S)
200 { myShapes->SetValue(i, S); }