0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWGroupRelationship.cxx
CommitLineData
7fd59977 1// File: RWStepBasic_RWGroupRelationship.cxx
2// Created: Wed May 10 15:09:08 2000
3// Author: Andrey BETENEV
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
5// Copyright: Matra Datavision 2000
6
7#include <RWStepBasic_RWGroupRelationship.ixx>
8
9//=======================================================================
10//function : RWStepBasic_RWGroupRelationship
11//purpose :
12//=======================================================================
13
14RWStepBasic_RWGroupRelationship::RWStepBasic_RWGroupRelationship ()
15{
16}
17
18//=======================================================================
19//function : ReadStep
20//purpose :
21//=======================================================================
22
23void RWStepBasic_RWGroupRelationship::ReadStep (const Handle(StepData_StepReaderData)& data,
24 const Standard_Integer num,
25 Handle(Interface_Check)& ach,
26 const Handle(StepBasic_GroupRelationship) &ent) const
27{
28 // Check number of parameters
29 if ( ! data->CheckNbParams(num,4,ach,"group_relationship") ) return;
30
31 // Own fields of GroupRelationship
32
33 Handle(TCollection_HAsciiString) aName;
34 data->ReadString (num, 1, "name", ach, aName);
35
36 Handle(TCollection_HAsciiString) aDescription;
37 Standard_Boolean hasDescription = Standard_True;
38 if ( data->IsParamDefined (num,2) ) {
39 data->ReadString (num, 2, "description", ach, aDescription);
40 }
41 else {
42 hasDescription = Standard_False;
43 }
44
45 Handle(StepBasic_Group) aRelatingGroup;
46 data->ReadEntity (num, 3, "relating_group", ach, STANDARD_TYPE(StepBasic_Group), aRelatingGroup);
47
48 Handle(StepBasic_Group) aRelatedGroup;
49 data->ReadEntity (num, 4, "related_group", ach, STANDARD_TYPE(StepBasic_Group), aRelatedGroup);
50
51 // Initialize entity
52 ent->Init(aName,
53 hasDescription,
54 aDescription,
55 aRelatingGroup,
56 aRelatedGroup);
57}
58
59//=======================================================================
60//function : WriteStep
61//purpose :
62//=======================================================================
63
64void RWStepBasic_RWGroupRelationship::WriteStep (StepData_StepWriter& SW,
65 const Handle(StepBasic_GroupRelationship) &ent) const
66{
67
68 // Own fields of GroupRelationship
69
70 SW.Send (ent->Name());
71
72 if ( ent->HasDescription() ) {
73 SW.Send (ent->Description());
74 }
75 else SW.SendUndef();
76
77 SW.Send (ent->RelatingGroup());
78
79 SW.Send (ent->RelatedGroup());
80}
81
82//=======================================================================
83//function : Share
84//purpose :
85//=======================================================================
86
87void RWStepBasic_RWGroupRelationship::Share (const Handle(StepBasic_GroupRelationship) &ent,
88 Interface_EntityIterator& iter) const
89{
90
91 // Own fields of GroupRelationship
92
93 iter.AddItem (ent->RelatingGroup());
94
95 iter.AddItem (ent->RelatedGroup());
96}