0026715: Problems in reading STEP short names in complex entities
[occt.git] / src / RWStepRepr / RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp.cxx
CommitLineData
28a73c1f 1// Created on: 2015-08-11
2// Created by: Irina KRYLOVA
3// Copyright (c) 2015 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16
17#include <Interface_Check.hxx>
18#include <Interface_EntityIterator.hxx>
19#include <RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
20#include <StepData_StepReaderData.hxx>
21#include <StepData_StepWriter.hxx>
22#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
23#include <StepRepr_ProductDefinitionShape.hxx>
24
25//=======================================================================
26//function : RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp
27//purpose :
28//=======================================================================
29RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp()
30{
31}
32
33
34//=======================================================================
35//function : ReadStep
36//purpose :
37//=======================================================================
38
39void RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::ReadStep
40 (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num0, Handle(Interface_Check)& ach,
42 const Handle(StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp)& ent) const
43{
44 Standard_Integer num = 0;
a7197ef3 45 data->NamedForComplex("SHAPE_ASPECT","SHPASP", num0, num, ach);
28a73c1f 46 if (!data->CheckNbParams(num, 4, ach, "shape_aspect")) return;
47
48 Handle(TCollection_HAsciiString) aName;
49 data->ReadString (num, 1, "name", ach, aName);
50
51 Handle(TCollection_HAsciiString) aDescription;
52 if (data->IsParamDefined (num, 2)) {
53 data->ReadString (num, 2, "description", ach, aDescription);
54 }
55 Handle(StepRepr_ProductDefinitionShape) aOfShape;
56 data->ReadEntity(num, 3,"of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aOfShape);
57
58 StepData_Logical aProductDefinitional;
59 data->ReadLogical (num,4,"product_definitional",ach,aProductDefinitional);
60
61 // Initialize the entity
62 ent->Init(aName, aDescription, aOfShape, aProductDefinitional);
63}
64
65
66//=======================================================================
67//function : WriteStep
68//purpose :
69//=======================================================================
70
71void RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::WriteStep
72 (StepData_StepWriter& SW,
73 const Handle(StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp)& ent) const
74{
75 SW.StartEntity("COMPOSITE_GROUP_SHAPE_ASPECT");
76 SW.StartEntity("COMPOSITE_SHAPE_ASPECT");
77 SW.StartEntity("DATUM_FEATURE");
78 SW.StartEntity("SHAPE_ASPECT");
79 SW.Send(ent->Name());
80 SW.Send(ent->Description());
81 SW.Send(ent->OfShape());
82 SW.SendLogical(ent->ProductDefinitional());
83}
84
85
86//=======================================================================
87//function : Share
88//purpose :
89//=======================================================================
90
91void RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::Share
92 (const Handle(StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp)& ent,
93 Interface_EntityIterator& iter) const
94{
95 iter.GetOneItem(ent->OfShape());
96}