b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
7fd59977 |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
7fd59977 |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
16 | //-------------------------------------------------------------------- |
7fd59977 |
17 | //-------------------------------------------------------------------- |
18 | |
42cf5bc1 |
19 | #include <IGESData_DirChecker.hxx> |
20 | #include <IGESData_Dump.hxx> |
42cf5bc1 |
21 | #include <IGESData_IGESDumper.hxx> |
42cf5bc1 |
22 | #include <IGESData_IGESReaderData.hxx> |
23 | #include <IGESData_IGESWriter.hxx> |
42cf5bc1 |
24 | #include <IGESData_ParamReader.hxx> |
25 | #include <IGESDefs_AttributeDef.hxx> |
7fd59977 |
26 | #include <IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.hxx> |
42cf5bc1 |
27 | #include <IGESDefs_ToolAttributeDef.hxx> |
28 | #include <IGESGraph_HArray1OfTextDisplayTemplate.hxx> |
29 | #include <IGESGraph_TextDisplayTemplate.hxx> |
30 | #include <Interface_Check.hxx> |
31 | #include <Interface_CopyTool.hxx> |
32 | #include <Interface_EntityIterator.hxx> |
7fd59977 |
33 | #include <Interface_HArray1OfHAsciiString.hxx> |
7fd59977 |
34 | #include <Interface_Macros.hxx> |
42cf5bc1 |
35 | #include <Interface_ShareTool.hxx> |
36 | #include <Message_Messenger.hxx> |
42cf5bc1 |
37 | #include <TCollection_HAsciiString.hxx> |
38 | #include <TColStd_HArray1OfInteger.hxx> |
39 | #include <TColStd_HArray1OfReal.hxx> |
40 | #include <TColStd_HArray1OfTransient.hxx> |
7fd59977 |
41 | |
42cf5bc1 |
42 | #include <stdio.h> |
7fd59977 |
43 | IGESDefs_ToolAttributeDef::IGESDefs_ToolAttributeDef () { } |
44 | |
45 | |
46 | void IGESDefs_ToolAttributeDef::ReadOwnParams |
47 | (const Handle(IGESDefs_AttributeDef)& ent, |
48 | const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const |
49 | { |
50 | //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down |
51 | Handle(TCollection_HAsciiString) aName; |
52 | Standard_Integer aListType; |
53 | Handle(TColStd_HArray1OfInteger) attrTypes; |
54 | Handle(TColStd_HArray1OfInteger) attrValueDataTypes; |
55 | Handle(TColStd_HArray1OfInteger) attrValueCounts; |
56 | Handle(TColStd_HArray1OfTransient) attrValues; |
57 | Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) attrValuePointers; |
58 | Standard_Integer nbval; |
59 | Standard_Integer fn = ent->FormNumber(); |
60 | |
61 | if (PR.DefinedElseSkip()) |
62 | PR.ReadText(PR.Current(), "Attribute Table Name", aName); //szv#4:S4163:12Mar99 `st=` not needed |
63 | |
64 | PR.ReadInteger(PR.Current(), "Attribute List Type", aListType); //szv#4:S4163:12Mar99 `st=` not needed |
65 | |
66 | Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Attributes", nbval); |
67 | if (st && nbval > 0) |
68 | { |
69 | attrTypes = new TColStd_HArray1OfInteger(1, nbval); |
70 | attrValueDataTypes = new TColStd_HArray1OfInteger(1, nbval); |
71 | attrValueCounts = new TColStd_HArray1OfInteger(1, nbval); |
72 | if (fn > 0) attrValues = |
73 | new TColStd_HArray1OfTransient(1, nbval); |
74 | if (fn > 1) attrValuePointers = |
75 | new IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(1, nbval); |
76 | } |
77 | else PR.AddFail("Number of Attributes: Not Positive"); |
78 | |
79 | if ( ! attrTypes.IsNull()) |
80 | for (Standard_Integer i = 1; i <= nbval; i++) |
81 | { |
82 | Standard_Integer attrType; |
83 | Standard_Integer attrValueDataType; |
84 | Standard_Integer avc; |
85 | // Value according type |
86 | Handle(IGESGraph_HArray1OfTextDisplayTemplate) attrValuePointer; |
87 | |
88 | //st = PR.ReadInteger(PR.Current(), "Attribute Type", attrType); //szv#4:S4163:12Mar99 moved in if |
89 | if (PR.ReadInteger(PR.Current(), "Attribute Type", attrType)) |
90 | attrTypes->SetValue(i, attrType); |
91 | |
92 | st = PR.ReadInteger(PR.Current(),"Attribute Data Type",attrValueDataType); |
93 | if (st) attrValueDataTypes->SetValue(i, attrValueDataType); |
94 | |
95 | if (PR.DefinedElseSkip()) |
96 | st = PR.ReadInteger (PR.Current(),"Attribute Value Count",avc); |
97 | else avc = 1; |
98 | |
99 | if (st) { |
100 | attrValueCounts->SetValue(i, avc); |
101 | if (fn > 1) attrValuePointer = |
102 | new IGESGraph_HArray1OfTextDisplayTemplate(1, avc); |
103 | } |
104 | |
105 | if (! attrValues.IsNull()) |
106 | if (fn > 0) |
107 | { |
108 | Handle(TColStd_HArray1OfInteger) attrInt; |
109 | Handle(TColStd_HArray1OfReal) attrReal; |
110 | Handle(Interface_HArray1OfHAsciiString) attrStr; |
111 | Handle(IGESData_HArray1OfIGESEntity) attrEnt; |
112 | switch (attrValueDataType) { |
113 | case 1 : attrInt = new TColStd_HArray1OfInteger (1,avc); |
114 | attrValues->SetValue(i,attrInt); break; |
115 | case 2 : attrReal = new TColStd_HArray1OfReal (1,avc); |
116 | attrValues->SetValue(i,attrReal); break; |
117 | case 3 : attrStr = new Interface_HArray1OfHAsciiString(1,avc); |
118 | attrValues->SetValue(i,attrStr); break; |
119 | case 4 : attrEnt = new IGESData_HArray1OfIGESEntity (1,avc); |
120 | attrValues->SetValue(i,attrEnt); break; |
121 | case 6 : attrInt = new TColStd_HArray1OfInteger (1,avc); |
122 | attrValues->SetValue(i,attrInt); break; |
123 | default : break; |
124 | } |
125 | for (Standard_Integer j = 1; j <= avc; j++) |
126 | { |
127 | switch(attrValueDataType) |
128 | { |
129 | case 0: |
130 | { |
131 | PR.SetCurrentNumber(PR.CurrentNumber() + 1); // passer |
132 | //// attrValue->SetValue(j, NULL); par defaut |
133 | break; |
134 | } |
135 | case 1: |
136 | { |
137 | Standard_Integer temp; |
138 | //st = PR.ReadInteger(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if |
139 | if (PR.ReadInteger(PR.Current(), "Attribute Value", temp)) |
140 | attrInt->SetValue(j, temp); |
141 | } |
142 | break; |
143 | case 2: |
144 | { |
145 | Standard_Real temp; |
146 | //st = PR.ReadReal(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if |
147 | if (PR.ReadReal(PR.Current(), "Attribute Value", temp)) |
148 | attrReal->SetValue(j, temp); |
149 | } |
150 | break; |
151 | case 3: |
152 | { |
153 | Handle(TCollection_HAsciiString) temp; |
154 | //st = PR.ReadText(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if |
155 | if (PR.ReadText(PR.Current(), "Attribute Value", temp)) |
156 | attrStr->SetValue(j, temp); |
157 | } |
158 | break; |
159 | case 4: |
160 | { |
161 | Handle(IGESData_IGESEntity) temp; |
162 | //st = PR.ReadEntity(IR, PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if |
163 | if (PR.ReadEntity(IR, PR.Current(), "Attribute Value", temp)) |
164 | attrEnt->SetValue(j, temp); |
165 | } |
166 | break; |
167 | case 5: |
168 | PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip |
169 | break; |
170 | case 6: |
171 | { |
172 | Standard_Boolean temp; |
173 | //st = PR.ReadBoolean(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if |
174 | if (PR.ReadBoolean(PR.Current(), "Attribute Value", temp)) |
175 | attrInt->SetValue(j, (temp ? 1 : 0)); |
176 | } |
177 | break; |
178 | } |
179 | if (fn == 2) |
180 | { |
181 | Handle(IGESGraph_TextDisplayTemplate) tempText; |
182 | //st = PR.ReadEntity(IR,PR.Current(),"Attribute Val. Pointer", |
183 | //STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempText); //szv#4:S4163:12Mar99 moved in if |
184 | if (PR.ReadEntity(IR,PR.Current(),"Attribute Val. Pointer", |
185 | STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempText)) |
186 | attrValuePointer->SetValue(j, tempText); |
187 | } |
188 | } |
189 | if (fn == 2) |
190 | attrValuePointers->SetValue(i, attrValuePointer); |
191 | } |
192 | } |
193 | |
194 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
195 | ent->Init |
196 | (aName, aListType, attrTypes, attrValueDataTypes, attrValueCounts, |
197 | attrValues, attrValuePointers); |
198 | } |
199 | |
200 | void IGESDefs_ToolAttributeDef::WriteOwnParams |
201 | (const Handle(IGESDefs_AttributeDef)& ent, IGESData_IGESWriter& IW) const |
202 | { |
203 | if (ent->HasTableName()) IW.Send(ent->TableName()); |
204 | else IW.SendVoid(); |
205 | IW.Send(ent->ListType()); |
206 | Standard_Integer upper = ent->NbAttributes(); |
207 | IW.Send(upper); |
208 | |
209 | for (Standard_Integer i = 1; i <= upper; i++) |
210 | { |
211 | Standard_Integer check = ent->AttributeValueDataType(i); |
212 | Standard_Integer count = ent->AttributeValueCount(i); |
213 | IW.Send(ent->AttributeType(i)); |
214 | IW.Send(check); |
215 | IW.Send(count); |
216 | if (ent->FormNumber() > 0) |
217 | { |
218 | for (Standard_Integer j = 1; j <= count; j++) |
219 | { |
220 | switch (check) { |
221 | case 0 : IW.SendVoid(); break; |
222 | case 1 : IW.Send(ent->AttributeAsInteger(i,j)); break; |
223 | case 2 : IW.Send(ent->AttributeAsReal(i,j)); break; |
224 | case 3 : IW.Send(ent->AttributeAsString(i,j)); break; |
225 | case 4 : IW.Send(ent->AttributeAsEntity(i,j)); break; |
226 | case 5 : IW.SendVoid(); break; |
227 | case 6 : IW.SendBoolean(ent->AttributeAsLogical(i,j)); break; |
228 | default : break; |
229 | } |
230 | if ( ent->FormNumber() == 2) |
231 | IW.Send(ent->AttributeTextDisplay(i,j)); |
232 | } |
233 | } |
234 | } |
235 | } |
236 | |
237 | void IGESDefs_ToolAttributeDef::OwnShared |
238 | (const Handle(IGESDefs_AttributeDef)& ent, Interface_EntityIterator& iter) const |
239 | { |
240 | Standard_Integer upper = ent->NbAttributes(); |
241 | for (Standard_Integer i = 1; i <= upper; i++) |
242 | { |
243 | Standard_Integer check = ent->AttributeValueDataType(i); |
244 | Standard_Integer count = ent->AttributeValueCount(i); |
245 | if (ent->FormNumber() > 0) |
246 | { |
247 | for (Standard_Integer j = 1; j <= count; j++) |
248 | { |
249 | if ( check == 4 ) iter.GetOneItem(ent->AttributeAsEntity(i,j)); |
250 | if ( ent->FormNumber() == 2) |
251 | iter.GetOneItem(ent->AttributeTextDisplay(i,j)); |
252 | } |
253 | } |
254 | } |
255 | } |
256 | |
257 | |
258 | void IGESDefs_ToolAttributeDef::OwnCopy |
259 | (const Handle(IGESDefs_AttributeDef)& another, |
260 | const Handle(IGESDefs_AttributeDef)& ent, Interface_CopyTool& TC) const |
261 | { |
262 | Handle(TCollection_HAsciiString) aName; |
263 | if (!another->TableName().IsNull()) aName = |
264 | new TCollection_HAsciiString(another->TableName()); |
265 | Standard_Integer aListType = another->ListType(); |
266 | |
267 | Handle(TColStd_HArray1OfInteger) attrTypes; |
268 | Handle(TColStd_HArray1OfInteger) attrValueDataTypes; |
269 | Handle(TColStd_HArray1OfInteger) attrValueCounts; |
270 | Handle(TColStd_HArray1OfTransient) attrValues; |
271 | Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) attrValuePointers; |
272 | Standard_Integer nbval = another->NbAttributes(); |
273 | |
274 | attrTypes = new TColStd_HArray1OfInteger(1, nbval); |
275 | attrValueDataTypes = new TColStd_HArray1OfInteger(1, nbval); |
276 | attrValueCounts = new TColStd_HArray1OfInteger(1, nbval); |
277 | if (another->HasValues()) attrValues = |
278 | new TColStd_HArray1OfTransient(1, nbval); |
279 | if (another->HasTextDisplay()) attrValuePointers = |
280 | new IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(1, nbval); |
281 | |
282 | for (Standard_Integer i = 1; i <= nbval; i++) |
283 | { |
284 | Standard_Integer attrType = another->AttributeType(i); |
285 | attrTypes->SetValue(i, attrType); |
286 | Standard_Integer attrValueDataType = another->AttributeValueDataType(i); |
287 | attrValueDataTypes->SetValue(i, attrValueDataType); |
288 | Standard_Integer avc = another->AttributeValueCount(i); |
289 | attrValueCounts->SetValue(i, avc); |
290 | Handle(IGESGraph_HArray1OfTextDisplayTemplate) attrValuePointer; |
291 | |
292 | if (another->HasTextDisplay()) attrValuePointer = |
293 | new IGESGraph_HArray1OfTextDisplayTemplate(1, avc); |
294 | |
295 | if (another->HasValues()) |
296 | { |
297 | Handle(TColStd_HArray1OfInteger) attrInt; |
298 | Handle(TColStd_HArray1OfReal) attrReal; |
299 | Handle(Interface_HArray1OfHAsciiString) attrStr; |
300 | Handle(IGESData_HArray1OfIGESEntity) attrEnt; |
301 | switch (attrValueDataType) { |
302 | case 1 : attrInt = new TColStd_HArray1OfInteger (1,avc); |
303 | attrValues->SetValue(i,attrInt); break; |
304 | case 2 : attrReal = new TColStd_HArray1OfReal (1,avc); |
305 | attrValues->SetValue(i,attrReal); break; |
306 | case 3 : attrStr = new Interface_HArray1OfHAsciiString(1,avc); |
307 | attrValues->SetValue(i,attrStr); break; |
308 | case 4 : attrEnt = new IGESData_HArray1OfIGESEntity (1,avc); |
309 | attrValues->SetValue(i,attrEnt); break; |
310 | case 6 : attrInt = new TColStd_HArray1OfInteger (1,avc); |
311 | attrValues->SetValue(i,attrInt); break; |
312 | default : break; |
313 | } |
314 | for (Standard_Integer j = 1; j <= avc; j ++) |
315 | { |
316 | switch(attrValueDataType) |
317 | { |
318 | case 0: |
319 | break; |
320 | case 1: attrInt->SetValue(j,another->AttributeAsInteger(i,j)); |
321 | break; |
322 | case 2: attrReal->SetValue(j,another->AttributeAsReal(i,j)); |
323 | break; |
324 | case 3: attrStr->SetValue(j,new TCollection_HAsciiString |
325 | (another->AttributeAsString(i,j))); |
326 | break; |
327 | case 4: { |
328 | DeclareAndCast(IGESData_IGESEntity,Ent,TC.Transferred |
329 | (another->AttributeAsEntity(i,j))); |
330 | attrEnt->SetValue(j,Ent); |
331 | } |
332 | break; |
333 | case 5: |
334 | break; |
335 | case 6: attrInt->SetValue |
336 | (j,(another->AttributeAsLogical(i,j) ? 1 : 0)); |
337 | break; |
338 | default : break; |
339 | } |
340 | if (another->HasTextDisplay()) |
341 | { |
342 | DeclareAndCast(IGESGraph_TextDisplayTemplate, temptext, |
343 | TC.Transferred(another->AttributeTextDisplay(i,j))); |
344 | attrValuePointer->SetValue (j, temptext); |
345 | } |
346 | } |
347 | if (another->HasTextDisplay()) |
348 | attrValuePointers->SetValue(i, attrValuePointer); |
349 | } |
350 | } |
351 | ent->Init |
352 | (aName, aListType, attrTypes, attrValueDataTypes, attrValueCounts, |
353 | attrValues, attrValuePointers); |
354 | } |
355 | |
356 | IGESData_DirChecker IGESDefs_ToolAttributeDef::DirChecker |
357 | (const Handle(IGESDefs_AttributeDef)& /* ent */ ) const |
358 | { |
359 | IGESData_DirChecker DC (322, 0, 2); |
360 | DC.Structure(IGESData_DefVoid); |
361 | DC.LineFont(IGESData_DefAny); |
362 | DC.LineWeight(IGESData_DefValue); |
363 | DC.Color(IGESData_DefAny); |
364 | DC.BlankStatusIgnored(); |
365 | DC.SubordinateStatusRequired(0); |
366 | DC.UseFlagRequired(2); |
367 | DC.GraphicsIgnored(1); |
368 | return DC; |
369 | } |
370 | |
371 | void IGESDefs_ToolAttributeDef::OwnCheck |
372 | (const Handle(IGESDefs_AttributeDef)& ent, |
373 | const Interface_ShareTool& , Handle(Interface_Check)& ach) const |
374 | { |
375 | Standard_Integer nb = ent->NbAttributes(); |
376 | Standard_Integer fn = ent->FormNumber(); |
377 | for (Standard_Integer i = 1; i <= nb; i ++) { |
378 | char mess[80]; |
379 | if (ent->AttributeType(i) < 0 || ent->AttributeType(i) > 9999) { |
380 | sprintf(mess,"Attribute Type n0.%d not in <0 - 9999>", ent->AttributeType(i)); |
381 | ach->AddFail(mess); |
382 | } |
383 | Standard_Integer aty = ent->AttributeValueDataType(i); |
384 | if (aty < 0 || aty > 6) { |
385 | sprintf(mess,"Attribute Value Data Type n0.%d not in <0 - 6>", aty); |
386 | ach->AddFail(mess); |
387 | } |
388 | if (ent->AttributeValueCount(i) <= 0) continue; |
389 | Handle(Standard_Transient) list = ent->AttributeList(i); |
390 | if (fn > 0 && ent.IsNull()) { |
391 | if (aty == 0 || aty == 5) continue; |
392 | sprintf(mess,"Form Number > 0 and Attribute Value List n0.%d undefined", aty); |
393 | ach->AddFail(mess); |
394 | continue; |
395 | } |
396 | else if (fn == 0) continue; |
397 | mess[0] = '\0'; |
c48e2889 |
398 | switch (aty) |
399 | { |
400 | case 1: |
401 | if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger))) |
402 | { |
403 | sprintf(mess,"Attribute List n0.%d (Integers) badly defined", aty); |
404 | } |
405 | break; |
406 | case 2: |
407 | if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfReal))) |
408 | { |
409 | sprintf(mess,"Attribute List n0.%d (Reals) badly defined", aty); |
410 | } |
411 | break; |
412 | case 3: |
413 | if (!list->IsKind(STANDARD_TYPE(Interface_HArray1OfHAsciiString))) |
414 | { |
415 | sprintf(mess,"Attribute List n0.%d (Strings) badly defined", aty); |
416 | } |
417 | break; |
418 | case 4: |
419 | if (!list->IsKind(STANDARD_TYPE(IGESData_HArray1OfIGESEntity))) |
420 | { |
421 | sprintf(mess,"Attribute List n0.%d (IGES Pointers) badly defined", aty); |
422 | } |
423 | break; |
424 | case 6: |
425 | if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger))) |
426 | { |
427 | sprintf(mess,"Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty); |
428 | } |
429 | break; |
430 | default: |
431 | break; |
7fd59977 |
432 | } |
433 | if (mess[0] != '\0') ach->AddFail(mess); |
434 | } |
435 | } |
436 | |
437 | |
438 | void IGESDefs_ToolAttributeDef::OwnDump |
439 | (const Handle(IGESDefs_AttributeDef)& ent, const IGESData_IGESDumper& dumper, |
0ebe5b0a |
440 | Standard_OStream& S, const Standard_Integer level) const |
7fd59977 |
441 | { |
442 | Standard_Integer sublevel = (level > 4) ? 1 : 0; |
443 | |
0ebe5b0a |
444 | S << "IGESDefs_AttributeDef\n" |
445 | << "Attribute Table Name: "; |
7fd59977 |
446 | IGESData_DumpString(S,ent->TableName()); |
0ebe5b0a |
447 | S << "\n" |
448 | << "Attribute List Type : " << ent->ListType() << "\n" |
449 | << "Number of Attributes : " << ent->NbAttributes() << "\n" |
450 | << "Attribute Types :\n" |
451 | << "Attribute Value Data Types :\n" |
452 | << "Attribute Value Counts :\n"; |
453 | if (ent->HasValues()) S << "Attribute Values :\n"; |
454 | if (ent->HasTextDisplay()) S << "Attribute Value Entities :\n"; |
7fd59977 |
455 | IGESData_DumpVals(S,-level,1, ent->NbAttributes(),ent->AttributeType); |
0ebe5b0a |
456 | S << "\n"; |
7fd59977 |
457 | if (level > 4) |
458 | { |
459 | Standard_Integer upper = ent->NbAttributes(); |
460 | for (Standard_Integer i = 1; i <= upper ; i ++) |
461 | { |
462 | Standard_Integer avc = ent->AttributeValueCount(i); |
463 | Standard_Integer typ = ent->AttributeValueDataType(i); |
0ebe5b0a |
464 | S << "[" << i << "]: " |
465 | << "Attribute Type : " << ent->AttributeType(i) << " " |
466 | << "Value Data Type : " << typ; |
7fd59977 |
467 | switch (typ) { |
468 | case 0 : S << " (Void)"; break; |
469 | case 1 : S << " : Integer "; break; |
470 | case 2 : S << " : Real "; break; |
471 | case 3 : S << " : String "; break; |
472 | case 4 : S << " : Entity "; break; |
473 | case 5 : S << " (Not Used)"; break; |
474 | case 6 : S << " : Logical "; break; |
475 | default : break; |
476 | } |
0ebe5b0a |
477 | S << " Count : " << avc << "\n"; |
7fd59977 |
478 | if (ent->HasValues()) |
479 | { |
480 | if (level <= 5) { |
0ebe5b0a |
481 | S << " [ content (Values) : ask level > 5 ]\n"; |
7fd59977 |
482 | continue; |
483 | } |
484 | for (Standard_Integer j = 1; j <= avc; j ++) |
485 | { |
486 | S << "[" << j << "]: "; |
487 | switch(ent->AttributeValueDataType(i)) |
488 | { |
489 | case 0: S << "(Void) "; |
490 | break; |
491 | case 1: S << ent->AttributeAsInteger(i,j); |
492 | break; |
493 | case 2: S << ent->AttributeAsReal(i,j); |
494 | break; |
495 | case 3: IGESData_DumpString(S,ent->AttributeAsString(i,j)); |
496 | break; |
497 | case 4: dumper.Dump(ent->AttributeAsEntity(i,j),S,level-5); |
498 | break; |
499 | case 5: S << "(Not Used)"; |
500 | break; |
501 | case 6: |
502 | S << ( ent->AttributeAsLogical(i,j) ? "True" : "False"); |
503 | break; |
504 | default : break; |
505 | } |
506 | if (ent->HasTextDisplay()) |
507 | { |
508 | S << " Attribute Value Pointer : "; |
509 | dumper.Dump (ent->AttributeTextDisplay(i,j),S, sublevel); |
510 | } |
0ebe5b0a |
511 | S << std::endl; |
7fd59977 |
512 | } |
513 | } |
514 | } |
515 | } |
0ebe5b0a |
516 | S << std::endl; |
7fd59977 |
517 | } |