1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Interface_Check.hxx>
16 #include <Interface_EntityIterator.hxx>
17 #include <RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.hxx>
18 #include <StepData_StepReaderData.hxx>
19 #include <StepData_StepWriter.hxx>
20 #include <StepRepr_RepresentationContext.hxx>
21 #include <StepRepr_RepresentationItem.hxx>
22 #include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
24 RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation::RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation () {}
26 void RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation::ReadStep
27 (const Handle(StepData_StepReaderData)& data,
28 const Standard_Integer num,
29 Handle(Interface_Check)& ach,
30 const Handle(StepShape_GeometricallyBoundedWireframeShapeRepresentation)& ent) const
34 // --- Number of Parameter Control ---
36 if (!data->CheckNbParams(num,3,ach,"geometrically_bounded_wireframe_shape_representation")) return;
38 // --- inherited field : name ---
40 Handle(TCollection_HAsciiString) aName;
41 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
42 data->ReadString (num,1,"name",ach,aName);
44 // --- inherited field : items ---
46 Handle(StepRepr_HArray1OfRepresentationItem) aItems;
47 Handle(StepRepr_RepresentationItem) anent2;
48 Standard_Integer nsub2;
49 if (data->ReadSubList (num,2,"items",ach,nsub2)) {
50 Standard_Integer nb2 = data->NbParams(nsub2);
51 aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2);
52 for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
53 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
54 if (data->ReadEntity (nsub2, i2,"representation_item", ach,
55 STANDARD_TYPE(StepRepr_RepresentationItem), anent2))
56 aItems->SetValue(i2, anent2);
60 // --- inherited field : contextOfItems ---
62 Handle(StepRepr_RepresentationContext) aContextOfItems;
63 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
64 data->ReadEntity(num, 3,"context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aContextOfItems);
66 //--- Initialisation of the read entity ---
69 ent->Init(aName, aItems, aContextOfItems);
73 void RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation::WriteStep
74 (StepData_StepWriter& SW,
75 const Handle(StepShape_GeometricallyBoundedWireframeShapeRepresentation)& ent) const
78 // --- inherited field name ---
82 // --- inherited field items ---
85 for (Standard_Integer i2 = 1; i2 <= ent->NbItems(); i2 ++) {
86 SW.Send(ent->ItemsValue(i2));
90 // --- inherited field contextOfItems ---
92 SW.Send(ent->ContextOfItems());
96 void RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation::Share(const Handle(StepShape_GeometricallyBoundedWireframeShapeRepresentation)& ent, Interface_EntityIterator& iter) const
99 Standard_Integer nbElem1 = ent->NbItems();
100 for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
101 iter.GetOneItem(ent->ItemsValue(is1));
106 iter.GetOneItem(ent->ContextOfItems());