VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtDeTimeManager.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtDeTimeManager.h,v $ $Revision: 1.8 $ $State: Exp $
00007 ******************************************************************************/
00008 
00012 
00013 #ifndef DtDeTimeManager_H_
00014 #define DtDeTimeManager_H_
00015 
00016 #include <vrvCore/vrvCore.h>
00017 #include <makArchives/DtDateTimeRecord.h>
00018 
00019 #include <math.h>
00020 
00021 namespace makVrv
00022 {
00023    class DtDe;
00024 
00029    class DT_DLL_VRVCORE DtDeTimeManager
00030    {
00031    public:
00032 
00033 
00034       enum Month
00035       {
00036          January = 1,
00037          February,
00038          March,
00039          April,
00040          May,
00041          June,
00042          July,
00043          August,
00044          September,
00045          October,
00046          November,
00047          December
00048       };
00049 
00051       DtDeTimeManager(DtDe& de);
00052 
00054       virtual ~DtDeTimeManager();
00055 
00058       //virtual void setReferenceDateAndTime(int daysAfterEpoch,double secondsInDay);
00060       virtual void setReferenceDateAndTime(int year, Month month,int dayOfMonth,
00061          int hours, int minutes,double seconds);
00062 
00064       virtual void getReferenceDateAndTime(int& year, Month& month,int& dayOfMonth,
00065          int& hours, int& minutes, double& seconds) const;
00066 
00068       virtual void syncReferenceDateAndTime();
00069 
00072       virtual void calculateCurrentDateAndTime(int& year, Month& month, int& dayOfMonth,
00073          int& hour, int& minutes,double& seconds) const;
00074 
00076       static bool isYearALeapYear(int year);
00077 
00080       static int daysInTheMonthOf(int year, Month month);
00081 
00083       static Month nextMonth(Month month);  
00084 
00086       virtual double timeScale() const;
00087 
00090       virtual void setTimeScale(double timeScale);
00091 
00093       virtual void getRecord(makArchives::DtDateTimeRecord& record) const;
00094 
00095    protected:
00096 
00097       double timeSinceSet() const;
00098 
00099       DtDe& myDe;
00100       
00101       int myYear;
00102       Month myMonth;
00103       int myDayOfTheMonth;     
00104       int myHours;
00105       int myMinutes;
00106       double mySeconds;
00107 
00108 
00111       double mySimulationTimeAtSet;
00112 
00113 
00115       double myTimeScaleFactor;
00116    };
00117 }
00118 
00119 #endif
00120 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)