1 // Created on: 2015-07-07
2 // Created by: Irina KRYLOVA
3 // Copyright (c) 2015 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 #include <RWStepAP242_RWIdAttribute.hxx>
17 #include <Interface_EntityIterator.hxx>
18 #include <StepData_StepReaderData.hxx>
19 #include <StepData_StepWriter.hxx>
20 #include <StepAP242_IdAttribute.hxx>
21 #include <StepAP242_IdAttributeSelect.hxx>
23 RWStepAP242_RWIdAttribute::RWStepAP242_RWIdAttribute () {}
25 void RWStepAP242_RWIdAttribute::ReadStep
26 (const Handle(StepData_StepReaderData)& data,
27 const Standard_Integer num,
28 Handle(Interface_Check)& ach,
29 const Handle(StepAP242_IdAttribute)& ent) const
33 // --- Number of Parameter Control ---
35 if (!data->CheckNbParams(num,2,ach,"id_attribute")) return;
37 // --- own field : attribute_value ---
39 Handle(TCollection_HAsciiString) anAttributeValue;
40 data->ReadString (num,1,"attribute_value",ach,anAttributeValue);
42 // --- own field : identified_item ---
44 StepAP242_IdAttributeSelect anIdentifiedItem;
45 data->ReadEntity (num,2,"identified_item",ach,anIdentifiedItem);
47 //--- Initialisation of the read entity ---
49 ent->Init(anAttributeValue, anIdentifiedItem);
52 void RWStepAP242_RWIdAttribute::WriteStep
53 (StepData_StepWriter& SW,
54 const Handle(StepAP242_IdAttribute)& ent) const
57 // --- own field : attribute_value ---
59 SW.Send(ent->AttributeValue());
61 // --- own field : identified_item ---
63 SW.Send(ent->IdentifiedItem().Value());
66 void RWStepAP242_RWIdAttribute::Share(const Handle(StepAP242_IdAttribute)& ent, Interface_EntityIterator& iter) const
68 iter.GetOneItem(ent->IdentifiedItem().Value());