973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
7fd59977 |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Interface_Check.hxx> |
7fd59977 |
16 | #include <Interface_EntityIterator.hxx> |
42cf5bc1 |
17 | #include <RWStepBasic_RWRatioMeasureWithUnit.hxx> |
18 | #include <StepBasic_MeasureValueMember.hxx> |
19 | #include <StepBasic_NamedUnit.hxx> |
7fd59977 |
20 | #include <StepBasic_RatioMeasureWithUnit.hxx> |
42cf5bc1 |
21 | #include <StepData_StepReaderData.hxx> |
22 | #include <StepData_StepWriter.hxx> |
7fd59977 |
23 | |
24 | //======================================================================= |
25 | //function : RWStepBasic_RWRatioMeasureWithUnit |
26 | //purpose : |
27 | //======================================================================= |
7fd59977 |
28 | RWStepBasic_RWRatioMeasureWithUnit::RWStepBasic_RWRatioMeasureWithUnit () {} |
29 | |
30 | //======================================================================= |
31 | //function : ReadStep |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | void RWStepBasic_RWRatioMeasureWithUnit::ReadStep (const Handle(StepData_StepReaderData)& data, |
36 | const Standard_Integer num, |
37 | Handle(Interface_Check)& ach, |
38 | const Handle(StepBasic_RatioMeasureWithUnit)& ent) const |
39 | { |
40 | // --- Number of Parameter Control --- |
41 | if (!data->CheckNbParams(num,2,ach,"ratio_measure_with_unit")) return; |
42 | |
43 | // --- inherited field : valueComponent --- |
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_RWRatioMeasureWithUnit::WriteStep (StepData_StepWriter& SW, |
61 | const Handle(StepBasic_RatioMeasureWithUnit)& ent) const |
62 | { |
63 | // --- inherited field valueComponent --- |
64 | SW.Send(ent->ValueComponentMember()); |
65 | |
66 | // --- inherited field unitComponent --- |
67 | SW.Send(ent->UnitComponent().Value()); |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : Share |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void RWStepBasic_RWRatioMeasureWithUnit::Share (const Handle(StepBasic_RatioMeasureWithUnit)& ent, |
76 | Interface_EntityIterator& iter) const |
77 | { |
78 | iter.GetOneItem(ent->UnitComponent().Value()); |
79 | } |
80 | |