1 // Created on: 1999-11-26
2 // Created by: Andrey BETENEV
3 // Copyright (c) 1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
19 #include <Interface_Check.hxx>
20 #include <Interface_EntityIterator.hxx>
21 #include <RWStepRepr_RWConfigurationItem.hxx>
22 #include <StepData_StepReaderData.hxx>
23 #include <StepData_StepWriter.hxx>
24 #include <StepRepr_ConfigurationItem.hxx>
25 #include <StepRepr_ProductConcept.hxx>
27 //=======================================================================
28 //function : RWStepRepr_RWConfigurationItem
30 //=======================================================================
31 RWStepRepr_RWConfigurationItem::RWStepRepr_RWConfigurationItem ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepRepr_RWConfigurationItem::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepRepr_ConfigurationItem) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,5,ach,"configuration_item") ) return;
48 // Own fields of ConfigurationItem
50 Handle(TCollection_HAsciiString) aId;
51 data->ReadString (num, 1, "id", ach, aId);
53 Handle(TCollection_HAsciiString) aName;
54 data->ReadString (num, 2, "name", ach, aName);
56 Handle(TCollection_HAsciiString) aDescription;
57 Standard_Boolean hasDescription = Standard_True;
58 if ( data->IsParamDefined (num,3) ) {
59 data->ReadString (num, 3, "description", ach, aDescription);
62 hasDescription = Standard_False;
65 Handle(StepRepr_ProductConcept) aItemConcept;
66 data->ReadEntity (num, 4, "item_concept", ach, STANDARD_TYPE(StepRepr_ProductConcept), aItemConcept);
68 Handle(TCollection_HAsciiString) aPurpose;
69 Standard_Boolean hasPurpose = Standard_True;
70 if ( data->IsParamDefined (num,5) ) {
71 data->ReadString (num, 5, "purpose", ach, aPurpose);
74 hasPurpose = Standard_False;
87 //=======================================================================
88 //function : WriteStep
90 //=======================================================================
92 void RWStepRepr_RWConfigurationItem::WriteStep (StepData_StepWriter& SW,
93 const Handle(StepRepr_ConfigurationItem) &ent) const
96 // Own fields of ConfigurationItem
100 SW.Send (ent->Name());
102 if ( ent->HasDescription() ) {
103 SW.Send (ent->Description());
107 SW.Send (ent->ItemConcept());
109 if ( ent->HasPurpose() ) {
110 SW.Send (ent->Purpose());
115 //=======================================================================
118 //=======================================================================
120 void RWStepRepr_RWConfigurationItem::Share (const Handle(StepRepr_ConfigurationItem) &ent,
121 Interface_EntityIterator& iter) const
124 // Own fields of ConfigurationItem
126 iter.AddItem (ent->ItemConcept());