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 | |
42cf5bc1 |
19 | #include <Interface_Check.hxx> |
20 | #include <Interface_EntityIterator.hxx> |
21 | #include <RWStepAP203_RWCcDesignDateAndTimeAssignment.hxx> |
22 | #include <StepAP203_CcDesignDateAndTimeAssignment.hxx> |
7fd59977 |
23 | #include <StepAP203_DateTimeItem.hxx> |
42cf5bc1 |
24 | #include <StepAP203_HArray1OfDateTimeItem.hxx> |
ec357c5c |
25 | #include <StepBasic_DateAndTime.hxx> |
26 | #include <StepBasic_DateTimeRole.hxx> |
42cf5bc1 |
27 | #include <StepData_StepReaderData.hxx> |
28 | #include <StepData_StepWriter.hxx> |
7fd59977 |
29 | |
30 | //======================================================================= |
31 | //function : RWStepAP203_RWCcDesignDateAndTimeAssignment |
32 | //purpose : |
33 | //======================================================================= |
7fd59977 |
34 | RWStepAP203_RWCcDesignDateAndTimeAssignment::RWStepAP203_RWCcDesignDateAndTimeAssignment () |
35 | { |
36 | } |
37 | |
38 | //======================================================================= |
39 | //function : ReadStep |
40 | //purpose : |
41 | //======================================================================= |
42 | |
43 | void RWStepAP203_RWCcDesignDateAndTimeAssignment::ReadStep (const Handle(StepData_StepReaderData)& data, |
44 | const Standard_Integer num, |
45 | Handle(Interface_Check)& ach, |
46 | const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent) const |
47 | { |
48 | // Check number of parameters |
49 | if ( ! data->CheckNbParams(num,3,ach,"cc_design_date_and_time_assignment") ) return; |
50 | |
51 | // Inherited fields of DateAndTimeAssignment |
52 | |
53 | Handle(StepBasic_DateAndTime) aDateAndTimeAssignment_AssignedDateAndTime; |
54 | data->ReadEntity (num, 1, "date_and_time_assignment.assigned_date_and_time", ach, STANDARD_TYPE(StepBasic_DateAndTime), aDateAndTimeAssignment_AssignedDateAndTime); |
55 | |
56 | Handle(StepBasic_DateTimeRole) aDateAndTimeAssignment_Role; |
57 | data->ReadEntity (num, 2, "date_and_time_assignment.role", ach, STANDARD_TYPE(StepBasic_DateTimeRole), aDateAndTimeAssignment_Role); |
58 | |
59 | // Own fields of CcDesignDateAndTimeAssignment |
60 | |
61 | Handle(StepAP203_HArray1OfDateTimeItem) aItems; |
62 | Standard_Integer sub3 = 0; |
63 | if ( data->ReadSubList (num, 3, "items", ach, sub3) ) { |
64 | Standard_Integer num2 = sub3; |
65 | Standard_Integer nb0 = data->NbParams(num2); |
66 | aItems = new StepAP203_HArray1OfDateTimeItem (1, nb0); |
67 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
68 | StepAP203_DateTimeItem anIt0; |
69 | data->ReadEntity (num2, i0, "items", ach, anIt0); |
70 | aItems->SetValue(i0, anIt0); |
71 | } |
72 | } |
73 | |
74 | // Initialize entity |
75 | ent->Init(aDateAndTimeAssignment_AssignedDateAndTime, |
76 | aDateAndTimeAssignment_Role, |
77 | aItems); |
78 | } |
79 | |
80 | //======================================================================= |
81 | //function : WriteStep |
82 | //purpose : |
83 | //======================================================================= |
84 | |
85 | void RWStepAP203_RWCcDesignDateAndTimeAssignment::WriteStep (StepData_StepWriter& SW, |
86 | const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent) const |
87 | { |
88 | |
89 | // Inherited fields of DateAndTimeAssignment |
90 | |
91 | SW.Send (ent->StepBasic_DateAndTimeAssignment::AssignedDateAndTime()); |
92 | |
93 | SW.Send (ent->StepBasic_DateAndTimeAssignment::Role()); |
94 | |
95 | // Own fields of CcDesignDateAndTimeAssignment |
96 | |
97 | SW.OpenSub(); |
98 | for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) { |
99 | StepAP203_DateTimeItem Var0 = ent->Items()->Value(i2); |
100 | SW.Send (Var0.Value()); |
101 | } |
102 | SW.CloseSub(); |
103 | } |
104 | |
105 | //======================================================================= |
106 | //function : Share |
107 | //purpose : |
108 | //======================================================================= |
109 | |
110 | void RWStepAP203_RWCcDesignDateAndTimeAssignment::Share (const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent, |
111 | Interface_EntityIterator& iter) const |
112 | { |
113 | |
114 | // Inherited fields of DateAndTimeAssignment |
115 | |
116 | iter.AddItem (ent->StepBasic_DateAndTimeAssignment::AssignedDateAndTime()); |
117 | |
118 | iter.AddItem (ent->StepBasic_DateAndTimeAssignment::Role()); |
119 | |
120 | // Own fields of CcDesignDateAndTimeAssignment |
121 | |
122 | for (Standard_Integer i3=1; i3 <= ent->Items()->Length(); i3++ ) { |
123 | StepAP203_DateTimeItem Var0 = ent->Items()->Value(i3); |
124 | iter.AddItem (Var0.Value()); |
125 | } |
126 | } |