0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWDerivedUnitElement.cxx
CommitLineData
7fd59977 1
2#include <RWStepBasic_RWDerivedUnitElement.ixx>
3#include <StepBasic_NamedUnit.hxx>
4
5
6#include <Interface_EntityIterator.hxx>
7
8
9#include <StepBasic_DerivedUnitElement.hxx>
10
11
12RWStepBasic_RWDerivedUnitElement::RWStepBasic_RWDerivedUnitElement () {}
13
14void RWStepBasic_RWDerivedUnitElement::ReadStep
15 (const Handle(StepData_StepReaderData)& data,
16 const Standard_Integer num,
17 Handle(Interface_Check)& ach,
18 const Handle(StepBasic_DerivedUnitElement)& ent) const
19{
20
21
22 // --- Number of Parameter Control ---
23
24 if (!data->CheckNbParams(num,2,ach,"derived_unit_element")) return;
25
26 // --- own fields
27
28 Handle(StepBasic_NamedUnit) nu;
29 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
30 data->ReadEntity(num, 1,"unit", ach, STANDARD_TYPE(StepBasic_NamedUnit), nu);
31 Standard_Real expo;
32 //szv#4:S4163:12Mar99 `stat1 =` not needed
33 data->ReadReal (num,2,"exponent", ach, expo);
34
35 //--- Initialisation of the read entity ---
36
37
38 ent->Init(nu,expo);
39}
40
41
42void RWStepBasic_RWDerivedUnitElement::WriteStep
43 (StepData_StepWriter& SW,
44 const Handle(StepBasic_DerivedUnitElement)& ent) const
45{
46
47 // --- own field : dimensions ---
48
49 SW.Send(ent->Unit());
50 SW.Send(ent->Exponent());
51}
52
53
54void RWStepBasic_RWDerivedUnitElement::Share(const Handle(StepBasic_DerivedUnitElement)& ent, Interface_EntityIterator& iter) const
55{
56
57 iter.GetOneItem(ent->Unit());
58}