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 | //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000) |
42cf5bc1 |
15 | |
16 | #include <IFSelect_ContextModif.hxx> |
17 | #include <IGESData_GlobalSection.hxx> |
18 | #include <IGESData_IGESModel.hxx> |
19 | #include <IGESSelect_UpdateLastChange.hxx> |
20 | #include <Interface_Check.hxx> |
21 | #include <Interface_CopyTool.hxx> |
7fd59977 |
22 | #include <OSD_Process.hxx> |
23 | #include <Quantity_Date.hxx> |
42cf5bc1 |
24 | #include <Standard_Type.hxx> |
25 | #include <TCollection_AsciiString.hxx> |
7fd59977 |
26 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
27 | |
92efcf78 |
28 | IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_UpdateLastChange,IGESSelect_ModelModifier) |
29 | |
b311480e |
30 | IGESSelect_UpdateLastChange::IGESSelect_UpdateLastChange () |
7fd59977 |
31 | : IGESSelect_ModelModifier (Standard_False) { } |
32 | |
33 | void IGESSelect_UpdateLastChange::Performing |
34 | (IFSelect_ContextModif& ctx, |
35 | const Handle(IGESData_IGESModel)& target, |
36 | Interface_CopyTool& ) const |
37 | { |
38 | Standard_Integer jour,mois,annee,heure,minute,seconde,millisec,microsec; |
39 | OSD_Process system; |
40 | Quantity_Date ladate = system.SystemDate(); |
41 | ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec); |
42 | |
43 | IGESData_GlobalSection GS = target->GlobalSection(); |
44 | if (GS.IGESVersion() < 9) GS.SetIGESVersion(9); |
45 | if (annee < 2000) |
46 | //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000) |
47 | GS.SetDate (IGESData_GlobalSection::NewDateString |
48 | (annee,mois,jour,heure,minute,seconde,0)); |
49 | else |
50 | //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000) |
51 | GS.SetDate (IGESData_GlobalSection::NewDateString |
52 | (annee,mois,jour,heure,minute,seconde, -1)); |
53 | target->SetGlobalSection(GS); |
54 | Handle(Interface_Check) check = new Interface_Check; |
55 | target->VerifyCheck(check); |
56 | ctx.AddCheck(check); |
57 | } |
58 | |
59 | |
60 | TCollection_AsciiString IGESSelect_UpdateLastChange::Label () const |
61 | { return TCollection_AsciiString ("Update Last Change Date in IGES Global Section"); } |