0022934: Wrong delete operator in IGESSelect_SelectFromDrawing.cxx / IGESSelect_Selec...
[occt.git] / src / IGESSelect / IGESSelect_UpdateCreationDate.cxx
1 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000)
2 #include <IGESSelect_UpdateCreationDate.ixx>
3 #include <OSD_Process.hxx>
4 #include <Quantity_Date.hxx>
5 #include <IGESData_GlobalSection.hxx>
6 #include <TCollection_HAsciiString.hxx>
7 #include <Interface_Check.hxx>
8
9
10
11     IGESSelect_UpdateCreationDate::IGESSelect_UpdateCreationDate ()
12     : IGESSelect_ModelModifier (Standard_False)    {  }
13
14     void  IGESSelect_UpdateCreationDate::Performing
15   (IFSelect_ContextModif& ctx,
16    const Handle(IGESData_IGESModel)& target,
17    Interface_CopyTool& ) const
18 {
19   Standard_Integer jour,mois,annee,heure,minute,seconde,millisec,microsec;
20   OSD_Process system;
21   Quantity_Date ladate = system.SystemDate();
22   ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec);
23
24   IGESData_GlobalSection GS = target->GlobalSection();
25   if (annee < 2000)
26      //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000)
27     GS.SetDate (IGESData_GlobalSection::NewDateString
28                 (annee,mois,jour,heure,minute,seconde,0));
29   else 
30     //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000)
31     GS.SetDate (IGESData_GlobalSection::NewDateString
32                 (annee,mois,jour,heure,minute,seconde, -1));
33   target->SetGlobalSection(GS);
34   Handle(Interface_Check) check = new Interface_Check;
35   target->VerifyCheck(check);
36   ctx.AddCheck(check);
37 }
38
39
40     TCollection_AsciiString  IGESSelect_UpdateCreationDate::Label () const
41 { return TCollection_AsciiString ("Update Creation Date in IGES Global Section"); }