0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / RWStepAP242 / RWStepAP242_RWIdAttribute.cxx
CommitLineData
28a73c1f 1// Created on: 2015-07-07
2// Created by: Irina KRYLOVA
3// Copyright (c) 2015 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
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>
22
23RWStepAP242_RWIdAttribute::RWStepAP242_RWIdAttribute () {}
24
25void 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
30{
31
32
33 // --- Number of Parameter Control ---
34
35 if (!data->CheckNbParams(num,2,ach,"id_attribute")) return;
36
37 // --- own field : attribute_value ---
38
39 Handle(TCollection_HAsciiString) anAttributeValue;
40 data->ReadString (num,1,"attribute_value",ach,anAttributeValue);
41
42 // --- own field : identified_item ---
43
44 StepAP242_IdAttributeSelect anIdentifiedItem;
45 data->ReadEntity (num,2,"identified_item",ach,anIdentifiedItem);
46
47 //--- Initialisation of the read entity ---
48
49 ent->Init(anAttributeValue, anIdentifiedItem);
50}
51
52void RWStepAP242_RWIdAttribute::WriteStep
53 (StepData_StepWriter& SW,
54 const Handle(StepAP242_IdAttribute)& ent) const
55{
56
57 // --- own field : attribute_value ---
58
59 SW.Send(ent->AttributeValue());
60
61 // --- own field : identified_item ---
62
63 SW.Send(ent->IdentifiedItem().Value());
64}
65
66void RWStepAP242_RWIdAttribute::Share(const Handle(StepAP242_IdAttribute)& ent, Interface_EntityIterator& iter) const
67{
68 iter.GetOneItem(ent->IdentifiedItem().Value());
69}
70