0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / RWStepShape / RWStepShape_RWDimensionalLocation.cxx
1 // Created on: 2000-04-18
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2000-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.0
17
18 #include <RWStepShape_RWDimensionalLocation.ixx>
19 #include <StepRepr_ShapeAspect.hxx>
20
21 //=======================================================================
22 //function : RWStepShape_RWDimensionalLocation
23 //purpose  : 
24 //=======================================================================
25
26 RWStepShape_RWDimensionalLocation::RWStepShape_RWDimensionalLocation ()
27 {
28 }
29
30 //=======================================================================
31 //function : ReadStep
32 //purpose  : 
33 //=======================================================================
34
35 void RWStepShape_RWDimensionalLocation::ReadStep (const Handle(StepData_StepReaderData)& data,
36                                                   const Standard_Integer num,
37                                                   Handle(Interface_Check)& ach,
38                                                   const Handle(StepShape_DimensionalLocation) &ent) const
39 {
40   // Check number of parameters
41   if ( ! data->CheckNbParams(num,4,ach,"dimensional_location") ) return;
42
43   // Inherited fields of ShapeAspectRelationship
44
45   Handle(TCollection_HAsciiString) aShapeAspectRelationship_Name;
46   data->ReadString (num, 1, "shape_aspect_relationship.name", ach, aShapeAspectRelationship_Name);
47
48   Handle(TCollection_HAsciiString) aShapeAspectRelationship_Description;
49   Standard_Boolean hasShapeAspectRelationship_Description = Standard_True;
50   if ( data->IsParamDefined (num,2) ) {
51     data->ReadString (num, 2, "shape_aspect_relationship.description", ach, aShapeAspectRelationship_Description);
52   }
53   else {
54     hasShapeAspectRelationship_Description = Standard_False;
55   }
56
57   Handle(StepRepr_ShapeAspect) aShapeAspectRelationship_RelatingShapeAspect;
58   data->ReadEntity (num, 3, "shape_aspect_relationship.relating_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aShapeAspectRelationship_RelatingShapeAspect);
59
60   Handle(StepRepr_ShapeAspect) aShapeAspectRelationship_RelatedShapeAspect;
61   data->ReadEntity (num, 4, "shape_aspect_relationship.related_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aShapeAspectRelationship_RelatedShapeAspect);
62
63   // Initialize entity
64   ent->Init(aShapeAspectRelationship_Name,
65             hasShapeAspectRelationship_Description,
66             aShapeAspectRelationship_Description,
67             aShapeAspectRelationship_RelatingShapeAspect,
68             aShapeAspectRelationship_RelatedShapeAspect);
69 }
70
71 //=======================================================================
72 //function : WriteStep
73 //purpose  : 
74 //=======================================================================
75
76 void RWStepShape_RWDimensionalLocation::WriteStep (StepData_StepWriter& SW,
77                                                    const Handle(StepShape_DimensionalLocation) &ent) const
78 {
79
80   // Inherited fields of ShapeAspectRelationship
81
82   SW.Send (ent->StepRepr_ShapeAspectRelationship::Name());
83
84   if ( ent->StepRepr_ShapeAspectRelationship::HasDescription() ) {
85     SW.Send (ent->StepRepr_ShapeAspectRelationship::Description());
86   }
87   else SW.SendUndef();
88
89   SW.Send (ent->StepRepr_ShapeAspectRelationship::RelatingShapeAspect());
90
91   SW.Send (ent->StepRepr_ShapeAspectRelationship::RelatedShapeAspect());
92 }
93
94 //=======================================================================
95 //function : Share
96 //purpose  : 
97 //=======================================================================
98
99 void RWStepShape_RWDimensionalLocation::Share (const Handle(StepShape_DimensionalLocation) &ent,
100                                                Interface_EntityIterator& iter) const
101 {
102
103   // Inherited fields of ShapeAspectRelationship
104
105   iter.AddItem (ent->StepRepr_ShapeAspectRelationship::RelatingShapeAspect());
106
107   iter.AddItem (ent->StepRepr_ShapeAspectRelationship::RelatedShapeAspect());
108 }