0033018: Coding - get rid of unused headers [Plugin to ShapeAnalysis]
[occt.git] / src / RWStepBasic / RWStepBasic_RWLengthMeasureWithUnit.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Interface_Check.hxx>
16 #include <Interface_EntityIterator.hxx>
17 #include <RWStepBasic_RWLengthMeasureWithUnit.hxx>
18 #include <StepBasic_LengthMeasureWithUnit.hxx>
19 #include <StepBasic_MeasureValueMember.hxx>
20 #include <StepData_StepReaderData.hxx>
21 #include <StepData_StepWriter.hxx>
22
23 //=======================================================================
24 //function : RWStepBasic_RWLengthMeasureWithUnit
25 //purpose  : 
26 //=======================================================================
27 RWStepBasic_RWLengthMeasureWithUnit::RWStepBasic_RWLengthMeasureWithUnit () {}
28
29 //=======================================================================
30 //function : ReadStep
31 //purpose  : 
32 //=======================================================================
33
34 void RWStepBasic_RWLengthMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data,
35                                                     const Standard_Integer num,
36                                                     Handle(Interface_Check)& ach,
37                                                     const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
38 {
39   // --- Number of Parameter Control ---
40   if (!data->CheckNbParams(num,2,ach,"length_measure_with_unit")) return;
41   
42   // --- inherited field : valueComponent ---
43   // --- Update 12-02-96 by FMA , 31-MARS-1997 by CKY
44   Handle(StepBasic_MeasureValueMember) mvc = new StepBasic_MeasureValueMember;
45   data->ReadMember (num,1, "value_component", ach, mvc);
46   
47   // --- inherited field : unitComponent ---
48   StepBasic_Unit aUnitComponent;
49   data->ReadEntity(num, 2,"unit_component", ach, aUnitComponent);
50
51   //--- Initialisation of the read entity ---
52   ent->Init(mvc, aUnitComponent);
53 }
54
55 //=======================================================================
56 //function : WriteStep
57 //purpose  : 
58 //=======================================================================
59
60 void RWStepBasic_RWLengthMeasureWithUnit::WriteStep (StepData_StepWriter& SW,
61                                                      const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
62 {
63
64   // --- inherited field valueComponent ---
65   SW.Send(ent->ValueComponentMember());
66
67   // --- inherited field unitComponent ---
68   SW.Send(ent->UnitComponent().Value());
69 }
70
71
72 //=======================================================================
73 //function : Share
74 //purpose  : 
75 //=======================================================================
76
77 void RWStepBasic_RWLengthMeasureWithUnit::Share (const Handle(StepBasic_LengthMeasureWithUnit)& ent, 
78                                                  Interface_EntityIterator& iter) const
79 {
80
81   iter.GetOneItem(ent->UnitComponent().Value());
82 }
83