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_RWCcDesignSpecificationReference.ixx> |
20 | #include <StepAP203_HArray1OfSpecifiedItem.hxx> |
21 | #include <StepAP203_SpecifiedItem.hxx> |
ec357c5c |
22 | #include <StepBasic_Document.hxx> |
7fd59977 |
23 | |
24 | //======================================================================= |
25 | //function : RWStepAP203_RWCcDesignSpecificationReference |
26 | //purpose : |
27 | //======================================================================= |
28 | |
29 | RWStepAP203_RWCcDesignSpecificationReference::RWStepAP203_RWCcDesignSpecificationReference () |
30 | { |
31 | } |
32 | |
33 | //======================================================================= |
34 | //function : ReadStep |
35 | //purpose : |
36 | //======================================================================= |
37 | |
38 | void RWStepAP203_RWCcDesignSpecificationReference::ReadStep (const Handle(StepData_StepReaderData)& data, |
39 | const Standard_Integer num, |
40 | Handle(Interface_Check)& ach, |
41 | const Handle(StepAP203_CcDesignSpecificationReference) &ent) const |
42 | { |
43 | // Check number of parameters |
44 | if ( ! data->CheckNbParams(num,3,ach,"cc_design_specification_reference") ) return; |
45 | |
46 | // Inherited fields of DocumentReference |
47 | |
48 | Handle(StepBasic_Document) aDocumentReference_AssignedDocument; |
49 | data->ReadEntity (num, 1, "document_reference.assigned_document", ach, STANDARD_TYPE(StepBasic_Document), aDocumentReference_AssignedDocument); |
50 | |
51 | Handle(TCollection_HAsciiString) aDocumentReference_Source; |
52 | data->ReadString (num, 2, "document_reference.source", ach, aDocumentReference_Source); |
53 | |
54 | // Own fields of CcDesignSpecificationReference |
55 | |
56 | Handle(StepAP203_HArray1OfSpecifiedItem) aItems; |
57 | Standard_Integer sub3 = 0; |
58 | if ( data->ReadSubList (num, 3, "items", ach, sub3) ) { |
59 | Standard_Integer num2 = sub3; |
60 | Standard_Integer nb0 = data->NbParams(num2); |
61 | aItems = new StepAP203_HArray1OfSpecifiedItem (1, nb0); |
62 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
63 | StepAP203_SpecifiedItem anIt0; |
64 | data->ReadEntity (num2, i0, "items", ach, anIt0); |
65 | aItems->SetValue(i0, anIt0); |
66 | } |
67 | } |
68 | |
69 | // Initialize entity |
70 | ent->Init(aDocumentReference_AssignedDocument, |
71 | aDocumentReference_Source, |
72 | aItems); |
73 | } |
74 | |
75 | //======================================================================= |
76 | //function : WriteStep |
77 | //purpose : |
78 | //======================================================================= |
79 | |
80 | void RWStepAP203_RWCcDesignSpecificationReference::WriteStep (StepData_StepWriter& SW, |
81 | const Handle(StepAP203_CcDesignSpecificationReference) &ent) const |
82 | { |
83 | |
84 | // Inherited fields of DocumentReference |
85 | |
86 | SW.Send (ent->StepBasic_DocumentReference::AssignedDocument()); |
87 | |
88 | SW.Send (ent->StepBasic_DocumentReference::Source()); |
89 | |
90 | // Own fields of CcDesignSpecificationReference |
91 | |
92 | SW.OpenSub(); |
93 | for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) { |
94 | StepAP203_SpecifiedItem Var0 = ent->Items()->Value(i2); |
95 | SW.Send (Var0.Value()); |
96 | } |
97 | SW.CloseSub(); |
98 | } |
99 | |
100 | //======================================================================= |
101 | //function : Share |
102 | //purpose : |
103 | //======================================================================= |
104 | |
105 | void RWStepAP203_RWCcDesignSpecificationReference::Share (const Handle(StepAP203_CcDesignSpecificationReference) &ent, |
106 | Interface_EntityIterator& iter) const |
107 | { |
108 | |
109 | // Inherited fields of DocumentReference |
110 | |
111 | iter.AddItem (ent->StepBasic_DocumentReference::AssignedDocument()); |
112 | |
113 | // Own fields of CcDesignSpecificationReference |
114 | |
115 | for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) { |
116 | StepAP203_SpecifiedItem Var0 = ent->Items()->Value(i2); |
117 | iter.AddItem (Var0.Value()); |
118 | } |
119 | } |