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 //--------------------------------------------------------------------
19 #include <IGESData_DirChecker.hxx>
20 #include <IGESData_Dump.hxx>
21 #include <IGESData_HArray1OfIGESEntity.hxx>
22 #include <IGESData_IGESDumper.hxx>
23 #include <IGESData_IGESEntity.hxx>
24 #include <IGESData_IGESReaderData.hxx>
25 #include <IGESData_IGESWriter.hxx>
26 #include <IGESData_ParamCursor.hxx>
27 #include <IGESData_ParamReader.hxx>
28 #include <IGESGeom_CompositeCurve.hxx>
29 #include <IGESGeom_ToolCompositeCurve.hxx>
30 #include <Interface_Check.hxx>
31 #include <Interface_CopyTool.hxx>
32 #include <Interface_EntityIterator.hxx>
33 #include <Interface_Macros.hxx>
34 #include <Interface_ShareTool.hxx>
35 #include <Message_Messenger.hxx>
36 #include <Message_Msg.hxx>
37 #include <Standard_DomainError.hxx>
40 IGESGeom_ToolCompositeCurve::IGESGeom_ToolCompositeCurve () { }
43 void IGESGeom_ToolCompositeCurve::ReadOwnParams
44 (const Handle(IGESGeom_CompositeCurve)& ent,
45 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
48 // Building of messages
49 //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
50 Handle(IGESData_HArray1OfIGESEntity) tempEntities;
52 Standard_Integer num; //szv#4:S4163:12Mar99 i not needed
54 Standard_Boolean st = PR.ReadInteger(PR.Current(), num);
55 // st = PR.ReadInteger(PR.Current(), "Number of Components", num);
57 Message_Msg Msg80("XSTEP_80");
58 PR.ReadEnts (IR,PR.CurrentList(num),Msg80,tempEntities); //szv#4:S4163:12Mar99 `st=` not needed
59 //else st = PR.ReadEnts (IR,PR.CurrentList(num),"List of Components",tempEntities);
61 //if (st && num <= 0) PR.SendFail(Msg79);
63 Message_Msg Msg79("XSTEP_79");
67 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
68 ent->Init(tempEntities);
71 void IGESGeom_ToolCompositeCurve::WriteOwnParams
72 (const Handle(IGESGeom_CompositeCurve)& ent, IGESData_IGESWriter& IW) const
74 Standard_Integer num = ent->NbCurves(); Standard_Integer i;
76 for ( num = ent->NbCurves(), i = 1; i <= num; i++ )
77 IW.Send(ent->Curve(i));
80 void IGESGeom_ToolCompositeCurve::OwnShared
81 (const Handle(IGESGeom_CompositeCurve)& ent, Interface_EntityIterator& iter) const
83 Standard_Integer num = ent->NbCurves();
84 for ( Standard_Integer i = 1; i <= num; i++ )
85 iter.GetOneItem(ent->Curve(i));
88 void IGESGeom_ToolCompositeCurve::OwnCopy
89 (const Handle(IGESGeom_CompositeCurve)& another,
90 const Handle(IGESGeom_CompositeCurve)& ent, Interface_CopyTool& TC) const
92 Standard_Integer i, num = another->NbCurves();
93 Handle(IGESData_HArray1OfIGESEntity) tempEntities =
94 new IGESData_HArray1OfIGESEntity(1, num);
95 for ( i = 1; i <= num; i++ )
97 DeclareAndCast(IGESData_IGESEntity, new_ent,
98 TC.Transferred(another->Curve(i)));
99 tempEntities->SetValue(i, new_ent);
101 ent->Init(tempEntities);
104 IGESData_DirChecker IGESGeom_ToolCompositeCurve::DirChecker
105 (const Handle(IGESGeom_CompositeCurve)& /* ent */ ) const
107 IGESData_DirChecker DC(102, 0);
108 DC.Structure(IGESData_DefVoid);
109 DC.GraphicsIgnored();
110 DC.LineFont(IGESData_DefAny);
111 // DC.LineWeight(IGESData_DefValue);
112 DC.Color(IGESData_DefAny);
116 void IGESGeom_ToolCompositeCurve::OwnCheck
117 (const Handle(IGESGeom_CompositeCurve)& /* ent */,
118 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
122 void IGESGeom_ToolCompositeCurve::OwnDump
123 (const Handle(IGESGeom_CompositeCurve)& ent, const IGESData_IGESDumper& dumper,
124 const Handle(Message_Messenger)& S, const Standard_Integer level) const
126 S << "IGESGeom_CompositeCurve" << endl;
127 S << "Curve Entities : " << endl;
128 IGESData_DumpEntities(S,dumper ,level,1, ent->NbCurves(),ent->Curve);