0024510: Remove unused local variables
[occt.git] / src / RWStepDimTol / RWStepDimTol_RWCommonDatum.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//
973c2be1 7// This library is free software; you can redistribute it and / or modify it
8// under the terms of the GNU Lesser General Public version 2.1 as published
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_RWCommonDatum.ixx>
19#include <StepDimTol_Datum.hxx>
20
21//=======================================================================
22//function : RWStepDimTol_RWCommonDatum
23//purpose :
24//=======================================================================
25
26RWStepDimTol_RWCommonDatum::RWStepDimTol_RWCommonDatum ()
27{
28}
29
30//=======================================================================
31//function : ReadStep
32//purpose :
33//=======================================================================
34
35void RWStepDimTol_RWCommonDatum::ReadStep (const Handle(StepData_StepReaderData)& data,
36 const Standard_Integer num,
37 Handle(Interface_Check)& ach,
38 const Handle(StepDimTol_CommonDatum) &ent) const
39{
40 // Check number of parameters
41 if ( ! data->CheckNbParams(num,9,ach,"common_datum") ) return;
42
43 // Inherited fields of ShapeAspect
44
45 Handle(TCollection_HAsciiString) aShapeAspect_Name;
46 data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
47
48 Handle(TCollection_HAsciiString) aShapeAspect_Description;
7fd59977 49 if ( data->IsParamDefined (num,2) ) {
50 data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
51 }
7fd59977 52
53 Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
54 data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
55
56 StepData_Logical aShapeAspect_ProductDefinitional;
57 data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
58
59 // Inherited fields of Datum
60
61 Handle(TCollection_HAsciiString) aDatum_Name;
62 data->ReadString (num, 5, "shape_aspect.name", ach,aDatum_Name);
63
64 Handle(TCollection_HAsciiString) aDatum_Description;
65 if ( data->IsParamDefined (num,6) ) {
66 data->ReadString (num, 6, "shape_aspect.description", ach,aDatum_Description);
67 }
68
69 Handle(StepRepr_ProductDefinitionShape) aDatum_OfShape;
70 data->ReadEntity (num, 7, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape),aDatum_OfShape);
71
72 StepData_Logical aDatum_ProductDefinitional;
73 data->ReadLogical (num, 8, "shape_aspect.product_definitional", ach,aDatum_ProductDefinitional);
74
75 // Inherited fields of Datum
76
77 Handle(TCollection_HAsciiString) aDatum_Identification;
78 data->ReadString (num, 9, "datum.identification", ach, aDatum_Identification);
79
80 // Initialize entity
81 ent->Init(aShapeAspect_Name,
82 aShapeAspect_Description,
83 aShapeAspect_OfShape,
84 aShapeAspect_ProductDefinitional,
85 aDatum_Name,
86 aDatum_Description,
87 aDatum_OfShape,
88 aDatum_ProductDefinitional,
89 aDatum_Identification);
90}
91
92//=======================================================================
93//function : WriteStep
94//purpose :
95//=======================================================================
96
97void RWStepDimTol_RWCommonDatum::WriteStep (StepData_StepWriter& SW,
98 const Handle(StepDimTol_CommonDatum) &ent) const
99{
100
101 // Inherited fields of ShapeAspect
102
103 SW.Send (ent->StepRepr_ShapeAspect::Name());
104
105 SW.Send (ent->StepRepr_ShapeAspect::Description());
106
107 SW.Send (ent->StepRepr_ShapeAspect::OfShape());
108
109 SW.SendLogical (ent->StepRepr_ShapeAspect::ProductDefinitional());
110
111 // Inherited fields of Datum->ShapeAspect
112
113 SW.Send (ent->Datum()->StepRepr_ShapeAspect::Name());
114
115 SW.Send (ent->Datum()->StepRepr_ShapeAspect::Description());
116
117 SW.Send (ent->Datum()->StepRepr_ShapeAspect::OfShape());
118
119 SW.SendLogical (ent->Datum()->StepRepr_ShapeAspect::ProductDefinitional());
120
121 // Inherited fields of Datum
122
123 SW.Send (ent->Datum()->Identification());
124}
125
126//=======================================================================
127//function : Share
128//purpose :
129//=======================================================================
130
131void RWStepDimTol_RWCommonDatum::Share (const Handle(StepDimTol_CommonDatum) &ent,
132 Interface_EntityIterator& iter) const
133{
134
135 // Inherited fields of ShapeAspect
136
137 iter.AddItem (ent->StepRepr_ShapeAspect::OfShape());
138
139 // Inherited fields of Datum
140
141 iter.AddItem (ent->Datum()->StepRepr_ShapeAspect::OfShape());
142
143}