1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepDimTol_RWCommonDatum.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepDimTol_CommonDatum.hxx>
24 #include <StepDimTol_Datum.hxx>
25 #include <StepRepr_ProductDefinitionShape.hxx>
27 //=======================================================================
28 //function : RWStepDimTol_RWCommonDatum
30 //=======================================================================
31 RWStepDimTol_RWCommonDatum::RWStepDimTol_RWCommonDatum ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepDimTol_RWCommonDatum::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepDimTol_CommonDatum) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,9,ach,"common_datum") ) return;
48 // Inherited fields of ShapeAspect
50 Handle(TCollection_HAsciiString) aShapeAspect_Name;
51 data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
53 Handle(TCollection_HAsciiString) aShapeAspect_Description;
54 if ( data->IsParamDefined (num,2) ) {
55 data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
58 Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
59 data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
61 StepData_Logical aShapeAspect_ProductDefinitional;
62 data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
64 // Inherited fields of Datum
66 Handle(TCollection_HAsciiString) aDatum_Name;
67 data->ReadString (num, 5, "shape_aspect.name", ach,aDatum_Name);
69 Handle(TCollection_HAsciiString) aDatum_Description;
70 if ( data->IsParamDefined (num,6) ) {
71 data->ReadString (num, 6, "shape_aspect.description", ach,aDatum_Description);
74 Handle(StepRepr_ProductDefinitionShape) aDatum_OfShape;
75 data->ReadEntity (num, 7, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape),aDatum_OfShape);
77 StepData_Logical aDatum_ProductDefinitional;
78 data->ReadLogical (num, 8, "shape_aspect.product_definitional", ach,aDatum_ProductDefinitional);
80 // Inherited fields of Datum
82 Handle(TCollection_HAsciiString) aDatum_Identification;
83 data->ReadString (num, 9, "datum.identification", ach, aDatum_Identification);
86 ent->Init(aShapeAspect_Name,
87 aShapeAspect_Description,
89 aShapeAspect_ProductDefinitional,
93 aDatum_ProductDefinitional,
94 aDatum_Identification);
97 //=======================================================================
98 //function : WriteStep
100 //=======================================================================
102 void RWStepDimTol_RWCommonDatum::WriteStep (StepData_StepWriter& SW,
103 const Handle(StepDimTol_CommonDatum) &ent) const
106 // Inherited fields of ShapeAspect
108 SW.Send (ent->StepRepr_ShapeAspect::Name());
110 SW.Send (ent->StepRepr_ShapeAspect::Description());
112 SW.Send (ent->StepRepr_ShapeAspect::OfShape());
114 SW.SendLogical (ent->StepRepr_ShapeAspect::ProductDefinitional());
116 // Inherited fields of Datum->ShapeAspect
118 SW.Send (ent->Datum()->StepRepr_ShapeAspect::Name());
120 SW.Send (ent->Datum()->StepRepr_ShapeAspect::Description());
122 SW.Send (ent->Datum()->StepRepr_ShapeAspect::OfShape());
124 SW.SendLogical (ent->Datum()->StepRepr_ShapeAspect::ProductDefinitional());
126 // Inherited fields of Datum
128 SW.Send (ent->Datum()->Identification());
131 //=======================================================================
134 //=======================================================================
136 void RWStepDimTol_RWCommonDatum::Share (const Handle(StepDimTol_CommonDatum) &ent,
137 Interface_EntityIterator& iter) const
140 // Inherited fields of ShapeAspect
142 iter.AddItem (ent->StepRepr_ShapeAspect::OfShape());
144 // Inherited fields of Datum
146 iter.AddItem (ent->Datum()->StepRepr_ShapeAspect::OfShape());