2 #include <RWStepShape_RWPolyLoop.ixx>
3 #include <StepGeom_HArray1OfCartesianPoint.hxx>
4 #include <StepGeom_CartesianPoint.hxx>
7 #include <Interface_EntityIterator.hxx>
10 #include <StepShape_PolyLoop.hxx>
13 RWStepShape_RWPolyLoop::RWStepShape_RWPolyLoop () {}
15 void RWStepShape_RWPolyLoop::ReadStep
16 (const Handle(StepData_StepReaderData)& data,
17 const Standard_Integer num,
18 Handle(Interface_Check)& ach,
19 const Handle(StepShape_PolyLoop)& ent) const
23 // --- Number of Parameter Control ---
25 if (!data->CheckNbParams(num,2,ach,"poly_loop")) return;
27 // --- inherited field : name ---
29 Handle(TCollection_HAsciiString) aName;
30 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
31 data->ReadString (num,1,"name",ach,aName);
33 // --- own field : polygon ---
35 Handle(StepGeom_HArray1OfCartesianPoint) aPolygon;
36 Handle(StepGeom_CartesianPoint) anent2;
37 Standard_Integer nsub2;
38 if (data->ReadSubList (num,2,"polygon",ach,nsub2)) {
39 Standard_Integer nb2 = data->NbParams(nsub2);
40 aPolygon = new StepGeom_HArray1OfCartesianPoint (1, nb2);
41 for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
42 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
43 if (data->ReadEntity (nsub2, i2,"cartesian_point", ach, STANDARD_TYPE(StepGeom_CartesianPoint), anent2))
44 aPolygon->SetValue(i2, anent2);
48 //--- Initialisation of the read entity ---
51 ent->Init(aName, aPolygon);
55 void RWStepShape_RWPolyLoop::WriteStep
56 (StepData_StepWriter& SW,
57 const Handle(StepShape_PolyLoop)& ent) const
60 // --- inherited field name ---
64 // --- own field : polygon ---
67 for (Standard_Integer i2 = 1; i2 <= ent->NbPolygon(); i2 ++) {
68 SW.Send(ent->PolygonValue(i2));
74 void RWStepShape_RWPolyLoop::Share(const Handle(StepShape_PolyLoop)& ent, Interface_EntityIterator& iter) const
77 Standard_Integer nbElem1 = ent->NbPolygon();
78 for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
79 iter.GetOneItem(ent->PolygonValue(is1));