| 1 | //gka 05.03.99 S4134 upgrade from CD to DIS |
| 2 | #include <RWStepBasic_RWProductDefinition.ixx> |
| 3 | #include <StepBasic_ProductDefinitionFormation.hxx> |
| 4 | #include <StepBasic_ProductDefinitionContext.hxx> |
| 5 | |
| 6 | |
| 7 | #include <Interface_EntityIterator.hxx> |
| 8 | |
| 9 | |
| 10 | #include <StepBasic_ProductDefinition.hxx> |
| 11 | |
| 12 | |
| 13 | RWStepBasic_RWProductDefinition::RWStepBasic_RWProductDefinition () {} |
| 14 | |
| 15 | void RWStepBasic_RWProductDefinition::ReadStep |
| 16 | (const Handle(StepData_StepReaderData)& data, |
| 17 | const Standard_Integer num, |
| 18 | Handle(Interface_Check)& ach, |
| 19 | const Handle(StepBasic_ProductDefinition)& ent) const |
| 20 | { |
| 21 | |
| 22 | |
| 23 | // --- Number of Parameter Control --- |
| 24 | |
| 25 | if (!data->CheckNbParams(num,4,ach,"product_definition")) return; |
| 26 | |
| 27 | // --- own field : id --- |
| 28 | |
| 29 | Handle(TCollection_HAsciiString) aId; |
| 30 | //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed |
| 31 | data->ReadString (num,1,"id",ach,aId); |
| 32 | |
| 33 | // --- own field : description --- |
| 34 | |
| 35 | Handle(TCollection_HAsciiString) aDescription; |
| 36 | if (data->IsParamDefined (num,2)) { //gka 05.03.99 S4134 upgrade from CD to DIS |
| 37 | //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed |
| 38 | data->ReadString (num,2,"description",ach,aDescription); |
| 39 | } |
| 40 | // --- own field : formation --- |
| 41 | |
| 42 | Handle(StepBasic_ProductDefinitionFormation) aFormation; |
| 43 | //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed |
| 44 | data->ReadEntity(num, 3,"formation", ach, STANDARD_TYPE(StepBasic_ProductDefinitionFormation), aFormation); |
| 45 | |
| 46 | // --- own field : frameOfReference --- |
| 47 | |
| 48 | Handle(StepBasic_ProductDefinitionContext) aFrameOfReference; |
| 49 | //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed |
| 50 | data->ReadEntity(num, 4,"frame_of_reference", ach, STANDARD_TYPE(StepBasic_ProductDefinitionContext), aFrameOfReference); |
| 51 | |
| 52 | //--- Initialisation of the read entity --- |
| 53 | |
| 54 | |
| 55 | ent->Init(aId, aDescription, aFormation, aFrameOfReference); |
| 56 | } |
| 57 | |
| 58 | |
| 59 | void RWStepBasic_RWProductDefinition::WriteStep |
| 60 | (StepData_StepWriter& SW, |
| 61 | const Handle(StepBasic_ProductDefinition)& ent) const |
| 62 | { |
| 63 | |
| 64 | // --- own field : id --- |
| 65 | |
| 66 | SW.Send(ent->Id()); |
| 67 | |
| 68 | // --- own field : description --- |
| 69 | |
| 70 | SW.Send(ent->Description()); |
| 71 | |
| 72 | // --- own field : formation --- |
| 73 | |
| 74 | SW.Send(ent->Formation()); |
| 75 | |
| 76 | // --- own field : frameOfReference --- |
| 77 | |
| 78 | SW.Send(ent->FrameOfReference()); |
| 79 | } |
| 80 | |
| 81 | |
| 82 | void RWStepBasic_RWProductDefinition::Share(const Handle(StepBasic_ProductDefinition)& ent, Interface_EntityIterator& iter) const |
| 83 | { |
| 84 | |
| 85 | iter.GetOneItem(ent->Formation()); |
| 86 | |
| 87 | |
| 88 | iter.GetOneItem(ent->FrameOfReference()); |
| 89 | } |
| 90 | |