0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / RWStepAP214 / RWStepAP214_RWAutoDesignNominalDateAssignment.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
7fd59977 13
7fd59977 14
42cf5bc1 15#include <Interface_Check.hxx>
7fd59977 16#include <Interface_EntityIterator.hxx>
42cf5bc1 17#include <RWStepAP214_RWAutoDesignNominalDateAssignment.hxx>
18#include <StepAP214_AutoDesignDatedItem.hxx>
7fd59977 19#include <StepAP214_AutoDesignNominalDateAssignment.hxx>
42cf5bc1 20#include <StepAP214_HArray1OfAutoDesignDatedItem.hxx>
21#include <StepBasic_Date.hxx>
22#include <StepBasic_DateRole.hxx>
23#include <StepData_StepReaderData.hxx>
24#include <StepData_StepWriter.hxx>
7fd59977 25
26RWStepAP214_RWAutoDesignNominalDateAssignment::RWStepAP214_RWAutoDesignNominalDateAssignment () {}
27
28void RWStepAP214_RWAutoDesignNominalDateAssignment::ReadStep
29 (const Handle(StepData_StepReaderData)& data,
30 const Standard_Integer num,
31 Handle(Interface_Check)& ach,
32 const Handle(StepAP214_AutoDesignNominalDateAssignment)& ent) const
33{
34
35
36 // --- Number of Parameter Control ---
37
38 if (!data->CheckNbParams(num,3,ach,"auto_design_nominal_date_assignment")) return;
39
40 // --- inherited field : assignedDate ---
41
42 Handle(StepBasic_Date) aAssignedDate;
302f96fb 43 data->ReadEntity(num, 1,"assigned_date", ach, STANDARD_TYPE(StepBasic_Date), aAssignedDate);
7fd59977 44
45 // --- inherited field : role ---
46
47 Handle(StepBasic_DateRole) aRole;
302f96fb 48 data->ReadEntity(num, 2,"role", ach, STANDARD_TYPE(StepBasic_DateRole), aRole);
7fd59977 49
50 // --- own field : items ---
51
52 Handle(StepAP214_HArray1OfAutoDesignDatedItem) aItems;
53 StepAP214_AutoDesignDatedItem aItemsItem;
54 Standard_Integer nsub3;
55 if (data->ReadSubList (num,3,"items",ach,nsub3)) {
56 Standard_Integer nb3 = data->NbParams(nsub3);
57 aItems = new StepAP214_HArray1OfAutoDesignDatedItem (1, nb3);
58 for (Standard_Integer i3 = 1; i3 <= nb3; i3 ++) {
59 Standard_Boolean stat3 = data->ReadEntity
60 (nsub3,i3,"items",ach,aItemsItem);
61 if (stat3) aItems->SetValue(i3,aItemsItem);
62 }
63 }
64
65 //--- Initialisation of the read entity ---
66
67
68 ent->Init(aAssignedDate, aRole, aItems);
69}
70
71
72void RWStepAP214_RWAutoDesignNominalDateAssignment::WriteStep
73 (StepData_StepWriter& SW,
74 const Handle(StepAP214_AutoDesignNominalDateAssignment)& ent) const
75{
76
77 // --- inherited field assignedDate ---
78
79 SW.Send(ent->AssignedDate());
80
81 // --- inherited field role ---
82
83 SW.Send(ent->Role());
84
85 // --- own field : items ---
86
87 SW.OpenSub();
88 for (Standard_Integer i3 = 1; i3 <= ent->NbItems(); i3 ++) {
89 SW.Send(ent->ItemsValue(i3).Value());
90 }
91 SW.CloseSub();
92}
93
94
95void RWStepAP214_RWAutoDesignNominalDateAssignment::Share(const Handle(StepAP214_AutoDesignNominalDateAssignment)& ent, Interface_EntityIterator& iter) const
96{
97
98 iter.GetOneItem(ent->AssignedDate());
99
100
101 iter.GetOneItem(ent->Role());
102
103
104 Standard_Integer nbElem3 = ent->NbItems();
105 for (Standard_Integer is3=1; is3<=nbElem3; is3 ++) {
106 iter.GetOneItem(ent->ItemsValue(is3).Value());
107 }
108
109}
110