1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 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.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
21 #include <IGESData_DirChecker.hxx>
22 #include <IGESData_Dump.hxx>
23 #include <IGESData_IGESDumper.hxx>
24 #include <IGESData_IGESEntity.hxx>
25 #include <IGESData_IGESReaderData.hxx>
26 #include <IGESData_IGESWriter.hxx>
27 #include <IGESData_ParamCursor.hxx>
28 #include <IGESData_ParamReader.hxx>
29 #include <IGESData_Status.hxx>
30 #include <IGESGeom_TabulatedCylinder.hxx>
31 #include <IGESGeom_ToolTabulatedCylinder.hxx>
32 #include <Interface_Check.hxx>
33 #include <Interface_CopyTool.hxx>
34 #include <Interface_EntityIterator.hxx>
35 #include <Interface_Macros.hxx>
36 #include <Interface_ShareTool.hxx>
37 #include <Message_Messenger.hxx>
38 #include <Message_Msg.hxx>
39 #include <Standard_DomainError.hxx>
42 IGESGeom_ToolTabulatedCylinder::IGESGeom_ToolTabulatedCylinder () { }
45 void IGESGeom_ToolTabulatedCylinder::ReadOwnParams
46 (const Handle(IGESGeom_TabulatedCylinder)& ent,
47 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
50 // Building of messages
51 //========================================
52 Message_Msg Msg157("XSTEP_157");
53 //========================================
55 Handle(IGESData_IGESEntity) aDirectrix;
57 IGESData_Status aStatus;
59 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
61 // Reading the directrix curve entity
62 if (!PR.ReadEntity(IR, PR.Current(), aStatus, aDirectrix)){ //szv#4:S4163:12Mar99 `st=` not needed
63 Message_Msg Msg156("XSTEP_156");
65 case IGESData_ReferenceError: {
66 Message_Msg Msg216 ("IGES_216");
67 Msg156.Arg(Msg216.Value());
70 case IGESData_EntityError: {
71 Message_Msg Msg217 ("IGES_217");
72 Msg156.Arg(Msg217.Value());
79 //st = PR.ReadEntity(IR, PR.Current(), "Directrix", aDirectrix);
81 // Reading the terminate point of the generatrix
82 PR.ReadXYZ(PR.CurrentList(1, 3), Msg157, anEnd); //szv#4:S4163:12Mar99 `st=` not needed
83 //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Terminate Point", anEnd);
85 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
86 ent->Init(aDirectrix, anEnd);
89 void IGESGeom_ToolTabulatedCylinder::WriteOwnParams
90 (const Handle(IGESGeom_TabulatedCylinder)& ent, IGESData_IGESWriter& IW) const
92 IW.Send( ent->Directrix() );
93 IW.Send( ent->EndPoint().X() );
94 IW.Send( ent->EndPoint().Y() );
95 IW.Send( ent->EndPoint().Z() );
98 void IGESGeom_ToolTabulatedCylinder::OwnShared
99 (const Handle(IGESGeom_TabulatedCylinder)& ent, Interface_EntityIterator& iter) const
101 iter.GetOneItem( ent->Directrix() );
104 void IGESGeom_ToolTabulatedCylinder::OwnCopy
105 (const Handle(IGESGeom_TabulatedCylinder)& another,
106 const Handle(IGESGeom_TabulatedCylinder)& ent, Interface_CopyTool& TC) const
108 DeclareAndCast(IGESData_IGESEntity, aDirectrix,
109 TC.Transferred(another->Directrix()));
111 gp_XYZ anEnd = another->EndPoint().XYZ();
113 ent->Init(aDirectrix, anEnd);
117 IGESData_DirChecker IGESGeom_ToolTabulatedCylinder::DirChecker
118 (const Handle(IGESGeom_TabulatedCylinder)& /* ent */ ) const
120 IGESData_DirChecker DC(122, 0);
121 DC.Structure(IGESData_DefVoid);
122 DC.LineFont(IGESData_DefAny);
123 // DC.LineWeight(IGESData_DefValue);
124 DC.Color(IGESData_DefAny);
125 DC.HierarchyStatusIgnored();
129 void IGESGeom_ToolTabulatedCylinder::OwnCheck
130 (const Handle(IGESGeom_TabulatedCylinder)& /* ent */,
131 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
134 void IGESGeom_ToolTabulatedCylinder::OwnDump
135 (const Handle(IGESGeom_TabulatedCylinder)& ent, const IGESData_IGESDumper& dumper,
136 const Handle(Message_Messenger)& S, const Standard_Integer level) const
138 Standard_Integer sublevel = (level <= 4) ? 0 : 1;
140 S << "IGESGeom_TabulatedCylinder" << Message_EndLine;
143 dumper.Dump(ent->Directrix(),S, sublevel);
144 S << Message_EndLine;
145 S << "Terminate Point : ";
146 IGESData_DumpXYZL(S,level, ent->EndPoint(), ent->Location());
147 S << Message_EndLine;