1 // Created on: 2000-07-03
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepRepr_RWSpecifiedHigherUsageOccurrence.hxx>
21 #include <StepBasic_ProductDefinition.hxx>
22 #include <StepData_StepReaderData.hxx>
23 #include <StepData_StepWriter.hxx>
24 #include <StepRepr_AssemblyComponentUsage.hxx>
25 #include <StepRepr_NextAssemblyUsageOccurrence.hxx>
26 #include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
28 //=======================================================================
29 //function : RWStepRepr_RWSpecifiedHigherUsageOccurrence
31 //=======================================================================
32 RWStepRepr_RWSpecifiedHigherUsageOccurrence::RWStepRepr_RWSpecifiedHigherUsageOccurrence ()
36 //=======================================================================
39 //=======================================================================
41 void RWStepRepr_RWSpecifiedHigherUsageOccurrence::ReadStep (const Handle(StepData_StepReaderData)& data,
42 const Standard_Integer num,
43 Handle(Interface_Check)& ach,
44 const Handle(StepRepr_SpecifiedHigherUsageOccurrence) &ent) const
46 // Check number of parameters
47 if ( ! data->CheckNbParams(num,8,ach,"specified_higher_usage_occurrence") ) return;
49 // Inherited fields of ProductDefinitionRelationship
51 Handle(TCollection_HAsciiString) aProductDefinitionRelationship_Id;
52 data->ReadString (num, 1, "product_definition_relationship.id", ach, aProductDefinitionRelationship_Id);
54 Handle(TCollection_HAsciiString) aProductDefinitionRelationship_Name;
55 data->ReadString (num, 2, "product_definition_relationship.name", ach, aProductDefinitionRelationship_Name);
57 Handle(TCollection_HAsciiString) aProductDefinitionRelationship_Description;
58 Standard_Boolean hasProductDefinitionRelationship_Description = Standard_True;
59 if ( data->IsParamDefined (num,3) ) {
60 data->ReadString (num, 3, "product_definition_relationship.description", ach, aProductDefinitionRelationship_Description);
63 hasProductDefinitionRelationship_Description = Standard_False;
66 StepBasic_ProductDefinitionOrReference aProductDefinitionRelationship_RelatingProductDefinition;
67 data->ReadEntity (num, 4, "product_definition_relationship.relating_product_definition", ach, aProductDefinitionRelationship_RelatingProductDefinition);
69 StepBasic_ProductDefinitionOrReference aProductDefinitionRelationship_RelatedProductDefinition;
70 data->ReadEntity (num, 5, "product_definition_relationship.related_product_definition", ach, aProductDefinitionRelationship_RelatedProductDefinition);
72 // Inherited fields of AssemblyComponentUsage
74 Handle(TCollection_HAsciiString) aAssemblyComponentUsage_ReferenceDesignator;
75 Standard_Boolean hasAssemblyComponentUsage_ReferenceDesignator = Standard_True;
76 if ( data->IsParamDefined (num,6) ) {
77 data->ReadString (num, 6, "assembly_component_usage.reference_designator", ach, aAssemblyComponentUsage_ReferenceDesignator);
80 hasAssemblyComponentUsage_ReferenceDesignator = Standard_False;
83 // Own fields of SpecifiedHigherUsageOccurrence
85 Handle(StepRepr_AssemblyComponentUsage) aUpperUsage;
86 data->ReadEntity (num, 7, "upper_usage", ach, STANDARD_TYPE(StepRepr_AssemblyComponentUsage), aUpperUsage);
88 Handle(StepRepr_NextAssemblyUsageOccurrence) aNextUsage;
89 data->ReadEntity (num, 8, "next_usage", ach, STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence), aNextUsage);
92 ent->Init(aProductDefinitionRelationship_Id,
93 aProductDefinitionRelationship_Name,
94 hasProductDefinitionRelationship_Description,
95 aProductDefinitionRelationship_Description,
96 aProductDefinitionRelationship_RelatingProductDefinition,
97 aProductDefinitionRelationship_RelatedProductDefinition,
98 hasAssemblyComponentUsage_ReferenceDesignator,
99 aAssemblyComponentUsage_ReferenceDesignator,
104 //=======================================================================
105 //function : WriteStep
107 //=======================================================================
109 void RWStepRepr_RWSpecifiedHigherUsageOccurrence::WriteStep (StepData_StepWriter& SW,
110 const Handle(StepRepr_SpecifiedHigherUsageOccurrence) &ent) const
113 // Inherited fields of ProductDefinitionRelationship
115 SW.Send (ent->StepBasic_ProductDefinitionRelationship::Id());
117 SW.Send (ent->StepBasic_ProductDefinitionRelationship::Name());
119 if ( ent->StepBasic_ProductDefinitionRelationship::HasDescription() ) {
120 SW.Send (ent->StepBasic_ProductDefinitionRelationship::Description());
124 SW.Send (ent->StepBasic_ProductDefinitionRelationship::RelatingProductDefinitionAP242().Value());
126 SW.Send (ent->StepBasic_ProductDefinitionRelationship::RelatedProductDefinitionAP242().Value());
128 // Inherited fields of AssemblyComponentUsage
130 if ( ent->StepRepr_AssemblyComponentUsage::HasReferenceDesignator() ) {
131 SW.Send (ent->StepRepr_AssemblyComponentUsage::ReferenceDesignator());
135 // Own fields of SpecifiedHigherUsageOccurrence
137 SW.Send (ent->UpperUsage());
139 SW.Send (ent->NextUsage());
142 //=======================================================================
145 //=======================================================================
147 void RWStepRepr_RWSpecifiedHigherUsageOccurrence::Share (const Handle(StepRepr_SpecifiedHigherUsageOccurrence) &ent,
148 Interface_EntityIterator& iter) const
151 // Inherited fields of ProductDefinitionRelationship
153 iter.AddItem (ent->StepBasic_ProductDefinitionRelationship::RelatingProductDefinitionAP242().Value());
155 iter.AddItem (ent->StepBasic_ProductDefinitionRelationship::RelatedProductDefinitionAP242().Value());
157 // Inherited fields of AssemblyComponentUsage
159 // Own fields of SpecifiedHigherUsageOccurrence
161 iter.AddItem (ent->UpperUsage());
163 iter.AddItem (ent->NextUsage());