0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / RWStepAP203 / RWStepAP203_RWCcDesignSpecificationReference.cxx
1 // Created on: 1999-11-26
2 // Created by: Andrey BETENEV
3 // Copyright (c) 1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
18
19 #include <Interface_Check.hxx>
20 #include <Interface_EntityIterator.hxx>
21 #include <RWStepAP203_RWCcDesignSpecificationReference.hxx>
22 #include <StepAP203_CcDesignSpecificationReference.hxx>
23 #include <StepAP203_HArray1OfSpecifiedItem.hxx>
24 #include <StepAP203_SpecifiedItem.hxx>
25 #include <StepBasic_Document.hxx>
26 #include <StepData_StepReaderData.hxx>
27 #include <StepData_StepWriter.hxx>
28
29 //=======================================================================
30 //function : RWStepAP203_RWCcDesignSpecificationReference
31 //purpose  : 
32 //=======================================================================
33 RWStepAP203_RWCcDesignSpecificationReference::RWStepAP203_RWCcDesignSpecificationReference ()
34 {
35 }
36
37 //=======================================================================
38 //function : ReadStep
39 //purpose  : 
40 //=======================================================================
41
42 void RWStepAP203_RWCcDesignSpecificationReference::ReadStep (const Handle(StepData_StepReaderData)& data,
43                                                              const Standard_Integer num,
44                                                              Handle(Interface_Check)& ach,
45                                                              const Handle(StepAP203_CcDesignSpecificationReference) &ent) const
46 {
47   // Check number of parameters
48   if ( ! data->CheckNbParams(num,3,ach,"cc_design_specification_reference") ) return;
49
50   // Inherited fields of DocumentReference
51
52   Handle(StepBasic_Document) aDocumentReference_AssignedDocument;
53   data->ReadEntity (num, 1, "document_reference.assigned_document", ach, STANDARD_TYPE(StepBasic_Document), aDocumentReference_AssignedDocument);
54
55   Handle(TCollection_HAsciiString) aDocumentReference_Source;
56   data->ReadString (num, 2, "document_reference.source", ach, aDocumentReference_Source);
57
58   // Own fields of CcDesignSpecificationReference
59
60   Handle(StepAP203_HArray1OfSpecifiedItem) aItems;
61   Standard_Integer sub3 = 0;
62   if ( data->ReadSubList (num, 3, "items", ach, sub3) ) {
63     Standard_Integer num2 = sub3;
64     Standard_Integer nb0 = data->NbParams(num2);
65     aItems = new StepAP203_HArray1OfSpecifiedItem (1, nb0);
66     for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
67       StepAP203_SpecifiedItem anIt0;
68       data->ReadEntity (num2, i0, "items", ach, anIt0);
69       aItems->SetValue(i0, anIt0);
70     }
71   }
72
73   // Initialize entity
74   ent->Init(aDocumentReference_AssignedDocument,
75             aDocumentReference_Source,
76             aItems);
77 }
78
79 //=======================================================================
80 //function : WriteStep
81 //purpose  : 
82 //=======================================================================
83
84 void RWStepAP203_RWCcDesignSpecificationReference::WriteStep (StepData_StepWriter& SW,
85                                                               const Handle(StepAP203_CcDesignSpecificationReference) &ent) const
86 {
87
88   // Inherited fields of DocumentReference
89
90   SW.Send (ent->StepBasic_DocumentReference::AssignedDocument());
91
92   SW.Send (ent->StepBasic_DocumentReference::Source());
93
94   // Own fields of CcDesignSpecificationReference
95
96   SW.OpenSub();
97   for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) {
98     StepAP203_SpecifiedItem Var0 = ent->Items()->Value(i2);
99     SW.Send (Var0.Value());
100   }
101   SW.CloseSub();
102 }
103
104 //=======================================================================
105 //function : Share
106 //purpose  : 
107 //=======================================================================
108
109 void RWStepAP203_RWCcDesignSpecificationReference::Share (const Handle(StepAP203_CcDesignSpecificationReference) &ent,
110                                                           Interface_EntityIterator& iter) const
111 {
112
113   // Inherited fields of DocumentReference
114
115   iter.AddItem (ent->StepBasic_DocumentReference::AssignedDocument());
116
117   // Own fields of CcDesignSpecificationReference
118
119   for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) {
120     StepAP203_SpecifiedItem Var0 = ent->Items()->Value(i2);
121     iter.AddItem (Var0.Value());
122   }
123 }