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