0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWLengthMeasureWithUnit.cxx
CommitLineData
7fd59977 1
2#include <RWStepBasic_RWLengthMeasureWithUnit.ixx>
3#include <StepBasic_NamedUnit.hxx>
4#include <StepBasic_MeasureValueMember.hxx>
5
6#include <TCollection_AsciiString.hxx>
7
8#include <Interface_EntityIterator.hxx>
9
10
11#include <StepBasic_LengthMeasureWithUnit.hxx>
12
13//=======================================================================
14//function : RWStepBasic_RWLengthMeasureWithUnit
15//purpose :
16//=======================================================================
17
18RWStepBasic_RWLengthMeasureWithUnit::RWStepBasic_RWLengthMeasureWithUnit () {}
19
20//=======================================================================
21//function : ReadStep
22//purpose :
23//=======================================================================
24
25void RWStepBasic_RWLengthMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data,
26 const Standard_Integer num,
27 Handle(Interface_Check)& ach,
28 const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
29{
30 // --- Number of Parameter Control ---
31 if (!data->CheckNbParams(num,2,ach,"length_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//function : WriteStep
48//purpose :
49//=======================================================================
50
51void RWStepBasic_RWLengthMeasureWithUnit::WriteStep (StepData_StepWriter& SW,
52 const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
53{
54
55 // --- inherited field valueComponent ---
56 SW.Send(ent->ValueComponentMember());
57
58 // --- inherited field unitComponent ---
59 SW.Send(ent->UnitComponent().Value());
60}
61
62
63//=======================================================================
64//function : Share
65//purpose :
66//=======================================================================
67
68void RWStepBasic_RWLengthMeasureWithUnit::Share (const Handle(StepBasic_LengthMeasureWithUnit)& ent,
69 Interface_EntityIterator& iter) const
70{
71
72 iter.GetOneItem(ent->UnitComponent().Value());
73}
74