Converted FrameStamp::g/setFrameNumber from int to uint
This commit is contained in:
parent
b5d4d9954a
commit
410b4fd109
@ -31,7 +31,7 @@ PROJECT(OpenSceneGraph)
|
|||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 9)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 9)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 11)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 11)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 69)
|
SET(OPENSCENEGRAPH_SOVERSION 70)
|
||||||
|
|
||||||
# set to 0 when not a release candidate, non zero means that any generated
|
# set to 0 when not a release candidate, non zero means that any generated
|
||||||
# svn tags will be treated as release candidates of given number
|
# svn tags will be treated as release candidates of given number
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
osg::Timer_t _startTime;
|
osg::Timer_t _startTime;
|
||||||
osg::Timer_t _currentTime;
|
osg::Timer_t _currentTime;
|
||||||
bool _playing;
|
bool _playing;
|
||||||
int _lastUpdate;
|
unsigned int _lastUpdate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ public:
|
|||||||
osg::Timer_t _startTime;
|
osg::Timer_t _startTime;
|
||||||
osg::Timer_t _currentTime;
|
osg::Timer_t _currentTime;
|
||||||
bool _playing;
|
bool _playing;
|
||||||
int _lastUpdate;
|
unsigned int _lastUpdate;
|
||||||
};
|
};
|
||||||
|
|
||||||
// This won't really give good results in any situation, but it does demonstrate
|
// This won't really give good results in any situation, but it does demonstrate
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
osg::Timer_t _startTime;
|
osg::Timer_t _startTime;
|
||||||
osg::Timer_t _currentTime;
|
osg::Timer_t _currentTime;
|
||||||
bool _playing;
|
bool _playing;
|
||||||
int _lastUpdate;
|
unsigned int _lastUpdate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
osg::Timer_t _startTime;
|
osg::Timer_t _startTime;
|
||||||
osg::Timer_t _currentTime;
|
osg::Timer_t _currentTime;
|
||||||
bool _playing;
|
bool _playing;
|
||||||
int _lastUpdate;
|
unsigned int _lastUpdate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class ElevationLayerBlendingCallback : public osg::NodeCallback
|
|||||||
typedef std::vector<double> Elevations;
|
typedef std::vector<double> Elevations;
|
||||||
|
|
||||||
ElevationLayerBlendingCallback(osgFX::MultiTextureControl* mtc, const Elevations& elevations, float animationTime=4.0f):
|
ElevationLayerBlendingCallback(osgFX::MultiTextureControl* mtc, const Elevations& elevations, float animationTime=4.0f):
|
||||||
_previousFrame(-1),
|
_previousFrame(0),
|
||||||
_previousTime(0.0),
|
_previousTime(0.0),
|
||||||
_animationTime(animationTime),
|
_animationTime(animationTime),
|
||||||
_currentElevation(0.0),
|
_currentElevation(0.0),
|
||||||
@ -105,7 +105,7 @@ class ElevationLayerBlendingCallback : public osg::NodeCallback
|
|||||||
{
|
{
|
||||||
|
|
||||||
float deltaTime = 0.01f;
|
float deltaTime = 0.01f;
|
||||||
if (_previousFrame!=-1)
|
if (_previousFrame!=0)
|
||||||
{
|
{
|
||||||
deltaTime = float(nv->getFrameStamp()->getReferenceTime() - _previousTime);
|
deltaTime = float(nv->getFrameStamp()->getReferenceTime() - _previousTime);
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ class ElevationLayerBlendingCallback : public osg::NodeCallback
|
|||||||
traverse(node,nv);
|
traverse(node,nv);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _previousFrame;
|
unsigned int _previousFrame;
|
||||||
double _previousTime;
|
double _previousTime;
|
||||||
float _animationTime;
|
float _animationTime;
|
||||||
double _currentElevation;
|
double _currentElevation;
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
if ( nv->getFrameStamp() && updateTimeStamp )
|
if ( nv->getFrameStamp() && updateTimeStamp )
|
||||||
{
|
{
|
||||||
double timeStamp = nv->getFrameStamp()?nv->getFrameStamp()->getReferenceTime():0.0;
|
double timeStamp = nv->getFrameStamp()?nv->getFrameStamp()->getReferenceTime():0.0;
|
||||||
int frameNumber = nv->getFrameStamp()?nv->getFrameStamp()->getFrameNumber():0;
|
unsigned int frameNumber = nv->getFrameStamp()?nv->getFrameStamp()->getFrameNumber():0;
|
||||||
|
|
||||||
pagedLOD->setFrameNumberOfLastTraversal( frameNumber );
|
pagedLOD->setFrameNumberOfLastTraversal( frameNumber );
|
||||||
pagedLOD->setTimeStamp( numChildren-1, timeStamp );
|
pagedLOD->setTimeStamp( numChildren-1, timeStamp );
|
||||||
|
@ -142,7 +142,7 @@ protected:
|
|||||||
|
|
||||||
bool _isRunning;
|
bool _isRunning;
|
||||||
bool _isFinishing;
|
bool _isFinishing;
|
||||||
int _lastBindingFrame;
|
unsigned int _lastBindingFrame;
|
||||||
int _tileRows;
|
int _tileRows;
|
||||||
int _tileColumns;
|
int _tileColumns;
|
||||||
int _currentRow;
|
int _currentRow;
|
||||||
|
@ -87,7 +87,7 @@ void updateUserStats(osgViewer::Viewer& viewer)
|
|||||||
// use that frame's timings because it's probably not finished
|
// use that frame's timings because it's probably not finished
|
||||||
// rendering yet (in multithreaded viewer modes). So we'll use the
|
// rendering yet (in multithreaded viewer modes). So we'll use the
|
||||||
// timings for framenumber-2 for this demo.
|
// timings for framenumber-2 for this demo.
|
||||||
int framenumber = viewer.getFrameStamp()->getFrameNumber();
|
unsigned int framenumber = viewer.getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
// Get the update time and the viewer main camera's cull time. We use
|
// Get the update time and the viewer main camera's cull time. We use
|
||||||
// getAveragedAttribute() in order to get the actual time elapsed as
|
// getAveragedAttribute() in order to get the actual time elapsed as
|
||||||
@ -131,7 +131,7 @@ void startTiming(osgViewer::Viewer& viewer, const std::string& name)
|
|||||||
{
|
{
|
||||||
osg::Timer_t tick = osg::Timer::instance()->tick();
|
osg::Timer_t tick = osg::Timer::instance()->tick();
|
||||||
double currentTime = osg::Timer::instance()->delta_s(viewer.getStartTick(), tick);
|
double currentTime = osg::Timer::instance()->delta_s(viewer.getStartTick(), tick);
|
||||||
int framenumber = viewer.getFrameStamp()->getFrameNumber();
|
unsigned int framenumber = viewer.getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
viewer.getViewerStats()->setAttribute(framenumber, name + " begin", currentTime);
|
viewer.getViewerStats()->setAttribute(framenumber, name + " begin", currentTime);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ void endTiming(osgViewer::Viewer& viewer, const std::string& name)
|
|||||||
{
|
{
|
||||||
osg::Timer_t tick = osg::Timer::instance()->tick();
|
osg::Timer_t tick = osg::Timer::instance()->tick();
|
||||||
double currentTime = osg::Timer::instance()->delta_s(viewer.getStartTick(), tick);
|
double currentTime = osg::Timer::instance()->delta_s(viewer.getStartTick(), tick);
|
||||||
int framenumber = viewer.getFrameStamp()->getFrameNumber();
|
unsigned int framenumber = viewer.getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
viewer.getViewerStats()->setAttribute(framenumber, name + " end", currentTime);
|
viewer.getViewerStats()->setAttribute(framenumber, name + " end", currentTime);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class OSG_EXPORT DeleteHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef std::pair<int, const osg::Referenced*> FrameNumberObjectPair;
|
typedef std::pair<unsigned int, const osg::Referenced*> FrameNumberObjectPair;
|
||||||
typedef std::list<FrameNumberObjectPair> ObjectsToDeleteList;
|
typedef std::list<FrameNumberObjectPair> ObjectsToDeleteList;
|
||||||
|
|
||||||
DeleteHandler(int numberOfFramesToRetainObjects=0);
|
DeleteHandler(int numberOfFramesToRetainObjects=0);
|
||||||
@ -44,15 +44,15 @@ class OSG_EXPORT DeleteHandler
|
|||||||
* The ability to retain objects for several frames is useful to prevent premature deletion when objects
|
* The ability to retain objects for several frames is useful to prevent premature deletion when objects
|
||||||
* are still be used the graphics threads that are using double buffering of rendering data structures with
|
* are still be used the graphics threads that are using double buffering of rendering data structures with
|
||||||
* non ref_ptr<> pointers to scene graph elements.*/
|
* non ref_ptr<> pointers to scene graph elements.*/
|
||||||
void setNumFramesToRetainObjects(int numberOfFramesToRetainObjects) { _numFramesToRetainObjects = numberOfFramesToRetainObjects; }
|
void setNumFramesToRetainObjects(unsigned int numberOfFramesToRetainObjects) { _numFramesToRetainObjects = numberOfFramesToRetainObjects; }
|
||||||
|
|
||||||
int getNumFramesToRetainObjects() const { return _numFramesToRetainObjects; }
|
unsigned int getNumFramesToRetainObjects() const { return _numFramesToRetainObjects; }
|
||||||
|
|
||||||
/** Set the current frame number so that subsequent deletes get tagged as associated with this frame.*/
|
/** Set the current frame number so that subsequent deletes get tagged as associated with this frame.*/
|
||||||
void setFrameNumber(int frameNumber) { _currentFrameNumber = frameNumber; }
|
void setFrameNumber(unsigned int frameNumber) { _currentFrameNumber = frameNumber; }
|
||||||
|
|
||||||
/** Get the current frame number.*/
|
/** Get the current frame number.*/
|
||||||
int getFrameNumber() const { return _currentFrameNumber; }
|
unsigned int getFrameNumber() const { return _currentFrameNumber; }
|
||||||
|
|
||||||
inline void doDelete(const Referenced* object) { delete object; }
|
inline void doDelete(const Referenced* object) { delete object; }
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ class OSG_EXPORT DeleteHandler
|
|||||||
_currentFrameNumber(0) {}
|
_currentFrameNumber(0) {}
|
||||||
DeleteHandler operator = (const DeleteHandler&) { return *this; }
|
DeleteHandler operator = (const DeleteHandler&) { return *this; }
|
||||||
|
|
||||||
int _numFramesToRetainObjects;
|
unsigned int _numFramesToRetainObjects;
|
||||||
int _currentFrameNumber;
|
unsigned int _currentFrameNumber;
|
||||||
OpenThreads::Mutex _mutex;
|
OpenThreads::Mutex _mutex;
|
||||||
ObjectsToDeleteList _objectsToDelete;
|
ObjectsToDeleteList _objectsToDelete;
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ class OSG_EXPORT FrameStamp : public Referenced
|
|||||||
|
|
||||||
FrameStamp& operator = (const FrameStamp& fs);
|
FrameStamp& operator = (const FrameStamp& fs);
|
||||||
|
|
||||||
void setFrameNumber(int fnum) { _frameNumber = fnum; }
|
void setFrameNumber(unsigned int fnum) { _frameNumber = fnum; }
|
||||||
int getFrameNumber() const { return _frameNumber; }
|
unsigned int getFrameNumber() const { return _frameNumber; }
|
||||||
|
|
||||||
void setReferenceTime(double refTime) { _referenceTime = refTime; }
|
void setReferenceTime(double refTime) { _referenceTime = refTime; }
|
||||||
double getReferenceTime() const { return _referenceTime; }
|
double getReferenceTime() const { return _referenceTime; }
|
||||||
@ -63,7 +63,7 @@ class OSG_EXPORT FrameStamp : public Referenced
|
|||||||
// via a simple memory copy or within a data packet across
|
// via a simple memory copy or within a data packet across
|
||||||
// the network.
|
// the network.
|
||||||
|
|
||||||
int _frameNumber;
|
unsigned int _frameNumber;
|
||||||
double _referenceTime;
|
double _referenceTime;
|
||||||
double _simulationTime;
|
double _simulationTime;
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ class Transform;
|
|||||||
class Camera;
|
class Camera;
|
||||||
class CameraView;
|
class CameraView;
|
||||||
|
|
||||||
|
const unsigned int UNINITIALIZED_FRAME_NUMBER=0xffffffff;
|
||||||
|
|
||||||
#define META_NodeVisitor(library,name) \
|
#define META_NodeVisitor(library,name) \
|
||||||
virtual const char* libraryName() const { return #library; }\
|
virtual const char* libraryName() const { return #library; }\
|
||||||
virtual const char* className() const { return #name; }
|
virtual const char* className() const { return #name; }
|
||||||
@ -109,10 +111,10 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
|
|||||||
inline VisitorType getVisitorType() const { return _visitorType; }
|
inline VisitorType getVisitorType() const { return _visitorType; }
|
||||||
|
|
||||||
/** Set the traversal number. Typically used to denote the frame count.*/
|
/** Set the traversal number. Typically used to denote the frame count.*/
|
||||||
inline void setTraversalNumber(int fn) { _traversalNumber = fn; }
|
inline void setTraversalNumber(unsigned int fn) { _traversalNumber = fn; }
|
||||||
|
|
||||||
/** Get the traversal number. Typically used to denote the frame count.*/
|
/** Get the traversal number. Typically used to denote the frame count.*/
|
||||||
inline int getTraversalNumber() const { return _traversalNumber; }
|
inline unsigned int getTraversalNumber() const { return _traversalNumber; }
|
||||||
|
|
||||||
/** Set the FrameStamp that this traversal is associated with.*/
|
/** Set the FrameStamp that this traversal is associated with.*/
|
||||||
inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; }
|
inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; }
|
||||||
@ -326,7 +328,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
VisitorType _visitorType;
|
VisitorType _visitorType;
|
||||||
int _traversalNumber;
|
unsigned int _traversalNumber;
|
||||||
|
|
||||||
ref_ptr<FrameStamp> _frameStamp;
|
ref_ptr<FrameStamp> _frameStamp;
|
||||||
|
|
||||||
|
@ -122,8 +122,8 @@ public:
|
|||||||
unsigned int getVisibilityThreshold() const { return _visThreshold; }
|
unsigned int getVisibilityThreshold() const { return _visThreshold; }
|
||||||
|
|
||||||
// Specifies how many frames to wait before issuing another query.
|
// Specifies how many frames to wait before issuing another query.
|
||||||
void setQueryFrameCount( int frames ) { _queryFrameCount = frames; }
|
void setQueryFrameCount( unsigned int frames ) { _queryFrameCount = frames; }
|
||||||
int getQueryFrameCount() const { return _queryFrameCount; }
|
unsigned int getQueryFrameCount() const { return _queryFrameCount; }
|
||||||
|
|
||||||
// Indicate whether or not the bounding box used in the occlusion query test
|
// Indicate whether or not the bounding box used in the occlusion query test
|
||||||
// should be rendered. Handy for debugging and development.
|
// should be rendered. Handy for debugging and development.
|
||||||
@ -179,7 +179,7 @@ protected:
|
|||||||
|
|
||||||
// Tracks the last frame number that we performed a query.
|
// Tracks the last frame number that we performed a query.
|
||||||
// User can set how many times (See setQueryFrameCount).
|
// User can set how many times (See setQueryFrameCount).
|
||||||
typedef std::map< const osg::Camera*, int > FrameCountMap;
|
typedef std::map< const osg::Camera*, unsigned int > FrameCountMap;
|
||||||
FrameCountMap _frameCountMap;
|
FrameCountMap _frameCountMap;
|
||||||
mutable OpenThreads::Mutex _frameCountMutex;
|
mutable OpenThreads::Mutex _frameCountMutex;
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ protected:
|
|||||||
|
|
||||||
// User-settable variables
|
// User-settable variables
|
||||||
unsigned int _visThreshold;
|
unsigned int _visThreshold;
|
||||||
int _queryFrameCount;
|
unsigned int _queryFrameCount;
|
||||||
bool _debugBB;
|
bool _debugBB;
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ class OSG_EXPORT PagedLOD : public LOD
|
|||||||
float _priorityOffset;
|
float _priorityOffset;
|
||||||
float _priorityScale;
|
float _priorityScale;
|
||||||
double _timeStamp;
|
double _timeStamp;
|
||||||
int _frameNumber;
|
unsigned int _frameNumber;
|
||||||
int _frameNumberOfLastReleaseGLObjects;
|
unsigned int _frameNumberOfLastReleaseGLObjects;
|
||||||
osg::ref_ptr<osg::Referenced> _databaseRequest;
|
osg::ref_ptr<osg::Referenced> _databaseRequest;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ class OSG_EXPORT PagedLOD : public LOD
|
|||||||
double getTimeStamp(unsigned int childNo) const { return _perRangeDataList[childNo]._timeStamp; }
|
double getTimeStamp(unsigned int childNo) const { return _perRangeDataList[childNo]._timeStamp; }
|
||||||
unsigned int getNumTimeStamps() const { return _perRangeDataList.size(); }
|
unsigned int getNumTimeStamps() const { return _perRangeDataList.size(); }
|
||||||
|
|
||||||
void setFrameNumber(unsigned int childNo, int frameNumber) { expandPerRangeDataTo(childNo); _perRangeDataList[childNo]._frameNumber=frameNumber; }
|
void setFrameNumber(unsigned int childNo, unsigned int frameNumber) { expandPerRangeDataTo(childNo); _perRangeDataList[childNo]._frameNumber=frameNumber; }
|
||||||
double getFrameNumber(unsigned int childNo) const { return _perRangeDataList[childNo]._frameNumber; }
|
unsigned getFrameNumber(unsigned int childNo) const { return _perRangeDataList[childNo]._frameNumber; }
|
||||||
unsigned int getNumFrameNumbers() const { return _perRangeDataList.size(); }
|
unsigned int getNumFrameNumbers() const { return _perRangeDataList.size(); }
|
||||||
|
|
||||||
|
|
||||||
@ -114,10 +114,10 @@ class OSG_EXPORT PagedLOD : public LOD
|
|||||||
/** Set the frame number of the last time that this PageLOD node was traversed.
|
/** Set the frame number of the last time that this PageLOD node was traversed.
|
||||||
* Note, this frame number is automatically set by the traverse() method for all traversals (update, cull etc.).
|
* Note, this frame number is automatically set by the traverse() method for all traversals (update, cull etc.).
|
||||||
*/
|
*/
|
||||||
inline void setFrameNumberOfLastTraversal(int frameNumber) { _frameNumberOfLastTraversal=frameNumber; }
|
inline void setFrameNumberOfLastTraversal(unsigned int frameNumber) { _frameNumberOfLastTraversal=frameNumber; }
|
||||||
|
|
||||||
/** Get the frame number of the last time that this PageLOD node was traversed.*/
|
/** Get the frame number of the last time that this PageLOD node was traversed.*/
|
||||||
inline int getFrameNumberOfLastTraversal() const { return _frameNumberOfLastTraversal; }
|
inline unsigned int getFrameNumberOfLastTraversal() const { return _frameNumberOfLastTraversal; }
|
||||||
|
|
||||||
|
|
||||||
/** Set the number of children that the PagedLOD must keep around, even if they are older than their expiry time.*/
|
/** Set the number of children that the PagedLOD must keep around, even if they are older than their expiry time.*/
|
||||||
@ -137,11 +137,7 @@ class OSG_EXPORT PagedLOD : public LOD
|
|||||||
* The removed children are added to the removeChildren list passed into the method,
|
* The removed children are added to the removeChildren list passed into the method,
|
||||||
* this allows the children to be deleted later at the caller's discretion.
|
* this allows the children to be deleted later at the caller's discretion.
|
||||||
* Return true if children are removed, false otherwise. */
|
* Return true if children are removed, false otherwise. */
|
||||||
virtual bool removeExpiredChildren(double expiryTime, int expiryFrame, NodeList& removedChildren);
|
virtual bool removeExpiredChildren(double expiryTime, unsigned int expiryFrame, NodeList& removedChildren);
|
||||||
|
|
||||||
/** Release the GL Objects of the children from the PagedLOD which haven't been visited since specified expiry time and expiry frame number.
|
|
||||||
* Return true if any children have release called upon them, false otherwise. */
|
|
||||||
virtual bool releaseGLObjectsOnExpiredChildren(double releaseTime, int releaseFrame);
|
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
|
||||||
@ -152,7 +148,7 @@ class OSG_EXPORT PagedLOD : public LOD
|
|||||||
ref_ptr<Referenced> _databaseOptions;
|
ref_ptr<Referenced> _databaseOptions;
|
||||||
std::string _databasePath;
|
std::string _databasePath;
|
||||||
|
|
||||||
int _frameNumberOfLastTraversal;
|
unsigned int _frameNumberOfLastTraversal;
|
||||||
unsigned int _numChildrenThatCannotBeExpired;
|
unsigned int _numChildrenThatCannotBeExpired;
|
||||||
bool _disableExternalChildrenPaging;
|
bool _disableExternalChildrenPaging;
|
||||||
|
|
||||||
|
@ -38,15 +38,15 @@ class OSG_EXPORT Stats : public osg::Referenced
|
|||||||
|
|
||||||
void allocate(unsigned int numberOfFrames);
|
void allocate(unsigned int numberOfFrames);
|
||||||
|
|
||||||
int getEarliestFrameNumber() const { return _latestFrameNumber < static_cast<int>(_attributeMapList.size()) ? 0 : _latestFrameNumber - static_cast<int>(_attributeMapList.size()) + 1; }
|
unsigned int getEarliestFrameNumber() const { return _latestFrameNumber < static_cast<unsigned int>(_attributeMapList.size()) ? 0 : _latestFrameNumber - static_cast<unsigned int>(_attributeMapList.size()) + 1; }
|
||||||
int getLatestFrameNumber() const { return _latestFrameNumber; }
|
unsigned int getLatestFrameNumber() const { return _latestFrameNumber; }
|
||||||
|
|
||||||
typedef std::map<std::string, double> AttributeMap;
|
typedef std::map<std::string, double> AttributeMap;
|
||||||
typedef std::vector<AttributeMap> AttributeMapList;
|
typedef std::vector<AttributeMap> AttributeMapList;
|
||||||
|
|
||||||
bool setAttribute(int frameNumber, const std::string& attributeName, double value);
|
bool setAttribute(unsigned int frameNumber, const std::string& attributeName, double value);
|
||||||
|
|
||||||
inline bool getAttribute(int frameNumber, const std::string& attributeName, double& value) const
|
inline bool getAttribute(unsigned int frameNumber, const std::string& attributeName, double& value) const
|
||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||||
return getAttributeNoMutex(frameNumber, attributeName, value);
|
return getAttributeNoMutex(frameNumber, attributeName, value);
|
||||||
@ -54,15 +54,15 @@ class OSG_EXPORT Stats : public osg::Referenced
|
|||||||
|
|
||||||
bool getAveragedAttribute(const std::string& attributeName, double& value, bool averageInInverseSpace=false) const;
|
bool getAveragedAttribute(const std::string& attributeName, double& value, bool averageInInverseSpace=false) const;
|
||||||
|
|
||||||
bool getAveragedAttribute(int startFrameNumber, int endFrameNumber, const std::string& attributeName, double& value, bool averageInInverseSpace=false) const;
|
bool getAveragedAttribute(unsigned int startFrameNumber, unsigned int endFrameNumber, const std::string& attributeName, double& value, bool averageInInverseSpace=false) const;
|
||||||
|
|
||||||
inline AttributeMap& getAttributeMap(int frameNumber)
|
inline AttributeMap& getAttributeMap(unsigned int frameNumber)
|
||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||||
return getAttributeMapNoMutex(frameNumber);
|
return getAttributeMapNoMutex(frameNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const AttributeMap& getAttributeMap(int frameNumber) const
|
inline const AttributeMap& getAttributeMap(unsigned int frameNumber) const
|
||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||||
return getAttributeMapNoMutex(frameNumber);
|
return getAttributeMapNoMutex(frameNumber);
|
||||||
@ -87,13 +87,13 @@ class OSG_EXPORT Stats : public osg::Referenced
|
|||||||
|
|
||||||
virtual ~Stats() {}
|
virtual ~Stats() {}
|
||||||
|
|
||||||
bool getAttributeNoMutex(int frameNumber, const std::string& attributeName, double& value) const;
|
bool getAttributeNoMutex(unsigned int frameNumber, const std::string& attributeName, double& value) const;
|
||||||
|
|
||||||
AttributeMap& getAttributeMapNoMutex(int frameNumber);
|
AttributeMap& getAttributeMapNoMutex(unsigned int frameNumber);
|
||||||
const AttributeMap& getAttributeMapNoMutex(int frameNumber) const;
|
const AttributeMap& getAttributeMapNoMutex(unsigned int frameNumber) const;
|
||||||
|
|
||||||
|
|
||||||
int getIndex(int frameNumber) const
|
int getIndex(unsigned int frameNumber) const
|
||||||
{
|
{
|
||||||
// reject frame that are in the future
|
// reject frame that are in the future
|
||||||
if (frameNumber > _latestFrameNumber) return -1;
|
if (frameNumber > _latestFrameNumber) return -1;
|
||||||
@ -109,8 +109,8 @@ class OSG_EXPORT Stats : public osg::Referenced
|
|||||||
|
|
||||||
mutable OpenThreads::Mutex _mutex;
|
mutable OpenThreads::Mutex _mutex;
|
||||||
|
|
||||||
int _baseFrameNumber;
|
unsigned int _baseFrameNumber;
|
||||||
int _latestFrameNumber;
|
unsigned int _latestFrameNumber;
|
||||||
|
|
||||||
AttributeMapList _attributeMapList;
|
AttributeMapList _attributeMapList;
|
||||||
AttributeMap _invalidAttributeMap;
|
AttributeMap _invalidAttributeMap;
|
||||||
|
@ -21,7 +21,7 @@ extern "C" {
|
|||||||
#define OPENSCENEGRAPH_MAJOR_VERSION 2
|
#define OPENSCENEGRAPH_MAJOR_VERSION 2
|
||||||
#define OPENSCENEGRAPH_MINOR_VERSION 9
|
#define OPENSCENEGRAPH_MINOR_VERSION 9
|
||||||
#define OPENSCENEGRAPH_PATCH_VERSION 11
|
#define OPENSCENEGRAPH_PATCH_VERSION 11
|
||||||
#define OPENSCENEGRAPH_SOVERSION 69
|
#define OPENSCENEGRAPH_SOVERSION 70
|
||||||
|
|
||||||
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
|
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
|
||||||
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)
|
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)
|
||||||
|
@ -104,8 +104,8 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
void setName(const std::string& name) { _name = name; }
|
void setName(const std::string& name) { _name = name; }
|
||||||
const std::string& getName() const { return _name; }
|
const std::string& getName() const { return _name; }
|
||||||
|
|
||||||
void setDone(bool done) { _done = done; }
|
void setDone(bool done) { _done.exchange(done?1:0); }
|
||||||
bool getDone() const { return _done; }
|
bool getDone() const { return _done!=0; }
|
||||||
|
|
||||||
void setActive(bool active) { _active = active; }
|
void setActive(bool active) { _active = active; }
|
||||||
bool getActive() const { return _active; }
|
bool getActive() const { return _active; }
|
||||||
@ -118,7 +118,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
|
|
||||||
virtual ~DatabaseThread();
|
virtual ~DatabaseThread();
|
||||||
|
|
||||||
volatile bool _done;
|
OpenThreads::Atomic _done;
|
||||||
volatile bool _active;
|
volatile bool _active;
|
||||||
DatabasePager* _pager;
|
DatabasePager* _pager;
|
||||||
Mode _mode;
|
Mode _mode;
|
||||||
@ -163,7 +163,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
/** Find all PagedLOD nodes in a subgraph and register them with
|
/** Find all PagedLOD nodes in a subgraph and register them with
|
||||||
* the DatabasePager so it can keep track of expired nodes.
|
* the DatabasePager so it can keep track of expired nodes.
|
||||||
* note, should be only be called from the update thread. */
|
* note, should be only be called from the update thread. */
|
||||||
virtual void registerPagedLODs(osg::Node* subgraph, int frameNumber = 0);
|
virtual void registerPagedLODs(osg::Node* subgraph, unsigned int frameNumber = 0);
|
||||||
|
|
||||||
/** Set the incremental compile operation.
|
/** Set the incremental compile operation.
|
||||||
* Used to manage the OpenGL object compilation and merging of subgraphs in a way that avoids overloading
|
* Used to manage the OpenGL object compilation and merging of subgraphs in a way that avoids overloading
|
||||||
@ -273,7 +273,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
virtual PagedLODList* clone() = 0;
|
virtual PagedLODList* clone() = 0;
|
||||||
virtual void clear() = 0;
|
virtual void clear() = 0;
|
||||||
virtual unsigned int size() = 0;
|
virtual unsigned int size() = 0;
|
||||||
virtual void removeExpiredChildren(int numberChildrenToRemove, double expiryTime, int expiryFrame, ObjectList& childrenRemoved, bool visitActive) = 0;
|
virtual void removeExpiredChildren(int numberChildrenToRemove, double expiryTime, unsigned int expiryFrame, ObjectList& childrenRemoved, bool visitActive) = 0;
|
||||||
virtual void removeNodes(osg::NodeList& nodesToRemove) = 0;
|
virtual void removeNodes(osg::NodeList& nodesToRemove) = 0;
|
||||||
virtual void insertPagedLOD(const osg::observer_ptr<osg::PagedLOD>& plod) = 0;
|
virtual void insertPagedLOD(const osg::observer_ptr<osg::PagedLOD>& plod) = 0;
|
||||||
virtual bool containsPagedLOD(const osg::observer_ptr<osg::PagedLOD>& plod) const = 0;
|
virtual bool containsPagedLOD(const osg::observer_ptr<osg::PagedLOD>& plod) const = 0;
|
||||||
@ -309,10 +309,10 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
|
|
||||||
bool _valid;
|
bool _valid;
|
||||||
std::string _fileName;
|
std::string _fileName;
|
||||||
int _frameNumberFirstRequest;
|
unsigned int _frameNumberFirstRequest;
|
||||||
double _timestampFirstRequest;
|
double _timestampFirstRequest;
|
||||||
float _priorityFirstRequest;
|
float _priorityFirstRequest;
|
||||||
int _frameNumberLastRequest;
|
unsigned int _frameNumberLastRequest;
|
||||||
double _timestampLastRequest;
|
double _timestampLastRequest;
|
||||||
float _priorityLastRequest;
|
float _priorityLastRequest;
|
||||||
unsigned int _numOfRequests;
|
unsigned int _numOfRequests;
|
||||||
@ -362,7 +362,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
DatabasePager* _pager;
|
DatabasePager* _pager;
|
||||||
RequestList _requestList;
|
RequestList _requestList;
|
||||||
OpenThreads::Mutex _requestMutex;
|
OpenThreads::Mutex _requestMutex;
|
||||||
int _frameNumberLastPruned;
|
unsigned int _frameNumberLastPruned;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~RequestQueue();
|
virtual ~RequestQueue();
|
||||||
@ -427,7 +427,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
|
|||||||
|
|
||||||
int _numFramesActive;
|
int _numFramesActive;
|
||||||
mutable OpenThreads::Mutex _numFramesActiveMutex;
|
mutable OpenThreads::Mutex _numFramesActiveMutex;
|
||||||
volatile int _frameNumber;
|
OpenThreads::Atomic _frameNumber;
|
||||||
|
|
||||||
osg::ref_ptr<ReadQueue> _fileRequestQueue;
|
osg::ref_ptr<ReadQueue> _fileRequestQueue;
|
||||||
osg::ref_ptr<ReadQueue> _httpRequestQueue;
|
osg::ref_ptr<ReadQueue> _httpRequestQueue;
|
||||||
|
@ -172,7 +172,7 @@ namespace osgParticle
|
|||||||
|
|
||||||
//added- 1/17/06- bgandere@nps.edu
|
//added- 1/17/06- bgandere@nps.edu
|
||||||
//a var to keep from doing multiple updates
|
//a var to keep from doing multiple updates
|
||||||
int _frameNumber;
|
unsigned int _frameNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
// INLINE FUNCTIONS
|
// INLINE FUNCTIONS
|
||||||
|
@ -176,7 +176,7 @@ namespace osgParticle
|
|||||||
inline virtual void reuseParticle(int i) { _deadparts.push(&(_particles[i])); }
|
inline virtual void reuseParticle(int i) { _deadparts.push(&(_particles[i])); }
|
||||||
|
|
||||||
/// Get the last frame number.
|
/// Get the last frame number.
|
||||||
inline int getLastFrameNumber() const;
|
inline unsigned int getLastFrameNumber() const;
|
||||||
|
|
||||||
/// Get the unique delta time for emitters and updaters to use
|
/// Get the unique delta time for emitters and updaters to use
|
||||||
inline double& getDeltaTime( double currentTime );
|
inline double& getDeltaTime( double currentTime );
|
||||||
@ -294,7 +294,7 @@ namespace osgParticle
|
|||||||
bool _bounds_computed;
|
bool _bounds_computed;
|
||||||
|
|
||||||
Particle _def_ptemp;
|
Particle _def_ptemp;
|
||||||
mutable int _last_frame;
|
mutable unsigned int _last_frame;
|
||||||
mutable bool _dirty_dt;
|
mutable bool _dirty_dt;
|
||||||
bool _freeze_on_cull;
|
bool _freeze_on_cull;
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ namespace osgParticle
|
|||||||
_particles[i].kill();
|
_particles[i].kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int ParticleSystem::getLastFrameNumber() const
|
inline unsigned int ParticleSystem::getLastFrameNumber() const
|
||||||
{
|
{
|
||||||
return _last_frame;
|
return _last_frame;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ namespace osgParticle
|
|||||||
|
|
||||||
//added 1/17/06- bgandere@nps.edu
|
//added 1/17/06- bgandere@nps.edu
|
||||||
//a var to keep from doing multiple updates per frame
|
//a var to keep from doing multiple updates per frame
|
||||||
int _frameNumber;
|
unsigned int _frameNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
// INLINE FUNCTIONS
|
// INLINE FUNCTIONS
|
||||||
|
@ -35,7 +35,7 @@ class OSGPRESENTATION_EXPORT CompileSlideCallback : public osg::Camera::DrawCall
|
|||||||
virtual ~CompileSlideCallback() {}
|
virtual ~CompileSlideCallback() {}
|
||||||
|
|
||||||
mutable bool _needCompile;
|
mutable bool _needCompile;
|
||||||
mutable int _frameNumber;
|
mutable unsigned int _frameNumber;
|
||||||
osg::ref_ptr<osg::Node> _sceneToCompile;
|
osg::ref_ptr<osg::Node> _sceneToCompile;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -91,7 +91,7 @@ class OSGQT_EXPORT QGraphicsViewAdapter : public QObject
|
|||||||
|
|
||||||
OpenThreads::Mutex _qimagesMutex;
|
OpenThreads::Mutex _qimagesMutex;
|
||||||
OpenThreads::Mutex _qresizeMutex;
|
OpenThreads::Mutex _qresizeMutex;
|
||||||
int _previousFrameNumber;
|
unsigned int _previousFrameNumber;
|
||||||
bool _newImageAvailable;
|
bool _newImageAvailable;
|
||||||
unsigned int _currentRead;
|
unsigned int _currentRead;
|
||||||
unsigned int _currentWrite;
|
unsigned int _currentWrite;
|
||||||
|
@ -116,7 +116,7 @@ class OSGSIM_EXPORT DOFTransform : public osg::Transform
|
|||||||
|
|
||||||
virtual ~DOFTransform() {}
|
virtual ~DOFTransform() {}
|
||||||
|
|
||||||
int _previousTraversalNumber;
|
unsigned int _previousTraversalNumber;
|
||||||
double _previousTime;
|
double _previousTime;
|
||||||
|
|
||||||
osg::Vec3 _minHPR;
|
osg::Vec3 _minHPR;
|
||||||
|
@ -71,10 +71,10 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
|
|||||||
inline const osg::Vec3& getStoredLocalEyePoint() const { return _storedLocalEyePoint; }
|
inline const osg::Vec3& getStoredLocalEyePoint() const { return _storedLocalEyePoint; }
|
||||||
|
|
||||||
/** Set the frame number for when the ImpostorSprite was last used in rendering. */
|
/** Set the frame number for when the ImpostorSprite was last used in rendering. */
|
||||||
inline void setLastFrameUsed(int frameNumber) { _lastFrameUsed = frameNumber; }
|
inline void setLastFrameUsed(unsigned int frameNumber) { _lastFrameUsed = frameNumber; }
|
||||||
|
|
||||||
/** Get the frame number for when the ImpostorSprite was last used in rendering. */
|
/** Get the frame number for when the ImpostorSprite was last used in rendering. */
|
||||||
inline int getLastFrameUsed() const { return _lastFrameUsed; }
|
inline unsigned int getLastFrameUsed() const { return _lastFrameUsed; }
|
||||||
|
|
||||||
|
|
||||||
/** Get the coordinates of the corners of the quad.
|
/** Get the coordinates of the corners of the quad.
|
||||||
@ -180,7 +180,7 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
|
|||||||
ImpostorSprite* _previous;
|
ImpostorSprite* _previous;
|
||||||
ImpostorSprite* _next;
|
ImpostorSprite* _next;
|
||||||
|
|
||||||
int _lastFrameUsed;
|
unsigned int _lastFrameUsed;
|
||||||
|
|
||||||
osg::Vec3 _storedLocalEyePoint;
|
osg::Vec3 _storedLocalEyePoint;
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ class OSGSIM_EXPORT ImpostorSpriteManager : public osg::Referenced
|
|||||||
|
|
||||||
void remove(ImpostorSprite* is);
|
void remove(ImpostorSprite* is);
|
||||||
|
|
||||||
ImpostorSprite* createOrReuseImpostorSprite(int s,int t,int frameNumber);
|
ImpostorSprite* createOrReuseImpostorSprite(int s,int t,unsigned int frameNumber);
|
||||||
|
|
||||||
osg::StateSet* createOrReuseStateSet();
|
osg::StateSet* createOrReuseStateSet();
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class OSGUTIL_EXPORT TransformCallback : public osg::NodeCallback
|
|||||||
osg::Vec3 _pivot;
|
osg::Vec3 _pivot;
|
||||||
osg::Vec3 _axis;
|
osg::Vec3 _axis;
|
||||||
|
|
||||||
int _previousTraversalNumber;
|
unsigned int _previousTraversalNumber;
|
||||||
double _previousTime;
|
double _previousTime;
|
||||||
bool _pause;
|
bool _pause;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class OSGVIEWER_EXPORT OpenGLQuerySupport : public osg::Referenced
|
|||||||
virtual void checkQuery(osg::Stats* stats, osg::State* state,
|
virtual void checkQuery(osg::Stats* stats, osg::State* state,
|
||||||
osg::Timer_t startTick) = 0;
|
osg::Timer_t startTick) = 0;
|
||||||
|
|
||||||
virtual void beginQuery(int frameNumber, osg::State* state) = 0;
|
virtual void beginQuery(unsigned int frameNumber, osg::State* state) = 0;
|
||||||
virtual void endQuery(osg::State* state) = 0;
|
virtual void endQuery(osg::State* state) = 0;
|
||||||
virtual void initialize(osg::State* state, osg::Timer_t startTick);
|
virtual void initialize(osg::State* state, osg::Timer_t startTick);
|
||||||
protected:
|
protected:
|
||||||
|
@ -37,7 +37,7 @@ void DeleteHandler::flush()
|
|||||||
// list, but delete the objects outside this scoped lock so that if any objects deleted
|
// list, but delete the objects outside this scoped lock so that if any objects deleted
|
||||||
// unref their children then no deadlock happens.
|
// unref their children then no deadlock happens.
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||||
int frameNumberToClearTo = _currentFrameNumber - _numFramesToRetainObjects;
|
unsigned int frameNumberToClearTo = _currentFrameNumber - _numFramesToRetainObjects;
|
||||||
|
|
||||||
ObjectsToDeleteList::iterator itr;
|
ObjectsToDeleteList::iterator itr;
|
||||||
for(itr = _objectsToDelete.begin();
|
for(itr = _objectsToDelete.begin();
|
||||||
@ -65,7 +65,7 @@ void DeleteHandler::flush()
|
|||||||
|
|
||||||
void DeleteHandler::flushAll()
|
void DeleteHandler::flushAll()
|
||||||
{
|
{
|
||||||
int temp_numFramesToRetainObjects = _numFramesToRetainObjects;
|
unsigned int temp_numFramesToRetainObjects = _numFramesToRetainObjects;
|
||||||
_numFramesToRetainObjects = 0;
|
_numFramesToRetainObjects = 0;
|
||||||
|
|
||||||
typedef std::list<const osg::Referenced*> DeletionList;
|
typedef std::list<const osg::Referenced*> DeletionList;
|
||||||
|
@ -512,7 +512,7 @@ OcclusionQueryNode::getPassed( const osg::Camera* camera, osg::NodeVisitor& nv )
|
|||||||
// 2) we haven't rendered for an abnormally long time (probably because we're an out-of-range LOD child)
|
// 2) we haven't rendered for an abnormally long time (probably because we're an out-of-range LOD child)
|
||||||
// In these cases, assume we're visible to avoid blinking.
|
// In these cases, assume we're visible to avoid blinking.
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _frameCountMutex );
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _frameCountMutex );
|
||||||
const int& lastQueryFrame( _frameCountMap[ camera ] );
|
const unsigned int& lastQueryFrame( _frameCountMap[ camera ] );
|
||||||
if( ( lastQueryFrame == 0 ) ||
|
if( ( lastQueryFrame == 0 ) ||
|
||||||
( (nv.getTraversalNumber() - lastQueryFrame) > (_queryFrameCount + 1) ) )
|
( (nv.getTraversalNumber() - lastQueryFrame) > (_queryFrameCount + 1) ) )
|
||||||
return true;
|
return true;
|
||||||
@ -559,7 +559,7 @@ OcclusionQueryNode::traverseQuery( const osg::Camera* camera, osg::NodeVisitor&
|
|||||||
const int curFrame = nv.getTraversalNumber();
|
const int curFrame = nv.getTraversalNumber();
|
||||||
|
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _frameCountMutex );
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _frameCountMutex );
|
||||||
int& lastQueryFrame = _frameCountMap[ camera ];
|
unsigned int& lastQueryFrame = _frameCountMap[ camera ];
|
||||||
issueQuery = (curFrame - lastQueryFrame >= _queryFrameCount);
|
issueQuery = (curFrame - lastQueryFrame >= _queryFrameCount);
|
||||||
if (issueQuery)
|
if (issueQuery)
|
||||||
lastQueryFrame = curFrame;
|
lastQueryFrame = curFrame;
|
||||||
|
@ -127,7 +127,7 @@ void PagedLOD::traverse(NodeVisitor& nv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
double timeStamp = nv.getFrameStamp()?nv.getFrameStamp()->getReferenceTime():0.0;
|
double timeStamp = nv.getFrameStamp()?nv.getFrameStamp()->getReferenceTime():0.0;
|
||||||
int frameNumber = nv.getFrameStamp()?nv.getFrameStamp()->getFrameNumber():0;
|
unsigned int frameNumber = nv.getFrameStamp()?nv.getFrameStamp()->getFrameNumber():0;
|
||||||
bool updateTimeStamp = nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR;
|
bool updateTimeStamp = nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR;
|
||||||
|
|
||||||
switch(nv.getTraversalMode())
|
switch(nv.getTraversalMode())
|
||||||
@ -284,7 +284,7 @@ bool PagedLOD::removeChildren( unsigned int pos,unsigned int numChildrenToRemove
|
|||||||
return Group::removeChildren(pos,numChildrenToRemove);
|
return Group::removeChildren(pos,numChildrenToRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PagedLOD::removeExpiredChildren(double expiryTime, int expiryFrame, NodeList& removedChildren)
|
bool PagedLOD::removeExpiredChildren(double expiryTime, unsigned int expiryFrame, NodeList& removedChildren)
|
||||||
{
|
{
|
||||||
if (_children.size()>_numChildrenThatCannotBeExpired)
|
if (_children.size()>_numChildrenThatCannotBeExpired)
|
||||||
{
|
{
|
||||||
@ -299,23 +299,3 @@ bool PagedLOD::removeExpiredChildren(double expiryTime, int expiryFrame, NodeLis
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PagedLOD::releaseGLObjectsOnExpiredChildren(double releaseTime, int releaseFrame)
|
|
||||||
{
|
|
||||||
unsigned int numChildrenReleased = 0;
|
|
||||||
|
|
||||||
unsigned int numChildren = osg::minimum(_perRangeDataList.size(), _children.size());
|
|
||||||
for(unsigned int i=_numChildrenThatCannotBeExpired; i<numChildren; ++i)
|
|
||||||
{
|
|
||||||
if (_perRangeDataList[i]._frameNumberOfLastReleaseGLObjects != _perRangeDataList[i]._frameNumber &&
|
|
||||||
_perRangeDataList[i]._timeStamp<releaseTime &&
|
|
||||||
_perRangeDataList[i]._frameNumber<releaseFrame)
|
|
||||||
{
|
|
||||||
_perRangeDataList[i]._frameNumberOfLastReleaseGLObjects = _perRangeDataList[i]._frameNumber;
|
|
||||||
|
|
||||||
_children[i]->releaseGLObjects();
|
|
||||||
++numChildrenReleased;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return numChildrenReleased>0;
|
|
||||||
}
|
|
||||||
|
@ -40,7 +40,7 @@ void Stats::allocate(unsigned int numberOfFrames)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Stats::setAttribute(int frameNumber, const std::string& attributeName, double value)
|
bool Stats::setAttribute(unsigned int frameNumber, const std::string& attributeName, double value)
|
||||||
{
|
{
|
||||||
if (frameNumber<getEarliestFrameNumber()) return false;
|
if (frameNumber<getEarliestFrameNumber()) return false;
|
||||||
|
|
||||||
@ -51,13 +51,13 @@ bool Stats::setAttribute(int frameNumber, const std::string& attributeName, doub
|
|||||||
// need to advance
|
// need to advance
|
||||||
|
|
||||||
// first clear the entries up to and including the new frameNumber
|
// first clear the entries up to and including the new frameNumber
|
||||||
for(int i = _latestFrameNumber+1; i<= frameNumber; ++i)
|
for(unsigned int i = _latestFrameNumber+1; i<= frameNumber; ++i)
|
||||||
{
|
{
|
||||||
int index = (i - _baseFrameNumber) % _attributeMapList.size();
|
unsigned int index = (i - _baseFrameNumber) % _attributeMapList.size();
|
||||||
_attributeMapList[index].clear();
|
_attributeMapList[index].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (frameNumber-_baseFrameNumber) >= static_cast<int>(_attributeMapList.size()))
|
if ( (frameNumber-_baseFrameNumber) >= static_cast<unsigned int>(_attributeMapList.size()))
|
||||||
{
|
{
|
||||||
_baseFrameNumber = (frameNumber/_attributeMapList.size())*_attributeMapList.size();
|
_baseFrameNumber = (frameNumber/_attributeMapList.size())*_attributeMapList.size();
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ bool Stats::setAttribute(int frameNumber, const std::string& attributeName, doub
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stats::getAttributeNoMutex(int frameNumber, const std::string& attributeName, double& value) const
|
bool Stats::getAttributeNoMutex(unsigned int frameNumber, const std::string& attributeName, double& value) const
|
||||||
{
|
{
|
||||||
int index = getIndex(frameNumber);
|
int index = getIndex(frameNumber);
|
||||||
if (index<0) return false;
|
if (index<0) return false;
|
||||||
@ -97,7 +97,7 @@ bool Stats::getAveragedAttribute(const std::string& attributeName, double& value
|
|||||||
return getAveragedAttribute(getEarliestFrameNumber(), getLatestFrameNumber(), attributeName, value, averageInInverseSpace);
|
return getAveragedAttribute(getEarliestFrameNumber(), getLatestFrameNumber(), attributeName, value, averageInInverseSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stats::getAveragedAttribute(int startFrameNumber, int endFrameNumber, const std::string& attributeName, double& value, bool averageInInverseSpace) const
|
bool Stats::getAveragedAttribute(unsigned int startFrameNumber, unsigned int endFrameNumber, const std::string& attributeName, double& value, bool averageInInverseSpace) const
|
||||||
{
|
{
|
||||||
if (endFrameNumber<startFrameNumber)
|
if (endFrameNumber<startFrameNumber)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ bool Stats::getAveragedAttribute(int startFrameNumber, int endFrameNumber, const
|
|||||||
|
|
||||||
double total = 0.0;
|
double total = 0.0;
|
||||||
double numValidSamples = 0.0;
|
double numValidSamples = 0.0;
|
||||||
for(int i = startFrameNumber; i<=endFrameNumber; ++i)
|
for(unsigned int i = startFrameNumber; i<=endFrameNumber; ++i)
|
||||||
{
|
{
|
||||||
double v = 0.0;
|
double v = 0.0;
|
||||||
if (getAttributeNoMutex(i,attributeName,v))
|
if (getAttributeNoMutex(i,attributeName,v))
|
||||||
@ -127,7 +127,7 @@ bool Stats::getAveragedAttribute(int startFrameNumber, int endFrameNumber, const
|
|||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Stats::AttributeMap& Stats::getAttributeMapNoMutex(int frameNumber)
|
Stats::AttributeMap& Stats::getAttributeMapNoMutex(unsigned int frameNumber)
|
||||||
{
|
{
|
||||||
int index = getIndex(frameNumber);
|
int index = getIndex(frameNumber);
|
||||||
if (index<0) return _invalidAttributeMap;
|
if (index<0) return _invalidAttributeMap;
|
||||||
@ -135,7 +135,7 @@ Stats::AttributeMap& Stats::getAttributeMapNoMutex(int frameNumber)
|
|||||||
return _attributeMapList[index];
|
return _attributeMapList[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
const Stats::AttributeMap& Stats::getAttributeMapNoMutex(int frameNumber) const
|
const Stats::AttributeMap& Stats::getAttributeMapNoMutex(unsigned int frameNumber) const
|
||||||
{
|
{
|
||||||
int index = getIndex(frameNumber);
|
int index = getIndex(frameNumber);
|
||||||
if (index<0) return _invalidAttributeMap;
|
if (index<0) return _invalidAttributeMap;
|
||||||
@ -149,7 +149,7 @@ void Stats::report(std::ostream& out, const char* indent) const
|
|||||||
|
|
||||||
if (indent) out<<indent;
|
if (indent) out<<indent;
|
||||||
out<<"Stats "<<_name<<std::endl;
|
out<<"Stats "<<_name<<std::endl;
|
||||||
for(int i = getEarliestFrameNumber(); i<= getLatestFrameNumber(); ++i)
|
for(unsigned int i = getEarliestFrameNumber(); i<= getLatestFrameNumber(); ++i)
|
||||||
{
|
{
|
||||||
out<<" FrameNumber "<<i<<std::endl;
|
out<<" FrameNumber "<<i<<std::endl;
|
||||||
const osg::Stats::AttributeMap& attributes = getAttributeMapNoMutex(i);
|
const osg::Stats::AttributeMap& attributes = getAttributeMapNoMutex(i);
|
||||||
|
@ -150,7 +150,7 @@ struct StatsGraph : public osg::MatrixTransform
|
|||||||
const float _max;
|
const float _max;
|
||||||
const std::string _nameBegin;
|
const std::string _nameBegin;
|
||||||
const std::string _nameEnd;
|
const std::string _nameEnd;
|
||||||
mutable int _frameNumber;
|
mutable unsigned int _frameNumber;
|
||||||
|
|
||||||
GraphUpdateCallback(float width, float height, osg::Stats* viewerStats, osg::Stats* stats,
|
GraphUpdateCallback(float width, float height, osg::Stats* viewerStats, osg::Stats* stats,
|
||||||
float max, const std::string& nameBegin, const std::string& nameEnd = "")
|
float max, const std::string& nameBegin, const std::string& nameEnd = "")
|
||||||
@ -168,7 +168,7 @@ struct StatsGraph : public osg::MatrixTransform
|
|||||||
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
||||||
if (!vertices) return;
|
if (!vertices) return;
|
||||||
|
|
||||||
int frameNumber = nv->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = nv->getFrameStamp()->getFrameNumber();
|
||||||
if (frameNumber == _frameNumber)
|
if (frameNumber == _frameNumber)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ struct ValueTextDrawCallback : public virtual osg::Drawable::DrawCallback
|
|||||||
{
|
{
|
||||||
osgText::Text* text = (osgText::Text*)drawable;
|
osgText::Text* text = (osgText::Text*)drawable;
|
||||||
|
|
||||||
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
||||||
if (frameNumber == _frameNumber) {
|
if (frameNumber == _frameNumber) {
|
||||||
text->drawImplementation(renderInfo);
|
text->drawImplementation(renderInfo);
|
||||||
return;
|
return;
|
||||||
@ -276,7 +276,7 @@ struct ValueTextDrawCallback : public virtual osg::Drawable::DrawCallback
|
|||||||
osg::ref_ptr<osg::Stats> _stats;
|
osg::ref_ptr<osg::Stats> _stats;
|
||||||
std::string _attributeName;
|
std::string _attributeName;
|
||||||
mutable char _tmpText[128];
|
mutable char _tmpText[128];
|
||||||
mutable int _frameNumber;
|
mutable unsigned int _frameNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -562,10 +562,10 @@ bool StatsHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdap
|
|||||||
typedef std::vector<osg::Stats*> StatsList;
|
typedef std::vector<osg::Stats*> StatsList;
|
||||||
StatsList statsList;
|
StatsList statsList;
|
||||||
|
|
||||||
for (int i = 0; i < (int)finder._timelines.size(); i++)
|
for (unsigned int i = 0; i < finder._timelines.size(); i++)
|
||||||
statsList.push_back(finder._timelines[i]->getStats());
|
statsList.push_back(finder._timelines[i]->getStats());
|
||||||
|
|
||||||
for(int i = statsList[0]->getEarliestFrameNumber(); i<= statsList[0]->getLatestFrameNumber()-1; ++i)
|
for(unsigned int i = statsList[0]->getEarliestFrameNumber(); i< statsList[0]->getLatestFrameNumber(); ++i)
|
||||||
{
|
{
|
||||||
for(StatsList::iterator itr = statsList.begin();
|
for(StatsList::iterator itr = statsList.begin();
|
||||||
itr != statsList.end();
|
itr != statsList.end();
|
||||||
|
@ -46,10 +46,6 @@ using namespace OpenThreads;
|
|||||||
static osg::ApplicationUsageProxy DatabasePager_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DO_PRE_COMPILE <ON/OFF>","Switch on or off the pre compile of OpenGL object database pager.");
|
static osg::ApplicationUsageProxy DatabasePager_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DO_PRE_COMPILE <ON/OFF>","Switch on or off the pre compile of OpenGL object database pager.");
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e3(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DATABASE_PAGER_DRAWABLE <mode>","Set the drawable policy for setting of loaded drawable to specified type. mode can be one of DoNotModify, DisplayList, VBO or VertexArrays>.");
|
static osg::ApplicationUsageProxy DatabasePager_e3(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DATABASE_PAGER_DRAWABLE <mode>","Set the drawable policy for setting of loaded drawable to specified type. mode can be one of DoNotModify, DisplayList, VBO or VertexArrays>.");
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e4(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DATABASE_PAGER_PRIORITY <mode>", "Set the thread priority to DEFAULT, MIN, LOW, NOMINAL, HIGH or MAX.");
|
static osg::ApplicationUsageProxy DatabasePager_e4(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DATABASE_PAGER_PRIORITY <mode>", "Set the thread priority to DEFAULT, MIN, LOW, NOMINAL, HIGH or MAX.");
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e7(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_EXPIRY_DELAY <float> ","Set the length of time a PagedLOD child is kept in memory, without being used, before its tagged as expired, and ear marked to deletion.");
|
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e8(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_EXPIRY_FRAMES <int> ","Set number of frames a PagedLOD child is kept in memory, without being used, before its tagged as expired, and ear marked to deletion.");
|
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e9(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_RELEASE_DELAY <float> ","Set the length of time a PagedLOD child's OpenGL objects are kept in memory, without being used, before be released (setting to OFF disables this feature.)");
|
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e10(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_RELEASE_FRAMES <int> ","Set number of frames a PagedLOD child's OpenGL objects are kept in memory, without being used, before be released.");
|
|
||||||
static osg::ApplicationUsageProxy DatabasePager_e11(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_PAGEDLOD <num>","Set the target maximum number of PagedLOD to maintain.");
|
static osg::ApplicationUsageProxy DatabasePager_e11(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_PAGEDLOD <num>","Set the target maximum number of PagedLOD to maintain.");
|
||||||
|
|
||||||
// Convert function objects that take pointer args into functions that a
|
// Convert function objects that take pointer args into functions that a
|
||||||
@ -154,10 +150,12 @@ public:
|
|||||||
traverse(plod);
|
traverse(plod);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool removeExpiredChildrenAndCountPagedLODs(osg::PagedLOD* plod, double expiryTime, int expiryFrame, osg::NodeList& removedChildren)
|
bool removeExpiredChildrenAndCountPagedLODs(osg::PagedLOD* plod, double expiryTime, unsigned int expiryFrame, osg::NodeList& removedChildren)
|
||||||
{
|
{
|
||||||
size_t sizeBefore = removedChildren.size();
|
size_t sizeBefore = removedChildren.size();
|
||||||
|
|
||||||
plod->removeExpiredChildren(expiryTime, expiryFrame, removedChildren);
|
plod->removeExpiredChildren(expiryTime, expiryFrame, removedChildren);
|
||||||
|
|
||||||
for(size_t i = sizeBefore; i<removedChildren.size(); ++i)
|
for(size_t i = sizeBefore; i<removedChildren.size(); ++i)
|
||||||
{
|
{
|
||||||
removedChildren[i]->accept(*this);
|
removedChildren[i]->accept(*this);
|
||||||
@ -197,7 +195,7 @@ public:
|
|||||||
virtual unsigned int size() { return _pagedLODs.size(); }
|
virtual unsigned int size() { return _pagedLODs.size(); }
|
||||||
|
|
||||||
virtual void removeExpiredChildren(
|
virtual void removeExpiredChildren(
|
||||||
int numberChildrenToRemove, double expiryTime, int expiryFrame,
|
int numberChildrenToRemove, double expiryTime, unsigned int expiryFrame,
|
||||||
DatabasePager::ObjectList& childrenRemoved, bool visitActive)
|
DatabasePager::ObjectList& childrenRemoved, bool visitActive)
|
||||||
{
|
{
|
||||||
int leftToRemove = numberChildrenToRemove;
|
int leftToRemove = numberChildrenToRemove;
|
||||||
@ -208,12 +206,9 @@ public:
|
|||||||
osg::ref_ptr<osg::PagedLOD> plod;
|
osg::ref_ptr<osg::PagedLOD> plod;
|
||||||
if (itr->lock(plod))
|
if (itr->lock(plod))
|
||||||
{
|
{
|
||||||
int delta = expiryFrame - plod->getFrameNumberOfLastTraversal();
|
bool plodActive = expiryFrame < plod->getFrameNumberOfLastTraversal();
|
||||||
if ((visitActive && delta > 0) || (!visitActive && delta <= 0))
|
if (visitActive==plodActive) // true if (visitActive && plodActive) OR (!visitActive &&!plodActive)
|
||||||
{
|
{
|
||||||
++itr;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
DatabasePager::CountPagedLODsVisitor countPagedLODsVisitor;
|
DatabasePager::CountPagedLODsVisitor countPagedLODsVisitor;
|
||||||
osg::NodeList expiredChildren; // expired PagedLODs
|
osg::NodeList expiredChildren; // expired PagedLODs
|
||||||
countPagedLODsVisitor.removeExpiredChildrenAndCountPagedLODs(
|
countPagedLODsVisitor.removeExpiredChildrenAndCountPagedLODs(
|
||||||
@ -236,6 +231,8 @@ public:
|
|||||||
childrenRemoved.insert(childrenRemoved.end(),
|
childrenRemoved.insert(childrenRemoved.end(),
|
||||||
expiredChildren.begin(),
|
expiredChildren.begin(),
|
||||||
expiredChildren.end());
|
expiredChildren.end());
|
||||||
|
}
|
||||||
|
|
||||||
// advance the iterator to the next element
|
// advance the iterator to the next element
|
||||||
++itr;
|
++itr;
|
||||||
}
|
}
|
||||||
@ -485,7 +482,7 @@ bool DatabasePager::RequestQueue::pruneOldRequestsAndCheckIfEmpty()
|
|||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_requestMutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_requestMutex);
|
||||||
|
|
||||||
int frameNumber = _pager->_frameNumber;
|
unsigned int frameNumber = _pager->_frameNumber;
|
||||||
if (_frameNumberLastPruned != frameNumber)
|
if (_frameNumberLastPruned != frameNumber)
|
||||||
{
|
{
|
||||||
for(RequestQueue::RequestList::iterator citr = _requestList.begin();
|
for(RequestQueue::RequestList::iterator citr = _requestList.begin();
|
||||||
@ -686,8 +683,7 @@ int DatabasePager::DatabaseThread::cancel()
|
|||||||
|
|
||||||
if( isRunning() )
|
if( isRunning() )
|
||||||
{
|
{
|
||||||
|
setDone(true);
|
||||||
_done = true;
|
|
||||||
|
|
||||||
switch(_mode)
|
switch(_mode)
|
||||||
{
|
{
|
||||||
@ -713,6 +709,7 @@ int DatabasePager::DatabaseThread::cancel()
|
|||||||
|
|
||||||
// _startThreadCalled = false;
|
// _startThreadCalled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//OSG_NOTICE<<"DatabasePager::DatabaseThread stopped running"<<std::endl;
|
//OSG_NOTICE<<"DatabasePager::DatabaseThread stopped running"<<std::endl;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
@ -1013,7 +1010,7 @@ DatabasePager::DatabasePager()
|
|||||||
_databasePagerThreadPaused = false;
|
_databasePagerThreadPaused = false;
|
||||||
|
|
||||||
_numFramesActive = 0;
|
_numFramesActive = 0;
|
||||||
_frameNumber = 0;
|
_frameNumber.exchange(0);
|
||||||
|
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
@ -1139,7 +1136,7 @@ DatabasePager::DatabasePager(const DatabasePager& rhs)
|
|||||||
_databasePagerThreadPaused = false;
|
_databasePagerThreadPaused = false;
|
||||||
|
|
||||||
_numFramesActive = 0;
|
_numFramesActive = 0;
|
||||||
_frameNumber = 0;
|
_frameNumber.exchange(0);
|
||||||
|
|
||||||
_drawablePolicy = rhs._drawablePolicy;
|
_drawablePolicy = rhs._drawablePolicy;
|
||||||
|
|
||||||
@ -1387,7 +1384,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
|||||||
|
|
||||||
|
|
||||||
double timestamp = framestamp?framestamp->getReferenceTime():0.0;
|
double timestamp = framestamp?framestamp->getReferenceTime():0.0;
|
||||||
int frameNumber = framestamp?framestamp->getFrameNumber():_frameNumber;
|
unsigned int frameNumber = framestamp?framestamp->getFrameNumber():static_cast<unsigned int>(_frameNumber);
|
||||||
|
|
||||||
// #define WITH_REQUESTNODEFILE_TIMING
|
// #define WITH_REQUESTNODEFILE_TIMING
|
||||||
#ifdef WITH_REQUESTNODEFILE_TIMING
|
#ifdef WITH_REQUESTNODEFILE_TIMING
|
||||||
@ -1521,7 +1518,7 @@ void DatabasePager::signalBeginFrame(const osg::FrameStamp* framestamp)
|
|||||||
_dataToCompileList->pruneOldRequestsAndCheckIfEmpty();
|
_dataToCompileList->pruneOldRequestsAndCheckIfEmpty();
|
||||||
|
|
||||||
//OSG_INFO << "signalBeginFrame "<<framestamp->getFrameNumber()<<">>>>>>>>>>>>>>>>"<<std::endl;
|
//OSG_INFO << "signalBeginFrame "<<framestamp->getFrameNumber()<<">>>>>>>>>>>>>>>>"<<std::endl;
|
||||||
_frameNumber = framestamp->getFrameNumber();
|
_frameNumber.exchange(framestamp->getFrameNumber());
|
||||||
|
|
||||||
} //else OSG_INFO << "signalBeginFrame >>>>>>>>>>>>>>>>"<<std::endl;
|
} //else OSG_INFO << "signalBeginFrame >>>>>>>>>>>>>>>>"<<std::endl;
|
||||||
}
|
}
|
||||||
@ -1594,7 +1591,7 @@ void DatabasePager::updateSceneGraph(const osg::FrameStamp& frameStamp)
|
|||||||
void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
||||||
{
|
{
|
||||||
double timeStamp = frameStamp.getReferenceTime();
|
double timeStamp = frameStamp.getReferenceTime();
|
||||||
int frameNumber = frameStamp.getFrameNumber();
|
unsigned int frameNumber = frameStamp.getFrameNumber();
|
||||||
|
|
||||||
osg::Timer_t before = osg::Timer::instance()->tick(), mid, last;
|
osg::Timer_t before = osg::Timer::instance()->tick(), mid, last;
|
||||||
|
|
||||||
@ -1702,6 +1699,13 @@ void DatabasePager::removeExpiredSubgraphs(const osg::FrameStamp& frameStamp)
|
|||||||
static double s_total_time_stage_c = 0.0;
|
static double s_total_time_stage_c = 0.0;
|
||||||
static double s_total_max_stage_c = 0.0;
|
static double s_total_max_stage_c = 0.0;
|
||||||
|
|
||||||
|
if (frameStamp.getFrameNumber()==0)
|
||||||
|
{
|
||||||
|
// No need to remove anything on first frame.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
// numPagedLODs >= actual number of PagedLODs. There can be
|
// numPagedLODs >= actual number of PagedLODs. There can be
|
||||||
@ -1727,7 +1731,7 @@ void DatabasePager::removeExpiredSubgraphs(const osg::FrameStamp& frameStamp)
|
|||||||
ObjectList childrenRemoved;
|
ObjectList childrenRemoved;
|
||||||
|
|
||||||
double expiryTime = frameStamp.getReferenceTime() - 0.1;
|
double expiryTime = frameStamp.getReferenceTime() - 0.1;
|
||||||
int expiryFrame = frameStamp.getFrameNumber() - 1;
|
unsigned int expiryFrame = frameStamp.getFrameNumber() - 1;
|
||||||
|
|
||||||
// First traverse inactive PagedLODs, as their children will
|
// First traverse inactive PagedLODs, as their children will
|
||||||
// certainly have expired. Then traverse active nodes if we still
|
// certainly have expired. Then traverse active nodes if we still
|
||||||
@ -1783,7 +1787,7 @@ class DatabasePager::FindPagedLODsVisitor : public osg::NodeVisitor
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FindPagedLODsVisitor(DatabasePager::PagedLODList& pagedLODList, int frameNumber):
|
FindPagedLODsVisitor(DatabasePager::PagedLODList& pagedLODList, unsigned int frameNumber):
|
||||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
||||||
_activePagedLODList(pagedLODList),
|
_activePagedLODList(pagedLODList),
|
||||||
_frameNumber(frameNumber)
|
_frameNumber(frameNumber)
|
||||||
@ -1803,7 +1807,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
DatabasePager::PagedLODList& _activePagedLODList;
|
DatabasePager::PagedLODList& _activePagedLODList;
|
||||||
int _frameNumber;
|
unsigned int _frameNumber;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -1811,7 +1815,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void DatabasePager::registerPagedLODs(osg::Node* subgraph, int frameNumber)
|
void DatabasePager::registerPagedLODs(osg::Node* subgraph, unsigned int frameNumber)
|
||||||
{
|
{
|
||||||
if (!subgraph) return;
|
if (!subgraph) return;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor& nv)
|
|||||||
if (alive &&
|
if (alive &&
|
||||||
_enabled &&
|
_enabled &&
|
||||||
!_ps->isFrozen() &&
|
!_ps->isFrozen() &&
|
||||||
(_ps->getLastFrameNumber() >= (nv.getFrameStamp()->getFrameNumber() - 1) || !_ps->getFreezeOnCull()))
|
((_ps->getLastFrameNumber()+1) >= (nv.getFrameStamp()->getFrameNumber()) || !_ps->getFreezeOnCull()))
|
||||||
{
|
{
|
||||||
// initialize matrix flags
|
// initialize matrix flags
|
||||||
_need_ltw_matrix = true;
|
_need_ltw_matrix = true;
|
||||||
|
@ -11,7 +11,7 @@ PendulumCallback::PendulumCallback(const osg::Vec3& axis,
|
|||||||
_endAngle = endAngle;
|
_endAngle = endAngle;
|
||||||
_frequency = frequency;
|
_frequency = frequency;
|
||||||
|
|
||||||
_previousTraversalNumber = -1;
|
_previousTraversalNumber = osg::UNINITIALIZED_FRAME_NUMBER;
|
||||||
_previousTime = -1.0;
|
_previousTime = -1.0;
|
||||||
_angle = 0.0;
|
_angle = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class PendulumCallback : public osg::NodeCallback
|
|||||||
float _frequency;
|
float _frequency;
|
||||||
osg::Vec3 _axis;
|
osg::Vec3 _axis;
|
||||||
|
|
||||||
int _previousTraversalNumber;
|
unsigned int _previousTraversalNumber;
|
||||||
double _previousTime;
|
double _previousTime;
|
||||||
float _angle;
|
float _angle;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ ShuttleCallback::ShuttleCallback(const osg::Vec3& startPos,
|
|||||||
_endPos = endPos;
|
_endPos = endPos;
|
||||||
_frequency = frequency;
|
_frequency = frequency;
|
||||||
|
|
||||||
_previousTraversalNumber = -1;
|
_previousTraversalNumber = osg::UNINITIALIZED_FRAME_NUMBER;
|
||||||
_previousTime = -1.0;
|
_previousTime = -1.0;
|
||||||
_angle = 0.0;
|
_angle = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ class ShuttleCallback : public osg::NodeCallback
|
|||||||
osg::Vec3 _endPos;
|
osg::Vec3 _endPos;
|
||||||
float _frequency;
|
float _frequency;
|
||||||
|
|
||||||
int _previousTraversalNumber;
|
unsigned int _previousTraversalNumber;
|
||||||
double _previousTime;
|
double _previousTime;
|
||||||
float _angle;
|
float _angle;
|
||||||
};
|
};
|
||||||
|
@ -30,7 +30,7 @@ void TXPPagedLOD::traverse(osg::NodeVisitor& nv)
|
|||||||
|
|
||||||
double timeStamp = nv.getFrameStamp()?nv.getFrameStamp()->getReferenceTime():0.0;
|
double timeStamp = nv.getFrameStamp()?nv.getFrameStamp()->getReferenceTime():0.0;
|
||||||
bool updateTimeStamp = nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR;
|
bool updateTimeStamp = nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR;
|
||||||
int frameNumber = nv.getFrameStamp()?nv.getFrameStamp()->getFrameNumber():0;
|
unsigned int frameNumber = nv.getFrameStamp()?nv.getFrameStamp()->getFrameNumber():0;
|
||||||
|
|
||||||
// set the frame number of the traversal so that external nodes can find out how active this
|
// set the frame number of the traversal so that external nodes can find out how active this
|
||||||
// node is.
|
// node is.
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include <osg/Version>
|
#include <osg/Version>
|
||||||
#include <osgGA/GUIEventAdapter>
|
#include <osgGA/GUIEventAdapter>
|
||||||
|
|
||||||
|
#include <osg/NodeVisitor>
|
||||||
#include <osg/io_utils>
|
#include <osg/io_utils>
|
||||||
#include <QtGui/QGraphicsItem>
|
#include <QtGui/QGraphicsItem>
|
||||||
#include <QtGui/QGraphicsProxyWidget>
|
#include <QtGui/QGraphicsProxyWidget>
|
||||||
@ -100,7 +101,7 @@ QGraphicsViewAdapter::QGraphicsViewAdapter(osg::Image* image, QWidget* widget):
|
|||||||
_currentRead = 0;
|
_currentRead = 0;
|
||||||
_currentWrite = 1;
|
_currentWrite = 1;
|
||||||
_previousWrite = 2;
|
_previousWrite = 2;
|
||||||
_previousFrameNumber = 0;
|
_previousFrameNumber = osg::UNINITIALIZED_FRAME_NUMBER;
|
||||||
_newImageAvailable = false;
|
_newImageAvailable = false;
|
||||||
|
|
||||||
connect(_graphicsScene, SIGNAL(changed(const QList<QRectF> &)),
|
connect(_graphicsScene, SIGNAL(changed(const QList<QRectF> &)),
|
||||||
|
@ -27,7 +27,7 @@ static const unsigned int SCALE_Z_LIMIT_BIT = 0x80000000u >> 8;
|
|||||||
|
|
||||||
|
|
||||||
DOFTransform::DOFTransform():
|
DOFTransform::DOFTransform():
|
||||||
_previousTraversalNumber(-1),
|
_previousTraversalNumber(osg::UNINITIALIZED_FRAME_NUMBER),
|
||||||
_previousTime(0.0),
|
_previousTime(0.0),
|
||||||
_limitationFlags(0),
|
_limitationFlags(0),
|
||||||
_animationOn(false),
|
_animationOn(false),
|
||||||
|
@ -39,6 +39,8 @@ ImpostorSprite::ImpostorSprite()
|
|||||||
_previous = NULL;
|
_previous = NULL;
|
||||||
_next = NULL;
|
_next = NULL;
|
||||||
|
|
||||||
|
_lastFrameUsed = osg::UNINITIALIZED_FRAME_NUMBER;
|
||||||
|
|
||||||
_texture = NULL;
|
_texture = NULL;
|
||||||
_s = 0;
|
_s = 0;
|
||||||
_t = 0;
|
_t = 0;
|
||||||
@ -238,7 +240,7 @@ void ImpostorSpriteManager::remove(ImpostorSprite* is)
|
|||||||
if (_last==is) _last = is->_previous;
|
if (_last==is) _last = is->_previous;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,int frameNumber)
|
ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,unsigned int frameNumber)
|
||||||
{
|
{
|
||||||
if (!empty())
|
if (!empty())
|
||||||
{
|
{
|
||||||
|
@ -1212,7 +1212,7 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie
|
|||||||
#endif
|
#endif
|
||||||
if (_characterSizeMode!=OBJECT_COORDS || _autoRotateToScreen)
|
if (_characterSizeMode!=OBJECT_COORDS || _autoRotateToScreen)
|
||||||
{
|
{
|
||||||
int frameNumber = state.getFrameStamp()?state.getFrameStamp()->getFrameNumber():0;
|
unsigned int frameNumber = state.getFrameStamp()?state.getFrameStamp()->getFrameNumber():0;
|
||||||
AutoTransformCache& atc = _autoTransformCache[contextID];
|
AutoTransformCache& atc = _autoTransformCache[contextID];
|
||||||
const osg::Matrix& modelview = state.getModelViewMatrix();
|
const osg::Matrix& modelview = state.getModelViewMatrix();
|
||||||
const osg::Matrix& projection = state.getProjectionMatrix();
|
const osg::Matrix& projection = state.getProjectionMatrix();
|
||||||
|
@ -379,7 +379,7 @@ void SceneView::updateUniforms()
|
|||||||
|
|
||||||
if ((_activeUniforms & FRAME_NUMBER_UNIFORM) && _frameStamp.valid())
|
if ((_activeUniforms & FRAME_NUMBER_UNIFORM) && _frameStamp.valid())
|
||||||
{
|
{
|
||||||
osg::Uniform* uniform = _localStateSet->getOrCreateUniform("osg_FrameNumber",osg::Uniform::INT);
|
osg::Uniform* uniform = _localStateSet->getOrCreateUniform("osg_FrameNumber",osg::Uniform::UNSIGNED_INT);
|
||||||
uniform->set(_frameStamp->getFrameNumber());
|
uniform->set(_frameStamp->getFrameNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ TransformCallback::TransformCallback(const osg::Vec3& pivot,const osg::Vec3& axi
|
|||||||
_axis = axis;
|
_axis = axis;
|
||||||
_angular_velocity = angularVelocity;
|
_angular_velocity = angularVelocity;
|
||||||
|
|
||||||
_previousTraversalNumber = -1;
|
_previousTraversalNumber = osg::UNINITIALIZED_FRAME_NUMBER;
|
||||||
_previousTime = -1.0;
|
_previousTime = -1.0;
|
||||||
|
|
||||||
_pause = false;
|
_pause = false;
|
||||||
|
@ -619,7 +619,7 @@ void CompositeViewer::advance(double simulationTime)
|
|||||||
if (_done) return;
|
if (_done) return;
|
||||||
|
|
||||||
double prevousReferenceTime = _frameStamp->getReferenceTime();
|
double prevousReferenceTime = _frameStamp->getReferenceTime();
|
||||||
int previousFrameNumber = _frameStamp->getFrameNumber();
|
unsigned int previousFrameNumber = _frameStamp->getFrameNumber();
|
||||||
|
|
||||||
|
|
||||||
_frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1);
|
_frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1);
|
||||||
|
@ -45,12 +45,12 @@ class OSGVIEWER_EXPORT EXTQuerySupport : public OpenGLQuerySupport
|
|||||||
public:
|
public:
|
||||||
EXTQuerySupport();
|
EXTQuerySupport();
|
||||||
void checkQuery(osg::Stats* stats, osg::State* state, osg::Timer_t startTick);
|
void checkQuery(osg::Stats* stats, osg::State* state, osg::Timer_t startTick);
|
||||||
virtual void beginQuery(int frameNumber, osg::State* state);
|
virtual void beginQuery(unsigned int frameNumber, osg::State* state);
|
||||||
virtual void endQuery(osg::State* state);
|
virtual void endQuery(osg::State* state);
|
||||||
virtual void initialize(osg::State* state, osg::Timer_t startTick);
|
virtual void initialize(osg::State* state, osg::Timer_t startTick);
|
||||||
protected:
|
protected:
|
||||||
GLuint createQueryObject();
|
GLuint createQueryObject();
|
||||||
typedef std::pair<GLuint, int> QueryFrameNumberPair;
|
typedef std::pair<GLuint, unsigned int> QueryFrameNumberPair;
|
||||||
typedef std::list<QueryFrameNumberPair> QueryFrameNumberList;
|
typedef std::list<QueryFrameNumberPair> QueryFrameNumberList;
|
||||||
typedef std::vector<GLuint> QueryList;
|
typedef std::vector<GLuint> QueryList;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ GLuint EXTQuerySupport::createQueryObject()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXTQuerySupport::beginQuery(int frameNumber, osg::State* state)
|
void EXTQuerySupport::beginQuery(unsigned int frameNumber, osg::State* state)
|
||||||
{
|
{
|
||||||
GLuint query = createQueryObject();
|
GLuint query = createQueryObject();
|
||||||
_extensions->glBeginQuery(GL_TIME_ELAPSED, query);
|
_extensions->glBeginQuery(GL_TIME_ELAPSED, query);
|
||||||
@ -148,7 +148,7 @@ public:
|
|||||||
virtual void checkQuery(osg::Stats* stats, osg::State* state,
|
virtual void checkQuery(osg::Stats* stats, osg::State* state,
|
||||||
osg::Timer_t startTick);
|
osg::Timer_t startTick);
|
||||||
|
|
||||||
virtual void beginQuery(int frameNumber, osg::State* state);
|
virtual void beginQuery(unsigned int frameNumber, osg::State* state);
|
||||||
virtual void endQuery(osg::State* state);
|
virtual void endQuery(osg::State* state);
|
||||||
virtual void initialize(osg::State* state, osg::Timer_t startTick);
|
virtual void initialize(osg::State* state, osg::Timer_t startTick);
|
||||||
protected:
|
protected:
|
||||||
@ -159,12 +159,12 @@ protected:
|
|||||||
: queries(start_, end_), frameNumber(frameNumber_)
|
: queries(start_, end_), frameNumber(frameNumber_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
ActiveQuery(const QueryPair& queries_, int frameNumber_)
|
ActiveQuery(const QueryPair& queries_, unsigned int frameNumber_)
|
||||||
: queries(queries_), frameNumber(frameNumber_)
|
: queries(queries_), frameNumber(frameNumber_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
QueryPair queries;
|
QueryPair queries;
|
||||||
int frameNumber;
|
unsigned int frameNumber;
|
||||||
};
|
};
|
||||||
typedef std::list<ActiveQuery> QueryFrameList;
|
typedef std::list<ActiveQuery> QueryFrameList;
|
||||||
typedef std::vector<QueryPair> QueryList;
|
typedef std::vector<QueryPair> QueryList;
|
||||||
@ -177,7 +177,7 @@ void ARBQuerySupport::initialize(osg::State* state, osg::Timer_t startTick)
|
|||||||
OpenGLQuerySupport::initialize(state, startTick);
|
OpenGLQuerySupport::initialize(state, startTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARBQuerySupport::beginQuery(int frameNumber, osg::State* state)
|
void ARBQuerySupport::beginQuery(unsigned int frameNumber, osg::State* state)
|
||||||
{
|
{
|
||||||
QueryPair query;
|
QueryPair query;
|
||||||
if (_availableQueryObjects.empty())
|
if (_availableQueryObjects.empty())
|
||||||
@ -531,7 +531,7 @@ void Renderer::cull()
|
|||||||
osg::Stats* stats = sceneView->getCamera()->getStats();
|
osg::Stats* stats = sceneView->getCamera()->getStats();
|
||||||
osg::State* state = sceneView->getState();
|
osg::State* state = sceneView->getState();
|
||||||
const osg::FrameStamp* fs = state->getFrameStamp();
|
const osg::FrameStamp* fs = state->getFrameStamp();
|
||||||
int frameNumber = fs ? fs->getFrameNumber() : 0;
|
unsigned int frameNumber = fs ? fs->getFrameNumber() : 0;
|
||||||
|
|
||||||
// do cull traversal
|
// do cull traversal
|
||||||
osg::Timer_t beforeCullTick = osg::Timer::instance()->tick();
|
osg::Timer_t beforeCullTick = osg::Timer::instance()->tick();
|
||||||
@ -643,7 +643,7 @@ void Renderer::draw()
|
|||||||
|
|
||||||
osg::Stats* stats = sceneView->getCamera()->getStats();
|
osg::Stats* stats = sceneView->getCamera()->getStats();
|
||||||
osg::State* state = sceneView->getState();
|
osg::State* state = sceneView->getState();
|
||||||
int frameNumber = state->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = state->getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
if (!_initialized)
|
if (!_initialized)
|
||||||
{
|
{
|
||||||
@ -747,7 +747,7 @@ void Renderer::cull_draw()
|
|||||||
osg::Stats* stats = sceneView->getCamera()->getStats();
|
osg::Stats* stats = sceneView->getCamera()->getStats();
|
||||||
osg::State* state = sceneView->getState();
|
osg::State* state = sceneView->getState();
|
||||||
const osg::FrameStamp* fs = state->getFrameStamp();
|
const osg::FrameStamp* fs = state->getFrameStamp();
|
||||||
int frameNumber = fs ? fs->getFrameNumber() : 0;
|
unsigned int frameNumber = fs ? fs->getFrameNumber() : 0;
|
||||||
|
|
||||||
if (!_initialized)
|
if (!_initialized)
|
||||||
{
|
{
|
||||||
|
@ -219,7 +219,7 @@ bool StatsHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = viewer->getViewerStats()->getEarliestFrameNumber(); i<= viewer->getViewerStats()->getLatestFrameNumber()-1; ++i)
|
for(unsigned int i = viewer->getViewerStats()->getEarliestFrameNumber(); i<= viewer->getViewerStats()->getLatestFrameNumber()-1; ++i)
|
||||||
{
|
{
|
||||||
for(StatsList::iterator itr = statsList.begin();
|
for(StatsList::iterator itr = statsList.begin();
|
||||||
itr != statsList.end();
|
itr != statsList.end();
|
||||||
@ -402,7 +402,7 @@ struct RawValueTextDrawCallback : public virtual osg::Drawable::DrawCallback
|
|||||||
{
|
{
|
||||||
_tickLastUpdated = tick;
|
_tickLastUpdated = tick;
|
||||||
|
|
||||||
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
||||||
double value;
|
double value;
|
||||||
if (_stats->getAttribute(frameNumber, _attributeName, value))
|
if (_stats->getAttribute(frameNumber, _attributeName, value))
|
||||||
{
|
{
|
||||||
@ -469,7 +469,7 @@ struct CameraSceneStatsTextDrawCallback : public virtual osg::Drawable::DrawCall
|
|||||||
viewStr << _camera->getName();
|
viewStr << _camera->getName();
|
||||||
viewStr << std::endl;
|
viewStr << std::endl;
|
||||||
|
|
||||||
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
||||||
if (!(renderer->getGraphicsThreadDoesCull()))
|
if (!(renderer->getGraphicsThreadDoesCull()))
|
||||||
{
|
{
|
||||||
--frameNumber;
|
--frameNumber;
|
||||||
@ -556,7 +556,7 @@ struct ViewSceneStatsTextDrawCallback : public virtual osg::Drawable::DrawCallba
|
|||||||
viewStr << ": " << _view->getName();
|
viewStr << ": " << _view->getName();
|
||||||
viewStr << std::endl;
|
viewStr << std::endl;
|
||||||
|
|
||||||
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
||||||
// if (!(renderer->getGraphicsThreadDoesCull()))
|
// if (!(renderer->getGraphicsThreadDoesCull()))
|
||||||
{
|
{
|
||||||
--frameNumber;
|
--frameNumber;
|
||||||
@ -625,7 +625,6 @@ struct BlockDrawCallback : public virtual osg::Drawable::DrawCallback
|
|||||||
osg::Vec3Array* vertices = (osg::Vec3Array*)geom->getVertexArray();
|
osg::Vec3Array* vertices = (osg::Vec3Array*)geom->getVertexArray();
|
||||||
|
|
||||||
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
int startFrame = frameNumber + _frameDelta - _numFrames + 1;
|
int startFrame = frameNumber + _frameDelta - _numFrames + 1;
|
||||||
int endFrame = frameNumber + _frameDelta;
|
int endFrame = frameNumber + _frameDelta;
|
||||||
double referenceTime;
|
double referenceTime;
|
||||||
@ -755,7 +754,7 @@ protected:
|
|||||||
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
||||||
if (!vertices) return;
|
if (!vertices) return;
|
||||||
|
|
||||||
int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = renderInfo.getState()->getFrameStamp()->getFrameNumber();
|
||||||
|
|
||||||
// Get stats
|
// Get stats
|
||||||
double value;
|
double value;
|
||||||
@ -837,11 +836,11 @@ protected:
|
|||||||
const float _max;
|
const float _max;
|
||||||
const std::string _nameBegin;
|
const std::string _nameBegin;
|
||||||
const std::string _nameEnd;
|
const std::string _nameEnd;
|
||||||
static int _frameNumber;
|
static unsigned int _frameNumber;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
int StatsGraph::GraphUpdateCallback::_frameNumber = 0;
|
unsigned int StatsGraph::GraphUpdateCallback::_frameNumber = 0;
|
||||||
|
|
||||||
|
|
||||||
osg::Geometry* StatsHandler::createGeometry(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numBlocks)
|
osg::Geometry* StatsHandler::createGeometry(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numBlocks)
|
||||||
|
@ -569,7 +569,7 @@ void Viewer::advance(double simulationTime)
|
|||||||
if (_done) return;
|
if (_done) return;
|
||||||
|
|
||||||
double prevousReferenceTime = _frameStamp->getReferenceTime();
|
double prevousReferenceTime = _frameStamp->getReferenceTime();
|
||||||
int previousFrameNumber = _frameStamp->getFrameNumber();
|
unsigned int previousFrameNumber = _frameStamp->getFrameNumber();
|
||||||
|
|
||||||
_frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1);
|
_frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1);
|
||||||
|
|
||||||
|
@ -584,10 +584,10 @@ int ViewerBase::run()
|
|||||||
realize();
|
realize();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* str = getenv("OSG_RUN_FRAME_COUNT");
|
const char* run_frame_count_str = getenv("OSG_RUN_FRAME_COUNT");
|
||||||
int runTillFrameNumber = str==0 ? -1 : atoi(str);
|
unsigned int runTillFrameNumber = run_frame_count_str==0 ? osg::UNINITIALIZED_FRAME_NUMBER : atoi(run_frame_count_str);
|
||||||
|
|
||||||
while(!done() && (runTillFrameNumber<0 || getViewerFrameStamp()->getFrameNumber()<runTillFrameNumber))
|
while(!done() && (run_frame_count_str==0 || getViewerFrameStamp()->getFrameNumber()<runTillFrameNumber))
|
||||||
{
|
{
|
||||||
double minFrameTime = _runMaxFrameRate>0.0 ? 1.0/_runMaxFrameRate : 0.0;
|
double minFrameTime = _runMaxFrameRate>0.0 ? 1.0/_runMaxFrameRate : 0.0;
|
||||||
osg::Timer_t startFrameTick = osg::Timer::instance()->tick();
|
osg::Timer_t startFrameTick = osg::Timer::instance()->tick();
|
||||||
@ -676,7 +676,7 @@ void ViewerBase::renderingTraversals()
|
|||||||
|
|
||||||
if (getViewerStats() && getViewerStats()->collectStats("scene"))
|
if (getViewerStats() && getViewerStats()->collectStats("scene"))
|
||||||
{
|
{
|
||||||
int frameNumber = frameStamp ? frameStamp->getFrameNumber() : 0;
|
unsigned int frameNumber = frameStamp ? frameStamp->getFrameNumber() : 0;
|
||||||
|
|
||||||
Views views;
|
Views views;
|
||||||
getViews(views);
|
getViews(views);
|
||||||
|
@ -10,6 +10,6 @@ REGISTER_OBJECT_WRAPPER( OcclusionQueryNode,
|
|||||||
{
|
{
|
||||||
ADD_BOOL_SERIALIZER( QueriesEnabled, true ); // _enabled
|
ADD_BOOL_SERIALIZER( QueriesEnabled, true ); // _enabled
|
||||||
ADD_UINT_SERIALIZER( VisibilityThreshold, 0 ); // _visThreshold
|
ADD_UINT_SERIALIZER( VisibilityThreshold, 0 ); // _visThreshold
|
||||||
ADD_INT_SERIALIZER( QueryFrameCount, 0 ); // _queryFrameCount
|
ADD_UINT_SERIALIZER( QueryFrameCount, 0 ); // _queryFrameCount
|
||||||
ADD_BOOL_SERIALIZER( DebugDisplay, false ); // _debugBB
|
ADD_BOOL_SERIALIZER( DebugDisplay, false ); // _debugBB
|
||||||
}
|
}
|
||||||
|
@ -139,9 +139,17 @@ REGISTER_OBJECT_WRAPPER( PagedLOD,
|
|||||||
// Note: osg::Group is not in the list to prevent recording dynamic loaded children
|
// Note: osg::Group is not in the list to prevent recording dynamic loaded children
|
||||||
|
|
||||||
ADD_USER_SERIALIZER( DatabasePath ); // _databasePath
|
ADD_USER_SERIALIZER( DatabasePath ); // _databasePath
|
||||||
ADD_INT_SERIALIZER( FrameNumberOfLastTraversal, 0 ); // _frameNumberOfLastTraversal
|
ADD_UINT_SERIALIZER( FrameNumberOfLastTraversal, 0 ); // _frameNumberOfLastTraversal, note, not required, removed from soversion 70 onwwards, see below
|
||||||
ADD_UINT_SERIALIZER( NumChildrenThatCannotBeExpired, 0 ); // _numChildrenThatCannotBeExpired
|
ADD_UINT_SERIALIZER( NumChildrenThatCannotBeExpired, 0 ); // _numChildrenThatCannotBeExpired
|
||||||
ADD_BOOL_SERIALIZER( DisableExternalChildrenPaging, false ); // _disableExternalChildrenPaging
|
ADD_BOOL_SERIALIZER( DisableExternalChildrenPaging, false ); // _disableExternalChildrenPaging
|
||||||
ADD_USER_SERIALIZER( RangeDataList ); // _perRangeDataList
|
ADD_USER_SERIALIZER( RangeDataList ); // _perRangeDataList
|
||||||
ADD_USER_SERIALIZER( Children ); // _children (which are not loaded from external)
|
ADD_USER_SERIALIZER( Children ); // _children (which are not loaded from external)
|
||||||
|
|
||||||
|
UPDATE_TO_VERSION( 70 )
|
||||||
|
{
|
||||||
|
REMOVE_SERIALIZER( FrameNumberOfLastTraversal );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user