0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWMassMeasureWithUnit.cxx
CommitLineData
7fd59977 1#include <RWStepBasic_RWMassMeasureWithUnit.ixx>
2
3#include <StepBasic_NamedUnit.hxx>
4#include <StepBasic_MeasureValueMember.hxx>
5#include <TCollection_AsciiString.hxx>
6#include <Interface_EntityIterator.hxx>
7#include <StepBasic_MassMeasureWithUnit.hxx>
8
9
10//=======================================================================
11//function : RWStepBasic_RWMassMeasureWithUnit
12//purpose :
13//=======================================================================
14
15RWStepBasic_RWMassMeasureWithUnit::RWStepBasic_RWMassMeasureWithUnit()
16{
17}
18
19
20//=======================================================================
21//function : ReadStep
22//purpose :
23//=======================================================================
24
25void RWStepBasic_RWMassMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data,
26 const Standard_Integer num,
27 Handle(Interface_Check)& ach,
28 const Handle(StepBasic_MassMeasureWithUnit)& ent) const
29{
30 // --- Number of Parameter Control ---
31 if (!data->CheckNbParams(num,2,ach,"Mass_measure_with_unit")) return;
32
33 // --- inherited field : valueComponent ---
34 // --- Update 12-02-96 by FMA , 31-MARS-1997 by CKY
35 Handle(StepBasic_MeasureValueMember) mvc = new StepBasic_MeasureValueMember;
36 data->ReadMember (num,1, "value_component", ach, mvc);
37
38 // --- inherited field : unitComponent ---
39 StepBasic_Unit aUnitComponent;
40 data->ReadEntity(num, 2,"unit_component", ach, aUnitComponent);
41
42 //--- Initialisation of the read entity ---
43 ent->Init(mvc, aUnitComponent);
44}
45
46
47//=======================================================================
48//function : WriteStep
49//purpose :
50//=======================================================================
51
52void RWStepBasic_RWMassMeasureWithUnit::WriteStep (StepData_StepWriter& SW,
53 const Handle(StepBasic_MassMeasureWithUnit)& ent) const
54{
55 // --- inherited field valueComponent ---
56 SW.Send(ent->ValueComponentMember());
57 // --- inherited field unitComponent ---
58 SW.Send(ent->UnitComponent().Value());
59}
60
61
62//=======================================================================
63//function : Share
64//purpose :
65//=======================================================================
66
67void RWStepBasic_RWMassMeasureWithUnit::Share (const Handle(StepBasic_MassMeasureWithUnit)& ent,
68 Interface_EntityIterator& iter) const
69{
70 iter.GetOneItem(ent->UnitComponent().Value());
71}
72