0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / RWStepBasic / RWStepBasic_RWDocument.cxx
CommitLineData
b311480e 1// Created on: 2000-05-11
2// Created by: data exchange team
973c2be1 3// Copyright (c) 2000-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.1
7fd59977 17
18#include <RWStepBasic_RWDocument.ixx>
19
20//=======================================================================
21//function : RWStepBasic_RWDocument
22//purpose :
23//=======================================================================
24
25RWStepBasic_RWDocument::RWStepBasic_RWDocument ()
26{
27}
28
29//=======================================================================
30//function : ReadStep
31//purpose :
32//=======================================================================
33
34void RWStepBasic_RWDocument::ReadStep (const Handle(StepData_StepReaderData)& data,
35 const Standard_Integer num,
36 Handle(Interface_Check)& ach,
37 const Handle(StepBasic_Document) &ent) const
38{
39 // Check number of parameters
40 if ( ! data->CheckNbParams(num,4,ach,"document") ) return;
41
42 // Own fields of Document
43
44 Handle(TCollection_HAsciiString) aId;
45 data->ReadString (num, 1, "id", ach, aId);
46
47 Handle(TCollection_HAsciiString) aName;
48 data->ReadString (num, 2, "name", ach, aName);
49
50 Handle(TCollection_HAsciiString) aDescription;
51 Standard_Boolean hasDescription = Standard_True;
52 if ( data->IsParamDefined (num,3) ) {
53 data->ReadString (num, 3, "description", ach, aDescription);
54 }
55 else {
56 hasDescription = Standard_False;
57 }
58
59 Handle(StepBasic_DocumentType) aKind;
60 data->ReadEntity (num, 4, "kind", ach, STANDARD_TYPE(StepBasic_DocumentType), aKind);
61
62 // Initialize entity
63 ent->Init(aId,
64 aName,
65 hasDescription,
66 aDescription,
67 aKind);
68}
69
70//=======================================================================
71//function : WriteStep
72//purpose :
73//=======================================================================
74
75void RWStepBasic_RWDocument::WriteStep (StepData_StepWriter& SW,
76 const Handle(StepBasic_Document) &ent) const
77{
78
79 // Own fields of Document
80
81 SW.Send (ent->Id());
82
83 SW.Send (ent->Name());
84
85 if ( ent->HasDescription() ) {
86 SW.Send (ent->Description());
87 }
88 else SW.SendUndef();
89
90 SW.Send (ent->Kind());
91}
92
93//=======================================================================
94//function : Share
95//purpose :
96//=======================================================================
97
98void RWStepBasic_RWDocument::Share (const Handle(StepBasic_Document) &ent,
99 Interface_EntityIterator& iter) const
100{
101
102 // Own fields of Document
103
104 iter.AddItem (ent->Kind());
105}