Warnings on vc14 were eliminated
[occt.git] / src / IGESBasic / IGESBasic_ToolExternalRefFileName.cxx
1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
18
19 #include <IGESBasic_ExternalRefFileName.hxx>
20 #include <IGESBasic_ToolExternalRefFileName.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>
26 #include <IGESData_ParamCursor.hxx>
27 #include <IGESData_ParamReader.hxx>
28 #include <Interface_Check.hxx>
29 #include <Interface_CopyTool.hxx>
30 #include <Interface_EntityIterator.hxx>
31 #include <Interface_Macros.hxx>
32 #include <Interface_ShareTool.hxx>
33 #include <Message_Messenger.hxx>
34 #include <Standard_DomainError.hxx>
35 #include <TCollection_HAsciiString.hxx>
36
37 IGESBasic_ToolExternalRefFileName::IGESBasic_ToolExternalRefFileName ()    {  }
38
39
40 void  IGESBasic_ToolExternalRefFileName::ReadOwnParams
41   (const Handle(IGESBasic_ExternalRefFileName)& ent,
42    const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
43 {
44   //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
45   Handle(TCollection_HAsciiString) tempExtRefFileIdentifier;
46   Handle(TCollection_HAsciiString) tempExtRefEntitySymbName;
47   PR.ReadText(PR.Current(), "External Reference File Identifier",
48               tempExtRefFileIdentifier); //szv#4:S4163:12Mar99 `st=` not needed
49   PR.ReadText(PR.Current(), "External Reference Symbolic Name",
50               tempExtRefEntitySymbName); //szv#4:S4163:12Mar99 `st=` not needed
51
52   DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
53   ent->Init (tempExtRefFileIdentifier, tempExtRefEntitySymbName);
54 }
55
56 void  IGESBasic_ToolExternalRefFileName::WriteOwnParams
57   (const Handle(IGESBasic_ExternalRefFileName)& ent, IGESData_IGESWriter& IW) const
58 {
59   IW.Send(ent->FileId());
60   IW.Send(ent->ReferenceName());
61 }
62
63 void  IGESBasic_ToolExternalRefFileName::OwnShared
64   (const Handle(IGESBasic_ExternalRefFileName)& /* ent */, Interface_EntityIterator& /* iter */) const
65 {
66 }
67
68 void  IGESBasic_ToolExternalRefFileName::OwnCopy
69   (const Handle(IGESBasic_ExternalRefFileName)& another,
70    const Handle(IGESBasic_ExternalRefFileName)& ent, Interface_CopyTool& /* TC */) const
71 {
72   Handle(TCollection_HAsciiString) tempFileId  =
73     new TCollection_HAsciiString(another->FileId());
74   Handle(TCollection_HAsciiString) tempRefName =
75     new TCollection_HAsciiString(another->ReferenceName());
76   ent->Init(tempFileId, tempRefName);
77 }
78
79 IGESData_DirChecker  IGESBasic_ToolExternalRefFileName::DirChecker
80   (const Handle(IGESBasic_ExternalRefFileName)& /* ent */ ) const
81 {
82   IGESData_DirChecker DC(416, 0, 2);
83   DC.Structure(IGESData_DefVoid);
84   DC.GraphicsIgnored();
85   DC.LineFont(IGESData_DefVoid);
86   DC.LineWeight(IGESData_DefVoid);
87   DC.Color(IGESData_DefVoid);
88   DC.BlankStatusIgnored();
89   DC.HierarchyStatusIgnored();
90   return DC;
91 }
92
93 void  IGESBasic_ToolExternalRefFileName::OwnCheck
94   (const Handle(IGESBasic_ExternalRefFileName)& ent,
95    const Interface_ShareTool& , Handle(Interface_Check)& ach) const
96 {
97   if (ent->FormNumber() == 1)
98     ach->AddFail("Invalid Form Number");
99 }
100
101 void  IGESBasic_ToolExternalRefFileName::OwnDump
102   (const Handle(IGESBasic_ExternalRefFileName)& ent, const IGESData_IGESDumper& /* dumper */,
103    const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const
104 {
105   S << "IGESBasic_ExternalRefFileName" << endl;
106   S << "External Reference File Identifier : ";
107   IGESData_DumpString(S,ent->FileId());
108   S << endl;
109   S << "External Reference Symbolic Name : ";
110   IGESData_DumpString(S,ent->ReferenceName());
111   S << endl;
112 }