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