0026912: CLang 3.6.2 compiler warning [-Winconsistent-missing-override]
[occt.git] / src / RWHeaderSection / RWHeaderSection_GeneralModule.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
7fd59977 14
15#include <HeaderSection.hxx>
7fd59977 16#include <HeaderSection_FileDescription.hxx>
42cf5bc1 17#include <HeaderSection_FileName.hxx>
7fd59977 18#include <HeaderSection_FileSchema.hxx>
c04c30b3 19#include <HeaderSection_Protocol.hxx>
42cf5bc1 20#include <Interface_Check.hxx>
21#include <Interface_CopyTool.hxx>
22#include <Interface_EntityIterator.hxx>
23#include <Interface_GeneralLib.hxx>
24#include <Interface_HArray1OfHAsciiString.hxx>
7fd59977 25#include <Interface_Macros.hxx>
42cf5bc1 26#include <Interface_ShareTool.hxx>
27#include <RWHeaderSection.hxx>
28#include <RWHeaderSection_GeneralModule.hxx>
29#include <Standard_Transient.hxx>
30#include <Standard_Type.hxx>
31#include <StepData_UndefinedEntity.hxx>
32#include <TCollection_HAsciiString.hxx>
7fd59977 33
34RWHeaderSection_GeneralModule::RWHeaderSection_GeneralModule ()
c04c30b3 35{
36 Interface_GeneralLib::SetGlobal(this, HeaderSection::Protocol());
37}
7fd59977 38
39void RWHeaderSection_GeneralModule::FillSharedCase(const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const
40{
41 if (CN != 4) return;
42
43 DeclareAndCast(StepData_UndefinedEntity,undf,ent);
44 undf->FillShared (iter);
45
46}
47
48
35e08fe8 49void RWHeaderSection_GeneralModule::CheckCase(const Standard_Integer,
50 const Handle(Standard_Transient)&,
51 const Interface_ShareTool&,
52 Handle(Interface_Check)&) const
7fd59977 53{
54}
55
56
57void RWHeaderSection_GeneralModule::CopyCase(const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const
58{
59// ajout manuel
60 switch (CN) {
61
62 case 1 : {
63 Standard_Integer i;
64 DeclareAndCast(HeaderSection_FileName,enfr,entfrom);
65 DeclareAndCast(HeaderSection_FileName,ento,entto);
66 Handle(TCollection_HAsciiString) name =
67 new TCollection_HAsciiString (enfr->Name());
68 Handle(TCollection_HAsciiString) time =
69 new TCollection_HAsciiString (enfr->TimeStamp());
70 Standard_Integer nba = enfr->NbAuthor();
71 Handle(Interface_HArray1OfHAsciiString) auth =
72 new Interface_HArray1OfHAsciiString (1,nba);
73 for (i = 1; i <= nba; i ++) auth->SetValue
74 (i, new TCollection_HAsciiString (enfr->AuthorValue(i)) );
75 Standard_Integer nbo = enfr->NbOrganization();
76 Handle(Interface_HArray1OfHAsciiString) orga =
77 new Interface_HArray1OfHAsciiString (1,nbo);
78 for (i = 1; i <= nbo; i ++) orga->SetValue
79 (i, new TCollection_HAsciiString (enfr->OrganizationValue(i)) );
80 Handle(TCollection_HAsciiString) prep =
81 new TCollection_HAsciiString (enfr->PreprocessorVersion());
82 Handle(TCollection_HAsciiString) orig =
83 new TCollection_HAsciiString (enfr->OriginatingSystem());
84 Handle(TCollection_HAsciiString) autr =
85 new TCollection_HAsciiString (enfr->Authorisation());
86 ento->Init (name,time,auth,orga,prep,orig,autr);
87 }
88 break;
89
90 case 2 : {
91 Standard_Integer i;
92 DeclareAndCast(HeaderSection_FileDescription,enfr,entfrom);
93 DeclareAndCast(HeaderSection_FileDescription,ento,entto);
94 Standard_Integer nbd = enfr->NbDescription();
95 Handle(Interface_HArray1OfHAsciiString) desc =
96 new Interface_HArray1OfHAsciiString (1,nbd);
97 for (i = 1; i <= nbd; i ++) desc->SetValue
98 (i, new TCollection_HAsciiString (enfr->DescriptionValue(i)) );
99 Handle(TCollection_HAsciiString) impl =
100 new TCollection_HAsciiString (enfr->ImplementationLevel());
101 ento->Init (desc,impl);
102 }
103 break;
104
105 case 3 : {
106 Standard_Integer i;
107 DeclareAndCast(HeaderSection_FileSchema,enfr,entfrom);
108 DeclareAndCast(HeaderSection_FileSchema,ento,entto);
109 Standard_Integer nbs = enfr->NbSchemaIdentifiers();
110 Handle(Interface_HArray1OfHAsciiString) sche =
111 new Interface_HArray1OfHAsciiString (1,nbs);
112 for (i = 1; i <= nbs; i ++) sche->SetValue
113 (i, new TCollection_HAsciiString (enfr->SchemaIdentifiersValue(i)) );
114 ento->Init (sche);
115 }
116 break;
117
118 case 4 : {
119 DeclareAndCast(StepData_UndefinedEntity,undfrom,entfrom);
120 DeclareAndCast(StepData_UndefinedEntity,undto,entto);
121 undto->GetFromAnother(undfrom,TC); // On pourrait rapatrier cela
122 }
123 break;
124
125 default : break;
126 }
127}
128 // --- Construction of empty class ---
129
130Standard_Boolean RWHeaderSection_GeneralModule::NewVoid
131 (const Standard_Integer CN, Handle(Standard_Transient)& ent) const
132{
133 if (CN == 0) return Standard_False;
134 switch (CN) {
135 case 1 :
136 ent = new HeaderSection_FileName;
137 break;
138 case 2 :
139 ent = new HeaderSection_FileDescription;
140 break;
141 case 3 :
142 ent = new HeaderSection_FileSchema;
143 break;
144 case 4 :
145 ent = new StepData_UndefinedEntity;
146 break;
147 default : return Standard_False;
148 }
149
150return Standard_True;
151}
152