0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWConversionBasedUnitAndTimeUnit.cxx
CommitLineData
7fd59977 1
2#include <RWStepBasic_RWConversionBasedUnitAndTimeUnit.ixx>
3#include <StepBasic_ConversionBasedUnit.hxx>
4#include <StepBasic_TimeUnit.hxx>
5#include <StepBasic_DimensionalExponents.hxx>
6#include <StepBasic_MeasureWithUnit.hxx>
7
8
9#include <Interface_EntityIterator.hxx>
10
11
12#include <StepBasic_ConversionBasedUnitAndTimeUnit.hxx>
13
14
15RWStepBasic_RWConversionBasedUnitAndTimeUnit::RWStepBasic_RWConversionBasedUnitAndTimeUnit () {}
16
17void RWStepBasic_RWConversionBasedUnitAndTimeUnit::ReadStep
18 (const Handle(StepData_StepReaderData)& data,
19 const Standard_Integer num0,
20 Handle(Interface_Check)& ach,
21 const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent) const
22{
23
24 Standard_Integer num = num0;
25
26
27 // --- Instance of plex componant ConversionBasedUnit ---
28
29 if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
30
31 // --- field : name ---
32
33 Handle(TCollection_HAsciiString) aName;
34 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
35 data->ReadString (num,1,"name",ach,aName);
36
37 // --- field : conversionFactor ---
38
39 Handle(StepBasic_MeasureWithUnit) aConversionFactor;
40 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
41 data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
42
43 num = data->NextForComplex(num);
44
45 // --- Instance of common supertype NamedUnit ---
46
47 if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
48 // --- field : dimensions ---
49
50
51 Handle(StepBasic_DimensionalExponents) aDimensions;
52 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
53 data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
54
55 num = data->NextForComplex(num);
56
57 // --- Instance of plex componant TimeUnit ---
58
59 if (!data->CheckNbParams(num,0,ach,"time_unit")) return;
60
61 //--- Initialisation of the red entity ---
62
63 ent->Init(aDimensions,aName,aConversionFactor);
64}
65
66
67void RWStepBasic_RWConversionBasedUnitAndTimeUnit::WriteStep
68 (StepData_StepWriter& SW,
69 const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent) const
70{
71
72 // --- Instance of plex componant ConversionBasedUnit ---
73
74 SW.StartEntity("CONVERSION_BASED_UNIT");
75 // --- field : name ---
76
77 SW.Send(ent->Name());
78 // --- field : conversionFactor ---
79
80 SW.Send(ent->ConversionFactor());
81
82 // --- Instance of plex componant TimeUnit ---
83
84 SW.StartEntity("TIME_UNIT");
85
86 // --- Instance of common supertype NamedUnit ---
87
88 SW.StartEntity("NAMED_UNIT");
89 // --- field : dimensions ---
90
91 SW.Send(ent->Dimensions());
92}
93
94
95void RWStepBasic_RWConversionBasedUnitAndTimeUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent, Interface_EntityIterator& iter) const
96{
97
98 iter.GetOneItem(ent->Dimensions());
99
100
101 iter.GetOneItem(ent->ConversionFactor());
102}
103