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 <IGESBasic_ToolExternalReferenceFile.ixx>
20 #include <IGESData_ParamCursor.hxx>
21 #include <TCollection_HAsciiString.hxx>
22 #include <Interface_HArray1OfHAsciiString.hxx>
23 #include <IGESData_Dump.hxx>
24 #include <Interface_Macros.hxx>
27 IGESBasic_ToolExternalReferenceFile::IGESBasic_ToolExternalReferenceFile () { }
30 void IGESBasic_ToolExternalReferenceFile::ReadOwnParams
31 (const Handle(IGESBasic_ExternalReferenceFile)& ent,
32 const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
34 //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
36 Handle(Interface_HArray1OfHAsciiString) tempNames;
37 Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of list entries", num);
38 if (st && num > 0) tempNames = new Interface_HArray1OfHAsciiString(1, num);
39 else PR.AddFail("Number of list entries: Not Positive");
40 if (!tempNames.IsNull())
41 PR.ReadTexts(PR.CurrentList(num), "External Reference Entity", tempNames); //szv#4:S4163:12Mar99 `st=` not needed
43 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
47 void IGESBasic_ToolExternalReferenceFile::WriteOwnParams
48 (const Handle(IGESBasic_ExternalReferenceFile)& ent, IGESData_IGESWriter& IW) const
50 Standard_Integer i, num;
51 IW.Send(ent->NbListEntries());
52 for ( num = ent->NbListEntries(), i = 1; i <= num; i++ )
53 IW.Send(ent->Name(i));
56 void IGESBasic_ToolExternalReferenceFile::OwnShared
57 (const Handle(IGESBasic_ExternalReferenceFile)& /* ent */, Interface_EntityIterator& /* iter */) const
61 void IGESBasic_ToolExternalReferenceFile::OwnCopy
62 (const Handle(IGESBasic_ExternalReferenceFile)& another,
63 const Handle(IGESBasic_ExternalReferenceFile)& ent, Interface_CopyTool& /* TC */) const
65 Standard_Integer num = another->NbListEntries();
66 Handle(Interface_HArray1OfHAsciiString) tempNames =
67 new Interface_HArray1OfHAsciiString(1, num);
68 for ( Standard_Integer i = 1; i <= num; i++ )
69 tempNames->SetValue(i, new TCollection_HAsciiString
74 IGESData_DirChecker IGESBasic_ToolExternalReferenceFile::DirChecker
75 (const Handle(IGESBasic_ExternalReferenceFile)& /* ent */ ) const
77 IGESData_DirChecker DC(406, 12);
78 DC.Structure(IGESData_DefVoid);
80 DC.LineFont(IGESData_DefVoid);
81 DC.LineWeight(IGESData_DefVoid);
82 DC.Color(IGESData_DefVoid);
83 DC.BlankStatusIgnored();
85 DC.HierarchyStatusIgnored();
89 void IGESBasic_ToolExternalReferenceFile::OwnCheck
90 (const Handle(IGESBasic_ExternalReferenceFile)& /* ent */,
91 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
95 void IGESBasic_ToolExternalReferenceFile::OwnDump
96 (const Handle(IGESBasic_ExternalReferenceFile)& ent, const IGESData_IGESDumper& /* dumper */,
97 const Handle(Message_Messenger)& S, const Standard_Integer level) const
99 S << "IGESBasic_ExternalReferenceFile" << endl;
100 S << "External Reference Names : ";
101 IGESData_DumpStrings(S ,level,1, ent->NbListEntries(),ent->Name);