0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / RWStepBasic / RWStepBasic_RWMassMeasureWithUnit.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_RWMassMeasureWithUnit.hxx>
18 #include <StepBasic_MassMeasureWithUnit.hxx>
19 #include <StepBasic_MeasureValueMember.hxx>
20 #include <StepData_StepReaderData.hxx>
21 #include <StepData_StepWriter.hxx>
22
23 //=======================================================================
24 //function : RWStepBasic_RWMassMeasureWithUnit
25 //purpose  : 
26 //=======================================================================
27 RWStepBasic_RWMassMeasureWithUnit::RWStepBasic_RWMassMeasureWithUnit()
28 {
29 }
30
31
32 //=======================================================================
33 //function : ReadStep
34 //purpose  : 
35 //=======================================================================
36
37 void RWStepBasic_RWMassMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data,
38                                                   const Standard_Integer num,
39                                                   Handle(Interface_Check)& ach,
40                                                   const Handle(StepBasic_MassMeasureWithUnit)& ent) const
41 {
42   // --- Number of Parameter Control ---
43   if (!data->CheckNbParams(num,2,ach,"Mass_measure_with_unit")) return;
44   
45   // --- inherited field : valueComponent ---
46   // --- Update 12-02-96 by FMA , 31-MARS-1997 by CKY
47   Handle(StepBasic_MeasureValueMember) mvc = new StepBasic_MeasureValueMember;
48   data->ReadMember (num,1, "value_component", ach, mvc);
49   
50   // --- inherited field : unitComponent ---
51   StepBasic_Unit aUnitComponent;
52   data->ReadEntity(num, 2,"unit_component", ach, aUnitComponent);
53
54   //--- Initialisation of the read entity ---
55   ent->Init(mvc, aUnitComponent);
56 }
57
58
59 //=======================================================================
60 //function : WriteStep
61 //purpose  : 
62 //=======================================================================
63
64 void RWStepBasic_RWMassMeasureWithUnit::WriteStep (StepData_StepWriter& SW,
65                                                    const Handle(StepBasic_MassMeasureWithUnit)& ent) const
66 {
67   // --- inherited field valueComponent ---
68   SW.Send(ent->ValueComponentMember());
69   // --- inherited field unitComponent ---
70   SW.Send(ent->UnitComponent().Value());
71 }
72
73
74 //=======================================================================
75 //function : Share
76 //purpose  : 
77 //=======================================================================
78
79 void RWStepBasic_RWMassMeasureWithUnit::Share (const Handle(StepBasic_MassMeasureWithUnit)& ent, 
80                                                Interface_EntityIterator& iter) const
81 {
82   iter.GetOneItem(ent->UnitComponent().Value());
83 }
84