1 // Created on: 2000-05-10
2 // Created by: Andrey BETENEV
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 <RWStepAP214_RWExternallyDefinedGeneralProperty.hxx>
21 #include <StepAP214_ExternallyDefinedGeneralProperty.hxx>
22 #include <StepBasic_ExternallyDefinedItem.hxx>
23 #include <StepBasic_ExternalSource.hxx>
24 #include <StepData_StepReaderData.hxx>
25 #include <StepData_StepWriter.hxx>
27 //=======================================================================
28 //function : RWStepAP214_RWExternallyDefinedGeneralProperty
30 //=======================================================================
31 RWStepAP214_RWExternallyDefinedGeneralProperty::RWStepAP214_RWExternallyDefinedGeneralProperty ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepAP214_RWExternallyDefinedGeneralProperty::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepAP214_ExternallyDefinedGeneralProperty) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,5,ach,"externally_defined_general_property") ) return;
48 // Inherited fields of GeneralProperty
50 Handle(TCollection_HAsciiString) aGeneralProperty_Id;
51 data->ReadString (num, 1, "general_property.id", ach, aGeneralProperty_Id);
53 Handle(TCollection_HAsciiString) aGeneralProperty_Name;
54 data->ReadString (num, 2, "general_property.name", ach, aGeneralProperty_Name);
56 Handle(TCollection_HAsciiString) aGeneralProperty_Description;
57 Standard_Boolean hasGeneralProperty_Description = Standard_True;
58 if ( data->IsParamDefined (num,3) ) {
59 data->ReadString (num, 3, "general_property.description", ach, aGeneralProperty_Description);
62 hasGeneralProperty_Description = Standard_False;
65 // Inherited fields of ExternallyDefinedItem
67 StepBasic_SourceItem aExternallyDefinedItem_ItemId;
68 data->ReadEntity (num, 4, "externally_defined_item.item_id", ach, aExternallyDefinedItem_ItemId);
70 Handle(StepBasic_ExternalSource) aExternallyDefinedItem_Source;
71 data->ReadEntity (num, 5, "externally_defined_item.source", ach, STANDARD_TYPE(StepBasic_ExternalSource), aExternallyDefinedItem_Source);
74 ent->Init(aGeneralProperty_Id,
75 aGeneralProperty_Name,
76 hasGeneralProperty_Description,
77 aGeneralProperty_Description,
78 aExternallyDefinedItem_ItemId,
79 aExternallyDefinedItem_Source);
82 //=======================================================================
83 //function : WriteStep
85 //=======================================================================
87 void RWStepAP214_RWExternallyDefinedGeneralProperty::WriteStep (StepData_StepWriter& SW,
88 const Handle(StepAP214_ExternallyDefinedGeneralProperty) &ent) const
91 // Inherited fields of GeneralProperty
93 SW.Send (ent->StepBasic_GeneralProperty::Id());
95 SW.Send (ent->StepBasic_GeneralProperty::Name());
97 if ( ent->StepBasic_GeneralProperty::HasDescription() ) {
98 SW.Send (ent->StepBasic_GeneralProperty::Description());
102 // Inherited fields of ExternallyDefinedItem
104 SW.Send (ent->ExternallyDefinedItem()->ItemId().Value());
106 SW.Send (ent->ExternallyDefinedItem()->Source());
109 //=======================================================================
112 //=======================================================================
114 void RWStepAP214_RWExternallyDefinedGeneralProperty::Share (const Handle(StepAP214_ExternallyDefinedGeneralProperty) &ent,
115 Interface_EntityIterator& iter) const
118 // Inherited fields of GeneralProperty
120 // Inherited fields of ExternallyDefinedItem
122 iter.AddItem (ent->ExternallyDefinedItem()->ItemId().Value());
124 iter.AddItem (ent->ExternallyDefinedItem()->Source());