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 | |
42cf5bc1 |
19 | #include <IGESBasic_ExternalReferenceFile.hxx> |
20 | #include <IGESBasic_ToolExternalReferenceFile.hxx> |
21 | #include <IGESData_DirChecker.hxx> |
22 | #include <IGESData_Dump.hxx> |
23 | #include <IGESData_IGESDumper.hxx> |
24 | #include <IGESData_IGESReaderData.hxx> |
25 | #include <IGESData_IGESWriter.hxx> |
7fd59977 |
26 | #include <IGESData_ParamCursor.hxx> |
42cf5bc1 |
27 | #include <IGESData_ParamReader.hxx> |
28 | #include <Interface_Check.hxx> |
29 | #include <Interface_CopyTool.hxx> |
30 | #include <Interface_EntityIterator.hxx> |
7fd59977 |
31 | #include <Interface_HArray1OfHAsciiString.hxx> |
7fd59977 |
32 | #include <Interface_Macros.hxx> |
42cf5bc1 |
33 | #include <Interface_ShareTool.hxx> |
34 | #include <Message_Messenger.hxx> |
35 | #include <Standard_DomainError.hxx> |
36 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
37 | |
38 | IGESBasic_ToolExternalReferenceFile::IGESBasic_ToolExternalReferenceFile () { } |
39 | |
40 | |
41 | void IGESBasic_ToolExternalReferenceFile::ReadOwnParams |
42 | (const Handle(IGESBasic_ExternalReferenceFile)& ent, |
43 | const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const |
44 | { |
45 | //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down |
46 | Standard_Integer num; |
47 | Handle(Interface_HArray1OfHAsciiString) tempNames; |
48 | Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of list entries", num); |
49 | if (st && num > 0) tempNames = new Interface_HArray1OfHAsciiString(1, num); |
50 | else PR.AddFail("Number of list entries: Not Positive"); |
51 | if (!tempNames.IsNull()) |
52 | PR.ReadTexts(PR.CurrentList(num), "External Reference Entity", tempNames); //szv#4:S4163:12Mar99 `st=` not needed |
53 | |
54 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
55 | ent->Init(tempNames); |
56 | } |
57 | |
58 | void IGESBasic_ToolExternalReferenceFile::WriteOwnParams |
59 | (const Handle(IGESBasic_ExternalReferenceFile)& ent, IGESData_IGESWriter& IW) const |
60 | { |
61 | Standard_Integer i, num; |
62 | IW.Send(ent->NbListEntries()); |
63 | for ( num = ent->NbListEntries(), i = 1; i <= num; i++ ) |
64 | IW.Send(ent->Name(i)); |
65 | } |
66 | |
67 | void IGESBasic_ToolExternalReferenceFile::OwnShared |
68 | (const Handle(IGESBasic_ExternalReferenceFile)& /* ent */, Interface_EntityIterator& /* iter */) const |
69 | { |
70 | } |
71 | |
72 | void IGESBasic_ToolExternalReferenceFile::OwnCopy |
73 | (const Handle(IGESBasic_ExternalReferenceFile)& another, |
74 | const Handle(IGESBasic_ExternalReferenceFile)& ent, Interface_CopyTool& /* TC */) const |
75 | { |
76 | Standard_Integer num = another->NbListEntries(); |
77 | Handle(Interface_HArray1OfHAsciiString) tempNames = |
78 | new Interface_HArray1OfHAsciiString(1, num); |
79 | for ( Standard_Integer i = 1; i <= num; i++ ) |
80 | tempNames->SetValue(i, new TCollection_HAsciiString |
81 | (another->Name(i))); |
82 | ent->Init(tempNames); |
83 | } |
84 | |
85 | IGESData_DirChecker IGESBasic_ToolExternalReferenceFile::DirChecker |
86 | (const Handle(IGESBasic_ExternalReferenceFile)& /* ent */ ) const |
87 | { |
88 | IGESData_DirChecker DC(406, 12); |
89 | DC.Structure(IGESData_DefVoid); |
90 | DC.GraphicsIgnored(); |
91 | DC.LineFont(IGESData_DefVoid); |
92 | DC.LineWeight(IGESData_DefVoid); |
93 | DC.Color(IGESData_DefVoid); |
94 | DC.BlankStatusIgnored(); |
95 | DC.UseFlagIgnored(); |
96 | DC.HierarchyStatusIgnored(); |
97 | return DC; |
98 | } |
99 | |
100 | void IGESBasic_ToolExternalReferenceFile::OwnCheck |
101 | (const Handle(IGESBasic_ExternalReferenceFile)& /* ent */, |
102 | const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const |
103 | { |
104 | } |
105 | |
106 | void IGESBasic_ToolExternalReferenceFile::OwnDump |
107 | (const Handle(IGESBasic_ExternalReferenceFile)& ent, const IGESData_IGESDumper& /* dumper */, |
108 | const Handle(Message_Messenger)& S, const Standard_Integer level) const |
109 | { |
110 | S << "IGESBasic_ExternalReferenceFile" << endl; |
111 | S << "External Reference Names : "; |
112 | IGESData_DumpStrings(S ,level,1, ent->NbListEntries(),ent->Name); |
113 | S << endl; |
114 | } |