1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
19 #include <RWStepBasic_RWLengthMeasureWithUnit.ixx>
20 #include <StepBasic_NamedUnit.hxx>
21 #include <StepBasic_MeasureValueMember.hxx>
23 #include <TCollection_AsciiString.hxx>
25 #include <Interface_EntityIterator.hxx>
28 #include <StepBasic_LengthMeasureWithUnit.hxx>
30 //=======================================================================
31 //function : RWStepBasic_RWLengthMeasureWithUnit
33 //=======================================================================
35 RWStepBasic_RWLengthMeasureWithUnit::RWStepBasic_RWLengthMeasureWithUnit () {}
37 //=======================================================================
40 //=======================================================================
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
47 // --- Number of Parameter Control ---
48 if (!data->CheckNbParams(num,2,ach,"length_measure_with_unit")) return;
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);
55 // --- inherited field : unitComponent ---
56 StepBasic_Unit aUnitComponent;
57 data->ReadEntity(num, 2,"unit_component", ach, aUnitComponent);
59 //--- Initialisation of the read entity ---
60 ent->Init(mvc, aUnitComponent);
63 //=======================================================================
64 //function : WriteStep
66 //=======================================================================
68 void RWStepBasic_RWLengthMeasureWithUnit::WriteStep (StepData_StepWriter& SW,
69 const Handle(StepBasic_LengthMeasureWithUnit)& ent) const
72 // --- inherited field valueComponent ---
73 SW.Send(ent->ValueComponentMember());
75 // --- inherited field unitComponent ---
76 SW.Send(ent->UnitComponent().Value());
80 //=======================================================================
83 //=======================================================================
85 void RWStepBasic_RWLengthMeasureWithUnit::Share (const Handle(StepBasic_LengthMeasureWithUnit)& ent,
86 Interface_EntityIterator& iter) const
89 iter.GetOneItem(ent->UnitComponent().Value());