1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000)
15 #include <IGESSelect_UpdateCreationDate.ixx>
16 #include <OSD_Process.hxx>
17 #include <Quantity_Date.hxx>
18 #include <IGESData_GlobalSection.hxx>
19 #include <TCollection_HAsciiString.hxx>
20 #include <Interface_Check.hxx>
24 IGESSelect_UpdateCreationDate::IGESSelect_UpdateCreationDate ()
25 : IGESSelect_ModelModifier (Standard_False) { }
27 void IGESSelect_UpdateCreationDate::Performing
28 (IFSelect_ContextModif& ctx,
29 const Handle(IGESData_IGESModel)& target,
30 Interface_CopyTool& ) const
32 Standard_Integer jour,mois,annee,heure,minute,seconde,millisec,microsec;
34 Quantity_Date ladate = system.SystemDate();
35 ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec);
37 IGESData_GlobalSection GS = target->GlobalSection();
39 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000)
40 GS.SetDate (IGESData_GlobalSection::NewDateString
41 (annee,mois,jour,heure,minute,seconde,0));
43 //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000)
44 GS.SetDate (IGESData_GlobalSection::NewDateString
45 (annee,mois,jour,heure,minute,seconde, -1));
46 target->SetGlobalSection(GS);
47 Handle(Interface_Check) check = new Interface_Check;
48 target->VerifyCheck(check);
53 TCollection_AsciiString IGESSelect_UpdateCreationDate::Label () const
54 { return TCollection_AsciiString ("Update Creation Date in IGES Global Section"); }