0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWProductContext.cxx
1
2 #include <RWStepBasic_RWProductContext.ixx>
3 #include <StepBasic_ApplicationContext.hxx>
4
5
6 #include <Interface_EntityIterator.hxx>
7
8
9 #include <StepBasic_ProductContext.hxx>
10
11
12 RWStepBasic_RWProductContext::RWStepBasic_RWProductContext () {}
13
14 void RWStepBasic_RWProductContext::ReadStep
15         (const Handle(StepData_StepReaderData)& data,
16          const Standard_Integer num,
17          Handle(Interface_Check)& ach,
18          const Handle(StepBasic_ProductContext)& ent) const
19 {
20
21
22         // --- Number of Parameter Control ---
23
24         if (!data->CheckNbParams(num,3,ach,"product_context")) return;
25
26         // --- inherited field : name ---
27
28         Handle(TCollection_HAsciiString) aName;
29         //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
30         data->ReadString (num,1,"name",ach,aName);
31
32         // --- inherited field : frameOfReference ---
33
34         Handle(StepBasic_ApplicationContext) aFrameOfReference;
35         //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
36         data->ReadEntity(num, 2,"frame_of_reference", ach, STANDARD_TYPE(StepBasic_ApplicationContext), aFrameOfReference);
37
38         // --- own field : disciplineType ---
39
40         Handle(TCollection_HAsciiString) aDisciplineType;
41         //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
42         data->ReadString (num,3,"discipline_type",ach,aDisciplineType);
43
44         //--- Initialisation of the read entity ---
45
46
47         ent->Init(aName, aFrameOfReference, aDisciplineType);
48 }
49
50
51 void RWStepBasic_RWProductContext::WriteStep
52         (StepData_StepWriter& SW,
53          const Handle(StepBasic_ProductContext)& ent) const
54 {
55
56         // --- inherited field name ---
57
58         SW.Send(ent->Name());
59
60         // --- inherited field frameOfReference ---
61
62         SW.Send(ent->FrameOfReference());
63
64         // --- own field : disciplineType ---
65
66         SW.Send(ent->DisciplineType());
67 }
68
69
70 void RWStepBasic_RWProductContext::Share(const Handle(StepBasic_ProductContext)& ent, Interface_EntityIterator& iter) const
71 {
72
73         iter.GetOneItem(ent->FrameOfReference());
74 }
75