1 // Created on: 2015-08-11
2 // Created by: Irina KRYLOVA
3 // Copyright (c) 2015 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <Interface_Check.hxx>
18 #include <Interface_EntityIterator.hxx>
19 #include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
20 #include <StepData_StepReaderData.hxx>
21 #include <StepData_StepWriter.hxx>
22 #include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
23 #include <StepRepr_ProductDefinitionShape.hxx>
25 //=======================================================================
26 //function : RWStepRepr_RWCompShAspAndDatumFeatAndShAsp
28 //=======================================================================
29 RWStepRepr_RWCompShAspAndDatumFeatAndShAsp::RWStepRepr_RWCompShAspAndDatumFeatAndShAsp()
34 //=======================================================================
37 //=======================================================================
39 void RWStepRepr_RWCompShAspAndDatumFeatAndShAsp::ReadStep
40 (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num0, Handle(Interface_Check)& ach,
42 const Handle(StepRepr_CompShAspAndDatumFeatAndShAsp)& ent) const
44 Standard_Integer num = 0;
45 data->NamedForComplex("SHAPE_ASPECT","SHPASP", num0, num, ach);
46 if (!data->CheckNbParams(num, 4, ach, "shape_aspect")) return;
48 Handle(TCollection_HAsciiString) aName;
49 data->ReadString (num, 1, "name", ach, aName);
51 Handle(TCollection_HAsciiString) aDescription;
52 if (data->IsParamDefined (num, 2)) {
53 data->ReadString (num, 2, "description", ach, aDescription);
55 Handle(StepRepr_ProductDefinitionShape) aOfShape;
56 data->ReadEntity(num, 3,"of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aOfShape);
58 StepData_Logical aProductDefinitional;
59 data->ReadLogical (num,4,"product_definitional",ach,aProductDefinitional);
61 // Initialize the entity
62 ent->Init(aName, aDescription, aOfShape, aProductDefinitional);
66 //=======================================================================
67 //function : WriteStep
69 //=======================================================================
71 void RWStepRepr_RWCompShAspAndDatumFeatAndShAsp::WriteStep
72 (StepData_StepWriter& SW,
73 const Handle(StepRepr_CompShAspAndDatumFeatAndShAsp)& ent) const
75 SW.StartEntity("COMPOSITE_SHAPE_ASPECT");
76 SW.StartEntity("DATUM_FEATURE");
77 SW.StartEntity("SHAPE_ASPECT");
79 SW.Send(ent->Description());
80 SW.Send(ent->OfShape());
81 SW.SendLogical(ent->ProductDefinitional());
85 //=======================================================================
88 //=======================================================================
90 void RWStepRepr_RWCompShAspAndDatumFeatAndShAsp::Share
91 (const Handle(StepRepr_CompShAspAndDatumFeatAndShAsp)& ent,
92 Interface_EntityIterator& iter) const
94 iter.GetOneItem(ent->OfShape());