0024624: Lost word in license statement in source files
[occt.git] / src / RWStepDimTol / RWStepDimTol_RWGeometricToleranceWithDatumReference.cxx
CommitLineData
b311480e 1// Created on: 2003-06-04
2// Created by: Galina KULIKOVA
973c2be1 3// Copyright (c) 2003-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
7fd59977 17
18#include <RWStepDimTol_RWGeometricToleranceWithDatumReference.ixx>
19#include <StepDimTol_HArray1OfDatumReference.hxx>
20#include <StepDimTol_DatumReference.hxx>
21
22//=======================================================================
23//function : RWStepDimTol_RWGeometricToleranceWithDatumReference
24//purpose :
25//=======================================================================
26
27RWStepDimTol_RWGeometricToleranceWithDatumReference::RWStepDimTol_RWGeometricToleranceWithDatumReference ()
28{
29}
30
31//=======================================================================
32//function : ReadStep
33//purpose :
34//=======================================================================
35
36void RWStepDimTol_RWGeometricToleranceWithDatumReference::ReadStep (const Handle(StepData_StepReaderData)& data,
37 const Standard_Integer num,
38 Handle(Interface_Check)& ach,
39 const Handle(StepDimTol_GeometricToleranceWithDatumReference) &ent) const
40{
41 // Check number of parameters
42 if ( ! data->CheckNbParams(num,5,ach,"geometric_tolerance_with_datum_reference") ) return;
43
44 // Inherited fields of GeometricTolerance
45
46 Handle(TCollection_HAsciiString) aGeometricTolerance_Name;
47 data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name);
48
49 Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
50 data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
51
52 Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
53 data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
54
55 Handle(StepRepr_ShapeAspect) aGeometricTolerance_TolerancedShapeAspect;
56 data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aGeometricTolerance_TolerancedShapeAspect);
57
58 // Own fields of GeometricToleranceWithDatumReference
59
60 Handle(StepDimTol_HArray1OfDatumReference) aDatumSystem;
61 Standard_Integer sub5 = 0;
62 if ( data->ReadSubList (num, 5, "datum_system", ach, sub5) ) {
63 Standard_Integer nb0 = data->NbParams(sub5);
64 aDatumSystem = new StepDimTol_HArray1OfDatumReference (1, nb0);
65 Standard_Integer num2 = sub5;
66 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
67 Handle(StepDimTol_DatumReference) anIt0;
68 data->ReadEntity (num2, i0, "datum_reference", ach, STANDARD_TYPE(StepDimTol_DatumReference), anIt0);
69 aDatumSystem->SetValue(i0, anIt0);
70 }
71 }
72
73 // Initialize entity
74 ent->Init(aGeometricTolerance_Name,
75 aGeometricTolerance_Description,
76 aGeometricTolerance_Magnitude,
77 aGeometricTolerance_TolerancedShapeAspect,
78 aDatumSystem);
79}
80
81//=======================================================================
82//function : WriteStep
83//purpose :
84//=======================================================================
85
86void RWStepDimTol_RWGeometricToleranceWithDatumReference::WriteStep (StepData_StepWriter& SW,
87 const Handle(StepDimTol_GeometricToleranceWithDatumReference) &ent) const
88{
89
90 // Inherited fields of GeometricTolerance
91
92 SW.Send (ent->StepDimTol_GeometricTolerance::Name());
93
94 SW.Send (ent->StepDimTol_GeometricTolerance::Description());
95
96 SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude());
97
98 SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
99
100 // Own fields of GeometricToleranceWithDatumReference
101
102 SW.OpenSub();
103 for (Standard_Integer i4=1; i4 <= ent->DatumSystem()->Length(); i4++ ) {
104 Handle(StepDimTol_DatumReference) Var0 = ent->DatumSystem()->Value(i4);
105 SW.Send (Var0);
106 }
107 SW.CloseSub();
108}
109
110//=======================================================================
111//function : Share
112//purpose :
113//=======================================================================
114
115void RWStepDimTol_RWGeometricToleranceWithDatumReference::Share (const Handle(StepDimTol_GeometricToleranceWithDatumReference) &ent,
116 Interface_EntityIterator& iter) const
117{
118
119 // Inherited fields of GeometricTolerance
120
121 iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude());
122
123 iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
124
125 // Own fields of GeometricToleranceWithDatumReference
126
127 for (Standard_Integer i3=1; i3 <= ent->DatumSystem()->Length(); i3++ ) {
128 Handle(StepDimTol_DatumReference) Var0 = ent->DatumSystem()->Value(i3);
129 iter.AddItem (Var0);
130 }
131}