d658f275 |
1 | // Created on: 2016-03-31 |
2 | // Created by: Irina KRYLOVA |
3 | // Copyright (c) 2016 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 | #include <Interface_Check.hxx> |
17 | #include <Interface_EntityIterator.hxx> |
18 | #include <RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation.hxx> |
19 | #include <StepBasic_ExternalSource.hxx> |
20 | #include <StepBasic_ProductDefinitionReferenceWithLocalRepresentation.hxx> |
21 | #include <StepBasic_ProductDefinitionContext.hxx> |
22 | #include <StepBasic_ProductDefinitionFormation.hxx> |
23 | #include <StepData_StepReaderData.hxx> |
24 | #include <StepData_StepWriter.hxx> |
25 | |
26 | //======================================================================= |
27 | //function : RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation |
28 | //purpose : |
29 | //======================================================================= |
30 | RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation:: |
31 | RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation () {} |
32 | |
33 | //======================================================================= |
34 | //function : ReadStep |
35 | //purpose : |
36 | //======================================================================= |
37 | void RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation::ReadStep |
38 | (const Handle(StepData_StepReaderData)& data, |
39 | const Standard_Integer num, |
40 | Handle(Interface_Check)& ach, |
41 | const Handle(StepBasic_ProductDefinitionReferenceWithLocalRepresentation)& ent) const |
42 | { |
43 | // Number of Parameter Control |
44 | if (!data->CheckNbParams(num, 5, ach, "product_definition_reference_with_local_representation")) return; |
45 | |
46 | // Own field source |
47 | Handle(StepBasic_ExternalSource) aSource; |
48 | data->ReadEntity(num, 1,"source", ach, STANDARD_TYPE(StepBasic_ExternalSource), aSource); |
49 | |
50 | // Inherited field : id |
51 | Handle(TCollection_HAsciiString) aId; |
52 | data->ReadString (num, 2, "id", ach, aId); |
53 | |
54 | // Inherited field : description |
55 | Handle(TCollection_HAsciiString) aDescription; |
56 | if (data->IsParamDefined (num, 3)) { |
57 | data->ReadString (num, 3, "description", ach, aDescription); |
58 | } |
59 | |
60 | // Inherited field : formation |
61 | Handle(StepBasic_ProductDefinitionFormation) aFormation; |
62 | data->ReadEntity(num, 4, "formation", ach, STANDARD_TYPE(StepBasic_ProductDefinitionFormation), aFormation); |
63 | |
64 | // Inherited : frame_of_reference |
65 | Handle(StepBasic_ProductDefinitionContext) aFrameOfReference; |
66 | data->ReadEntity(num, 5,"frame_of_reference", ach, STANDARD_TYPE(StepBasic_ProductDefinitionContext), aFrameOfReference); |
67 | |
68 | // Initialisation of the read entity |
69 | ent->Init(aSource, aId, aDescription, aFormation, aFrameOfReference); |
70 | } |
71 | |
72 | |
73 | //======================================================================= |
74 | //function : WriteStep |
75 | //purpose : |
76 | //======================================================================= |
77 | void RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation::WriteStep |
78 | (StepData_StepWriter& SW, |
79 | const Handle(StepBasic_ProductDefinitionReferenceWithLocalRepresentation)& ent) const |
80 | { |
81 | // Own field : source |
82 | SW.Send(ent->Source()); |
83 | |
84 | // Inherited field : id |
85 | SW.Send(ent->Id()); |
86 | |
87 | // Inherited field : description |
88 | SW.Send(ent->Description()); |
89 | |
90 | // Inherited field : formation |
91 | SW.Send(ent->Formation()); |
92 | |
93 | // Inherited field : frame_of_reference |
94 | SW.Send(ent->FrameOfReference()); |
95 | } |
96 | |
97 | |
98 | //======================================================================= |
99 | //function : Share |
100 | //purpose : |
101 | //======================================================================= |
102 | void RWStepBasic_RWProductDefinitionReferenceWithLocalRepresentation::Share( |
103 | const Handle(StepBasic_ProductDefinitionReferenceWithLocalRepresentation)& ent, |
104 | Interface_EntityIterator& iter) const |
105 | { |
106 | iter.GetOneItem(ent->Source()); |
107 | iter.GetOneItem(ent->Formation()); |
108 | iter.GetOneItem(ent->FrameOfReference()); |
109 | } |
110 | |