OpenSceneGraph 3.6.5
FrameStamp
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_FRAMESTAMP
15#define OSG_FRAMESTAMP 1
16
17#include <osg/Referenced>
18
19#if defined(__sgi) || (defined(WIN32) && !defined(__MWERKS__))
20#include <time.h>
21#else
22#include <ctime>
23using std::tm;
24#endif
25
26namespace osg
27{
28
35{
36 public:
37
40
41 FrameStamp& operator = (const FrameStamp& fs);
42
43 void setFrameNumber(unsigned int fnum) { _frameNumber = fnum; }
44 unsigned int getFrameNumber() const { return _frameNumber; }
45
46 void setReferenceTime(double refTime) { _referenceTime = refTime; }
47 double getReferenceTime() const { return _referenceTime; }
48
49 void setSimulationTime(double refTime) { _simulationTime = refTime; }
50 double getSimulationTime() const { return _simulationTime; }
51
52 void setCalendarTime(const tm& calendarTime);
53 void getCalendarTime(tm& calendarTime) const;
54
55 // keep public to allow it to be permit allocation which is
56 // not on the heap used osgcluster
57 virtual ~FrameStamp();
58
59 protected:
60
61
62 // note no dynamic memory is used so that data can be passed
63 // via a simple memory copy or within a data packet across
64 // the network.
65
66 unsigned int _frameNumber;
69
70 // member variables of time.h's tm structure, copied here to
71 // ensure that all data is not dynamic. The tm structure itself
72 // is not completely consistent between implementations, which
73 // could be a problem when sending the FrameStamp across a network
74 // with different versions of tm (i.e mixing Unix and Windows.)
75 int tm_sec; /* Seconds. [0-60] (1 leap second) */
76 int tm_min; /* Minutes. [0-59] */
77 int tm_hour; /* Hours. [0-23] */
78 int tm_mday; /* Day. [1-31] */
79 int tm_mon; /* Month. [0-11] */
80 int tm_year; /* Year - 1900. */
81 int tm_wday; /* Day of week. [0-6] */
82 int tm_yday; /* Days in year. [0-365] */
83 int tm_isdst; /* DST. [-1/0/1]*/
84
85
86};
87
88}
89
90
91#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
void setSimulationTime(double refTime)
Definition FrameStamp:49
int tm_mday
Definition FrameStamp:78
FrameStamp(const FrameStamp &fs)
double getSimulationTime() const
Definition FrameStamp:50
unsigned int _frameNumber
Definition FrameStamp:66
int tm_year
Definition FrameStamp:80
void getCalendarTime(tm &calendarTime) const
int tm_min
Definition FrameStamp:76
int tm_isdst
Definition FrameStamp:83
void setReferenceTime(double refTime)
Definition FrameStamp:46
void setCalendarTime(const tm &calendarTime)
int tm_hour
Definition FrameStamp:77
int tm_wday
Definition FrameStamp:81
virtual ~FrameStamp()
unsigned int getFrameNumber() const
Definition FrameStamp:44
double _simulationTime
Definition FrameStamp:68
int tm_yday
Definition FrameStamp:82
double _referenceTime
Definition FrameStamp:67
int tm_sec
Definition FrameStamp:75
int tm_mon
Definition FrameStamp:79
double getReferenceTime() const
Definition FrameStamp:47
void setFrameNumber(unsigned int fnum)
Definition FrameStamp:43
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.