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)
16 #include <IFSelect_ContextModif.hxx>
17 #include <IGESData_GlobalSection.hxx>
18 #include <IGESData_IGESModel.hxx>
19 #include <IGESSelect_UpdateCreationDate.hxx>
20 #include <Interface_Check.hxx>
21 #include <Interface_CopyTool.hxx>
22 #include <OSD_Process.hxx>
23 #include <Quantity_Date.hxx>
24 #include <Standard_Type.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <TCollection_HAsciiString.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_UpdateCreationDate,IGESSelect_ModelModifier)
30 IGESSelect_UpdateCreationDate::IGESSelect_UpdateCreationDate ()
31 : IGESSelect_ModelModifier (Standard_False) { }
33 void IGESSelect_UpdateCreationDate::Performing
34 (IFSelect_ContextModif& ctx,
35 const Handle(IGESData_IGESModel)& target,
36 Interface_CopyTool& ) const
38 Standard_Integer jour,mois,annee,heure,minute,seconde,millisec,microsec;
40 Quantity_Date ladate = system.SystemDate();
41 ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec);
43 IGESData_GlobalSection GS = target->GlobalSection();
45 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000)
46 GS.SetDate (IGESData_GlobalSection::NewDateString
47 (annee,mois,jour,heure,minute,seconde,0));
49 //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000)
50 GS.SetDate (IGESData_GlobalSection::NewDateString
51 (annee,mois,jour,heure,minute,seconde, -1));
52 target->SetGlobalSection(GS);
53 Handle(Interface_Check) check = new Interface_Check;
54 target->VerifyCheck(check);
59 TCollection_AsciiString IGESSelect_UpdateCreationDate::Label () const
60 { return TCollection_AsciiString ("Update Creation Date in IGES Global Section"); }