b311480e |
1 | // Created on: 2003-01-28 |
2 | // Created by: data exchange team |
973c2be1 |
3 | // Copyright (c) 2003-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.2 |
7fd59977 |
17 | |
18 | #include <RWStepBasic_RWDocumentProductEquivalence.ixx> |
ec357c5c |
19 | #include <StepBasic_Document.hxx> |
7fd59977 |
20 | |
21 | //======================================================================= |
22 | //function : RWStepBasic_RWDocumentProductEquivalence |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | RWStepBasic_RWDocumentProductEquivalence::RWStepBasic_RWDocumentProductEquivalence () |
27 | { |
28 | } |
29 | |
30 | //======================================================================= |
31 | //function : ReadStep |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | void RWStepBasic_RWDocumentProductEquivalence::ReadStep (const Handle(StepData_StepReaderData)& data, |
36 | const Standard_Integer num, |
37 | Handle(Interface_Check)& ach, |
38 | const Handle(StepBasic_DocumentProductEquivalence) &ent) const |
39 | { |
40 | // Check number of parameters |
41 | if ( ! data->CheckNbParams(num,4,ach,"document_product_equivalence") ) return; |
42 | |
43 | // Inherited fields of DocumentProductAssociation |
44 | |
45 | Handle(TCollection_HAsciiString) aDocumentProductAssociation_Name; |
46 | data->ReadString (num, 1, "document_product_association.name", ach, aDocumentProductAssociation_Name); |
47 | |
48 | Handle(TCollection_HAsciiString) aDocumentProductAssociation_Description; |
49 | Standard_Boolean hasDocumentProductAssociation_Description = Standard_True; |
50 | if ( data->IsParamDefined (num,2) ) { |
51 | data->ReadString (num, 2, "document_product_association.description", ach, aDocumentProductAssociation_Description); |
52 | } |
53 | else { |
54 | hasDocumentProductAssociation_Description = Standard_False; |
55 | } |
56 | |
57 | Handle(StepBasic_Document) aDocumentProductAssociation_RelatingDocument; |
58 | data->ReadEntity (num, 3, "document_product_association.relating_document", ach, STANDARD_TYPE(StepBasic_Document), aDocumentProductAssociation_RelatingDocument); |
59 | |
60 | StepBasic_ProductOrFormationOrDefinition aDocumentProductAssociation_RelatedProduct; |
61 | data->ReadEntity (num, 4, "document_product_association.related_product", ach, aDocumentProductAssociation_RelatedProduct); |
62 | |
63 | // Initialize entity |
64 | ent->Init(aDocumentProductAssociation_Name, |
65 | hasDocumentProductAssociation_Description, |
66 | aDocumentProductAssociation_Description, |
67 | aDocumentProductAssociation_RelatingDocument, |
68 | aDocumentProductAssociation_RelatedProduct); |
69 | } |
70 | |
71 | //======================================================================= |
72 | //function : WriteStep |
73 | //purpose : |
74 | //======================================================================= |
75 | |
76 | void RWStepBasic_RWDocumentProductEquivalence::WriteStep (StepData_StepWriter& SW, |
77 | const Handle(StepBasic_DocumentProductEquivalence) &ent) const |
78 | { |
79 | |
80 | // Inherited fields of DocumentProductAssociation |
81 | |
82 | SW.Send (ent->StepBasic_DocumentProductAssociation::Name()); |
83 | |
84 | if ( ent->StepBasic_DocumentProductAssociation::HasDescription() ) { |
85 | SW.Send (ent->StepBasic_DocumentProductAssociation::Description()); |
86 | } |
87 | else SW.SendUndef(); |
88 | |
89 | SW.Send (ent->StepBasic_DocumentProductAssociation::RelatingDocument()); |
90 | |
91 | SW.Send (ent->StepBasic_DocumentProductAssociation::RelatedProduct().Value()); |
92 | } |
93 | |
94 | //======================================================================= |
95 | //function : Share |
96 | //purpose : |
97 | //======================================================================= |
98 | |
99 | void RWStepBasic_RWDocumentProductEquivalence::Share (const Handle(StepBasic_DocumentProductEquivalence) &ent, |
100 | Interface_EntityIterator& iter) const |
101 | { |
102 | |
103 | // Inherited fields of DocumentProductAssociation |
104 | |
105 | iter.AddItem (ent->StepBasic_DocumentProductAssociation::RelatingDocument()); |
106 | |
107 | iter.AddItem (ent->StepBasic_DocumentProductAssociation::RelatedProduct().Value()); |
108 | } |