0033018: Coding - get rid of unused headers [Plugin to ShapeAnalysis]
[occt.git] / src / RWStepDimTol / RWStepDimTol_RWDatumTarget.cxx
1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
17
18 #include <Interface_EntityIterator.hxx>
19 #include <RWStepDimTol_RWDatumTarget.hxx>
20 #include <StepData_StepReaderData.hxx>
21 #include <StepData_StepWriter.hxx>
22 #include <StepDimTol_DatumTarget.hxx>
23 #include <StepRepr_ProductDefinitionShape.hxx>
24
25 //=======================================================================
26 //function : RWStepDimTol_RWDatumTarget
27 //purpose  : 
28 //=======================================================================
29 RWStepDimTol_RWDatumTarget::RWStepDimTol_RWDatumTarget ()
30 {
31 }
32
33 //=======================================================================
34 //function : ReadStep
35 //purpose  : 
36 //=======================================================================
37
38 void RWStepDimTol_RWDatumTarget::ReadStep (const Handle(StepData_StepReaderData)& data,
39                                            const Standard_Integer num,
40                                            Handle(Interface_Check)& ach,
41                                            const Handle(StepDimTol_DatumTarget) &ent) const
42 {
43   // Check number of parameters
44   if ( ! data->CheckNbParams(num,5,ach,"datum_target") ) return;
45
46   // Inherited fields of ShapeAspect
47
48   Handle(TCollection_HAsciiString) aShapeAspect_Name;
49   data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
50
51   Handle(TCollection_HAsciiString) aShapeAspect_Description;
52   if ( data->IsParamDefined (num,2) ) {
53     data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
54   }
55
56   Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
57   data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
58
59   StepData_Logical aShapeAspect_ProductDefinitional;
60   data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
61
62   // Own fields of DatumTarget
63
64   Handle(TCollection_HAsciiString) aTargetId;
65   data->ReadString (num, 5, "target_id", ach, aTargetId);
66
67   // Initialize entity
68   ent->Init(aShapeAspect_Name,
69             aShapeAspect_Description,
70             aShapeAspect_OfShape,
71             aShapeAspect_ProductDefinitional,
72             aTargetId);
73 }
74
75 //=======================================================================
76 //function : WriteStep
77 //purpose  : 
78 //=======================================================================
79
80 void RWStepDimTol_RWDatumTarget::WriteStep (StepData_StepWriter& SW,
81                                             const Handle(StepDimTol_DatumTarget) &ent) const
82 {
83
84   // Inherited fields of ShapeAspect
85
86   SW.Send (ent->StepRepr_ShapeAspect::Name());
87
88   SW.Send (ent->StepRepr_ShapeAspect::Description());
89
90   SW.Send (ent->StepRepr_ShapeAspect::OfShape());
91
92   SW.SendLogical (ent->StepRepr_ShapeAspect::ProductDefinitional());
93
94   // Own fields of DatumTarget
95
96   SW.Send (ent->TargetId());
97 }
98
99 //=======================================================================
100 //function : Share
101 //purpose  : 
102 //=======================================================================
103
104 void RWStepDimTol_RWDatumTarget::Share (const Handle(StepDimTol_DatumTarget) &ent,
105                                         Interface_EntityIterator& iter) const
106 {
107
108   // Inherited fields of ShapeAspect
109
110   iter.AddItem (ent->StepRepr_ShapeAspect::OfShape());
111
112   // Own fields of DatumTarget
113 }