0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit.cxx
1 // sln 09.10.2001. BUC61003. Correction of looking for items of complex entity in case of them  do not saticfy to alphabetical order
2 #include <RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit.ixx>
3 #include <StepBasic_ConversionBasedUnit.hxx>
4 #include <StepBasic_PlaneAngleUnit.hxx>
5 #include <StepBasic_DimensionalExponents.hxx>
6 #include <StepBasic_MeasureWithUnit.hxx>
7
8
9 #include <Interface_EntityIterator.hxx>
10
11
12 #include <StepBasic_ConversionBasedUnitAndPlaneAngleUnit.hxx>
13
14
15 RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit () {}
16
17 void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::ReadStep
18         (const Handle(StepData_StepReaderData)& data,
19          const Standard_Integer num0,
20          Handle(Interface_Check)& ach,
21          const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent) const
22 {
23         // sln 09.10.2001. BUC61003. Correction of looking for items of complex entity in case of them  do not saticfy to alphabetical order
24         // CONVERSION_BASED_UNIT
25         Standard_Integer num = 0;//num0;
26         data->NamedForComplex("CONVERSION_BASED_UNIT CNBSUN",num0,num,ach);
27         if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
28         Handle(TCollection_HAsciiString) aName;
29         data->ReadString (num,1,"name",ach,aName);
30         Handle(StepBasic_MeasureWithUnit) aConversionFactor;
31         data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
32         
33         // NAMED_UNIT
34         //num = 0; //gka TRJ9 c2-id-214.stp
35         data->NamedForComplex("NAMED_UNIT NMDUNT",num0,num,ach);
36         if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
37         Handle(StepBasic_DimensionalExponents) aDimensions;
38         data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
39
40         // PLANE_ANGLE_UNIT
41         //num = 0; //gka
42         data->NamedForComplex("PLANE_ANGLE_UNIT PLANUN",num0,num,ach);
43         if (!data->CheckNbParams(num,0,ach,"plane_angle_unit")) return;
44         
45         ent->Init(aDimensions,aName,aConversionFactor);
46 }
47
48
49 void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::WriteStep
50         (StepData_StepWriter& SW,
51          const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent) const
52 {
53
54         // --- Instance of plex componant ConversionBasedUnit ---
55
56         SW.StartEntity("CONVERSION_BASED_UNIT");
57         // --- field : name ---
58
59         SW.Send(ent->Name());
60         // --- field : conversionFactor ---
61
62         SW.Send(ent->ConversionFactor());
63
64         // --- Instance of common supertype NamedUnit ---
65
66         SW.StartEntity("NAMED_UNIT");
67         // --- field : dimensions ---
68
69         SW.Send(ent->Dimensions());
70
71         // --- Instance of plex componant PlaneAngleUnit ---
72
73         SW.StartEntity("PLANE_ANGLE_UNIT");
74 }
75
76
77 void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent, Interface_EntityIterator& iter) const
78 {
79
80         iter.GetOneItem(ent->Dimensions());
81
82
83         iter.GetOneItem(ent->ConversionFactor());
84 }
85