b311480e |
1 | // Created on: 1999-11-26 |
2 | // Created by: Andrey BETENEV |
3 | // Copyright (c) 1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0 |
7fd59977 |
18 | |
19 | #include <RWStepAP203_RWCcDesignDateAndTimeAssignment.ixx> |
20 | #include <StepAP203_HArray1OfDateTimeItem.hxx> |
21 | #include <StepAP203_DateTimeItem.hxx> |
22 | |
23 | //======================================================================= |
24 | //function : RWStepAP203_RWCcDesignDateAndTimeAssignment |
25 | //purpose : |
26 | //======================================================================= |
27 | |
28 | RWStepAP203_RWCcDesignDateAndTimeAssignment::RWStepAP203_RWCcDesignDateAndTimeAssignment () |
29 | { |
30 | } |
31 | |
32 | //======================================================================= |
33 | //function : ReadStep |
34 | //purpose : |
35 | //======================================================================= |
36 | |
37 | void RWStepAP203_RWCcDesignDateAndTimeAssignment::ReadStep (const Handle(StepData_StepReaderData)& data, |
38 | const Standard_Integer num, |
39 | Handle(Interface_Check)& ach, |
40 | const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent) const |
41 | { |
42 | // Check number of parameters |
43 | if ( ! data->CheckNbParams(num,3,ach,"cc_design_date_and_time_assignment") ) return; |
44 | |
45 | // Inherited fields of DateAndTimeAssignment |
46 | |
47 | Handle(StepBasic_DateAndTime) aDateAndTimeAssignment_AssignedDateAndTime; |
48 | data->ReadEntity (num, 1, "date_and_time_assignment.assigned_date_and_time", ach, STANDARD_TYPE(StepBasic_DateAndTime), aDateAndTimeAssignment_AssignedDateAndTime); |
49 | |
50 | Handle(StepBasic_DateTimeRole) aDateAndTimeAssignment_Role; |
51 | data->ReadEntity (num, 2, "date_and_time_assignment.role", ach, STANDARD_TYPE(StepBasic_DateTimeRole), aDateAndTimeAssignment_Role); |
52 | |
53 | // Own fields of CcDesignDateAndTimeAssignment |
54 | |
55 | Handle(StepAP203_HArray1OfDateTimeItem) aItems; |
56 | Standard_Integer sub3 = 0; |
57 | if ( data->ReadSubList (num, 3, "items", ach, sub3) ) { |
58 | Standard_Integer num2 = sub3; |
59 | Standard_Integer nb0 = data->NbParams(num2); |
60 | aItems = new StepAP203_HArray1OfDateTimeItem (1, nb0); |
61 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
62 | StepAP203_DateTimeItem anIt0; |
63 | data->ReadEntity (num2, i0, "items", ach, anIt0); |
64 | aItems->SetValue(i0, anIt0); |
65 | } |
66 | } |
67 | |
68 | // Initialize entity |
69 | ent->Init(aDateAndTimeAssignment_AssignedDateAndTime, |
70 | aDateAndTimeAssignment_Role, |
71 | aItems); |
72 | } |
73 | |
74 | //======================================================================= |
75 | //function : WriteStep |
76 | //purpose : |
77 | //======================================================================= |
78 | |
79 | void RWStepAP203_RWCcDesignDateAndTimeAssignment::WriteStep (StepData_StepWriter& SW, |
80 | const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent) const |
81 | { |
82 | |
83 | // Inherited fields of DateAndTimeAssignment |
84 | |
85 | SW.Send (ent->StepBasic_DateAndTimeAssignment::AssignedDateAndTime()); |
86 | |
87 | SW.Send (ent->StepBasic_DateAndTimeAssignment::Role()); |
88 | |
89 | // Own fields of CcDesignDateAndTimeAssignment |
90 | |
91 | SW.OpenSub(); |
92 | for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) { |
93 | StepAP203_DateTimeItem Var0 = ent->Items()->Value(i2); |
94 | SW.Send (Var0.Value()); |
95 | } |
96 | SW.CloseSub(); |
97 | } |
98 | |
99 | //======================================================================= |
100 | //function : Share |
101 | //purpose : |
102 | //======================================================================= |
103 | |
104 | void RWStepAP203_RWCcDesignDateAndTimeAssignment::Share (const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent, |
105 | Interface_EntityIterator& iter) const |
106 | { |
107 | |
108 | // Inherited fields of DateAndTimeAssignment |
109 | |
110 | iter.AddItem (ent->StepBasic_DateAndTimeAssignment::AssignedDateAndTime()); |
111 | |
112 | iter.AddItem (ent->StepBasic_DateAndTimeAssignment::Role()); |
113 | |
114 | // Own fields of CcDesignDateAndTimeAssignment |
115 | |
116 | for (Standard_Integer i3=1; i3 <= ent->Items()->Length(); i3++ ) { |
117 | StepAP203_DateTimeItem Var0 = ent->Items()->Value(i3); |
118 | iter.AddItem (Var0.Value()); |
119 | } |
120 | } |