0024157: Parallelization of assembly part of BO
[occt.git] / src / RWStepBasic / RWStepBasic_RWLengthMeasureWithUnit.cxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18
19 #include <RWStepBasic_RWLengthMeasureWithUnit.ixx>
20 #include <StepBasic_NamedUnit.hxx>
21 #include <StepBasic_MeasureValueMember.hxx>
22
23 #include <TCollection_AsciiString.hxx>
24
25 #include <Interface_EntityIterator.hxx>
26
27
28 #include <StepBasic_LengthMeasureWithUnit.hxx>
29
30 //=======================================================================
31 //function : RWStepBasic_RWLengthMeasureWithUnit
32 //purpose  : 
33 //=======================================================================
34
35 RWStepBasic_RWLengthMeasureWithUnit::RWStepBasic_RWLengthMeasureWithUnit () {}
36
37 //=======================================================================
38 //function : ReadStep
39 //purpose  : 
40 //=======================================================================
41
42 void RWStepBasic_RWLengthMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data,
43                                                     const Standard_Integer num,
44                                                     Handle(Interface_Check)& ach,
45                                                     const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
46 {
47   // --- Number of Parameter Control ---
48   if (!data->CheckNbParams(num,2,ach,"length_measure_with_unit")) return;
49   
50   // --- inherited field : valueComponent ---
51   // --- Update 12-02-96 by FMA , 31-MARS-1997 by CKY
52   Handle(StepBasic_MeasureValueMember) mvc = new StepBasic_MeasureValueMember;
53   data->ReadMember (num,1, "value_component", ach, mvc);
54   
55   // --- inherited field : unitComponent ---
56   StepBasic_Unit aUnitComponent;
57   data->ReadEntity(num, 2,"unit_component", ach, aUnitComponent);
58
59   //--- Initialisation of the read entity ---
60   ent->Init(mvc, aUnitComponent);
61 }
62
63 //=======================================================================
64 //function : WriteStep
65 //purpose  : 
66 //=======================================================================
67
68 void RWStepBasic_RWLengthMeasureWithUnit::WriteStep (StepData_StepWriter& SW,
69                                                      const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
70 {
71
72   // --- inherited field valueComponent ---
73   SW.Send(ent->ValueComponentMember());
74
75   // --- inherited field unitComponent ---
76   SW.Send(ent->UnitComponent().Value());
77 }
78
79
80 //=======================================================================
81 //function : Share
82 //purpose  : 
83 //=======================================================================
84
85 void RWStepBasic_RWLengthMeasureWithUnit::Share (const Handle(StepBasic_LengthMeasureWithUnit)& ent, 
86                                                  Interface_EntityIterator& iter) const
87 {
88
89   iter.GetOneItem(ent->UnitComponent().Value());
90 }
91