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 <RWStepDimTol_RWCommonDatum.ixx>
19 #include <StepDimTol_Datum.hxx>
21 //=======================================================================
22 //function : RWStepDimTol_RWCommonDatum
24 //=======================================================================
26 RWStepDimTol_RWCommonDatum::RWStepDimTol_RWCommonDatum ()
30 //=======================================================================
33 //=======================================================================
35 void 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
40 // Check number of parameters
41 if ( ! data->CheckNbParams(num,9,ach,"common_datum") ) return;
43 // Inherited fields of ShapeAspect
45 Handle(TCollection_HAsciiString) aShapeAspect_Name;
46 data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
48 Handle(TCollection_HAsciiString) aShapeAspect_Description;
49 if ( data->IsParamDefined (num,2) ) {
50 data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
53 Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
54 data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
56 StepData_Logical aShapeAspect_ProductDefinitional;
57 data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
59 // Inherited fields of Datum
61 Handle(TCollection_HAsciiString) aDatum_Name;
62 data->ReadString (num, 5, "shape_aspect.name", ach,aDatum_Name);
64 Handle(TCollection_HAsciiString) aDatum_Description;
65 if ( data->IsParamDefined (num,6) ) {
66 data->ReadString (num, 6, "shape_aspect.description", ach,aDatum_Description);
69 Handle(StepRepr_ProductDefinitionShape) aDatum_OfShape;
70 data->ReadEntity (num, 7, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape),aDatum_OfShape);
72 StepData_Logical aDatum_ProductDefinitional;
73 data->ReadLogical (num, 8, "shape_aspect.product_definitional", ach,aDatum_ProductDefinitional);
75 // Inherited fields of Datum
77 Handle(TCollection_HAsciiString) aDatum_Identification;
78 data->ReadString (num, 9, "datum.identification", ach, aDatum_Identification);
81 ent->Init(aShapeAspect_Name,
82 aShapeAspect_Description,
84 aShapeAspect_ProductDefinitional,
88 aDatum_ProductDefinitional,
89 aDatum_Identification);
92 //=======================================================================
93 //function : WriteStep
95 //=======================================================================
97 void RWStepDimTol_RWCommonDatum::WriteStep (StepData_StepWriter& SW,
98 const Handle(StepDimTol_CommonDatum) &ent) const
101 // Inherited fields of ShapeAspect
103 SW.Send (ent->StepRepr_ShapeAspect::Name());
105 SW.Send (ent->StepRepr_ShapeAspect::Description());
107 SW.Send (ent->StepRepr_ShapeAspect::OfShape());
109 SW.SendLogical (ent->StepRepr_ShapeAspect::ProductDefinitional());
111 // Inherited fields of Datum->ShapeAspect
113 SW.Send (ent->Datum()->StepRepr_ShapeAspect::Name());
115 SW.Send (ent->Datum()->StepRepr_ShapeAspect::Description());
117 SW.Send (ent->Datum()->StepRepr_ShapeAspect::OfShape());
119 SW.SendLogical (ent->Datum()->StepRepr_ShapeAspect::ProductDefinitional());
121 // Inherited fields of Datum
123 SW.Send (ent->Datum()->Identification());
126 //=======================================================================
129 //=======================================================================
131 void RWStepDimTol_RWCommonDatum::Share (const Handle(StepDimTol_CommonDatum) &ent,
132 Interface_EntityIterator& iter) const
135 // Inherited fields of ShapeAspect
137 iter.AddItem (ent->StepRepr_ShapeAspect::OfShape());
139 // Inherited fields of Datum
141 iter.AddItem (ent->Datum()->StepRepr_ShapeAspect::OfShape());