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 <RWStepFEA_RWNodeRepresentation.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepFEA_FeaModel.hxx>
24 #include <StepFEA_NodeRepresentation.hxx>
25 #include <StepRepr_HArray1OfRepresentationItem.hxx>
26 #include <StepRepr_RepresentationContext.hxx>
27 #include <StepRepr_RepresentationItem.hxx>
29 //=======================================================================
30 //function : RWStepFEA_RWNodeRepresentation
32 //=======================================================================
33 RWStepFEA_RWNodeRepresentation::RWStepFEA_RWNodeRepresentation ()
37 //=======================================================================
40 //=======================================================================
42 void RWStepFEA_RWNodeRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
43 const Standard_Integer num,
44 Handle(Interface_Check)& ach,
45 const Handle(StepFEA_NodeRepresentation) &ent) const
47 // Check number of parameters
48 if ( ! data->CheckNbParams(num,4,ach,"node_representation") ) return;
50 // Inherited fields of Representation
52 Handle(TCollection_HAsciiString) aRepresentation_Name;
53 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
55 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
56 Standard_Integer sub2 = 0;
57 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
58 Standard_Integer nb0 = data->NbParams(sub2);
59 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
60 Standard_Integer num2 = sub2;
61 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
62 Handle(StepRepr_RepresentationItem) anIt0;
63 data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
64 aRepresentation_Items->SetValue(i0, anIt0);
68 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
69 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
71 // Own fields of NodeRepresentation
73 Handle(StepFEA_FeaModel) aModelRef;
74 data->ReadEntity (num, 4, "model_ref", ach, STANDARD_TYPE(StepFEA_FeaModel), aModelRef);
77 ent->Init(aRepresentation_Name,
78 aRepresentation_Items,
79 aRepresentation_ContextOfItems,
83 //=======================================================================
84 //function : WriteStep
86 //=======================================================================
88 void RWStepFEA_RWNodeRepresentation::WriteStep (StepData_StepWriter& SW,
89 const Handle(StepFEA_NodeRepresentation) &ent) const
92 // Inherited fields of Representation
94 SW.Send (ent->StepRepr_Representation::Name());
97 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
98 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
103 SW.Send (ent->StepRepr_Representation::ContextOfItems());
105 // Own fields of NodeRepresentation
107 SW.Send (ent->ModelRef());
110 //=======================================================================
113 //=======================================================================
115 void RWStepFEA_RWNodeRepresentation::Share (const Handle(StepFEA_NodeRepresentation) &ent,
116 Interface_EntityIterator& iter) const
119 // Inherited fields of Representation
121 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
122 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
126 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
128 // Own fields of NodeRepresentation
130 iter.AddItem (ent->ModelRef());