b311480e |
1 | // Created on: 2000-05-11 |
2 | // Created by: data exchange team |
973c2be1 |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1 |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Interface_Check.hxx> |
19 | #include <Interface_EntityIterator.hxx> |
20 | #include <RWStepBasic_RWDocumentFile.hxx> |
7fd59977 |
21 | #include <StepBasic_CharacterizedObject.hxx> |
42cf5bc1 |
22 | #include <StepBasic_DocumentFile.hxx> |
ec357c5c |
23 | #include <StepBasic_DocumentType.hxx> |
42cf5bc1 |
24 | #include <StepData_StepReaderData.hxx> |
25 | #include <StepData_StepWriter.hxx> |
7fd59977 |
26 | |
27 | //======================================================================= |
28 | //function : RWStepBasic_RWDocumentFile |
29 | //purpose : |
30 | //======================================================================= |
7fd59977 |
31 | RWStepBasic_RWDocumentFile::RWStepBasic_RWDocumentFile () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : ReadStep |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | void RWStepBasic_RWDocumentFile::ReadStep (const Handle(StepData_StepReaderData)& data, |
41 | const Standard_Integer num, |
42 | Handle(Interface_Check)& ach, |
43 | const Handle(StepBasic_DocumentFile) &ent) const |
44 | { |
45 | // Check number of parameters |
46 | if ( ! data->CheckNbParams(num,6,ach,"document_file") ) return; |
47 | |
48 | // Inherited fields of Document |
49 | |
50 | Handle(TCollection_HAsciiString) aDocument_Id; |
51 | data->ReadString (num, 1, "document.id", ach, aDocument_Id); |
52 | |
53 | Handle(TCollection_HAsciiString) aDocument_Name; |
54 | data->ReadString (num, 2, "document.name", ach, aDocument_Name); |
55 | |
56 | Handle(TCollection_HAsciiString) aDocument_Description; |
57 | Standard_Boolean hasDocument_Description = Standard_True; |
58 | if ( data->IsParamDefined (num,3) ) { |
59 | data->ReadString (num, 3, "document.description", ach, aDocument_Description); |
60 | } |
61 | else { |
62 | hasDocument_Description = Standard_False; |
63 | } |
64 | |
65 | Handle(StepBasic_DocumentType) aDocument_Kind; |
66 | data->ReadEntity (num, 4, "document.kind", ach, STANDARD_TYPE(StepBasic_DocumentType), aDocument_Kind); |
67 | |
68 | // Inherited fields of CharacterizedObject |
69 | |
70 | Handle(TCollection_HAsciiString) aCharacterizedObject_Name; |
71 | data->ReadString (num, 5, "characterized_object.name", ach, aCharacterizedObject_Name); |
72 | |
73 | Handle(TCollection_HAsciiString) aCharacterizedObject_Description; |
74 | Standard_Boolean hasCharacterizedObject_Description = Standard_True; |
75 | if ( data->IsParamDefined (num,6) ) { |
76 | data->ReadString (num, 6, "characterized_object.description", ach, aCharacterizedObject_Description); |
77 | } |
78 | else { |
79 | hasCharacterizedObject_Description = Standard_False; |
80 | } |
81 | |
82 | // Initialize entity |
83 | ent->Init(aDocument_Id, |
84 | aDocument_Name, |
85 | hasDocument_Description, |
86 | aDocument_Description, |
87 | aDocument_Kind, |
88 | aCharacterizedObject_Name, |
89 | hasCharacterizedObject_Description, |
90 | aCharacterizedObject_Description); |
91 | } |
92 | |
93 | //======================================================================= |
94 | //function : WriteStep |
95 | //purpose : |
96 | //======================================================================= |
97 | |
98 | void RWStepBasic_RWDocumentFile::WriteStep (StepData_StepWriter& SW, |
99 | const Handle(StepBasic_DocumentFile) &ent) const |
100 | { |
101 | |
102 | // Inherited fields of Document |
103 | |
104 | SW.Send (ent->StepBasic_Document::Id()); |
105 | |
106 | SW.Send (ent->StepBasic_Document::Name()); |
107 | |
108 | if ( ent->StepBasic_Document::HasDescription() ) { |
109 | SW.Send (ent->StepBasic_Document::Description()); |
110 | } |
111 | else SW.SendUndef(); |
112 | |
113 | SW.Send (ent->StepBasic_Document::Kind()); |
114 | |
115 | // Inherited fields of CharacterizedObject |
116 | |
117 | SW.Send (ent->CharacterizedObject()->Name()); |
118 | |
119 | if ( ent->CharacterizedObject()->HasDescription() ) { |
120 | SW.Send (ent->CharacterizedObject()->Description()); |
121 | } |
122 | else SW.SendUndef(); |
123 | } |
124 | |
125 | //======================================================================= |
126 | //function : Share |
127 | //purpose : |
128 | //======================================================================= |
129 | |
130 | void RWStepBasic_RWDocumentFile::Share (const Handle(StepBasic_DocumentFile) &ent, |
131 | Interface_EntityIterator& iter) const |
132 | { |
133 | |
134 | // Inherited fields of Document |
135 | |
136 | iter.AddItem (ent->StepBasic_Document::Kind()); |
137 | |
138 | // Inherited fields of CharacterizedObject |
139 | } |