0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / IGESGeom / IGESGeom_ToolTabulatedCylinder.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
7fd59977 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.
7fd59977 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
16//--------------------------------------------------------------------
7fd59977 17//--------------------------------------------------------------------
18
7fd59977 19#include <gp_Pnt.hxx>
42cf5bc1 20#include <gp_XYZ.hxx>
21#include <IGESData_DirChecker.hxx>
7fd59977 22#include <IGESData_Dump.hxx>
42cf5bc1 23#include <IGESData_IGESDumper.hxx>
42cf5bc1 24#include <IGESData_IGESReaderData.hxx>
25#include <IGESData_IGESWriter.hxx>
42cf5bc1 26#include <IGESData_ParamReader.hxx>
27#include <IGESData_Status.hxx>
28#include <IGESGeom_TabulatedCylinder.hxx>
29#include <IGESGeom_ToolTabulatedCylinder.hxx>
30#include <Interface_Check.hxx>
31#include <Interface_CopyTool.hxx>
32#include <Interface_EntityIterator.hxx>
7fd59977 33#include <Interface_Macros.hxx>
42cf5bc1 34#include <Interface_ShareTool.hxx>
7fd59977 35#include <Message_Msg.hxx>
42cf5bc1 36#include <Standard_DomainError.hxx>
7fd59977 37
42cf5bc1 38// MGE 31/07/98
7fd59977 39IGESGeom_ToolTabulatedCylinder::IGESGeom_ToolTabulatedCylinder () { }
40
41
42void IGESGeom_ToolTabulatedCylinder::ReadOwnParams
43 (const Handle(IGESGeom_TabulatedCylinder)& ent,
44 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
45{
46 // MGE 31/07/98
47 // Building of messages
48 //========================================
49 Message_Msg Msg157("XSTEP_157");
50 //========================================
51
52 Handle(IGESData_IGESEntity) aDirectrix;
53 gp_XYZ anEnd;
54 IGESData_Status aStatus;
55
56 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
57
58 // Reading the directrix curve entity
59 if (!PR.ReadEntity(IR, PR.Current(), aStatus, aDirectrix)){ //szv#4:S4163:12Mar99 `st=` not needed
60 Message_Msg Msg156("XSTEP_156");
61 switch(aStatus) {
62 case IGESData_ReferenceError: {
63 Message_Msg Msg216 ("IGES_216");
64 Msg156.Arg(Msg216.Value());
65 PR.SendFail(Msg156);
66 break; }
67 case IGESData_EntityError: {
68 Message_Msg Msg217 ("IGES_217");
69 Msg156.Arg(Msg217.Value());
70 PR.SendFail(Msg156);
71 break; }
72 default:{
73 }
74 }
75 }
76 //st = PR.ReadEntity(IR, PR.Current(), "Directrix", aDirectrix);
77
78 // Reading the terminate point of the generatrix
79 PR.ReadXYZ(PR.CurrentList(1, 3), Msg157, anEnd); //szv#4:S4163:12Mar99 `st=` not needed
80 //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Terminate Point", anEnd);
81
82 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
83 ent->Init(aDirectrix, anEnd);
84}
85
86void IGESGeom_ToolTabulatedCylinder::WriteOwnParams
87 (const Handle(IGESGeom_TabulatedCylinder)& ent, IGESData_IGESWriter& IW) const
88{
89 IW.Send( ent->Directrix() );
90 IW.Send( ent->EndPoint().X() );
91 IW.Send( ent->EndPoint().Y() );
92 IW.Send( ent->EndPoint().Z() );
93}
94
95void IGESGeom_ToolTabulatedCylinder::OwnShared
96 (const Handle(IGESGeom_TabulatedCylinder)& ent, Interface_EntityIterator& iter) const
97{
98 iter.GetOneItem( ent->Directrix() );
99}
100
101void IGESGeom_ToolTabulatedCylinder::OwnCopy
102 (const Handle(IGESGeom_TabulatedCylinder)& another,
103 const Handle(IGESGeom_TabulatedCylinder)& ent, Interface_CopyTool& TC) const
104{
105 DeclareAndCast(IGESData_IGESEntity, aDirectrix,
106 TC.Transferred(another->Directrix()));
107
108 gp_XYZ anEnd = another->EndPoint().XYZ();
109
110 ent->Init(aDirectrix, anEnd);
111}
112
113
114IGESData_DirChecker IGESGeom_ToolTabulatedCylinder::DirChecker
115 (const Handle(IGESGeom_TabulatedCylinder)& /* ent */ ) const
116{
117 IGESData_DirChecker DC(122, 0);
118 DC.Structure(IGESData_DefVoid);
119 DC.LineFont(IGESData_DefAny);
120// DC.LineWeight(IGESData_DefValue);
121 DC.Color(IGESData_DefAny);
122 DC.HierarchyStatusIgnored();
123 return DC;
124}
125
126void IGESGeom_ToolTabulatedCylinder::OwnCheck
127 (const Handle(IGESGeom_TabulatedCylinder)& /* ent */,
128 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
129{ }
130
131void IGESGeom_ToolTabulatedCylinder::OwnDump
132 (const Handle(IGESGeom_TabulatedCylinder)& ent, const IGESData_IGESDumper& dumper,
0ebe5b0a 133 Standard_OStream& S, const Standard_Integer level) const
7fd59977 134{
135 Standard_Integer sublevel = (level <= 4) ? 0 : 1;
136
0ebe5b0a 137 S << "IGESGeom_TabulatedCylinder\n"
138 << "Directrix : ";
7fd59977 139 dumper.Dump(ent->Directrix(),S, sublevel);
0ebe5b0a 140 S << "\n"
141 << "Terminate Point : ";
7fd59977 142 IGESData_DumpXYZL(S,level, ent->EndPoint(), ent->Location());
0ebe5b0a 143 S << std::endl;
7fd59977 144}