0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / RWStepRepr / RWStepRepr_RWConfigurationItem.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 <RWStepRepr_RWConfigurationItem.hxx>
22 #include <StepData_StepReaderData.hxx>
23 #include <StepData_StepWriter.hxx>
24 #include <StepRepr_ConfigurationItem.hxx>
25 #include <StepRepr_ProductConcept.hxx>
26
27 //=======================================================================
28 //function : RWStepRepr_RWConfigurationItem
29 //purpose  : 
30 //=======================================================================
31 RWStepRepr_RWConfigurationItem::RWStepRepr_RWConfigurationItem ()
32 {
33 }
34
35 //=======================================================================
36 //function : ReadStep
37 //purpose  : 
38 //=======================================================================
39
40 void RWStepRepr_RWConfigurationItem::ReadStep (const Handle(StepData_StepReaderData)& data,
41                                                const Standard_Integer num,
42                                                Handle(Interface_Check)& ach,
43                                                const Handle(StepRepr_ConfigurationItem) &ent) const
44 {
45   // Check number of parameters
46   if ( ! data->CheckNbParams(num,5,ach,"configuration_item") ) return;
47
48   // Own fields of ConfigurationItem
49
50   Handle(TCollection_HAsciiString) aId;
51   data->ReadString (num, 1, "id", ach, aId);
52
53   Handle(TCollection_HAsciiString) aName;
54   data->ReadString (num, 2, "name", ach, aName);
55
56   Handle(TCollection_HAsciiString) aDescription;
57   Standard_Boolean hasDescription = Standard_True;
58   if ( data->IsParamDefined (num,3) ) {
59     data->ReadString (num, 3, "description", ach, aDescription);
60   }
61   else {
62     hasDescription = Standard_False;
63   }
64
65   Handle(StepRepr_ProductConcept) aItemConcept;
66   data->ReadEntity (num, 4, "item_concept", ach, STANDARD_TYPE(StepRepr_ProductConcept), aItemConcept);
67
68   Handle(TCollection_HAsciiString) aPurpose;
69   Standard_Boolean hasPurpose = Standard_True;
70   if ( data->IsParamDefined (num,5) ) {
71     data->ReadString (num, 5, "purpose", ach, aPurpose);
72   }
73   else {
74     hasPurpose = Standard_False;
75   }
76
77   // Initialize entity
78   ent->Init(aId,
79             aName,
80             hasDescription,
81             aDescription,
82             aItemConcept,
83             hasPurpose,
84             aPurpose);
85 }
86
87 //=======================================================================
88 //function : WriteStep
89 //purpose  : 
90 //=======================================================================
91
92 void RWStepRepr_RWConfigurationItem::WriteStep (StepData_StepWriter& SW,
93                                                 const Handle(StepRepr_ConfigurationItem) &ent) const
94 {
95
96   // Own fields of ConfigurationItem
97
98   SW.Send (ent->Id());
99
100   SW.Send (ent->Name());
101
102   if ( ent->HasDescription() ) {
103     SW.Send (ent->Description());
104   }
105   else SW.SendUndef();
106
107   SW.Send (ent->ItemConcept());
108
109   if ( ent->HasPurpose() ) {
110     SW.Send (ent->Purpose());
111   }
112   else SW.SendUndef();
113 }
114
115 //=======================================================================
116 //function : Share
117 //purpose  : 
118 //=======================================================================
119
120 void RWStepRepr_RWConfigurationItem::Share (const Handle(StepRepr_ConfigurationItem) &ent,
121                                             Interface_EntityIterator& iter) const
122 {
123
124   // Own fields of ConfigurationItem
125
126   iter.AddItem (ent->ItemConcept());
127 }