1 // Created on: 2002-12-12
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepElement_RWElementMaterial.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepElement_ElementMaterial.hxx>
24 #include <StepRepr_HArray1OfMaterialPropertyRepresentation.hxx>
25 #include <StepRepr_MaterialPropertyRepresentation.hxx>
27 //=======================================================================
28 //function : RWStepElement_RWElementMaterial
30 //=======================================================================
31 RWStepElement_RWElementMaterial::RWStepElement_RWElementMaterial ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepElement_RWElementMaterial::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepElement_ElementMaterial) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,3,ach,"element_material") ) return;
48 // Own fields of ElementMaterial
50 Handle(TCollection_HAsciiString) aMaterialId;
51 data->ReadString (num, 1, "material_id", ach, aMaterialId);
53 Handle(TCollection_HAsciiString) aDescription;
54 data->ReadString (num, 2, "description", ach, aDescription);
56 Handle(StepRepr_HArray1OfMaterialPropertyRepresentation) aProperties;
57 Standard_Integer sub3 = 0;
58 if ( data->ReadSubList (num, 3, "properties", ach, sub3) ) {
59 Standard_Integer nb0 = data->NbParams(sub3);
60 aProperties = new StepRepr_HArray1OfMaterialPropertyRepresentation (1, nb0);
61 Standard_Integer num2 = sub3;
62 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
63 Handle(StepRepr_MaterialPropertyRepresentation) anIt0;
64 data->ReadEntity (num2, i0, "material_property_representation", ach, STANDARD_TYPE(StepRepr_MaterialPropertyRepresentation), anIt0);
65 aProperties->SetValue(i0, anIt0);
70 ent->Init(aMaterialId,
75 //=======================================================================
76 //function : WriteStep
78 //=======================================================================
80 void RWStepElement_RWElementMaterial::WriteStep (StepData_StepWriter& SW,
81 const Handle(StepElement_ElementMaterial) &ent) const
84 // Own fields of ElementMaterial
86 SW.Send (ent->MaterialId());
88 SW.Send (ent->Description());
91 for (Standard_Integer i2=1; i2 <= ent->Properties()->Length(); i2++ ) {
92 Handle(StepRepr_MaterialPropertyRepresentation) Var0 = ent->Properties()->Value(i2);
98 //=======================================================================
101 //=======================================================================
103 void RWStepElement_RWElementMaterial::Share (const Handle(StepElement_ElementMaterial) &ent,
104 Interface_EntityIterator& iter) const
107 // Own fields of ElementMaterial
109 for (Standard_Integer i1=1; i1 <= ent->Properties()->Length(); i1++ ) {
110 Handle(StepRepr_MaterialPropertyRepresentation) Var0 = ent->Properties()->Value(i1);