summaryrefslogtreecommitdiff
path: root/src/RWStepBasic/RWStepBasic_RWOrganizationalAddress.cxx
blob: ef8ed0e466a78781cd953d954c695724d7a48021 (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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
//gka 05.03.99 S4134 upgrade from CD to DIS
#include <RWStepBasic_RWOrganizationalAddress.ixx>
#include <StepBasic_HArray1OfOrganization.hxx>
#include <StepBasic_Organization.hxx>


#include <Interface_EntityIterator.hxx>


#include <StepBasic_OrganizationalAddress.hxx>


RWStepBasic_RWOrganizationalAddress::RWStepBasic_RWOrganizationalAddress () {}

void RWStepBasic_RWOrganizationalAddress::ReadStep
	(const Handle(StepData_StepReaderData)& data,
	 const Standard_Integer num,
	 Handle(Interface_Check)& ach,
	 const Handle(StepBasic_OrganizationalAddress)& ent) const
{


	// --- Number of Parameter Control ---

	if (!data->CheckNbParams(num,14,ach,"organizational_address")) return;

	// --- inherited field : internalLocation ---

	Handle(TCollection_HAsciiString) aInternalLocation;
	Standard_Boolean hasAinternalLocation = Standard_True;
	if (data->IsParamDefined(num,1)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
	  data->ReadString (num,1,"internal_location",ach,aInternalLocation);
	}
	else {
	  hasAinternalLocation = Standard_False;
	  aInternalLocation.Nullify();
	}

	// --- inherited field : streetNumber ---

	Handle(TCollection_HAsciiString) aStreetNumber;
	Standard_Boolean hasAstreetNumber = Standard_True;
	if (data->IsParamDefined(num,2)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
	  data->ReadString (num,2,"street_number",ach,aStreetNumber);
	}
	else {
	  hasAstreetNumber = Standard_False;
	  aStreetNumber.Nullify();
	}

	// --- inherited field : street ---

	Handle(TCollection_HAsciiString) aStreet;
	Standard_Boolean hasAstreet = Standard_True;
	if (data->IsParamDefined(num,3)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
	  data->ReadString (num,3,"street",ach,aStreet);
	}
	else {
	  hasAstreet = Standard_False;
	  aStreet.Nullify();
	}

	// --- inherited field : postalBox ---

	Handle(TCollection_HAsciiString) aPostalBox;
	Standard_Boolean hasApostalBox = Standard_True;
	if (data->IsParamDefined(num,4)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
	  data->ReadString (num,4,"postal_box",ach,aPostalBox);
	}
	else {
	  hasApostalBox = Standard_False;
	  aPostalBox.Nullify();
	}

	// --- inherited field : town ---

	Handle(TCollection_HAsciiString) aTown;
	Standard_Boolean hasAtown = Standard_True;
	if (data->IsParamDefined(num,5)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed
	  data->ReadString (num,5,"town",ach,aTown);
	}
	else {
	  hasAtown = Standard_False;
	  aTown.Nullify();
	}

	// --- inherited field : region ---

	Handle(TCollection_HAsciiString) aRegion;
	Standard_Boolean hasAregion = Standard_True;
	if (data->IsParamDefined(num,6)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed
	  data->ReadString (num,6,"region",ach,aRegion);
	}
	else {
	  hasAregion = Standard_False;
	  aRegion.Nullify();
	}

	// --- inherited field : postalCode ---

	Handle(TCollection_HAsciiString) aPostalCode;
	Standard_Boolean hasApostalCode = Standard_True;
	if (data->IsParamDefined(num,7)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed
	  data->ReadString (num,7,"postal_code",ach,aPostalCode);
	}
	else {
	  hasApostalCode = Standard_False;
	  aPostalCode.Nullify();
	}

	// --- inherited field : country ---

	Handle(TCollection_HAsciiString) aCountry;
	Standard_Boolean hasAcountry = Standard_True;
	if (data->IsParamDefined(num,8)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed
	  data->ReadString (num,8,"country",ach,aCountry);
	}
	else {
	  hasAcountry = Standard_False;
	  aCountry.Nullify();
	}

	// --- inherited field : facsimileNumber ---

	Handle(TCollection_HAsciiString) aFacsimileNumber;
	Standard_Boolean hasAfacsimileNumber = Standard_True;
	if (data->IsParamDefined(num,9)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat9 =` not needed
	  data->ReadString (num,9,"facsimile_number",ach,aFacsimileNumber);
	}
	else {
	  hasAfacsimileNumber = Standard_False;
	  aFacsimileNumber.Nullify();
	}

	// --- inherited field : telephoneNumber ---

	Handle(TCollection_HAsciiString) aTelephoneNumber;
	Standard_Boolean hasAtelephoneNumber = Standard_True;
	if (data->IsParamDefined(num,10)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat10 =` not needed
	  data->ReadString (num,10,"telephone_number",ach,aTelephoneNumber);
	}
	else {
	  hasAtelephoneNumber = Standard_False;
	  aTelephoneNumber.Nullify();
	}

	// --- inherited field : electronicMailAddress ---

	Handle(TCollection_HAsciiString) aElectronicMailAddress;
	Standard_Boolean hasAelectronicMailAddress = Standard_True;
	if (data->IsParamDefined(num,11)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat11 =` not needed
	  data->ReadString (num,11,"electronic_mail_address",ach,aElectronicMailAddress);
	}
	else {
	  hasAelectronicMailAddress = Standard_False;
	  aElectronicMailAddress.Nullify();
	}

	// --- inherited field : telexNumber ---

	Handle(TCollection_HAsciiString) aTelexNumber;
	Standard_Boolean hasAtelexNumber = Standard_True;
	if (data->IsParamDefined(num,12)) {
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat12 =` not needed
	  data->ReadString (num,12,"telex_number",ach,aTelexNumber);
	}
	else {
	  hasAtelexNumber = Standard_False;
	  aTelexNumber.Nullify();
	}

	// --- own field : organizations ---

	Handle(StepBasic_HArray1OfOrganization) aOrganizations;
	Handle(StepBasic_Organization) anent13;
	Standard_Integer nsub13;
	if (data->ReadSubList (num,13,"organizations",ach,nsub13)) {
	  Standard_Integer nb13 = data->NbParams(nsub13);
	  aOrganizations = new StepBasic_HArray1OfOrganization (1, nb13);
	  for (Standard_Integer i13 = 1; i13 <= nb13; i13 ++) {
	    //szv#4:S4163:12Mar99 `Standard_Boolean stat13 =` not needed
	    if (data->ReadEntity (nsub13, i13,"organization", ach, STANDARD_TYPE(StepBasic_Organization), anent13))
	      aOrganizations->SetValue(i13, anent13);
	  }
	}

	// --- own field : description ---

	Handle(TCollection_HAsciiString) aDescription;
	if (data->IsParamDefined (num,14)) { //gka 05.03.99 S4134 upgrade from CD to DIS
	  //szv#4:S4163:12Mar99 `Standard_Boolean stat14 =` not needed
	  data->ReadString (num,14,"description",ach,aDescription);
	}
	//--- Initialisation of the read entity ---


	ent->Init(hasAinternalLocation, aInternalLocation, hasAstreetNumber, aStreetNumber, hasAstreet, aStreet, hasApostalBox, aPostalBox, hasAtown, aTown, hasAregion, aRegion, hasApostalCode, aPostalCode, hasAcountry, aCountry, hasAfacsimileNumber, aFacsimileNumber, hasAtelephoneNumber, aTelephoneNumber, hasAelectronicMailAddress, aElectronicMailAddress, hasAtelexNumber, aTelexNumber, aOrganizations, aDescription);
}


void RWStepBasic_RWOrganizationalAddress::WriteStep
	(StepData_StepWriter& SW,
	 const Handle(StepBasic_OrganizationalAddress)& ent) const
{

	// --- inherited field internalLocation ---

	Standard_Boolean hasAinternalLocation = ent->HasInternalLocation();
	if (hasAinternalLocation) {
	  SW.Send(ent->InternalLocation());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field streetNumber ---

	Standard_Boolean hasAstreetNumber = ent->HasStreetNumber();
	if (hasAstreetNumber) {
	  SW.Send(ent->StreetNumber());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field street ---

	Standard_Boolean hasAstreet = ent->HasStreet();
	if (hasAstreet) {
	  SW.Send(ent->Street());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field postalBox ---

	Standard_Boolean hasApostalBox = ent->HasPostalBox();
	if (hasApostalBox) {
	  SW.Send(ent->PostalBox());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field town ---

	Standard_Boolean hasAtown = ent->HasTown();
	if (hasAtown) {
	  SW.Send(ent->Town());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field region ---

	Standard_Boolean hasAregion = ent->HasRegion();
	if (hasAregion) {
	  SW.Send(ent->Region());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field postalCode ---

	Standard_Boolean hasApostalCode = ent->HasPostalCode();
	if (hasApostalCode) {
	  SW.Send(ent->PostalCode());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field country ---

	Standard_Boolean hasAcountry = ent->HasCountry();
	if (hasAcountry) {
	  SW.Send(ent->Country());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field facsimileNumber ---

	Standard_Boolean hasAfacsimileNumber = ent->HasFacsimileNumber();
	if (hasAfacsimileNumber) {
	  SW.Send(ent->FacsimileNumber());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field telephoneNumber ---

	Standard_Boolean hasAtelephoneNumber = ent->HasTelephoneNumber();
	if (hasAtelephoneNumber) {
	  SW.Send(ent->TelephoneNumber());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field electronicMailAddress ---

	Standard_Boolean hasAelectronicMailAddress = ent->HasElectronicMailAddress();
	if (hasAelectronicMailAddress) {
	  SW.Send(ent->ElectronicMailAddress());
	}
	else {
	  SW.SendUndef();
	}

	// --- inherited field telexNumber ---

	Standard_Boolean hasAtelexNumber = ent->HasTelexNumber();
	if (hasAtelexNumber) {
	  SW.Send(ent->TelexNumber());
	}
	else {
	  SW.SendUndef();
	}

	// --- own field : organizations ---

	SW.OpenSub();
	for (Standard_Integer i13 = 1;  i13 <= ent->NbOrganizations();  i13 ++) {
	  SW.Send(ent->OrganizationsValue(i13));
	}
	SW.CloseSub();

	// --- own field : description ---

	SW.Send(ent->Description());
}


void RWStepBasic_RWOrganizationalAddress::Share(const Handle(StepBasic_OrganizationalAddress)& ent, Interface_EntityIterator& iter) const
{

	Standard_Integer nbElem1 = ent->NbOrganizations();
	for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
	  iter.GetOneItem(ent->OrganizationsValue(is1));
	}

}