summaryrefslogtreecommitdiff
path: root/src/PTopoDS/PTopoDS_TShape1.cxx
blob: 2c31842a360e532c691f78ef25655fb7dace99e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// File:	PTopoDS_TShape1.cxx
//      	-------------------
// Author:	DAUTRY Philippe
//		<fid@fox.paris1.matra-dtv.fr>
// Copyright:	Matra Datavision 1998

// Version:	0.0
// History:	Version	Date		Purpose
//		0.0	Feb  4 1998	Creation



#include <PTopoDS_TShape1.ixx>

// Enum terms are better than statics, who need to be initialized.
enum {
  PTopoDS_FreeMask       = 1,
  // FreeMask has no sense in D.B. context; it is free for future use.
  PTopoDS_ModifiedMask   = 2,
  PTopoDS_CheckedMask    = 4,
  PTopoDS_OrientableMask = 8,
  PTopoDS_ClosedMask     = 16,
  PTopoDS_InfiniteMask   = 32,
  PTopoDS_ConvexMask     = 64
};


//=======================================================================
//function : PTopoDS_TShape1
//purpose  : 
//=======================================================================

PTopoDS_TShape1::PTopoDS_TShape1()
: myFlags(0)
     // These two flags are always set to the Transient Value
     //Modified(Standard_True);
     //Orientable(Standard_True);
{}


//=======================================================================
//function : Modified
//purpose  : 
//=======================================================================

Standard_Boolean  PTopoDS_TShape1::Modified() const 
{ return myFlags & PTopoDS_ModifiedMask; }

//=======================================================================
//function : Modified
//purpose  : 
//=======================================================================

void  PTopoDS_TShape1::Modified(const Standard_Boolean M)
{
  if (M) myFlags |= PTopoDS_ModifiedMask;
  else   myFlags &= ~PTopoDS_ModifiedMask;
}

//=======================================================================
//function : Checked
//purpose  : 
//=======================================================================

Standard_Boolean  PTopoDS_TShape1::Checked() const 
{ return myFlags & PTopoDS_CheckedMask; }

//=======================================================================
//function : Checked
//purpose  : 
//=======================================================================

void  PTopoDS_TShape1::Checked(const Standard_Boolean M)
{
  if (M) myFlags |= PTopoDS_CheckedMask;
  else   myFlags &= ~PTopoDS_CheckedMask;
}

//=======================================================================
//function : Orientable
//purpose  : 
//=======================================================================

Standard_Boolean  PTopoDS_TShape1::Orientable() const 
{ return myFlags & PTopoDS_OrientableMask; }

//=======================================================================
//function : Orientable
//purpose  : 
//=======================================================================

void  PTopoDS_TShape1::Orientable(const Standard_Boolean M)
{
  if (M) myFlags |= PTopoDS_OrientableMask;
  else   myFlags &= ~PTopoDS_OrientableMask;
}

//=======================================================================
//function : Closed
//purpose  : 
//=======================================================================

Standard_Boolean  PTopoDS_TShape1::Closed() const 
{ return myFlags & PTopoDS_ClosedMask; }

//=======================================================================
//function : Closed
//purpose  : 
//=======================================================================

void  PTopoDS_TShape1::Closed(const Standard_Boolean M)
{
  if (M) myFlags |= PTopoDS_ClosedMask;
  else   myFlags &= ~PTopoDS_ClosedMask;
}

//=======================================================================
//function : Infinite
//purpose  : 
//=======================================================================

Standard_Boolean  PTopoDS_TShape1::Infinite() const 
{ return myFlags & PTopoDS_InfiniteMask; }

//=======================================================================
//function : Infinite
//purpose  : 
//=======================================================================

void  PTopoDS_TShape1::Infinite(const Standard_Boolean M)
{
  if (M) myFlags |= PTopoDS_InfiniteMask;
  else   myFlags &= ~PTopoDS_InfiniteMask;
}

//=======================================================================
//function : Convex
//purpose  : 
//=======================================================================

Standard_Boolean  PTopoDS_TShape1::Convex() const 
{ return myFlags & PTopoDS_ConvexMask; }

//=======================================================================
//function : Convex
//purpose  : 
//=======================================================================

void  PTopoDS_TShape1::Convex(const Standard_Boolean M)
{
  if (M) myFlags |= PTopoDS_ConvexMask;
  else   myFlags &= ~PTopoDS_ConvexMask;
}


//=======================================================================
//function : Shapes
//purpose  : returns the array of sub-shapes
//=======================================================================

Handle(PTopoDS_HArray1OfShape1) PTopoDS_TShape1::Shapes() const
{ return myShapes; }

//=======================================================================
//function : Shapes
//purpose  : returns the Ith element of the array of sub-shapes
//=======================================================================

PTopoDS_Shape1 PTopoDS_TShape1::Shapes
(const Standard_Integer i) const
{ return myShapes->Value(i); }

//=======================================================================
//function : Shapes
//purpose  : Sets the array of sub-shapes
//=======================================================================

void PTopoDS_TShape1::Shapes(const Handle(PTopoDS_HArray1OfShape1)& S)
{ myShapes = S; }

//=======================================================================
//function : Shapes
//purpose  : Sets the Ith element of the array of sub-shapes
//=======================================================================

void PTopoDS_TShape1::Shapes
(const Standard_Integer i,
 const PTopoDS_Shape1& S)
{ myShapes->SetValue(i, S); }