2 #include <RWStepShape_RWCsgShapeRepresentation.ixx>
3 #include <StepRepr_HArray1OfRepresentationItem.hxx>
4 #include <StepRepr_RepresentationItem.hxx>
5 #include <StepRepr_RepresentationContext.hxx>
8 #include <Interface_EntityIterator.hxx>
11 #include <StepShape_CsgShapeRepresentation.hxx>
14 RWStepShape_RWCsgShapeRepresentation::RWStepShape_RWCsgShapeRepresentation () {}
16 void RWStepShape_RWCsgShapeRepresentation::ReadStep
17 (const Handle(StepData_StepReaderData)& data,
18 const Standard_Integer num,
19 Handle(Interface_Check)& ach,
20 const Handle(StepShape_CsgShapeRepresentation)& ent) const
24 // --- Number of Parameter Control ---
26 if (!data->CheckNbParams(num,3,ach,"csg_shape_representation")) return;
28 // --- inherited field : name ---
30 Handle(TCollection_HAsciiString) aName;
31 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
32 data->ReadString (num,1,"name",ach,aName);
34 // --- inherited field : items ---
36 Handle(StepRepr_HArray1OfRepresentationItem) aItems;
37 Handle(StepRepr_RepresentationItem) anent2;
38 Standard_Integer nsub2;
39 if (data->ReadSubList (num,2,"items",ach,nsub2)) {
40 Standard_Integer nb2 = data->NbParams(nsub2);
41 aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2);
42 for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
43 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
44 if (data->ReadEntity (nsub2, i2,"representation_item", ach,
45 STANDARD_TYPE(StepRepr_RepresentationItem), anent2))
46 aItems->SetValue(i2, anent2);
50 // --- inherited field : contextOfItems ---
52 Handle(StepRepr_RepresentationContext) aContextOfItems;
53 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
54 data->ReadEntity(num, 3,"context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aContextOfItems);
56 //--- Initialisation of the read entity ---
59 ent->Init(aName, aItems, aContextOfItems);
63 void RWStepShape_RWCsgShapeRepresentation::WriteStep
64 (StepData_StepWriter& SW,
65 const Handle(StepShape_CsgShapeRepresentation)& ent) const
68 // --- inherited field name ---
72 // --- inherited field items ---
75 for (Standard_Integer i2 = 1; i2 <= ent->NbItems(); i2 ++) {
76 SW.Send(ent->ItemsValue(i2));
80 // --- inherited field contextOfItems ---
82 SW.Send(ent->ContextOfItems());
86 void RWStepShape_RWCsgShapeRepresentation::Share(const Handle(StepShape_CsgShapeRepresentation)& ent, Interface_EntityIterator& iter) const
89 Standard_Integer nbElem1 = ent->NbItems();
90 for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
91 iter.GetOneItem(ent->ItemsValue(is1));
96 iter.GetOneItem(ent->ContextOfItems());