0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / RWStepAP214 / RWStepAP214_RWExternallyDefinedGeneralProperty.cxx
1 // Created on: 2000-05-10
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
17
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepAP214_RWExternallyDefinedGeneralProperty.hxx>
21 #include <StepAP214_ExternallyDefinedGeneralProperty.hxx>
22 #include <StepBasic_ExternallyDefinedItem.hxx>
23 #include <StepBasic_ExternalSource.hxx>
24 #include <StepData_StepReaderData.hxx>
25 #include <StepData_StepWriter.hxx>
26
27 //=======================================================================
28 //function : RWStepAP214_RWExternallyDefinedGeneralProperty
29 //purpose  : 
30 //=======================================================================
31 RWStepAP214_RWExternallyDefinedGeneralProperty::RWStepAP214_RWExternallyDefinedGeneralProperty ()
32 {
33 }
34
35 //=======================================================================
36 //function : ReadStep
37 //purpose  : 
38 //=======================================================================
39
40 void RWStepAP214_RWExternallyDefinedGeneralProperty::ReadStep (const Handle(StepData_StepReaderData)& data,
41                                                                const Standard_Integer num,
42                                                                Handle(Interface_Check)& ach,
43                                                                const Handle(StepAP214_ExternallyDefinedGeneralProperty) &ent) const
44 {
45   // Check number of parameters
46   if ( ! data->CheckNbParams(num,5,ach,"externally_defined_general_property") ) return;
47
48   // Inherited fields of GeneralProperty
49
50   Handle(TCollection_HAsciiString) aGeneralProperty_Id;
51   data->ReadString (num, 1, "general_property.id", ach, aGeneralProperty_Id);
52
53   Handle(TCollection_HAsciiString) aGeneralProperty_Name;
54   data->ReadString (num, 2, "general_property.name", ach, aGeneralProperty_Name);
55
56   Handle(TCollection_HAsciiString) aGeneralProperty_Description;
57   Standard_Boolean hasGeneralProperty_Description = Standard_True;
58   if ( data->IsParamDefined (num,3) ) {
59     data->ReadString (num, 3, "general_property.description", ach, aGeneralProperty_Description);
60   }
61   else {
62     hasGeneralProperty_Description = Standard_False;
63   }
64
65   // Inherited fields of ExternallyDefinedItem
66
67   StepBasic_SourceItem aExternallyDefinedItem_ItemId;
68   data->ReadEntity (num, 4, "externally_defined_item.item_id", ach, aExternallyDefinedItem_ItemId);
69
70   Handle(StepBasic_ExternalSource) aExternallyDefinedItem_Source;
71   data->ReadEntity (num, 5, "externally_defined_item.source", ach, STANDARD_TYPE(StepBasic_ExternalSource), aExternallyDefinedItem_Source);
72
73   // Initialize entity
74   ent->Init(aGeneralProperty_Id,
75             aGeneralProperty_Name,
76             hasGeneralProperty_Description,
77             aGeneralProperty_Description,
78             aExternallyDefinedItem_ItemId,
79             aExternallyDefinedItem_Source);
80 }
81
82 //=======================================================================
83 //function : WriteStep
84 //purpose  : 
85 //=======================================================================
86
87 void RWStepAP214_RWExternallyDefinedGeneralProperty::WriteStep (StepData_StepWriter& SW,
88                                                                 const Handle(StepAP214_ExternallyDefinedGeneralProperty) &ent) const
89 {
90
91   // Inherited fields of GeneralProperty
92
93   SW.Send (ent->StepBasic_GeneralProperty::Id());
94
95   SW.Send (ent->StepBasic_GeneralProperty::Name());
96
97   if ( ent->StepBasic_GeneralProperty::HasDescription() ) {
98     SW.Send (ent->StepBasic_GeneralProperty::Description());
99   }
100   else SW.SendUndef();
101
102   // Inherited fields of ExternallyDefinedItem
103
104   SW.Send (ent->ExternallyDefinedItem()->ItemId().Value());
105
106   SW.Send (ent->ExternallyDefinedItem()->Source());
107 }
108
109 //=======================================================================
110 //function : Share
111 //purpose  : 
112 //=======================================================================
113
114 void RWStepAP214_RWExternallyDefinedGeneralProperty::Share (const Handle(StepAP214_ExternallyDefinedGeneralProperty) &ent,
115                                                             Interface_EntityIterator& iter) const
116 {
117
118   // Inherited fields of GeneralProperty
119
120   // Inherited fields of ExternallyDefinedItem
121
122   iter.AddItem (ent->ExternallyDefinedItem()->ItemId().Value());
123
124   iter.AddItem (ent->ExternallyDefinedItem()->Source());
125 }