1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-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 <RWStepShape_RWShapeRepresentationWithParameters.ixx>
19 #include <StepRepr_HArray1OfRepresentationItem.hxx>
20 #include <StepRepr_RepresentationItem.hxx>
21 #include <StepRepr_RepresentationContext.hxx>
24 //=======================================================================
25 //function : RWStepShape_RWShapeRepresentationWithParameters
27 //=======================================================================
29 RWStepShape_RWShapeRepresentationWithParameters::RWStepShape_RWShapeRepresentationWithParameters ()
33 //=======================================================================
36 //=======================================================================
38 void RWStepShape_RWShapeRepresentationWithParameters::ReadStep (const Handle(StepData_StepReaderData)& data,
39 const Standard_Integer num,
40 Handle(Interface_Check)& ach,
41 const Handle(StepShape_ShapeRepresentationWithParameters) &ent) const
43 // Check number of parameters
44 if ( ! data->CheckNbParams(num,3,ach,"shape_representation_with_parameters") ) return;
46 // Inherited fields of Representation
48 Handle(TCollection_HAsciiString) aRepresentation_Name;
49 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
51 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
52 Standard_Integer sub2 = 0;
53 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
54 Standard_Integer nb0 = data->NbParams(sub2);
55 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
56 Standard_Integer num2 = sub2;
57 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
58 Handle(StepRepr_RepresentationItem) anIt0;
59 data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
60 aRepresentation_Items->SetValue(i0, anIt0);
64 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
65 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
68 ent->Init(aRepresentation_Name,
69 aRepresentation_Items,
70 aRepresentation_ContextOfItems);
73 //=======================================================================
74 //function : WriteStep
76 //=======================================================================
78 void RWStepShape_RWShapeRepresentationWithParameters::WriteStep (StepData_StepWriter& SW,
79 const Handle(StepShape_ShapeRepresentationWithParameters) &ent) const
82 // Inherited fields of Representation
84 SW.Send (ent->StepRepr_Representation::Name());
87 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
88 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
93 SW.Send (ent->StepRepr_Representation::ContextOfItems());
96 //=======================================================================
99 //=======================================================================
101 void RWStepShape_RWShapeRepresentationWithParameters::Share (const Handle(StepShape_ShapeRepresentationWithParameters) &ent,
102 Interface_EntityIterator& iter) const
105 // Inherited fields of Representation
107 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
108 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
112 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());