Integration of OCCT 6.5.0 from SVN
[occt.git] / src / RWStepBasic / RWStepBasic_RWContract.cxx
1 // File:        RWStepBasic_RWContract.cxx
2 // Created:     Fri Nov 26 16:26:37 1999 
3 // Author:      Andrey BETENEV
4 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
5 // Copyright:   Matra Datavision 1999
6
7 #include <RWStepBasic_RWContract.ixx>
8
9 //=======================================================================
10 //function : RWStepBasic_RWContract
11 //purpose  : 
12 //=======================================================================
13
14 RWStepBasic_RWContract::RWStepBasic_RWContract ()
15 {
16 }
17
18 //=======================================================================
19 //function : ReadStep
20 //purpose  : 
21 //=======================================================================
22
23 void RWStepBasic_RWContract::ReadStep (const Handle(StepData_StepReaderData)& data,
24                                        const Standard_Integer num,
25                                        Handle(Interface_Check)& ach,
26                                        const Handle(StepBasic_Contract) &ent) const
27 {
28   // Check number of parameters
29   if ( ! data->CheckNbParams(num,3,ach,"contract") ) return;
30
31   // Own fields of Contract
32
33   Handle(TCollection_HAsciiString) aName;
34   data->ReadString (num, 1, "name", ach, aName);
35
36   Handle(TCollection_HAsciiString) aPurpose;
37   data->ReadString (num, 2, "purpose", ach, aPurpose);
38
39   Handle(StepBasic_ContractType) aKind;
40   data->ReadEntity (num, 3, "kind", ach, STANDARD_TYPE(StepBasic_ContractType), aKind);
41
42   // Initialize entity
43   ent->Init(aName,
44             aPurpose,
45             aKind);
46 }
47
48 //=======================================================================
49 //function : WriteStep
50 //purpose  : 
51 //=======================================================================
52
53 void RWStepBasic_RWContract::WriteStep (StepData_StepWriter& SW,
54                                         const Handle(StepBasic_Contract) &ent) const
55 {
56
57   // Own fields of Contract
58
59   SW.Send (ent->Name());
60
61   SW.Send (ent->Purpose());
62
63   SW.Send (ent->Kind());
64 }
65
66 //=======================================================================
67 //function : Share
68 //purpose  : 
69 //=======================================================================
70
71 void RWStepBasic_RWContract::Share (const Handle(StepBasic_Contract) &ent,
72                                     Interface_EntityIterator& iter) const
73 {
74
75   // Own fields of Contract
76
77   iter.AddItem (ent->Kind());
78 }