b311480e |
1 | // Created on: 1999-10-12 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 1999-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <RWStepBasic_RWConversionBasedUnitAndVolumeUnit.ixx> |
18 | |
19 | RWStepBasic_RWConversionBasedUnitAndVolumeUnit::RWStepBasic_RWConversionBasedUnitAndVolumeUnit () |
20 | { |
21 | } |
22 | |
23 | void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::ReadStep(const Handle(StepData_StepReaderData)& data, |
24 | const Standard_Integer num0, |
25 | Handle(Interface_Check)& ach, |
26 | const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const |
27 | { |
28 | Standard_Integer num = num0; |
29 | // --- Instance of plex componant ConversionBasedUnit --- |
30 | if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return; |
31 | Handle(TCollection_HAsciiString) aName; |
32 | data->ReadString (num,1,"name",ach,aName); |
33 | |
34 | // --- field : conversionFactor --- |
35 | Handle(StepBasic_MeasureWithUnit) aConversionFactor; |
36 | data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor); |
37 | |
38 | num = data->NextForComplex(num); |
39 | if (!data->CheckNbParams(num,1,ach,"named_unit")) return; |
40 | Handle(StepBasic_DimensionalExponents) aDimensions; |
41 | data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions); |
42 | |
43 | data->NamedForComplex("VOLUME_UNIT",num0,num,ach); |
44 | if (!data->CheckNbParams(num,0,ach,"volume_unit")) return; |
45 | |
46 | ent->Init(aDimensions,aName,aConversionFactor); |
47 | } |
48 | |
49 | void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::WriteStep(StepData_StepWriter& SW, |
50 | const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const |
51 | { |
52 | SW.StartEntity("CONVERSION_BASED_UNIT"); |
53 | SW.Send(ent->Name()); |
54 | SW.Send(ent->ConversionFactor()); |
55 | SW.StartEntity("NAMED_UNIT"); |
56 | SW.Send(ent->Dimensions()); |
57 | SW.StartEntity("VOLUME_UNIT"); |
58 | } |
59 | |
60 | void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent, |
61 | Interface_EntityIterator& iter) const |
62 | { |
63 | iter.GetOneItem(ent->Dimensions()); |
64 | iter.GetOneItem(ent->ConversionFactor()); |
65 | } |