0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / IGESSelect / IGESSelect_UpdateCreationDate.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//#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_UpdateCreationDate.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 28IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_UpdateCreationDate,IGESSelect_ModelModifier)
29
b311480e 30IGESSelect_UpdateCreationDate::IGESSelect_UpdateCreationDate ()
7fd59977 31 : IGESSelect_ModelModifier (Standard_False) { }
32
33 void IGESSelect_UpdateCreationDate::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 (annee < 2000)
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));
48 else
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);
55 ctx.AddCheck(check);
56}
57
58
59 TCollection_AsciiString IGESSelect_UpdateCreationDate::Label () const
60{ return TCollection_AsciiString ("Update Creation Date in IGES Global Section"); }