1 // Created on: 2000-05-11
2 // Created by: data exchange team
3 // Copyright (c) 2000-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 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepBasic_RWDocumentFile.hxx>
21 #include <StepBasic_CharacterizedObject.hxx>
22 #include <StepBasic_DocumentFile.hxx>
23 #include <StepBasic_DocumentType.hxx>
24 #include <StepData_StepReaderData.hxx>
25 #include <StepData_StepWriter.hxx>
27 //=======================================================================
28 //function : RWStepBasic_RWDocumentFile
30 //=======================================================================
31 RWStepBasic_RWDocumentFile::RWStepBasic_RWDocumentFile ()
35 //=======================================================================
38 //=======================================================================
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
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,6,ach,"document_file") ) return;
48 // Inherited fields of Document
50 Handle(TCollection_HAsciiString) aDocument_Id;
51 data->ReadString (num, 1, "document.id", ach, aDocument_Id);
53 Handle(TCollection_HAsciiString) aDocument_Name;
54 data->ReadString (num, 2, "document.name", ach, aDocument_Name);
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);
62 hasDocument_Description = Standard_False;
65 Handle(StepBasic_DocumentType) aDocument_Kind;
66 data->ReadEntity (num, 4, "document.kind", ach, STANDARD_TYPE(StepBasic_DocumentType), aDocument_Kind);
68 // Inherited fields of CharacterizedObject
70 Handle(TCollection_HAsciiString) aCharacterizedObject_Name;
71 data->ReadString (num, 5, "characterized_object.name", ach, aCharacterizedObject_Name);
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);
79 hasCharacterizedObject_Description = Standard_False;
83 ent->Init(aDocument_Id,
85 hasDocument_Description,
86 aDocument_Description,
88 aCharacterizedObject_Name,
89 hasCharacterizedObject_Description,
90 aCharacterizedObject_Description);
93 //=======================================================================
94 //function : WriteStep
96 //=======================================================================
98 void RWStepBasic_RWDocumentFile::WriteStep (StepData_StepWriter& SW,
99 const Handle(StepBasic_DocumentFile) &ent) const
102 // Inherited fields of Document
104 SW.Send (ent->StepBasic_Document::Id());
106 SW.Send (ent->StepBasic_Document::Name());
108 if ( ent->StepBasic_Document::HasDescription() ) {
109 SW.Send (ent->StepBasic_Document::Description());
113 SW.Send (ent->StepBasic_Document::Kind());
115 // Inherited fields of CharacterizedObject
117 SW.Send (ent->CharacterizedObject()->Name());
119 if ( ent->CharacterizedObject()->HasDescription() ) {
120 SW.Send (ent->CharacterizedObject()->Description());
125 //=======================================================================
128 //=======================================================================
130 void RWStepBasic_RWDocumentFile::Share (const Handle(StepBasic_DocumentFile) &ent,
131 Interface_EntityIterator& iter) const
134 // Inherited fields of Document
136 iter.AddItem (ent->StepBasic_Document::Kind());
138 // Inherited fields of CharacterizedObject