b311480e |
1 | // Created on: 2000-07-03 |
2 | // Created by: Andrey BETENEV |
973c2be1 |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1 |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Interface_Check.hxx> |
19 | #include <Interface_EntityIterator.hxx> |
20 | #include <RWStepRepr_RWMakeFromUsageOption.hxx> |
ec357c5c |
21 | #include <StepBasic_MeasureWithUnit.hxx> |
42cf5bc1 |
22 | #include <StepBasic_ProductDefinition.hxx> |
23 | #include <StepData_StepReaderData.hxx> |
24 | #include <StepData_StepWriter.hxx> |
25 | #include <StepRepr_MakeFromUsageOption.hxx> |
7fd59977 |
26 | |
27 | //======================================================================= |
28 | //function : RWStepRepr_RWMakeFromUsageOption |
29 | //purpose : |
30 | //======================================================================= |
7fd59977 |
31 | RWStepRepr_RWMakeFromUsageOption::RWStepRepr_RWMakeFromUsageOption () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : ReadStep |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | void RWStepRepr_RWMakeFromUsageOption::ReadStep (const Handle(StepData_StepReaderData)& data, |
41 | const Standard_Integer num, |
42 | Handle(Interface_Check)& ach, |
43 | const Handle(StepRepr_MakeFromUsageOption) &ent) const |
44 | { |
45 | // Check number of parameters |
46 | if ( ! data->CheckNbParams(num,8,ach,"make_from_usage_option") ) return; |
47 | |
48 | // Inherited fields of ProductDefinitionRelationship |
49 | |
50 | Handle(TCollection_HAsciiString) aProductDefinitionRelationship_Id; |
51 | data->ReadString (num, 1, "product_definition_relationship.id", ach, aProductDefinitionRelationship_Id); |
52 | |
53 | Handle(TCollection_HAsciiString) aProductDefinitionRelationship_Name; |
54 | data->ReadString (num, 2, "product_definition_relationship.name", ach, aProductDefinitionRelationship_Name); |
55 | |
56 | Handle(TCollection_HAsciiString) aProductDefinitionRelationship_Description; |
57 | Standard_Boolean hasProductDefinitionRelationship_Description = Standard_True; |
58 | if ( data->IsParamDefined (num,3) ) { |
59 | data->ReadString (num, 3, "product_definition_relationship.description", ach, aProductDefinitionRelationship_Description); |
60 | } |
61 | else { |
62 | hasProductDefinitionRelationship_Description = Standard_False; |
63 | } |
64 | |
65 | Handle(StepBasic_ProductDefinition) aProductDefinitionRelationship_RelatingProductDefinition; |
66 | data->ReadEntity (num, 4, "product_definition_relationship.relating_product_definition", ach, STANDARD_TYPE(StepBasic_ProductDefinition), aProductDefinitionRelationship_RelatingProductDefinition); |
67 | |
68 | Handle(StepBasic_ProductDefinition) aProductDefinitionRelationship_RelatedProductDefinition; |
69 | data->ReadEntity (num, 5, "product_definition_relationship.related_product_definition", ach, STANDARD_TYPE(StepBasic_ProductDefinition), aProductDefinitionRelationship_RelatedProductDefinition); |
70 | |
71 | // Own fields of MakeFromUsageOption |
72 | |
73 | Standard_Integer aRanking; |
74 | data->ReadInteger (num, 6, "ranking", ach, aRanking); |
75 | |
76 | Handle(TCollection_HAsciiString) aRankingRationale; |
77 | data->ReadString (num, 7, "ranking_rationale", ach, aRankingRationale); |
78 | |
79 | Handle(StepBasic_MeasureWithUnit) aQuantity; |
80 | data->ReadEntity (num, 8, "quantity", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aQuantity); |
81 | |
82 | // Initialize entity |
83 | ent->Init(aProductDefinitionRelationship_Id, |
84 | aProductDefinitionRelationship_Name, |
85 | hasProductDefinitionRelationship_Description, |
86 | aProductDefinitionRelationship_Description, |
87 | aProductDefinitionRelationship_RelatingProductDefinition, |
88 | aProductDefinitionRelationship_RelatedProductDefinition, |
89 | aRanking, |
90 | aRankingRationale, |
91 | aQuantity); |
92 | } |
93 | |
94 | //======================================================================= |
95 | //function : WriteStep |
96 | //purpose : |
97 | //======================================================================= |
98 | |
99 | void RWStepRepr_RWMakeFromUsageOption::WriteStep (StepData_StepWriter& SW, |
100 | const Handle(StepRepr_MakeFromUsageOption) &ent) const |
101 | { |
102 | |
103 | // Inherited fields of ProductDefinitionRelationship |
104 | |
105 | SW.Send (ent->StepBasic_ProductDefinitionRelationship::Id()); |
106 | |
107 | SW.Send (ent->StepBasic_ProductDefinitionRelationship::Name()); |
108 | |
109 | if ( ent->StepBasic_ProductDefinitionRelationship::HasDescription() ) { |
110 | SW.Send (ent->StepBasic_ProductDefinitionRelationship::Description()); |
111 | } |
112 | else SW.SendUndef(); |
113 | |
114 | SW.Send (ent->StepBasic_ProductDefinitionRelationship::RelatingProductDefinition()); |
115 | |
116 | SW.Send (ent->StepBasic_ProductDefinitionRelationship::RelatedProductDefinition()); |
117 | |
118 | // Own fields of MakeFromUsageOption |
119 | |
120 | SW.Send (ent->Ranking()); |
121 | |
122 | SW.Send (ent->RankingRationale()); |
123 | |
124 | SW.Send (ent->Quantity()); |
125 | } |
126 | |
127 | //======================================================================= |
128 | //function : Share |
129 | //purpose : |
130 | //======================================================================= |
131 | |
132 | void RWStepRepr_RWMakeFromUsageOption::Share (const Handle(StepRepr_MakeFromUsageOption) &ent, |
133 | Interface_EntityIterator& iter) const |
134 | { |
135 | |
136 | // Inherited fields of ProductDefinitionRelationship |
137 | |
138 | iter.AddItem (ent->StepBasic_ProductDefinitionRelationship::RelatingProductDefinition()); |
139 | |
140 | iter.AddItem (ent->StepBasic_ProductDefinitionRelationship::RelatedProductDefinition()); |
141 | |
142 | // Own fields of MakeFromUsageOption |
143 | |
144 | iter.AddItem (ent->Quantity()); |
145 | } |