1 // Created on: 2001-12-28
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2001-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.1
18 #include <RWStepShape_RWNonManifoldSurfaceShapeRepresentation.ixx>
19 #include <StepRepr_HArray1OfRepresentationItem.hxx>
20 #include <StepRepr_RepresentationItem.hxx>
22 //=======================================================================
23 //function : RWStepShape_RWNonManifoldSurfaceShapeRepresentation
25 //=======================================================================
27 RWStepShape_RWNonManifoldSurfaceShapeRepresentation::RWStepShape_RWNonManifoldSurfaceShapeRepresentation ()
31 //=======================================================================
34 //=======================================================================
36 void RWStepShape_RWNonManifoldSurfaceShapeRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
37 const Standard_Integer num,
38 Handle(Interface_Check)& ach,
39 const Handle(StepShape_NonManifoldSurfaceShapeRepresentation) &ent) const
41 // Check number of parameters
42 if ( ! data->CheckNbParams(num,3,ach,"non_manifold_surface_shape_representation") ) return;
44 // Inherited fields of Representation
46 Handle(TCollection_HAsciiString) aRepresentation_Name;
47 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
49 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
50 Standard_Integer sub2 = 0;
51 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
52 Standard_Integer num2 = sub2;
53 Standard_Integer nb0 = data->NbParams(num2);
54 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
55 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
56 Handle(StepRepr_RepresentationItem) anIt0;
57 data->ReadEntity (num2, i0, "representation.items", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
58 aRepresentation_Items->SetValue(i0, anIt0);
62 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
63 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
66 ent->Init(aRepresentation_Name,
67 aRepresentation_Items,
68 aRepresentation_ContextOfItems);
71 //=======================================================================
72 //function : WriteStep
74 //=======================================================================
76 void RWStepShape_RWNonManifoldSurfaceShapeRepresentation::WriteStep (StepData_StepWriter& SW,
77 const Handle(StepShape_NonManifoldSurfaceShapeRepresentation) &ent) const
80 // Inherited fields of Representation
82 SW.Send (ent->StepRepr_Representation::Name());
85 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
86 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
91 SW.Send (ent->StepRepr_Representation::ContextOfItems());
94 //=======================================================================
97 //=======================================================================
99 void RWStepShape_RWNonManifoldSurfaceShapeRepresentation::Share (const Handle(StepShape_NonManifoldSurfaceShapeRepresentation) &ent,
100 Interface_EntityIterator& iter) const
103 // Inherited fields of Representation
105 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
106 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
110 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());