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 <RWStepShape_RWPointRepresentation.ixx>
19 #include <StepRepr_HArray1OfRepresentationItem.hxx>
20 #include <StepRepr_RepresentationItem.hxx>
21 #include <StepRepr_RepresentationContext.hxx>
23 //=======================================================================
24 //function : RWStepShape_RWPointRepresentation
26 //=======================================================================
28 RWStepShape_RWPointRepresentation::RWStepShape_RWPointRepresentation ()
32 //=======================================================================
35 //=======================================================================
37 void RWStepShape_RWPointRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
38 const Standard_Integer num,
39 Handle(Interface_Check)& ach,
40 const Handle(StepShape_PointRepresentation) &ent) const
42 // Check number of parameters
43 if ( ! data->CheckNbParams(num,3,ach,"point_representation") ) return;
45 // Inherited fields of Representation
47 Handle(TCollection_HAsciiString) aRepresentation_Name;
48 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
50 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
51 Standard_Integer sub2 = 0;
52 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
53 Standard_Integer nb0 = data->NbParams(sub2);
54 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
55 Standard_Integer num2 = sub2;
56 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
57 Handle(StepRepr_RepresentationItem) anIt0;
58 data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
59 aRepresentation_Items->SetValue(i0, anIt0);
63 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
64 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
67 ent->Init(aRepresentation_Name,
68 aRepresentation_Items,
69 aRepresentation_ContextOfItems);
72 //=======================================================================
73 //function : WriteStep
75 //=======================================================================
77 void RWStepShape_RWPointRepresentation::WriteStep (StepData_StepWriter& SW,
78 const Handle(StepShape_PointRepresentation) &ent) const
81 // Inherited fields of Representation
83 SW.Send (ent->StepRepr_Representation::Name());
86 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
87 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
92 SW.Send (ent->StepRepr_Representation::ContextOfItems());
95 //=======================================================================
98 //=======================================================================
100 void RWStepShape_RWPointRepresentation::Share (const Handle(StepShape_PointRepresentation) &ent,
101 Interface_EntityIterator& iter) const
104 // Inherited fields of Representation
106 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
107 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
111 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());