0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[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
28a73c1f 17#include <Interface_EntityIterator.hxx>
18#include <RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
19#include <StepData_StepReaderData.hxx>
20#include <StepData_StepWriter.hxx>
21#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
22#include <StepRepr_ProductDefinitionShape.hxx>
23
24//=======================================================================
25//function : RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp
26//purpose :
27//=======================================================================
28RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp()
29{
30}
31
32
33//=======================================================================
34//function : ReadStep
35//purpose :
36//=======================================================================
37
38void RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::ReadStep
39 (const Handle(StepData_StepReaderData)& data,
40 const Standard_Integer num0, Handle(Interface_Check)& ach,
41 const Handle(StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp)& ent) const
42{
43 Standard_Integer num = 0;
a7197ef3 44 data->NamedForComplex("SHAPE_ASPECT","SHPASP", num0, num, ach);
28a73c1f 45 if (!data->CheckNbParams(num, 4, ach, "shape_aspect")) return;
46
47 Handle(TCollection_HAsciiString) aName;
48 data->ReadString (num, 1, "name", ach, aName);
49
50 Handle(TCollection_HAsciiString) aDescription;
51 if (data->IsParamDefined (num, 2)) {
52 data->ReadString (num, 2, "description", ach, aDescription);
53 }
54 Handle(StepRepr_ProductDefinitionShape) aOfShape;
55 data->ReadEntity(num, 3,"of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aOfShape);
56
57 StepData_Logical aProductDefinitional;
58 data->ReadLogical (num,4,"product_definitional",ach,aProductDefinitional);
59
60 // Initialize the entity
61 ent->Init(aName, aDescription, aOfShape, aProductDefinitional);
62}
63
64
65//=======================================================================
66//function : WriteStep
67//purpose :
68//=======================================================================
69
70void RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::WriteStep
71 (StepData_StepWriter& SW,
72 const Handle(StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp)& ent) const
73{
74 SW.StartEntity("COMPOSITE_GROUP_SHAPE_ASPECT");
75 SW.StartEntity("COMPOSITE_SHAPE_ASPECT");
76 SW.StartEntity("DATUM_FEATURE");
77 SW.StartEntity("SHAPE_ASPECT");
78 SW.Send(ent->Name());
79 SW.Send(ent->Description());
80 SW.Send(ent->OfShape());
81 SW.SendLogical(ent->ProductDefinitional());
82}
83
84
85//=======================================================================
86//function : Share
87//purpose :
88//=======================================================================
89
90void RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp::Share
91 (const Handle(StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp)& ent,
92 Interface_EntityIterator& iter) const
93{
94 iter.GetOneItem(ent->OfShape());
95}