0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWConversionBasedUnitAndVolumeUnit.cxx
CommitLineData
7fd59977 1// File: RWStepBasic_RWConversionBasedUnitAndVolumeUnit.cxx
2// Created: Tue Oct 12 14:32:09 1999
3// Author: data exchange team
4// <det@friendox>
5
6
7#include <RWStepBasic_RWConversionBasedUnitAndVolumeUnit.ixx>
8
9RWStepBasic_RWConversionBasedUnitAndVolumeUnit::RWStepBasic_RWConversionBasedUnitAndVolumeUnit ()
10{
11}
12
13void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::ReadStep(const Handle(StepData_StepReaderData)& data,
14 const Standard_Integer num0,
15 Handle(Interface_Check)& ach,
16 const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const
17{
18 Standard_Integer num = num0;
19 // --- Instance of plex componant ConversionBasedUnit ---
20 if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
21 Handle(TCollection_HAsciiString) aName;
22 data->ReadString (num,1,"name",ach,aName);
23
24 // --- field : conversionFactor ---
25 Handle(StepBasic_MeasureWithUnit) aConversionFactor;
26 data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
27
28 num = data->NextForComplex(num);
29 if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
30 Handle(StepBasic_DimensionalExponents) aDimensions;
31 data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
32
33 data->NamedForComplex("VOLUME_UNIT",num0,num,ach);
34 if (!data->CheckNbParams(num,0,ach,"volume_unit")) return;
35
36 ent->Init(aDimensions,aName,aConversionFactor);
37}
38
39void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::WriteStep(StepData_StepWriter& SW,
40 const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const
41{
42 SW.StartEntity("CONVERSION_BASED_UNIT");
43 SW.Send(ent->Name());
44 SW.Send(ent->ConversionFactor());
45 SW.StartEntity("NAMED_UNIT");
46 SW.Send(ent->Dimensions());
47 SW.StartEntity("VOLUME_UNIT");
48}
49
50void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent,
51 Interface_EntityIterator& iter) const
52{
53 iter.GetOneItem(ent->Dimensions());
54 iter.GetOneItem(ent->ConversionFactor());
55}