b311480e |
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 | |
7fd59977 |
18 | #include <RWStepBasic_RWMassMeasureWithUnit.ixx> |
19 | |
20 | #include <StepBasic_NamedUnit.hxx> |
21 | #include <StepBasic_MeasureValueMember.hxx> |
22 | #include <TCollection_AsciiString.hxx> |
23 | #include <Interface_EntityIterator.hxx> |
24 | #include <StepBasic_MassMeasureWithUnit.hxx> |
25 | |
26 | |
27 | //======================================================================= |
28 | //function : RWStepBasic_RWMassMeasureWithUnit |
29 | //purpose : |
30 | //======================================================================= |
31 | |
32 | RWStepBasic_RWMassMeasureWithUnit::RWStepBasic_RWMassMeasureWithUnit() |
33 | { |
34 | } |
35 | |
36 | |
37 | //======================================================================= |
38 | //function : ReadStep |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | void RWStepBasic_RWMassMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data, |
43 | const Standard_Integer num, |
44 | Handle(Interface_Check)& ach, |
45 | const Handle(StepBasic_MassMeasureWithUnit)& ent) const |
46 | { |
47 | // --- Number of Parameter Control --- |
48 | if (!data->CheckNbParams(num,2,ach,"Mass_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 | //======================================================================= |
65 | //function : WriteStep |
66 | //purpose : |
67 | //======================================================================= |
68 | |
69 | void RWStepBasic_RWMassMeasureWithUnit::WriteStep (StepData_StepWriter& SW, |
70 | const Handle(StepBasic_MassMeasureWithUnit)& ent) const |
71 | { |
72 | // --- inherited field valueComponent --- |
73 | SW.Send(ent->ValueComponentMember()); |
74 | // --- inherited field unitComponent --- |
75 | SW.Send(ent->UnitComponent().Value()); |
76 | } |
77 | |
78 | |
79 | //======================================================================= |
80 | //function : Share |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | void RWStepBasic_RWMassMeasureWithUnit::Share (const Handle(StepBasic_MassMeasureWithUnit)& ent, |
85 | Interface_EntityIterator& iter) const |
86 | { |
87 | iter.GetOneItem(ent->UnitComponent().Value()); |
88 | } |
89 | |