| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2003 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: time.h 5079 2005-10-14 16:21:35Z klimetschek $ 00019 // $Date: 2005-10-14 18:21:35 +0200 (Fri, 14 Oct 2005) $ 00020 // $Revision: 5079 $ 00021 // $State$ 00022 // $Author: klimetschek $ 00023 // 00024 // $Log$ 00025 // Revision 1.11 2005/10/14 16:21:35 klimetschek 00026 // added currentDateTimeString() method 00027 // cleaned up comments 00028 // 00029 // Revision 1.10 2005/01/03 01:43:08 klimetschek 00030 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00031 // - removed vrs.vcproj 00032 // minor things: 00033 // - added all glutexamples to vrs4glut.sln 00034 // - fixed some problems in glutexamples 00035 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00036 // 00037 // Revision 1.9 2004/11/05 13:58:10 basch 00038 // Class comment changed (Doxygen style) 00039 // 00040 // Revision 1.8 2004/03/12 16:28:39 baumann 00041 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00042 // 00043 // Revision 1.7 2004/03/10 16:11:43 kirsch 00044 // anged includes such that SerializationManager is known in so.h 00045 // 00046 // Revision 1.6 2004/01/19 17:07:21 baumann 00047 // moved VRS::Document from vrs/ to vrs/io/ 00048 // 00049 // Revision 1.5 2004/01/19 13:14:41 baumann 00050 // #include <vrs/io/document.h> added or removed 00051 // 00052 // Revision 1.4 2004/01/19 11:43:57 baumann 00053 // serialization mechanism improved 00054 // 00055 // Revision 1.3 2004/01/13 11:40:43 baumann 00056 // changed vrs/serializationmanager.h to vrs/io/document.h 00057 // 00058 // Revision 1.2 2004/01/13 11:30:08 baumann 00059 // #include <vrs/serializationmanager.h> added 00060 // 00061 // Revision 1.1 2003/10/21 11:41:13 baumann 00062 // moved class VRSTime from "vrs/sg" to "vrs" 00063 // 00064 // Revision 1.12 2002/10/29 10:32:53 baumann 00065 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00066 // 00067 // Revision 1.11 2002/03/18 16:09:14 baumann 00068 // TimeUtil::time() replaced with VRSTime::now() 00069 // class TimeUtil removed 00070 // 00071 // Revision 1.10 2002/02/27 15:03:29 kersting 00072 // renamed Time to VRSTime 00073 // 00074 // Revision 1.9 2002/02/19 10:34:20 kosta 00075 // undone all changes since 2002-02-15 00076 // 00077 // Revision 1.6 2002/02/13 16:28:11 kosta 00078 // implementation of the serialize()-method moved outside the class declaration 00079 // 00080 // Revision 1.5 2002/02/05 07:48:26 kosta 00081 // new persistency macros: 00082 // VRS_SERIALIZABLE(CLASS_NAME); 00083 // VRS_SERIALIZABLE_ABSTRACT_CLASS(CLASS_NAME); 00084 // VRS_SERIALIZABLE_NO_SO_CLASS(CLASS_NAME) 00085 // 00086 // Revision 1.4 2002/02/04 11:54:37 kosta 00087 // persistency rewritten (for better namespace support) 00088 // 00089 // Revision 1.3 2002/01/15 16:25:55 kosta 00090 // macros rewritten for a better namespace support 00091 // 00092 // Revision 1.2 2001/11/13 16:36:31 kirsch 00093 // changed line feed to unix style (removed control-M) 00094 // 00095 // Revision 1.1.1.1 2001/06/08 08:09:21 kirsch 00096 // imported alpha-version by olli 00097 // 00098 00099 #ifndef VRS_TIME_H 00100 #define VRS_TIME_H 00101 00102 // for serialiationmanager 00103 #include <vrs/sharedobj.h> 00104 00105 namespace VRS { 00106 00111 class VRS_CORE_API VRSTime { 00112 00113 public: 00115 VRSTime(double seconds = 0.0); 00117 VRSTime(double millisec, double sec, double min, double hours); 00118 00120 operator double() const; 00121 00123 double millisec() const; 00125 double seconds() const; 00127 double minutes() const; 00129 double hours() const; 00130 00132 static const VRSTime& maxTime(); 00134 static const VRSTime& zero(); 00135 00137 static VRSTime now(); 00138 00141 static std::string currentDateTimeString(); 00142 00144 VRSTime& operator+=(double secs); 00146 VRSTime& operator-=(double secs); 00147 00148 // implement persistency 00149 VRS_SERIALIZABLE_NO_SO_CLASS(VRSTime); 00150 00151 private: 00152 double time_; 00153 }; 00154 00155 } // namespace VRS 00156 00157 #endif // VRS_TIME_H