Convert NOTIFY to OSG_NOTIFY to avoid problems with polution of users apps with the NOTIFY macro
This commit is contained in:
parent
6ab51c7c47
commit
f17e401347
@ -11,8 +11,8 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSG_NOTIFY
|
||||
#define OSG_NOTIFY 1
|
||||
#ifndef OSG_NOTIFY_H
|
||||
#define OSG_NOTIFY_H 1
|
||||
|
||||
#include <osg/Export>
|
||||
#include <osg/Referenced> // for NotifyHandler
|
||||
@ -75,13 +75,13 @@ extern OSG_EXPORT std::ostream& notify(const NotifySeverity severity);
|
||||
|
||||
inline std::ostream& notify(void) { return notify(osg::INFO); }
|
||||
|
||||
#define NOTIFY(level) if (level>isNotifyEnabled(level)) osg::notify(level)
|
||||
#define OSG_NOTIFY(level) if (level>isNotifyEnabled(level)) osg::notify(level)
|
||||
|
||||
#if _DEBUG
|
||||
#define DEBUG_NOTIFY(level) if (level>isNotifyEnabled(level)) osg::notify(level)
|
||||
#define OSG_DEBUG_NOTIFY(level) if (level>isNotifyEnabled(level)) osg::notify(level)
|
||||
#else
|
||||
// when using an optimized build use if (false) to tell the compiler to ignore the rest of the notify.
|
||||
#define DEBUG_NOTIFY(level) if (false) osg::notify(level)
|
||||
#define OSG_DEBUG_NOTIFY(level) if (false) osg::notify(level)
|
||||
#endif
|
||||
|
||||
/** Handler processing output of notification stream. It acts as a sink to
|
||||
|
@ -66,12 +66,12 @@ GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject* bufferObjec
|
||||
_extensions->glGenBuffers(1, &_glObjectID);
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Constucting BufferObject "<<this<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Constucting BufferObject "<<this<<std::endl;
|
||||
}
|
||||
|
||||
GLBufferObject::~GLBufferObject()
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Destucting BufferObject "<<this<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Destucting BufferObject "<<this<<std::endl;
|
||||
}
|
||||
|
||||
void GLBufferObject::setBufferObject(BufferObject* bufferObject)
|
||||
@ -129,7 +129,7 @@ void GLBufferObject::compileBuffer()
|
||||
{
|
||||
unsigned int previousEndOfBufferDataMarker = entry.offset + entry.dataSize;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObject::compileBuffer(..) updating BufferEntry"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObject::compileBuffer(..) updating BufferEntry"<<std::endl;
|
||||
|
||||
|
||||
entry.offset = newTotalSize;
|
||||
@ -152,11 +152,11 @@ void GLBufferObject::compileBuffer()
|
||||
entry.dataSize = bd->getTotalDataSize();
|
||||
entry.dataSource = bd;
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<"entry"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" offset "<<entry.offset<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" dataSize "<<entry.dataSize<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" dataSource "<<entry.dataSource<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" modifiedCount "<<entry.modifiedCount<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"entry"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" offset "<<entry.offset<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" dataSize "<<entry.dataSize<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" dataSource "<<entry.dataSource<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" modifiedCount "<<entry.modifiedCount<<std::endl;
|
||||
#endif
|
||||
newTotalSize += entry.dataSize;
|
||||
|
||||
@ -175,7 +175,7 @@ void GLBufferObject::compileBuffer()
|
||||
|
||||
if (newTotalSize > _profile._size)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"newTotalSize="<<newTotalSize<<", _profile._size="<<_profile._size<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"newTotalSize="<<newTotalSize<<", _profile._size="<<_profile._size<<std::endl;
|
||||
|
||||
_profile._size = newTotalSize;
|
||||
|
||||
@ -205,7 +205,7 @@ void GLBufferObject::compileBuffer()
|
||||
BufferEntry& entry = *itr;
|
||||
if (compileAll || entry.modifiedCount != entry.dataSource->getModifiedCount())
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObject::compileBuffer(..) downloading BufferEntry "<<&entry<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObject::compileBuffer(..) downloading BufferEntry "<<&entry<<std::endl;
|
||||
entry.modifiedCount = entry.dataSource->getModifiedCount();
|
||||
|
||||
if (vboMemory)
|
||||
@ -224,7 +224,7 @@ void GLBufferObject::compileBuffer()
|
||||
|
||||
void GLBufferObject::deleteGLObject()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"GLBufferObject::deleteGLObject() "<<_glObjectID<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GLBufferObject::deleteGLObject() "<<_glObjectID<<std::endl;
|
||||
if (_glObjectID!=0)
|
||||
{
|
||||
_extensions->glDeleteBuffers(1, &_glObjectID);
|
||||
@ -397,16 +397,16 @@ GLBufferObjectSet::GLBufferObjectSet(GLBufferObjectManager* parent, const Buffer
|
||||
_head(0),
|
||||
_tail(0)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"GLBufferObjectSet::GLBufferObjectSet _profile._size="<<_profile._size<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GLBufferObjectSet::GLBufferObjectSet _profile._size="<<_profile._size<<std::endl;
|
||||
}
|
||||
|
||||
GLBufferObjectSet::~GLBufferObjectSet()
|
||||
{
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::~GLBufferObjectSet(), _numOfGLBufferObjects="<<_numOfGLBufferObjects<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" _orphanedGLBufferObjects = "<<_orphanedGLBufferObjects.size()<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" _head = "<<_head<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" _tail = "<<_tail<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::~GLBufferObjectSet(), _numOfGLBufferObjects="<<_numOfGLBufferObjects<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" _orphanedGLBufferObjects = "<<_orphanedGLBufferObjects.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" _head = "<<_head<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" _tail = "<<_tail<<std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
#ifndef CHECK_CONSISTENCY
|
||||
return true;
|
||||
#else
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency()"<<std::endl;
|
||||
// check consistency of linked list.
|
||||
unsigned int numInList = 0;
|
||||
GLBufferObject* to = _head;
|
||||
@ -427,7 +427,7 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
{
|
||||
if ((to->_next)->_previous != to)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error (to->_next)->_previous != to "<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error (to->_next)->_previous != to "<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -435,7 +435,7 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
{
|
||||
if (_tail != to)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error _trail != to"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error _trail != to"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -446,11 +446,11 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
unsigned int totalNumber = numInList + _orphanedGLBufferObjects.size();
|
||||
if (totalNumber != _numOfGLBufferObjects)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error numInList + _orphanedGLBufferObjects.size() != _numOfGLBufferObjects"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" numInList = "<<numInList<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" _orphanedGLBufferObjects.size() = "<<_orphanedGLBufferObjects.size()<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" _pendingOrphanedGLBufferObjects.size() = "<<_pendingOrphanedGLBufferObjects.size()<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" _numOfGLBufferObjects = "<<_numOfGLBufferObjects<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error numInList + _orphanedGLBufferObjects.size() != _numOfGLBufferObjects"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" numInList = "<<numInList<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" _orphanedGLBufferObjects.size() = "<<_orphanedGLBufferObjects.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" _pendingOrphanedGLBufferObjects.size() = "<<_pendingOrphanedGLBufferObjects.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" _numOfGLBufferObjects = "<<_numOfGLBufferObjects<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -460,7 +460,7 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
|
||||
void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"handlePendingOrphandedGLBufferObjects()"<<_pendingOrphanedGLBufferObjects.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"handlePendingOrphandedGLBufferObjects()"<<_pendingOrphanedGLBufferObjects.size()<<std::endl;
|
||||
|
||||
if (_pendingOrphanedGLBufferObjects.empty()) return;
|
||||
|
||||
@ -477,10 +477,10 @@ void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects()
|
||||
remove(to);
|
||||
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<" HPOTO after _head = "<<_head<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" HPOTO after _tail = "<<_tail<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" HPOTO after to->_previous = "<<to->_previous<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" HPOTO after to->_next = "<<to->_next<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" HPOTO after _head = "<<_head<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" HPOTO after _tail = "<<_tail<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" HPOTO after to->_previous = "<<to->_previous<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" HPOTO after to->_next = "<<to->_next<<std::endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
@ -497,7 +497,7 @@ void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects()
|
||||
|
||||
void GLBufferObjectSet::deleteAllGLBufferObjects()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::deleteAllGLBufferObjects()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::deleteAllGLBufferObjects()"<<std::endl;
|
||||
|
||||
// clean up the pending orphans.
|
||||
handlePendingOrphandedGLBufferObjects();
|
||||
@ -529,12 +529,12 @@ void GLBufferObjectSet::deleteAllGLBufferObjects()
|
||||
// do the actual delete.
|
||||
flushAllDeletedGLBufferObjects();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"done GLBufferObjectSet::deleteAllGLBufferObjects()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"done GLBufferObjectSet::deleteAllGLBufferObjects()"<<std::endl;
|
||||
}
|
||||
|
||||
void GLBufferObjectSet::discardAllGLBufferObjects()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::discardAllGLBufferObjects()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::discardAllGLBufferObjects()"<<std::endl;
|
||||
|
||||
GLBufferObject* to = _head;
|
||||
while(to!=0)
|
||||
@ -589,7 +589,7 @@ void GLBufferObjectSet::flushAllDeletedGLBufferObjects()
|
||||
|
||||
void GLBufferObjectSet::discardAllDeletedGLBufferObjects()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::discardAllDeletedGLBufferObjects()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::discardAllDeletedGLBufferObjects()"<<std::endl;
|
||||
|
||||
// clean up the pending orphans.
|
||||
handlePendingOrphandedGLBufferObjects();
|
||||
@ -639,9 +639,9 @@ void GLBufferObjectSet::flushDeletedGLBufferObjects(double currentTime, double&
|
||||
++numDeleted;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Size before = "<<_orphanedGLBufferObjects.size();
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Size before = "<<_orphanedGLBufferObjects.size();
|
||||
_orphanedGLBufferObjects.erase(_orphanedGLBufferObjects.begin(), itr);
|
||||
//NOTIFY(osg::NOTICE)<<", after = "<<_orphanedGLBufferObjects.size()<<" numDeleted = "<<numDeleted<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<", after = "<<_orphanedGLBufferObjects.size()<<" numDeleted = "<<numDeleted<<std::endl;
|
||||
|
||||
// update the number of TO's in this GLBufferObjectSet
|
||||
_numOfGLBufferObjects -= numDeleted;
|
||||
@ -689,7 +689,7 @@ GLBufferObject* GLBufferObjectSet::takeFromOrphans(BufferObject* bufferObject)
|
||||
// place at back of active list
|
||||
addToBack(glbo.get());
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Reusing orhpahned GLBufferObject, _numOfGLBufferObjects="<<_numOfGLBufferObjects<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Reusing orhpahned GLBufferObject, _numOfGLBufferObjects="<<_numOfGLBufferObjects<<std::endl;
|
||||
|
||||
return glbo.release();
|
||||
}
|
||||
@ -728,11 +728,11 @@ GLBufferObject* GLBufferObjectSet::takeOrGenerate(BufferObject* bufferObject)
|
||||
if (original_BufferObject.valid())
|
||||
{
|
||||
original_BufferObject->setGLBufferObject(_contextID,0);
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObjectSet="<<this<<": Reusing an active GLBufferObject "<<glbo.get()<<" _numOfGLBufferObjects="<<_numOfGLBufferObjects<<" size="<<_profile._size<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet="<<this<<": Reusing an active GLBufferObject "<<glbo.get()<<" _numOfGLBufferObjects="<<_numOfGLBufferObjects<<" size="<<_profile._size<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Reusing a recently orphaned active GLBufferObject "<<glbo.get()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Reusing a recently orphaned active GLBufferObject "<<glbo.get()<<std::endl;
|
||||
}
|
||||
|
||||
moveToBack(glbo.get());
|
||||
@ -756,7 +756,7 @@ GLBufferObject* GLBufferObjectSet::takeOrGenerate(BufferObject* bufferObject)
|
||||
|
||||
addToBack(glbo);
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Created new GLBufferObject, _numOfGLBufferObjects "<<_numOfGLBufferObjects<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Created new GLBufferObject, _numOfGLBufferObjects "<<_numOfGLBufferObjects<<std::endl;
|
||||
|
||||
return glbo;
|
||||
}
|
||||
@ -764,11 +764,11 @@ GLBufferObject* GLBufferObjectSet::takeOrGenerate(BufferObject* bufferObject)
|
||||
void GLBufferObjectSet::moveToBack(GLBufferObject* to)
|
||||
{
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::moveToBack("<<to<<")"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before _head = "<<_head<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before _tail = "<<_tail<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before to->_previous = "<<to->_previous<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before to->_next = "<<to->_next<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::moveToBack("<<to<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before _head = "<<_head<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before _tail = "<<_tail<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before to->_previous = "<<to->_previous<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before to->_next = "<<to->_next<<std::endl;
|
||||
#endif
|
||||
|
||||
to->_frameLastUsed = _parent->getFrameNumber();
|
||||
@ -779,7 +779,7 @@ void GLBufferObjectSet::moveToBack(GLBufferObject* to)
|
||||
// if no tail exists then assign 'to' as tail and head
|
||||
if (_tail==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error ***************** Should not get here !!!!!!!!!"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error ***************** Should not get here !!!!!!!!!"<<std::endl;
|
||||
_head = to;
|
||||
_tail = to;
|
||||
return;
|
||||
@ -787,7 +787,7 @@ void GLBufferObjectSet::moveToBack(GLBufferObject* to)
|
||||
|
||||
if (to->_next==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error ***************** Should not get here either !!!!!!!!!"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error ***************** Should not get here either !!!!!!!!!"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -815,10 +815,10 @@ void GLBufferObjectSet::moveToBack(GLBufferObject* to)
|
||||
_tail = to;
|
||||
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<" m2B after _head = "<<_head<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" m2B after _tail = "<<_tail<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" m2B after to->_previous = "<<to->_previous<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" m2B after to->_next = "<<to->_next<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" m2B after _head = "<<_head<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" m2B after _tail = "<<_tail<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" m2B after to->_previous = "<<to->_previous<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" m2B after to->_next = "<<to->_next<<std::endl;
|
||||
#endif
|
||||
checkConsistency();
|
||||
}
|
||||
@ -826,11 +826,11 @@ void GLBufferObjectSet::moveToBack(GLBufferObject* to)
|
||||
void GLBufferObjectSet::addToBack(GLBufferObject* to)
|
||||
{
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::addToBack("<<to<<")"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before _head = "<<_head<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before _tail = "<<_tail<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before to->_previous = "<<to->_previous<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" before to->_next = "<<to->_next<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::addToBack("<<to<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before _head = "<<_head<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before _tail = "<<_tail<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before to->_previous = "<<to->_previous<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" before to->_next = "<<to->_next<<std::endl;
|
||||
#endif
|
||||
|
||||
if (to->_previous !=0 || to->_next !=0)
|
||||
@ -848,10 +848,10 @@ void GLBufferObjectSet::addToBack(GLBufferObject* to)
|
||||
_tail = to;
|
||||
}
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<" a2B after _head = "<<_head<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" a2B after _tail = "<<_tail<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" a2B after to->_previous = "<<to->_previous<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" a2B after to->_next = "<<to->_next<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" a2B after _head = "<<_head<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" a2B after _tail = "<<_tail<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" a2B after to->_previous = "<<to->_previous<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" a2B after to->_next = "<<to->_next<<std::endl;
|
||||
#endif
|
||||
checkConsistency();
|
||||
}
|
||||
@ -939,7 +939,7 @@ void GLBufferObjectManager::setMaxGLBufferObjectPoolSize(unsigned int size)
|
||||
|
||||
if (size<_currGLBufferObjectPoolSize)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: new MaxGLBufferObjectPoolSize="<<size<<" is smaller than current GLBufferObjectPoolSize="<<_currGLBufferObjectPoolSize<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: new MaxGLBufferObjectPoolSize="<<size<<" is smaller than current GLBufferObjectPoolSize="<<_currGLBufferObjectPoolSize<<std::endl;
|
||||
}
|
||||
|
||||
_maxGLBufferObjectPoolSize = size;
|
||||
@ -965,7 +965,7 @@ GLBufferObject* GLBufferObjectManager::generateGLBufferObject(const BufferObject
|
||||
|
||||
BufferObjectProfile profile(bufferObject->getTarget(), bufferObject->getUsage(), bufferObject->computeRequiredBufferSize());
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"GLBufferObjectManager::generateGLBufferObject size="<<bufferObject->computeRequiredBufferSize()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectManager::generateGLBufferObject size="<<bufferObject->computeRequiredBufferSize()<<std::endl;
|
||||
|
||||
GLBufferObjectSet* glbos = getGLBufferObjectSet(profile);
|
||||
return glbos->takeOrGenerate(const_cast<BufferObject*>(bufferObject));
|
||||
@ -1049,7 +1049,7 @@ void GLBufferObjectManager::releaseGLBufferObject(GLBufferObject* to)
|
||||
if (to->_set) to->_set->orphan(to);
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectManager::releaseGLBufferObject(GLBufferObject* to) Not implemented yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectManager::releaseGLBufferObject(GLBufferObject* to) Not implemented yet"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1065,11 +1065,11 @@ void GLBufferObjectManager::newFrame(osg::FrameStamp* fs)
|
||||
void GLBufferObjectManager::reportStats()
|
||||
{
|
||||
double numFrames(_numFrames==0 ? 1.0 : _numFrames);
|
||||
NOTIFY(osg::NOTICE)<<"GLBufferObjectMananger::reportStats()"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" total _numOfGLBufferObjects="<<_numActiveGLBufferObjects<<", _numOrphanedGLBufferObjects="<<_numOrphanedGLBufferObjects<<" _currGLBufferObjectPoolSize="<<_currGLBufferObjectPoolSize<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" total _numGenerated="<<_numGenerated<<", _generateTime="<<_generateTime<<", averagePerFrame="<<_generateTime/numFrames*1000.0<<"ms"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" total _numDeleted="<<_numDeleted<<", _deleteTime="<<_deleteTime<<", averagePerFrame="<<_deleteTime/numFrames*1000.0<<"ms"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" total _numApplied="<<_numApplied<<", _applyTime="<<_applyTime<<", averagePerFrame="<<_applyTime/numFrames*1000.0<<"ms"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectMananger::reportStats()"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" total _numOfGLBufferObjects="<<_numActiveGLBufferObjects<<", _numOrphanedGLBufferObjects="<<_numOrphanedGLBufferObjects<<" _currGLBufferObjectPoolSize="<<_currGLBufferObjectPoolSize<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" total _numGenerated="<<_numGenerated<<", _generateTime="<<_generateTime<<", averagePerFrame="<<_generateTime/numFrames*1000.0<<"ms"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" total _numDeleted="<<_numDeleted<<", _deleteTime="<<_deleteTime<<", averagePerFrame="<<_deleteTime/numFrames*1000.0<<"ms"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" total _numApplied="<<_numApplied<<", _applyTime="<<_applyTime<<", averagePerFrame="<<_applyTime/numFrames*1000.0<<"ms"<<std::endl;
|
||||
}
|
||||
|
||||
void GLBufferObjectManager::resetStats()
|
||||
@ -1172,7 +1172,7 @@ void BufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
|
||||
void BufferObject::releaseGLObjects(State* state) const
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"BufferObject::releaseGLObjects("<<state<<")"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"BufferObject::releaseGLObjects("<<state<<")"<<std::endl;
|
||||
if (state)
|
||||
{
|
||||
unsigned int contextID = state->getContextID();
|
||||
@ -1188,7 +1188,7 @@ void BufferObject::releaseGLObjects(State* state) const
|
||||
{
|
||||
if (_glBufferObjects[i].valid())
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<" GLBufferObject::releaseGLBufferObject("<<i<<", _glBufferObjects["<<i<<"]="<<_glBufferObjects[i].get()<<")"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" GLBufferObject::releaseGLBufferObject("<<i<<", _glBufferObjects["<<i<<"]="<<_glBufferObjects[i].get()<<")"<<std::endl;
|
||||
GLBufferObject::releaseGLBufferObject(i, _glBufferObjects[i].get());
|
||||
_glBufferObjects[i] = 0;
|
||||
}
|
||||
@ -1212,7 +1212,7 @@ unsigned int BufferObject::addBufferData(BufferData* bd)
|
||||
|
||||
_bufferDataList.push_back(bd);
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"BufferObject "<<this<<":"<<className()<<"::addBufferData("<<bd<<"), bufferIndex= "<<_bufferDataList.size()-1<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"BufferObject "<<this<<":"<<className()<<"::addBufferData("<<bd<<"), bufferIndex= "<<_bufferDataList.size()-1<<std::endl;
|
||||
|
||||
return _bufferDataList.size()-1;
|
||||
}
|
||||
@ -1221,11 +1221,11 @@ void BufferObject::removeBufferData(unsigned int index)
|
||||
{
|
||||
if (index>=_bufferDataList.size())
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Error "<<className()<<"::removeBufferData("<<index<<") out of range."<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Error "<<className()<<"::removeBufferData("<<index<<") out of range."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"BufferObject::"<<this<<":"<<className()<<"::removeBufferData("<<index<<"), size= "<<_bufferDataList.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"BufferObject::"<<this<<":"<<className()<<"::removeBufferData("<<index<<"), size= "<<_bufferDataList.size()<<std::endl;
|
||||
|
||||
// alter the indices of the BufferData after the entry to be removed so their indices are correctly placed.
|
||||
for(unsigned int i=index+1; i<_bufferDataList.size(); ++i)
|
||||
@ -1245,7 +1245,7 @@ void BufferObject::removeBufferData(unsigned int index)
|
||||
|
||||
void BufferObject::removeBufferData(BufferData* bd)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"BufferObject::"<<this<<":"<<className()<<"::removeBufferData("<<bd<<"), index="<<bd->getBufferIndex()<<" size= "<<_bufferDataList.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"BufferObject::"<<this<<":"<<className()<<"::removeBufferData("<<bd<<"), index="<<bd->getBufferIndex()<<" size= "<<_bufferDataList.size()<<std::endl;
|
||||
|
||||
if (!bd || bd->getBufferObject()!=this) return;
|
||||
|
||||
@ -1273,7 +1273,7 @@ void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj)
|
||||
osg::ref_ptr<GLBufferObjectManager>& bufferObjectManager = GLBufferObjectManager::getGLBufferObjectManager(contextID);
|
||||
if (!bufferObjectManager)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning::BufferObject::deleteBufferObject("<<contextID<<", "<<globj<<") unable to get GLBufferObjectManager for context."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning::BufferObject::deleteBufferObject("<<contextID<<", "<<globj<<") unable to get GLBufferObjectManager for context."<<std::endl;
|
||||
return;
|
||||
}
|
||||
osg::ref_ptr<GLBufferObject> glBufferObject = new GLBufferObject(contextID, 0, globj);
|
||||
@ -1281,7 +1281,7 @@ void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj)
|
||||
GLBufferObjectSet* bufferObjectSet = bufferObjectManager->getGLBufferObjectSet(glBufferObject->getProfile());
|
||||
if (!bufferObjectSet)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning::BufferObject::deleteBufferObject("<<contextID<<", "<<globj<<") unable to get GLBufferObjectSet for context."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning::BufferObject::deleteBufferObject("<<contextID<<", "<<globj<<") unable to get GLBufferObjectSet for context."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1412,7 +1412,7 @@ PixelBufferObject::PixelBufferObject(osg::Image* image):
|
||||
setTarget(GL_PIXEL_UNPACK_BUFFER_ARB);
|
||||
setUsage(GL_STREAM_DRAW_ARB);
|
||||
|
||||
NOTIFY(osg::INFO)<<"Constructing PixelBufferObject for image="<<image<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Constructing PixelBufferObject for image="<<image<<std::endl;
|
||||
|
||||
setBufferData(0, image);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ void Camera::DrawCallback::operator () (osg::RenderInfo& renderInfo) const
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Error: Camera::DrawCallback called without valid camera."<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Error: Camera::DrawCallback called without valid camera."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ void Camera::setRenderTargetImplementation(RenderTargetImplementation impl, Rend
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: Camera::setRenderTargetImplementation(impl,fallback) must have a lower rated fallback than the main target implementation."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: Camera::setRenderTargetImplementation(impl,fallback) must have a lower rated fallback than the main target implementation."<<std::endl;
|
||||
setRenderTargetImplementation(impl);
|
||||
}
|
||||
}
|
||||
@ -393,7 +393,7 @@ void Camera::inheritCullSettings(const CullSettings& settings, unsigned int inhe
|
||||
const Camera* camera = dynamic_cast<const Camera*>(&settings);
|
||||
if (camera)
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Inheriting slave Camera"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Inheriting slave Camera"<<std::endl;
|
||||
if (inheritanceMask & CLEAR_COLOR)
|
||||
_clearColor = camera->_clearColor;
|
||||
|
||||
|
@ -95,7 +95,7 @@ static ApplicationUsageProxy ApplicationUsageProxyCullSettings_e1(ApplicationUsa
|
||||
|
||||
void CullSettings::readEnvironmentalVariables()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CullSettings::readEnvironmentalVariables()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CullSettings::readEnvironmentalVariables()"<<std::endl;
|
||||
|
||||
char *ptr;
|
||||
|
||||
@ -105,7 +105,7 @@ void CullSettings::readEnvironmentalVariables()
|
||||
else if (strcmp(ptr,"COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES")==0) _computeNearFar = COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES;
|
||||
else if (strcmp(ptr,"COMPUTE_NEAR_FAR_USING_PRIMITIVES")==0) _computeNearFar = COMPUTE_NEAR_FAR_USING_PRIMITIVES;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Set compute near far mode to "<<_computeNearFar<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Set compute near far mode to "<<_computeNearFar<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ void CullSettings::readEnvironmentalVariables()
|
||||
{
|
||||
_nearFarRatio = osg::asciiToDouble(ptr);
|
||||
|
||||
NOTIFY(osg::INFO)<<"Set near/far ratio to "<<_nearFarRatio<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Set near/far ratio to "<<_nearFarRatio<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
@ -134,7 +134,7 @@ void CullSettings::readCommandLine(ArgumentParser& arguments)
|
||||
else if (str=="COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES") _computeNearFar = COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES;
|
||||
else if (str=="COMPUTE_NEAR_FAR_USING_PRIMITIVES") _computeNearFar = COMPUTE_NEAR_FAR_USING_PRIMITIVES;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Set compute near far mode to "<<_computeNearFar<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Set compute near far mode to "<<_computeNearFar<<std::endl;
|
||||
}
|
||||
|
||||
double value;
|
||||
@ -142,7 +142,7 @@ void CullSettings::readCommandLine(ArgumentParser& arguments)
|
||||
{
|
||||
_nearFarRatio = value;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Set near/far ratio to "<<_nearFarRatio<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Set near/far ratio to "<<_nearFarRatio<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ void GL2Extensions::setupGL2Extensions(unsigned int contextID)
|
||||
const char* version = (const char*) glGetString( GL_VERSION );
|
||||
if (!version)
|
||||
{
|
||||
NOTIFY(osg::FATAL)<<"Error: OpenGL version test failed, requires valid graphics context."<<std::endl;
|
||||
OSG_NOTIFY(osg::FATAL)<<"Error: OpenGL version test failed, requires valid graphics context."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -349,7 +349,7 @@ void GL2Extensions::setupGL2Extensions(unsigned int contextID)
|
||||
_glslLanguageVersion = 1.0f;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)
|
||||
OSG_NOTIFY(osg::INFO)
|
||||
<< "glVersion=" << getGlVersion() << ", "
|
||||
<< "isGlslSupported=" << (isGlslSupported() ? "YES" : "NO") << ", "
|
||||
<< "glslLanguageVersion=" << getLanguageVersion()
|
||||
@ -519,7 +519,7 @@ void GL2Extensions::Set(unsigned int contextID, GL2Extensions* extensions)
|
||||
|
||||
static void NotSupported( const char* funcName )
|
||||
{
|
||||
NOTIFY(osg::WARN)
|
||||
OSG_NOTIFY(osg::WARN)
|
||||
<<"Error: "<<funcName<<" not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
|
@ -142,12 +142,12 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex
|
||||
|
||||
#endif
|
||||
|
||||
NOTIFY(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl;
|
||||
for(ExtensionSet::iterator itr=extensionSet.begin();
|
||||
itr!=extensionSet.end();
|
||||
++itr)
|
||||
{
|
||||
NOTIFY(INFO)<<" "<<*itr<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<" "<<*itr<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
@ -216,16 +216,16 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex
|
||||
{
|
||||
if (!extensionDisabled)
|
||||
{
|
||||
NOTIFY(INFO)<<"OpenGL extension '"<<extension<<"' is supported."<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL extension '"<<extension<<"' is supported."<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(INFO)<<"OpenGL extension '"<<extension<<"' is supported by OpenGL\ndriver but has been disabled by osg::getGLExtensionDisableString()."<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL extension '"<<extension<<"' is supported by OpenGL\ndriver but has been disabled by osg::getGLExtensionDisableString()."<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(INFO)<<"OpenGL extension '"<<extension<<"' is not supported."<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL extension '"<<extension<<"' is not supported."<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -274,12 +274,12 @@ std::string& osg::getGLExtensionDisableString()
|
||||
}
|
||||
if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord));
|
||||
|
||||
NOTIFY(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl;
|
||||
for(ExtensionSet::iterator itr=extensionSet.begin();
|
||||
itr!=extensionSet.end();
|
||||
++itr)
|
||||
{
|
||||
NOTIFY(INFO)<<" "<<*itr<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<" "<<*itr<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
@ -289,11 +289,11 @@ std::string& osg::getGLExtensionDisableString()
|
||||
|
||||
if (result)
|
||||
{
|
||||
NOTIFY(INFO)<<"OpenGL utility library extension '"<<extension<<"' is supported."<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL utility library extension '"<<extension<<"' is supported."<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(INFO)<<"OpenGL utility library extension '"<<extension<<"' is not supported."<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"OpenGL utility library extension '"<<extension<<"' is not supported."<<std::endl;
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -333,7 +333,7 @@ std::string& osg::getGLExtensionDisableString()
|
||||
|
||||
void* osg::getGLExtensionFuncPtr(const char *funcName)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"osg::getGLExtensionFuncPtr("<<funcName<<")"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"osg::getGLExtensionFuncPtr("<<funcName<<")"<<std::endl;
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
|
@ -55,13 +55,13 @@ void GraphicsContext::setWindowingSystemInterface(WindowingSystemInterface* call
|
||||
{
|
||||
ref_ptr<GraphicsContext::WindowingSystemInterface> &wsref = windowingSystemInterfaceRef();
|
||||
wsref = callback;
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::setWindowingSystemInterface() "<<wsref.get()<<"\t"<<&wsref<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::setWindowingSystemInterface() "<<wsref.get()<<"\t"<<&wsref<<std::endl;
|
||||
}
|
||||
|
||||
GraphicsContext::WindowingSystemInterface* GraphicsContext::getWindowingSystemInterface()
|
||||
{
|
||||
ref_ptr<GraphicsContext::WindowingSystemInterface> &wsref = windowingSystemInterfaceRef();
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::getWindowingSystemInterface() "<<wsref.get()<<"\t"<<&wsref<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::getWindowingSystemInterface() "<<wsref.get()<<"\t"<<&wsref<<std::endl;
|
||||
return wsref.get();
|
||||
}
|
||||
|
||||
@ -148,9 +148,9 @@ void GraphicsContext::ScreenIdentifier::setScreenIdentifier(const std::string& d
|
||||
}
|
||||
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<" hostName ["<<hostName<<"]"<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" displayNum "<<displayNum<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" screenNum "<<screenNum<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" hostName ["<<hostName<<"]"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" displayNum "<<displayNum<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" screenNum "<<screenNum<<std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -226,11 +226,11 @@ public:
|
||||
{
|
||||
--_numContexts;
|
||||
|
||||
NOTIFY(osg::INFO)<<"decrementUsageCount()"<<_numContexts<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"decrementUsageCount()"<<_numContexts<<std::endl;
|
||||
|
||||
if (_numContexts <= 1 && _compileContext.valid())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"resetting compileContext "<<_compileContext.get()<<" refCount "<<_compileContext->referenceCount()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"resetting compileContext "<<_compileContext.get()<<" refCount "<<_compileContext->referenceCount()<<std::endl;
|
||||
|
||||
_compileContext = 0;
|
||||
}
|
||||
@ -261,7 +261,7 @@ unsigned int GraphicsContext::createNewContextID()
|
||||
// reuse contextID;
|
||||
itr->second._numContexts = 1;
|
||||
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::createNewContextID() reusing contextID="<<itr->first<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::createNewContextID() reusing contextID="<<itr->first<<std::endl;
|
||||
|
||||
return itr->first;
|
||||
}
|
||||
@ -270,8 +270,8 @@ unsigned int GraphicsContext::createNewContextID()
|
||||
unsigned int contextID = s_contextIDMap.size();
|
||||
s_contextIDMap[contextID]._numContexts = 1;
|
||||
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::createNewContextID() creating contextID="<<contextID<<std::endl;
|
||||
NOTIFY(osg::INFO)<<"Updating the MaxNumberOfGraphicsContexts to "<<contextID+1<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::createNewContextID() creating contextID="<<contextID<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Updating the MaxNumberOfGraphicsContexts to "<<contextID+1<<std::endl;
|
||||
|
||||
// update the the maximum number of graphics contexts,
|
||||
// to ensure that texture objects and display buffers are configured to the correct size.
|
||||
@ -298,7 +298,7 @@ void GraphicsContext::incrementContextIDUsageCount(unsigned int contextID)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_contextIDMapMutex);
|
||||
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::incrementContextIDUsageCount("<<contextID<<") to "<<s_contextIDMap[contextID]._numContexts<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::incrementContextIDUsageCount("<<contextID<<") to "<<s_contextIDMap[contextID]._numContexts<<std::endl;
|
||||
|
||||
s_contextIDMap[contextID].incrementUsageCount();
|
||||
}
|
||||
@ -314,17 +314,17 @@ void GraphicsContext::decrementContextIDUsageCount(unsigned int contextID)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: decrementContextIDUsageCount("<<contextID<<") called on expired contextID."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: decrementContextIDUsageCount("<<contextID<<") called on expired contextID."<<std::endl;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::decrementContextIDUsageCount("<<contextID<<") to "<<s_contextIDMap[contextID]._numContexts<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::decrementContextIDUsageCount("<<contextID<<") to "<<s_contextIDMap[contextID]._numContexts<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GraphicsContext::registerGraphicsContext(GraphicsContext* gc)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::registerGraphicsContext "<<gc<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::registerGraphicsContext "<<gc<<std::endl;
|
||||
|
||||
if (!gc) return;
|
||||
|
||||
@ -338,7 +338,7 @@ void GraphicsContext::registerGraphicsContext(GraphicsContext* gc)
|
||||
|
||||
void GraphicsContext::unregisterGraphicsContext(GraphicsContext* gc)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::unregisterGraphicsContext "<<gc<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::unregisterGraphicsContext "<<gc<<std::endl;
|
||||
|
||||
if (!gc) return;
|
||||
|
||||
@ -350,7 +350,7 @@ void GraphicsContext::unregisterGraphicsContext(GraphicsContext* gc)
|
||||
|
||||
GraphicsContext::GraphicsContexts GraphicsContext::getAllRegisteredGraphicsContexts()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::getAllRegisteredGraphicsContexts s_registeredContexts.size()="<<s_registeredContexts.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::getAllRegisteredGraphicsContexts s_registeredContexts.size()="<<s_registeredContexts.size()<<std::endl;
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_contextIDMapMutex);
|
||||
return s_registeredContexts;
|
||||
}
|
||||
@ -368,14 +368,14 @@ GraphicsContext::GraphicsContexts GraphicsContext::getRegisteredGraphicsContexts
|
||||
if (gc->getState() && gc->getState()->getContextID()==contextID) contexts.push_back(gc);
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"GraphicsContext::getRegisteredGraphicsContexts "<<contextID<<" contexts.size()="<<contexts.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GraphicsContext::getRegisteredGraphicsContexts "<<contextID<<" contexts.size()="<<contexts.size()<<std::endl;
|
||||
|
||||
return contexts;
|
||||
}
|
||||
|
||||
GraphicsContext* GraphicsContext::getOrCreateCompileContext(unsigned int contextID)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsContext::createCompileContext."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsContext::createCompileContext."<<std::endl;
|
||||
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_contextIDMapMutex);
|
||||
@ -407,7 +407,7 @@ GraphicsContext* GraphicsContext::getOrCreateCompileContext(unsigned int context
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_contextIDMapMutex);
|
||||
s_contextIDMap[contextID]._compileContext = gc;
|
||||
NOTIFY(osg::NOTICE)<<" succeeded GraphicsContext::createCompileContext."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" succeeded GraphicsContext::createCompileContext."<<std::endl;
|
||||
return gc.release();
|
||||
}
|
||||
else
|
||||
@ -425,7 +425,7 @@ void GraphicsContext::setCompileContext(unsigned int contextID, GraphicsContext*
|
||||
|
||||
GraphicsContext* GraphicsContext::getCompileContext(unsigned int contextID)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"GraphicsContext::getCompileContext "<<contextID<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GraphicsContext::getCompileContext "<<contextID<<std::endl;
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_contextIDMapMutex);
|
||||
ContextIDMap::iterator itr = s_contextIDMap.find(contextID);
|
||||
if (itr != s_contextIDMap.end()) return itr->second._compileContext.get();
|
||||
@ -496,7 +496,7 @@ bool GraphicsContext::realize()
|
||||
|
||||
void GraphicsContext::close(bool callCloseImplementation)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"close("<<callCloseImplementation<<")"<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"close("<<callCloseImplementation<<")"<<this<<std::endl;
|
||||
|
||||
// switch off the graphics thread...
|
||||
setGraphicsThread(0);
|
||||
@ -518,7 +518,7 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
Camera* camera = (*itr);
|
||||
if (camera)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Releasing GL objects for Camera="<<camera<<" _state="<<_state.get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Releasing GL objects for Camera="<<camera<<" _state="<<_state.get()<<std::endl;
|
||||
camera->releaseGLObjects(_state.get());
|
||||
}
|
||||
}
|
||||
@ -526,16 +526,16 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
|
||||
if (callCloseImplementation && _state.valid() && isRealized())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Closing still viable window "<<sharedContextExists<<" _state->getContextID()="<<_state->getContextID()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Closing still viable window "<<sharedContextExists<<" _state->getContextID()="<<_state->getContextID()<<std::endl;
|
||||
|
||||
if (makeCurrent())
|
||||
{
|
||||
|
||||
NOTIFY(osg::INFO)<<"Doing delete of GL objects"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing delete of GL objects"<<std::endl;
|
||||
|
||||
osg::deleteAllGLObjects(_state->getContextID());
|
||||
|
||||
NOTIFY(osg::INFO)<<"Done delete of GL objects"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Done delete of GL objects"<<std::endl;
|
||||
|
||||
_state->reset();
|
||||
|
||||
@ -543,7 +543,7 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"makeCurrent did not succeed, could not do flush/deletion of OpenGL objects."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"makeCurrent did not succeed, could not do flush/deletion of OpenGL objects."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
// does not work.
|
||||
if (_state.valid())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing discard of deleted OpenGL objects."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing discard of deleted OpenGL objects."<<std::endl;
|
||||
|
||||
osg::discardAllGLObjects(_state->getContextID());
|
||||
}
|
||||
@ -661,7 +661,7 @@ void GraphicsContext::setGraphicsThread(GraphicsThread* gt)
|
||||
|
||||
void GraphicsContext::add(Operation* operation)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing add"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing add"<<std::endl;
|
||||
|
||||
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
@ -674,7 +674,7 @@ void GraphicsContext::add(Operation* operation)
|
||||
|
||||
void GraphicsContext::remove(Operation* operation)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing remove operation"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing remove operation"<<std::endl;
|
||||
|
||||
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
@ -694,7 +694,7 @@ void GraphicsContext::remove(Operation* operation)
|
||||
|
||||
void GraphicsContext::remove(const std::string& name)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing remove named operation"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing remove named operation"<<std::endl;
|
||||
|
||||
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
@ -715,7 +715,7 @@ void GraphicsContext::remove(const std::string& name)
|
||||
|
||||
void GraphicsContext::removeAllOperations()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing remove all operations"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing remove all operations"<<std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
_operations.clear();
|
||||
@ -775,7 +775,7 @@ void GraphicsContext::runOperations()
|
||||
|
||||
if (_currentOperation.valid())
|
||||
{
|
||||
// NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
|
||||
|
||||
// call the graphics operation.
|
||||
(*_currentOperation)(this);
|
||||
|
@ -76,22 +76,22 @@ ref_ptr<Operation> OperationQueue::getNextOperation(bool blockIfEmpty)
|
||||
|
||||
if (!currentOperation->getKeep())
|
||||
{
|
||||
// NOTIFY(osg::INFO)<<"removing "<<currentOperation->getName()<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"removing "<<currentOperation->getName()<<std::endl;
|
||||
|
||||
// remove it from the operations queue
|
||||
_currentOperationIterator = _operations.erase(_currentOperationIterator);
|
||||
|
||||
// NOTIFY(osg::INFO)<<"size "<<_operations.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"size "<<_operations.size()<<std::endl;
|
||||
|
||||
if (_operations.empty())
|
||||
{
|
||||
// NOTIFY(osg::INFO)<<"setting block "<<_operations.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"setting block "<<_operations.size()<<std::endl;
|
||||
_operationsBlock->set(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::INFO)<<"increment "<<_currentOperation->getName()<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"increment "<<_currentOperation->getName()<<std::endl;
|
||||
|
||||
// move on to the next operation in the list.
|
||||
++_currentOperationIterator;
|
||||
@ -102,7 +102,7 @@ ref_ptr<Operation> OperationQueue::getNextOperation(bool blockIfEmpty)
|
||||
|
||||
void OperationQueue::add(Operation* operation)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing add"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing add"<<std::endl;
|
||||
|
||||
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
@ -115,7 +115,7 @@ void OperationQueue::add(Operation* operation)
|
||||
|
||||
void OperationQueue::remove(Operation* operation)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing remove operation"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing remove operation"<<std::endl;
|
||||
|
||||
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
@ -138,7 +138,7 @@ void OperationQueue::remove(Operation* operation)
|
||||
|
||||
void OperationQueue::remove(const std::string& name)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing remove named operation"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing remove named operation"<<std::endl;
|
||||
|
||||
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
@ -166,7 +166,7 @@ void OperationQueue::remove(const std::string& name)
|
||||
|
||||
void OperationQueue::removeAllOperations()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing remove all operations"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing remove all operations"<<std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
|
||||
|
||||
@ -203,7 +203,7 @@ void OperationQueue::runOperations(Object* callingObject)
|
||||
++_currentOperationIterator;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
|
||||
|
||||
// call the graphics operation.
|
||||
(*operation)(callingObject);
|
||||
@ -258,11 +258,11 @@ OperationThread::OperationThread():
|
||||
|
||||
OperationThread::~OperationThread()
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Destructing graphics thread "<<this<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Destructing graphics thread "<<this<<std::endl;
|
||||
|
||||
cancel();
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"Done Destructing graphics thread "<<this<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Done Destructing graphics thread "<<this<<std::endl;
|
||||
}
|
||||
|
||||
void OperationThread::setOperationQueue(OperationQueue* opq)
|
||||
@ -286,13 +286,13 @@ void OperationThread::setDone(bool done)
|
||||
|
||||
if (done)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"set done "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"set done "<<this<<std::endl;
|
||||
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_threadMutex);
|
||||
if (_currentOperation.valid())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"releasing "<<_currentOperation.get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"releasing "<<_currentOperation.get()<<std::endl;
|
||||
_currentOperation->release();
|
||||
}
|
||||
}
|
||||
@ -303,7 +303,7 @@ void OperationThread::setDone(bool done)
|
||||
|
||||
int OperationThread::cancel()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Cancelling OperationThread "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Cancelling OperationThread "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
|
||||
int result = 0;
|
||||
if( isRunning() )
|
||||
@ -311,7 +311,7 @@ int OperationThread::cancel()
|
||||
|
||||
_done = true;
|
||||
|
||||
NOTIFY(osg::INFO)<<" Doing cancel "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" Doing cancel "<<this<<std::endl;
|
||||
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_threadMutex);
|
||||
@ -343,13 +343,13 @@ int OperationThread::cancel()
|
||||
}
|
||||
#endif
|
||||
// commenting out debug info as it was cashing crash on exit, presumable
|
||||
// due to NOTIFY or std::cout destructing earlier than this destructor.
|
||||
NOTIFY(osg::DEBUG_INFO)<<" Waiting for OperationThread to cancel "<<this<<std::endl;
|
||||
// due to OSG_NOTIFY or std::cout destructing earlier than this destructor.
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<" Waiting for OperationThread to cancel "<<this<<std::endl;
|
||||
OpenThreads::Thread::YieldCurrentThread();
|
||||
}
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<" OperationThread::cancel() thread cancelled "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" OperationThread::cancel() thread cancelled "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -381,13 +381,13 @@ void OperationThread::removeAllOperations()
|
||||
|
||||
void OperationThread::run()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing run "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing run "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
|
||||
bool firstTime = true;
|
||||
|
||||
do
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"In thread loop "<<this<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"In thread loop "<<this<<std::endl;
|
||||
ref_ptr<Operation> operation;
|
||||
ref_ptr<OperationQueue> operationQueue;
|
||||
|
||||
@ -407,7 +407,7 @@ void OperationThread::run()
|
||||
_currentOperation = operation;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
|
||||
|
||||
// call the graphics operation.
|
||||
(*operation)(_parent.get());
|
||||
@ -426,10 +426,10 @@ void OperationThread::run()
|
||||
firstTime = false;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"operations.size()="<<_operations.size()<<" done="<<_done<<" testCancel()"<<testCancel()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"operations.size()="<<_operations.size()<<" done="<<_done<<" testCancel()"<<testCancel()<<std::endl;
|
||||
|
||||
} while (!testCancel() && !_done);
|
||||
|
||||
NOTIFY(osg::INFO)<<"exit loop "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"exit loop "<<this<<" isRunning()="<<isRunning()<<std::endl;
|
||||
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ State::~State()
|
||||
|
||||
//_vertexAttribArrayList.clear();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"State::~State()"<<this<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"State::~State()"<<this<<std::endl;
|
||||
for(AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.begin();
|
||||
itr != _appliedProgramObjectSet.end();
|
||||
++itr)
|
||||
@ -173,7 +173,7 @@ void State::objectDeleted(void* object)
|
||||
AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.find(ppcp);
|
||||
if (itr != _appliedProgramObjectSet.end())
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Removing _appliedProgramObjectSet entry "<<ppcp<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Removing _appliedProgramObjectSet entry "<<ppcp<<std::endl;
|
||||
_appliedProgramObjectSet.erase(itr);
|
||||
}
|
||||
}
|
||||
@ -293,14 +293,14 @@ void State::setMaxTexturePoolSize(unsigned int size)
|
||||
{
|
||||
_maxTexturePoolSize = size;
|
||||
osg::Texture::getTextureObjectManager(getContextID())->setMaxTexturePoolSize(size);
|
||||
NOTIFY(osg::INFO)<<"osg::State::_maxTexturePoolSize="<<_maxTexturePoolSize<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"osg::State::_maxTexturePoolSize="<<_maxTexturePoolSize<<std::endl;
|
||||
}
|
||||
|
||||
void State::setMaxBufferObjectPoolSize(unsigned int size)
|
||||
{
|
||||
_maxBufferObjectPoolSize = size;
|
||||
osg::GLBufferObjectManager::getGLBufferObjectManager(getContextID())->setMaxGLBufferObjectPoolSize(_maxBufferObjectPoolSize);
|
||||
NOTIFY(osg::INFO)<<"osg::State::_maxBufferObjectPoolSize="<<_maxBufferObjectPoolSize<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"osg::State::_maxBufferObjectPoolSize="<<_maxBufferObjectPoolSize<<std::endl;
|
||||
}
|
||||
|
||||
void State::pushStateSet(const StateSet* dstate)
|
||||
@ -332,12 +332,12 @@ void State::pushStateSet(const StateSet* dstate)
|
||||
pushUniformList(_uniformMap,dstate->getUniformList());
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"State::pushStateSet()"<<_stateStateStack.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"State::pushStateSet()"<<_stateStateStack.size()<<std::endl;
|
||||
}
|
||||
|
||||
void State::popAllStateSets()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"State::popAllStateSets()"<<_stateStateStack.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"State::popAllStateSets()"<<_stateStateStack.size()<<std::endl;
|
||||
|
||||
while (!_stateStateStack.empty()) popStateSet();
|
||||
|
||||
@ -349,7 +349,7 @@ void State::popAllStateSets()
|
||||
|
||||
void State::popStateSet()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"State::popStateSet()"<<_stateStateStack.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"State::popStateSet()"<<_stateStateStack.size()<<std::endl;
|
||||
|
||||
if (_stateStateStack.empty()) return;
|
||||
|
||||
@ -414,7 +414,7 @@ void State::removeStateSet(unsigned int pos)
|
||||
{
|
||||
if (pos >= _stateStateStack.size())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: State::removeStateSet("<<pos<<") out of range"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: State::removeStateSet("<<pos<<") out of range"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -784,7 +784,7 @@ void State::setInterleavedArrays( GLenum format, GLsizei stride, const GLvoid* p
|
||||
#if defined(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE)
|
||||
glInterleavedArrays( format, stride, pointer);
|
||||
#else
|
||||
NOTIFY(osg::NOTICE)<<"Warning: State::setInterleavedArrays(..) not implemented."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: State::setInterleavedArrays(..) not implemented."<<std::endl;
|
||||
#endif
|
||||
|
||||
// the crude way, assume that all arrays have been effected so dirty them and
|
||||
@ -921,7 +921,7 @@ void State::setVertexAttribPointer( unsigned int index,
|
||||
{
|
||||
if (_glVertexAttribPointer)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"State::setVertexAttribPointer("<<index<<",...)"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"State::setVertexAttribPointer("<<index<<",...)"<<std::endl;
|
||||
|
||||
if ( index >= _vertexAttribArrayList.size()) _vertexAttribArrayList.resize(index+1);
|
||||
EnabledArrayPair& eap = _vertexAttribArrayList[index];
|
||||
@ -929,12 +929,12 @@ void State::setVertexAttribPointer( unsigned int index,
|
||||
if (!eap._enabled || eap._dirty)
|
||||
{
|
||||
eap._enabled = true;
|
||||
// NOTIFY(osg::NOTICE)<<" _glEnableVertexAttribArray( "<<index<<" )"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" _glEnableVertexAttribArray( "<<index<<" )"<<std::endl;
|
||||
_glEnableVertexAttribArray( index );
|
||||
}
|
||||
//if (eap._pointer != ptr || eap._normalized!=normalized || eap._dirty)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<" _glVertexAttribPointer( "<<index<<" )"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" _glVertexAttribPointer( "<<index<<" )"<<std::endl;
|
||||
_glVertexAttribPointer( index, size, type, normalized, stride, ptr );
|
||||
eap._pointer = ptr;
|
||||
eap._normalized = normalized;
|
||||
@ -957,7 +957,7 @@ void State::disableVertexAttribPointer( unsigned int index )
|
||||
{
|
||||
eap._enabled = false;
|
||||
eap._dirty = false;
|
||||
// NOTIFY(osg::NOTICE)<<" _glDisableVertexAttribArray( "<<index<<" )"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" _glDisableVertexAttribArray( "<<index<<" )"<<std::endl;
|
||||
_glDisableVertexAttribArray( index );
|
||||
}
|
||||
}
|
||||
@ -974,7 +974,7 @@ void State::disableVertexAttribPointersAboveAndIncluding( unsigned int index )
|
||||
{
|
||||
eap._enabled = false;
|
||||
eap._dirty = false;
|
||||
// NOTIFY(osg::NOTICE)<<" State::disableVertexAttribPointersAboveAndIncluding(): _glDisableVertexAttribArray( "<<index<<" )"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" State::disableVertexAttribPointersAboveAndIncluding(): _glDisableVertexAttribArray( "<<index<<" )"<<std::endl;
|
||||
_glDisableVertexAttribArray( index );
|
||||
}
|
||||
++index;
|
||||
@ -984,7 +984,7 @@ void State::disableVertexAttribPointersAboveAndIncluding( unsigned int index )
|
||||
|
||||
void State::lazyDisablingOfVertexAttributes()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"lazyDisablingOfVertexAttributes()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"lazyDisablingOfVertexAttributes()"<<std::endl;
|
||||
if (!_useVertexAttributeAliasing)
|
||||
{
|
||||
_vertexArray._lazy_disable = true;
|
||||
@ -1010,7 +1010,7 @@ void State::lazyDisablingOfVertexAttributes()
|
||||
|
||||
void State::applyDisablingOfVertexAttributes()
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"start of applyDisablingOfVertexAttributes()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"start of applyDisablingOfVertexAttributes()"<<std::endl;
|
||||
if (!_useVertexAttributeAliasing)
|
||||
{
|
||||
if (_vertexArray._lazy_disable) disableVertexPointer();
|
||||
@ -1027,7 +1027,7 @@ void State::applyDisablingOfVertexAttributes()
|
||||
{
|
||||
if (_vertexAttribArrayList[i]._lazy_disable) disableVertexAttribPointer(i);
|
||||
}
|
||||
// NOTIFY(osg::NOTICE)<<"end of applyDisablingOfVertexAttributes()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"end of applyDisablingOfVertexAttributes()"<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -1061,39 +1061,39 @@ bool State::checkGLErrors(const char* str) const
|
||||
const char* error = (char*)gluErrorString(errorNo);
|
||||
if (error)
|
||||
{
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error '" << error<<"'";
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error '" << error<<"'";
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec;
|
||||
}
|
||||
#else
|
||||
switch(errorNo)
|
||||
{
|
||||
case(GL_INVALID_ENUM):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM";
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM";
|
||||
break;
|
||||
case(GL_INVALID_VALUE):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE";
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE";
|
||||
break;
|
||||
case(GL_INVALID_OPERATION):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION";
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION";
|
||||
break;
|
||||
case(GL_OUT_OF_MEMORY):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY";
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY";
|
||||
break;
|
||||
default:
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (str)
|
||||
{
|
||||
NOTIFY(WARN)<<" at "<<str<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<" at "<<str<< std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(WARN)<<" in osg::State."<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<" in osg::State."<< std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1110,29 +1110,29 @@ bool State::checkGLErrors(StateAttribute::GLMode mode) const
|
||||
const char* error = (char*)gluErrorString(errorNo);
|
||||
if (error)
|
||||
{
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
}
|
||||
#else
|
||||
switch(errorNo)
|
||||
{
|
||||
case(GL_INVALID_ENUM):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
break;
|
||||
case(GL_INVALID_VALUE):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
break;
|
||||
case(GL_INVALID_OPERATION):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
break;
|
||||
case(GL_OUT_OF_MEMORY):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
break;
|
||||
default:
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@ -1150,29 +1150,29 @@ bool State::checkGLErrors(const StateAttribute* attribute) const
|
||||
const char* error = (char*)gluErrorString(errorNo);
|
||||
if (error)
|
||||
{
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
}
|
||||
#else
|
||||
switch(errorNo)
|
||||
{
|
||||
case(GL_INVALID_ENUM):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_ENUM after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
break;
|
||||
case(GL_INVALID_VALUE):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_VALUE after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
break;
|
||||
case(GL_INVALID_OPERATION):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_INVALID_OPERATION after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
break;
|
||||
case(GL_OUT_OF_MEMORY):
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error GL_OUT_OF_MEMORY after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
break;
|
||||
default:
|
||||
NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
OSG_NOTIFY(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@ -1231,9 +1231,9 @@ namespace State_Utils
|
||||
|
||||
bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"State::convertShaderSourceToOsgBuiltIns()"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"State::convertShaderSourceToOsgBuiltIns()"<<std::endl;
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"++Before Converted source "<<std::endl<<source<<std::endl<<"++++++++"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"++Before Converted source "<<std::endl<<source<<std::endl<<"++++++++"<<std::endl;
|
||||
|
||||
// replace ftransform as it only works with built-ins
|
||||
State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex");
|
||||
@ -1259,7 +1259,7 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
|
||||
State_Utils::replaceAndInsertDeclaration(source, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"-------- Converted source "<<std::endl<<source<<std::endl<<"----------------"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"-------- Converted source "<<std::endl<<source<<std::endl<<"----------------"<<std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1344,7 +1344,7 @@ void State::updateModelViewAndProjectionMatrixUniforms()
|
||||
|
||||
void State::drawQuads(GLint first, GLsizei count, GLsizei primCount)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"State::drawQuads("<<first<<", "<<count<<")"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"State::drawQuads("<<first<<", "<<count<<")"<<std::endl;
|
||||
|
||||
unsigned int array = first % 4;
|
||||
unsigned int offsetFirst = ((first-array) / 4) * 6;
|
||||
@ -1354,7 +1354,7 @@ void State::drawQuads(GLint first, GLsizei count, GLsizei primCount)
|
||||
Indices& indices = _quadIndices[array];
|
||||
if (endOfIndices>65536)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: State::drawQuads("<<first<<", "<<count<<") too large handle in remapping to ushort glDrawElements."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: State::drawQuads("<<first<<", "<<count<<") too large handle in remapping to ushort glDrawElements."<<std::endl;
|
||||
endOfIndices = 65536;
|
||||
}
|
||||
|
||||
@ -1375,13 +1375,13 @@ void State::drawQuads(GLint first, GLsizei count, GLsizei primCount)
|
||||
indices.push_back(base+2);
|
||||
indices.push_back(base+3);
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" adding quad indices ("<<base<<")"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" adding quad indices ("<<base<<")"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// if (array!=0) return;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" glDrawElements(GL_TRIANGLES, "<<numIndices<<", GL_UNSIGNED_SHORT, "<<&(indices[base])<<")"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" glDrawElements(GL_TRIANGLES, "<<numIndices<<", GL_UNSIGNED_SHORT, "<<&(indices[base])<<")"<<std::endl;
|
||||
glDrawElementsInstanced(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, &(indices[offsetFirst]), primCount);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ using namespace osg;
|
||||
View::View():
|
||||
Object(true)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Constructing osg::View"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Constructing osg::View"<<std::endl;
|
||||
|
||||
setLightingMode(HEADLIGHT);
|
||||
|
||||
@ -52,7 +52,7 @@ View::View(const osg::View& view, const osg::CopyOp& copyop):
|
||||
|
||||
View::~View()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Destructing osg::View"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Destructing osg::View"<<std::endl;
|
||||
|
||||
if (_camera.valid())
|
||||
{
|
||||
@ -82,7 +82,7 @@ View::~View()
|
||||
}
|
||||
#endif
|
||||
|
||||
NOTIFY(osg::INFO)<<"Done destructing osg::View"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Done destructing osg::View"<<std::endl;
|
||||
}
|
||||
|
||||
void View::take(osg::View& rhs)
|
||||
|
@ -186,11 +186,11 @@ public:
|
||||
compileStateSet = true;
|
||||
if (osg::getNotifyLevel() >= osg::DEBUG_INFO)
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO)
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)
|
||||
<<"Found compilable texture " << texture << " ";
|
||||
osg::Image* image = texture->getImage(0);
|
||||
if (image) NOTIFY(osg::DEBUG_INFO) << image->getFileName();
|
||||
NOTIFY(osg::DEBUG_INFO) << std:: endl;
|
||||
if (image) OSG_NOTIFY(osg::DEBUG_INFO) << image->getFileName();
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << std:: endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -217,7 +217,7 @@ public:
|
||||
{
|
||||
case DatabasePager::DO_NOT_MODIFY_DRAWABLE_SETTINGS:
|
||||
// do nothing, leave settings as they came in from loaded database.
|
||||
// NOTIFY(osg::NOTICE)<<"DO_NOT_MODIFY_DRAWABLE_SETTINGS"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"DO_NOT_MODIFY_DRAWABLE_SETTINGS"<<std::endl;
|
||||
break;
|
||||
case DatabasePager::USE_DISPLAY_LISTS:
|
||||
drawable->setUseDisplayList(true);
|
||||
@ -226,12 +226,12 @@ public:
|
||||
case DatabasePager::USE_VERTEX_BUFFER_OBJECTS:
|
||||
drawable->setUseDisplayList(true);
|
||||
drawable->setUseVertexBufferObjects(true);
|
||||
// NOTIFY(osg::NOTICE)<<"USE_VERTEX_BUFFER_OBJECTS"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"USE_VERTEX_BUFFER_OBJECTS"<<std::endl;
|
||||
break;
|
||||
case DatabasePager::USE_VERTEX_ARRAYS:
|
||||
drawable->setUseDisplayList(false);
|
||||
drawable->setUseVertexBufferObjects(false);
|
||||
// NOTIFY(osg::NOTICE)<<"USE_VERTEX_ARRAYS"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"USE_VERTEX_ARRAYS"<<std::endl;
|
||||
break;
|
||||
}
|
||||
// Don't compile if already compiled. This can happen if the
|
||||
@ -283,7 +283,7 @@ struct DatabasePager::SortFileRequestFunctor
|
||||
//
|
||||
void DatabasePager::DatabaseRequest::invalidate()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" DatabasePager::DatabaseRequest::invalidate()."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" DatabasePager::DatabaseRequest::invalidate()."<<std::endl;
|
||||
_valid = false;
|
||||
_groupForAddingLoadedSubgraph = 0;
|
||||
_loadedModel = 0;
|
||||
@ -293,7 +293,7 @@ void DatabasePager::DatabaseRequest::invalidate()
|
||||
|
||||
DatabasePager::RequestQueue::~RequestQueue()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DatabasePager::RequestQueue::~RequestQueue() Destructing queue."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DatabasePager::RequestQueue::~RequestQueue() Destructing queue."<<std::endl;
|
||||
for(RequestList::iterator itr = _requestList.begin();
|
||||
itr != _requestList.end();
|
||||
++itr)
|
||||
@ -443,8 +443,8 @@ int DatabasePager::DatabaseThread::cancel()
|
||||
while(isRunning())
|
||||
{
|
||||
// commenting out debug info as it was cashing crash on exit, presumable
|
||||
// due to NOTIFY or std::cout destructing earlier than this destructor.
|
||||
// NOTIFY(osg::DEBUG_INFO)<<"Waiting for DatabasePager to cancel"<<std::endl;
|
||||
// due to OSG_NOTIFY or std::cout destructing earlier than this destructor.
|
||||
// OSG_NOTIFY(osg::DEBUG_INFO)<<"Waiting for DatabasePager to cancel"<<std::endl;
|
||||
OpenThreads::Thread::YieldCurrentThread();
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ int DatabasePager::DatabaseThread::cancel()
|
||||
|
||||
void DatabasePager::DatabaseThread::run()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<_name<<": DatabasePager::DatabaseThread::run"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<_name<<": DatabasePager::DatabaseThread::run"<<std::endl;
|
||||
|
||||
#if 1
|
||||
// need to set the texture object manager to be able to reuse textures
|
||||
@ -501,7 +501,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
_active = true;
|
||||
|
||||
NOTIFY(osg::INFO)<<_name<<": _pager->_requestList.size()= "<<read_queue->_requestList.size()<<" to delete = "<<read_queue->_childrenToDeleteList.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<_name<<": _pager->_requestList.size()= "<<read_queue->_requestList.size()<<" to delete = "<<read_queue->_childrenToDeleteList.size()<<std::endl;
|
||||
|
||||
|
||||
//
|
||||
@ -582,7 +582,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<_name<<": Passing http requests over "<<databaseRequest->_fileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<_name<<": Passing http requests over "<<databaseRequest->_fileName<<std::endl;
|
||||
out_queue->add(databaseRequest.get());
|
||||
databaseRequest = 0;
|
||||
}
|
||||
@ -608,7 +608,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
// load the data, note safe to write to the databaseRequest since once
|
||||
// it is created this thread is the only one to write to the _loadedModel pointer.
|
||||
//NOTIFY(osg::NOTICE)<<"In DatabasePager thread readNodeFile("<<databaseRequest->_fileName<<")"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"In DatabasePager thread readNodeFile("<<databaseRequest->_fileName<<")"<<std::endl;
|
||||
//osg::Timer_t before = osg::Timer::instance()->tick();
|
||||
|
||||
|
||||
@ -618,7 +618,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
Registry::instance()->readNode(databaseRequest->_fileName, databaseRequest->_loadOptions.get(), false);
|
||||
|
||||
if (rr.validNode()) databaseRequest->_loadedModel = rr.getNode();
|
||||
if (rr.error()) NOTIFY(osg::WARN)<<"Error in reading file "<<databaseRequest->_fileName<<" : "<<rr.message() << std::endl;
|
||||
if (rr.error()) OSG_NOTIFY(osg::WARN)<<"Error in reading file "<<databaseRequest->_fileName<<" : "<<rr.message() << std::endl;
|
||||
|
||||
if (databaseRequest->_loadedModel.valid() &&
|
||||
fileCache.valid() &&
|
||||
@ -630,7 +630,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
if ((_pager->_frameNumber-databaseRequest->_frameNumberLastRequest)>1)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<_name<<": Warning DatabaseRquest no longer required."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<_name<<": Warning DatabaseRquest no longer required."<<std::endl;
|
||||
databaseRequest->_loadedModel = 0;
|
||||
}
|
||||
|
||||
@ -638,11 +638,11 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
if (!groupForAddingLoadedSubgraph)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<_name<<": Warning parent of loaded subgraph, deleted."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<_name<<": Warning parent of loaded subgraph, deleted."<<std::endl;
|
||||
databaseRequest->_loadedModel = 0;
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<" node read in "<<osg::Timer::instance()->delta_m(before,osg::Timer::instance()->tick())<<" ms"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<" node read in "<<osg::Timer::instance()->delta_m(before,osg::Timer::instance()->tick())<<" ms"<<std::endl;
|
||||
|
||||
bool loadedObjectsNeedToBeCompiled = false;
|
||||
|
||||
@ -750,7 +750,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
osgDB::Registry::instance()->getKdTreeBuilder())
|
||||
{
|
||||
//osg::Timer_t before = osg::Timer::instance()->tick();
|
||||
//NOTIFY(osg::NOTICE)<<"osgTerrain::GeometryTechnique::build kd tree"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"osgTerrain::GeometryTechnique::build kd tree"<<std::endl;
|
||||
osg::ref_ptr<osg::KdTreeBuilder> builder = osgDB::Registry::instance()->getKdTreeBuilder()->clone();
|
||||
|
||||
for(osg::NodePath::iterator nitr = nodePath.begin();
|
||||
@ -762,7 +762,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
databaseRequest->_loadedModel->accept(*builder);
|
||||
//osg::Timer_t after = osg::Timer::instance()->tick();
|
||||
//NOTIFY(osg::NOTICE)<<"KdTree build time "<<osg::Timer::instance()->delta_m(before, after)<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"KdTree build time "<<osg::Timer::instance()->delta_m(before, after)<<std::endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -804,7 +804,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
citr != _pager->_dataToCompileList->_requestList.end();
|
||||
++citr)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<_name<<": pruning from compile list"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<_name<<": pruning from compile list"<<std::endl;
|
||||
(*citr)->_loadedModel = 0;
|
||||
(*citr)->_requestQueue = 0;
|
||||
}
|
||||
@ -839,7 +839,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
}
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Done compiling in paging thread"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Done compiling in paging thread"<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -864,7 +864,7 @@ void DatabasePager::DatabaseThread::run()
|
||||
|
||||
DatabasePager::DatabasePager()
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<"Constructing DatabasePager()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Constructing DatabasePager()"<<std::endl;
|
||||
|
||||
_startThreadCalled = false;
|
||||
|
||||
@ -954,14 +954,14 @@ DatabasePager::DatabasePager()
|
||||
if( (ptr = getenv("OSG_EXPIRY_DELAY")) != 0)
|
||||
{
|
||||
_expiryDelay = osg::asciiToDouble(ptr);
|
||||
NOTIFY(osg::NOTICE)<<"DatabasePager: Expiry delay = "<<_expiryDelay<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DatabasePager: Expiry delay = "<<_expiryDelay<<std::endl;
|
||||
}
|
||||
|
||||
_expiryFrames = 1; // Last frame will not be expired
|
||||
if( (ptr = getenv("OSG_EXPIRY_FRAMES")) != 0)
|
||||
{
|
||||
_expiryFrames = atoi(ptr);
|
||||
NOTIFY(osg::NOTICE)<<"DatabasePager: Expiry frames = "<<_expiryFrames<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DatabasePager: Expiry frames = "<<_expiryFrames<<std::endl;
|
||||
}
|
||||
|
||||
if( (ptr = getenv("OSG_RELEASE_DELAY")) != 0)
|
||||
@ -975,7 +975,7 @@ DatabasePager::DatabasePager()
|
||||
setReleaseDelay(osg::asciiToDouble(ptr));
|
||||
}
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"DatabasePager: Release delay = "<<_releaseDelay<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DatabasePager: Release delay = "<<_releaseDelay<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -987,7 +987,7 @@ DatabasePager::DatabasePager()
|
||||
if( (ptr = getenv("OSG_RELEASE_FRAMES")) != 0)
|
||||
{
|
||||
_releaseFrames = atoi(ptr);
|
||||
NOTIFY(osg::NOTICE)<<"Release frames = "<<_releaseFrames<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Release frames = "<<_releaseFrames<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -995,7 +995,7 @@ DatabasePager::DatabasePager()
|
||||
if( (ptr = getenv("OSG_MAX_PAGEDLOD")) != 0)
|
||||
{
|
||||
_targetMaximumNumberOfPageLOD = atoi(ptr);
|
||||
NOTIFY(osg::NOTICE)<<"_targetMaximumNumberOfPageLOD = "<<_targetMaximumNumberOfPageLOD<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"_targetMaximumNumberOfPageLOD = "<<_targetMaximumNumberOfPageLOD<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -1042,7 +1042,7 @@ DatabasePager::DatabasePager()
|
||||
|
||||
DatabasePager::DatabasePager(const DatabasePager& rhs)
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<"Constructing DatabasePager(const DatabasePager& )"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Constructing DatabasePager(const DatabasePager& )"<<std::endl;
|
||||
|
||||
_startThreadCalled = false;
|
||||
|
||||
@ -1143,7 +1143,7 @@ void DatabasePager::setUpThreads(unsigned int totalNumThreads, unsigned int numH
|
||||
|
||||
unsigned int DatabasePager::addDatabaseThread(DatabaseThread::Mode mode, const std::string& name)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DatabasePager::addDatabaseThread() "<<name<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DatabasePager::addDatabaseThread() "<<name<<std::endl;
|
||||
|
||||
unsigned int pos = _databaseThreads.size();
|
||||
|
||||
@ -1152,7 +1152,7 @@ unsigned int DatabasePager::addDatabaseThread(DatabaseThread::Mode mode, const s
|
||||
|
||||
if (_startThreadCalled)
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO)<<"DatabasePager::startThread()"<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"DatabasePager::startThread()"<<std::endl;
|
||||
thread->startThread();
|
||||
}
|
||||
|
||||
@ -1306,11 +1306,11 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
||||
{
|
||||
loadOptions = Registry::instance()->getOptions();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Using options from Registry "<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Using options from Registry "<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"options from requestNodeFile "<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"options from requestNodeFile "<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -1328,7 +1328,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
||||
|
||||
if (previousFrame!=frameNumber)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"requestNodeFiles for "<<previousFrame<<" time = "<<totalTime<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"requestNodeFiles for "<<previousFrame<<" time = "<<totalTime<<std::endl;
|
||||
|
||||
previousFrame = frameNumber;
|
||||
totalTime = 0.0;
|
||||
@ -1343,13 +1343,13 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
||||
DatabaseRequest* databaseRequest = dynamic_cast<DatabaseRequest*>(databaseRequestRef.get());
|
||||
if (databaseRequest && databaseRequest->valid())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"DatabaseRequest has been previously invalidated whilst still attached to scene graph."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DatabaseRequest has been previously invalidated whilst still attached to scene graph."<<std::endl;
|
||||
databaseRequest = 0;
|
||||
}
|
||||
|
||||
if (databaseRequest)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DatabasePager::requestNodeFile("<<fileName<<") updating already assigned."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DatabasePager::requestNodeFile("<<fileName<<") updating already assigned."<<std::endl;
|
||||
|
||||
RequestQueue* requestQueue = databaseRequest->_requestQueue;
|
||||
if (requestQueue)
|
||||
@ -1373,7 +1373,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
||||
|
||||
if (databaseRequestRef->referenceCount()==1)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DatabasePager::requestNodeFile("<<fileName<<") orphaned, resubmitting."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DatabasePager::requestNodeFile("<<fileName<<") orphaned, resubmitting."<<std::endl;
|
||||
|
||||
databaseRequest->_frameNumberFirstRequest = frameNumber;
|
||||
databaseRequest->_timestampFirstRequest = timestamp;
|
||||
@ -1393,7 +1393,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
||||
|
||||
if (!foundEntry)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"In DatabasePager::requestNodeFile("<<fileName<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"In DatabasePager::requestNodeFile("<<fileName<<")"<<std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_fileRequestQueue->_requestMutex);
|
||||
|
||||
@ -1429,7 +1429,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou
|
||||
{
|
||||
_startThreadCalled = true;
|
||||
_done = false;
|
||||
NOTIFY(osg::DEBUG_INFO)<<"DatabasePager::startThread()"<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"DatabasePager::startThread()"<<std::endl;
|
||||
|
||||
if (_databaseThreads.empty())
|
||||
{
|
||||
@ -1456,15 +1456,15 @@ void DatabasePager::signalBeginFrame(const osg::FrameStamp* framestamp)
|
||||
{
|
||||
if (framestamp)
|
||||
{
|
||||
//NOTIFY(osg::INFO) << "signalBeginFrame "<<framestamp->getFrameNumber()<<">>>>>>>>>>>>>>>>"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO) << "signalBeginFrame "<<framestamp->getFrameNumber()<<">>>>>>>>>>>>>>>>"<<std::endl;
|
||||
_frameNumber = framestamp->getFrameNumber();
|
||||
|
||||
} //else NOTIFY(osg::INFO) << "signalBeginFrame >>>>>>>>>>>>>>>>"<<std::endl;
|
||||
} //else OSG_NOTIFY(osg::INFO) << "signalBeginFrame >>>>>>>>>>>>>>>>"<<std::endl;
|
||||
}
|
||||
|
||||
void DatabasePager::signalEndFrame()
|
||||
{
|
||||
//NOTIFY(osg::INFO) << "signalEndFrame <<<<<<<<<<<<<<<<<<<< "<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO) << "signalEndFrame <<<<<<<<<<<<<<<<<<<< "<<std::endl;
|
||||
}
|
||||
|
||||
void DatabasePager::setDatabasePagerThreadPause(bool pause)
|
||||
@ -1513,7 +1513,7 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
||||
{
|
||||
DatabaseRequest* databaseRequest = itr->get();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Merging "<<_frameNumber-(*itr)->_frameNumberLastRequest<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Merging "<<_frameNumber-(*itr)->_frameNumberLastRequest<<std::endl;
|
||||
|
||||
if (osgDB::Registry::instance()->getSharedStateManager())
|
||||
osgDB::Registry::instance()->getSharedStateManager()->share(databaseRequest->_loadedModel.get());
|
||||
@ -1542,7 +1542,7 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
||||
|
||||
group->addChild(databaseRequest->_loadedModel.get());
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"merged subgraph"<<databaseRequest->_fileName<<" after "<<databaseRequest->_numOfRequests<<" requests and time="<<(timeStamp-databaseRequest->_timestampFirstRequest)*1000.0<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"merged subgraph"<<databaseRequest->_fileName<<" after "<<databaseRequest->_numOfRequests<<" requests and time="<<(timeStamp-databaseRequest->_timestampFirstRequest)*1000.0<<std::endl;
|
||||
|
||||
double timeToMerge = timeStamp-databaseRequest->_timestampFirstRequest;
|
||||
|
||||
@ -1556,14 +1556,14 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
||||
// reset the loadedModel pointer
|
||||
databaseRequest->_loadedModel = 0;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"curr = "<<timeToMerge<<" min "<<getMinimumTimeToMergeTile()*1000.0<<" max = "<<getMaximumTimeToMergeTile()*1000.0<<" average = "<<getAverageTimToMergeTiles()*1000.0<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"curr = "<<timeToMerge<<" min "<<getMinimumTimeToMergeTile()*1000.0<<" max = "<<getMaximumTimeToMergeTile()*1000.0<<" average = "<<getAverageTimToMergeTiles()*1000.0<<std::endl;
|
||||
}
|
||||
|
||||
osg::Timer_t last = osg::Timer::instance()->tick();
|
||||
|
||||
if (!localFileLoadedList.empty())
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO)<<"Done DatabasePager::addLoadedDataToSceneGraph"<<
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"Done DatabasePager::addLoadedDataToSceneGraph"<<
|
||||
osg::Timer::instance()->delta_m(before,mid)<<"ms,\t"<<
|
||||
osg::Timer::instance()->delta_m(mid,last)<<"ms"<<
|
||||
" objects"<<localFileLoadedList.size()<<std::endl<<std::endl;
|
||||
@ -1642,7 +1642,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
if (_releaseDelay!=DBL_MAX)
|
||||
{
|
||||
plod->releaseGLObjects();
|
||||
NOTIFY(osg::INFO)<<"DatabasePager::removeExpiredSubgraphs(), releasing gl objects"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DatabasePager::removeExpiredSubgraphs(), releasing gl objects"<<std::endl;
|
||||
}
|
||||
|
||||
_inactivePagedLODList.push_back(plod);
|
||||
@ -1756,7 +1756,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
|
||||
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"numToPrune "<<numToPrune<< " markerVistor._numPagedLODsMarked="<<markerVistor._numPagedLODsMarked<< " childrenRemoved.size()="<<childrenRemoved.size()<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"numToPrune "<<numToPrune<< " markerVistor._numPagedLODsMarked="<<markerVistor._numPagedLODsMarked<< " childrenRemoved.size()="<<childrenRemoved.size()<<std::endl;
|
||||
|
||||
if (!childrenRemoved.empty())
|
||||
{
|
||||
@ -1781,9 +1781,9 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
int numToRemove = markerVistor._numPagedLODsMarked;
|
||||
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"Children to remove "<<childrenRemoved.size()<<" numToRemove="<<numToRemove<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Children to remove "<<childrenRemoved.size()<<" numToRemove="<<numToRemove<<std::endl;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" time 2 "<<osg::Timer::instance()->delta_m(before,osg::Timer::instance()->tick())<<" ms "<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" time 2 "<<osg::Timer::instance()->delta_m(before,osg::Timer::instance()->tick())<<" ms "<<std::endl;
|
||||
int numSkipped = 0;
|
||||
for(PagedLODList::iterator itr = _inactivePagedLODList.begin();
|
||||
itr!=_inactivePagedLODList.end() && numRemoved<numToRemove;
|
||||
@ -1796,11 +1796,11 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
|
||||
++numSkipped;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"skipping"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"skipping"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"removing"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"removing"<<std::endl;
|
||||
|
||||
++numRemoved;
|
||||
|
||||
@ -1808,7 +1808,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
}
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"Number of PagedLODs skipped="<<numSkipped<<" removed "<<numRemoved<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Number of PagedLODs skipped="<<numSkipped<<" removed "<<numRemoved<<std::endl;
|
||||
|
||||
|
||||
childrenRemoved.clear();
|
||||
@ -1829,7 +1829,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
|
||||
|
||||
|
||||
NOTIFY(osg::INFO)<<"active="<<_activePagedLODList.size()<<" inactive="<<_inactivePagedLODList.size()<<" overall = "<<osg::Timer::instance()->delta_m(startTick,end_c_Tick)<<
|
||||
OSG_NOTIFY(osg::INFO)<<"active="<<_activePagedLODList.size()<<" inactive="<<_inactivePagedLODList.size()<<" overall = "<<osg::Timer::instance()->delta_m(startTick,end_c_Tick)<<
|
||||
" A="<<time_a<<" avg="<<s_total_time_stage_a/s_total_iter_stage_a<<" max = "<<s_total_max_stage_a<<
|
||||
" B="<<time_b<<" avg="<<s_total_time_stage_b/s_total_iter_stage_b<<" max = "<<s_total_max_stage_b<<
|
||||
" C="<<time_c<<" avg="<<s_total_time_stage_c/s_total_iter_stage_c<<" max = "<<s_total_max_stage_c<<std::endl;
|
||||
@ -1837,7 +1837,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
|
||||
void DatabasePager::expiry_removeExpiredSubgraphs(const osg::FrameStamp& frameStamp)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"DatabasePager::new_removeExpiredSubgraphs()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"DatabasePager::new_removeExpiredSubgraphs()"<<std::endl;
|
||||
|
||||
static double s_total_iter = 0.0;
|
||||
static double s_total_time = 0.0;
|
||||
@ -1862,7 +1862,7 @@ void DatabasePager::expiry_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
|
||||
if (_releaseDelay!=DBL_MAX && plod->releaseGLObjectsOnExpiredChildren(releaseTime, releaseFrame))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DatabasePager::removeExpiredSubgraphs(), releasing gl objects"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DatabasePager::removeExpiredSubgraphs(), releasing gl objects"<<std::endl;
|
||||
}
|
||||
|
||||
plod->removeExpiredChildren(expiryTime, expiryFrame, childrenRemoved);
|
||||
@ -1878,7 +1878,7 @@ void DatabasePager::expiry_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
(*critr)->accept(markerVistor);
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Children to remove "<<childrenRemoved.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Children to remove "<<childrenRemoved.size()<<std::endl;
|
||||
|
||||
// pass the objects across to the database pager delete list
|
||||
if (_deleteRemovedSubgraphsInDatabaseThread)
|
||||
@ -1894,7 +1894,7 @@ void DatabasePager::expiry_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
_fileRequestQueue->updateBlock();
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" time 2 "<<osg::Timer::instance()->delta_m(before,osg::Timer::instance()->tick())<<" ms "<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" time 2 "<<osg::Timer::instance()->delta_m(before,osg::Timer::instance()->tick())<<" ms "<<std::endl;
|
||||
for(PagedLODList::iterator itr = _activePagedLODList.begin();
|
||||
itr!=_activePagedLODList.end();
|
||||
)
|
||||
@ -1925,7 +1925,7 @@ void DatabasePager::expiry_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
|
||||
s_total_time += time;
|
||||
if (s_total_max<time) s_total_max = time;
|
||||
|
||||
NOTIFY(osg::INFO)<<"_activePagedLODList.size()="<<_activePagedLODList.size()<<" overall = "<<time<<
|
||||
OSG_NOTIFY(osg::INFO)<<"_activePagedLODList.size()="<<_activePagedLODList.size()<<" overall = "<<time<<
|
||||
" avg="<<s_total_time/s_total_iter<<" max = "<<s_total_max<<std::endl;
|
||||
}
|
||||
|
||||
@ -1999,7 +1999,7 @@ DatabasePager::CompileOperation::CompileOperation(osgDB::DatabasePager* database
|
||||
|
||||
void DatabasePager::CompileOperation::operator () (osg::GraphicsContext* context)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Background thread compiling"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Background thread compiling"<<std::endl;
|
||||
|
||||
if (_databasePager.valid()) _databasePager->compileAllGLObjects(*(context->getState()));
|
||||
|
||||
@ -2020,7 +2020,7 @@ void DatabasePager::compileAllGLObjects(osg::State& state)
|
||||
|
||||
void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"DatabasePager::compileGLObjects "<<_frameNumber<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"DatabasePager::compileGLObjects "<<_frameNumber<<std::endl;
|
||||
|
||||
bool compileAll = (availableTime==DBL_MAX);
|
||||
|
||||
@ -2065,14 +2065,14 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
|
||||
// we have StateSet's to compile
|
||||
StateSetList& sslist = dtc.first;
|
||||
//NOTIFY(osg::INFO)<<"Compiling statesets"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Compiling statesets"<<std::endl;
|
||||
StateSetList::iterator itr=sslist.begin();
|
||||
unsigned int objTemp = numObjectsCompiled;
|
||||
for(;
|
||||
itr!=sslist.end() && (compileAll || ((elapsedTime+estimatedTextureDuration)<availableTime && numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame));
|
||||
++itr)
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<" Compiling stateset "<<(*itr).get()<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<" Compiling stateset "<<(*itr).get()<<std::endl;
|
||||
if (isCompiled(itr->get(), state.getContextID())
|
||||
|| (sharedManager && sharedManager->isShared(itr->get())))
|
||||
{
|
||||
@ -2097,7 +2097,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
}
|
||||
if (osg::getNotifyLevel() >= osg::DEBUG_INFO
|
||||
&& numObjectsCompiled > objTemp)
|
||||
NOTIFY(osg::DEBUG_INFO)<< _frameNumber << " compiled "
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<< _frameNumber << " compiled "
|
||||
<< numObjectsCompiled - objTemp
|
||||
<< " StateSets" << std::endl;
|
||||
// remove the compiled statesets from the list.
|
||||
@ -2107,7 +2107,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
if (!dtc.second.empty() && (compileAll || ((elapsedTime+estimatedDrawableDuration)<availableTime && numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame)))
|
||||
{
|
||||
// we have Drawable's to compile
|
||||
//NOTIFY(osg::INFO)<<"Compiling drawables"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Compiling drawables"<<std::endl;
|
||||
DrawableList& dwlist = dtc.second;
|
||||
DrawableList::iterator itr=dwlist.begin();
|
||||
unsigned int objTemp = numObjectsCompiled;
|
||||
@ -2115,7 +2115,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
itr!=dwlist.end() && (compileAll || ((elapsedTime+estimatedDrawableDuration)<availableTime && numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame));
|
||||
++itr)
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<" Compiling drawable "<<(*itr).get()<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<" Compiling drawable "<<(*itr).get()<<std::endl;
|
||||
if (isCompiled(itr->get(), state.getContextID()))
|
||||
{
|
||||
elapsedTime = timer.delta_s(start_tick,timer.tick());
|
||||
@ -2133,14 +2133,14 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
}
|
||||
if (osg::getNotifyLevel() >= osg::DEBUG_INFO
|
||||
&& numObjectsCompiled > objTemp)
|
||||
NOTIFY(osg::DEBUG_INFO)<< _frameNumber << " compiled "
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<< _frameNumber << " compiled "
|
||||
<< numObjectsCompiled - objTemp
|
||||
<< " Drawables" << std::endl;
|
||||
// remove the compiled drawables from the list.
|
||||
dwlist.erase(dwlist.begin(),itr);
|
||||
}
|
||||
|
||||
//NOTIFY(osg::INFO)<<"Checking if compiled"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Checking if compiled"<<std::endl;
|
||||
|
||||
// now check the to compile entries for all active graphics contexts
|
||||
// to make sure that all have been compiled. They won't be
|
||||
@ -2156,13 +2156,13 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
}
|
||||
|
||||
//if (numObjectsCompiled > 0)
|
||||
//NOTIFY(osg::NOTICE)<< _frameNumber << "compiled " << numObjectsCompiled << " objects" << std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<< _frameNumber << "compiled " << numObjectsCompiled << " objects" << std::endl;
|
||||
|
||||
if (allCompiled)
|
||||
{
|
||||
// we've compiled all of the current databaseRequest so we can now pop it off the
|
||||
// to compile list and place it on the merge list.
|
||||
// NOTIFY(osg::NOTICE)<<"All compiled"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"All compiled"<<std::endl;
|
||||
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_dataToCompileList->_requestMutex);
|
||||
@ -2195,7 +2195,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Not all compiled"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Not all compiled"<<std::endl;
|
||||
databaseRequest = 0;
|
||||
}
|
||||
|
||||
@ -2204,9 +2204,9 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime)
|
||||
|
||||
availableTime -= elapsedTime;
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"elapsedTime="<<elapsedTime<<"\ttime remaining ="<<availableTime<<"\tnumObjectsCompiled = "<<numObjectsCompiled<<std::endl;
|
||||
//NOTIFY(osg::NOTICE)<<"estimatedTextureDuration="<<estimatedTextureDuration;
|
||||
//NOTIFY(osg::NOTICE)<<"\testimatedDrawableDuration="<<estimatedDrawableDuration<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"elapsedTime="<<elapsedTime<<"\ttime remaining ="<<availableTime<<"\tnumObjectsCompiled = "<<numObjectsCompiled<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"estimatedTextureDuration="<<estimatedTextureDuration;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"\testimatedDrawableDuration="<<estimatedDrawableDuration<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -50,14 +50,14 @@ DynamicLibrary::DynamicLibrary(const std::string& name, HANDLE handle)
|
||||
{
|
||||
_name = name;
|
||||
_handle = handle;
|
||||
NOTIFY(osg::INFO)<<"Opened DynamicLibrary "<<_name<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Opened DynamicLibrary "<<_name<<std::endl;
|
||||
}
|
||||
|
||||
DynamicLibrary::~DynamicLibrary()
|
||||
{
|
||||
if (_handle)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Closing DynamicLibrary "<<_name<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Closing DynamicLibrary "<<_name<<std::endl;
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
FreeLibrary((HMODULE)_handle);
|
||||
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
|
||||
@ -83,7 +83,7 @@ DynamicLibrary* DynamicLibrary::loadLibrary(const std::string& libraryName)
|
||||
if (handle) return new DynamicLibrary(libraryName,handle);
|
||||
|
||||
// else no lib found so report errors.
|
||||
NOTIFY(osg::INFO) << "DynamicLibrary::failed loading \""<<libraryName<<"\""<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "DynamicLibrary::failed loading \""<<libraryName<<"\""<<std::endl;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -121,13 +121,13 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
|
||||
{
|
||||
if (fileExists(localLibraryName))
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Warning: dynamic library '" << libraryName << "' exists, but an error occurred while trying to open it:" << std::endl;
|
||||
NOTIFY(osg::WARN) << dlerror() << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Warning: dynamic library '" << libraryName << "' exists, but an error occurred while trying to open it:" << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << dlerror() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO) << "Warning: dynamic library '" << libraryName << "' does not exist (or isn't readable):" << std::endl;
|
||||
NOTIFY(osg::INFO) << dlerror() << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "Warning: dynamic library '" << libraryName << "' does not exist (or isn't readable):" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << dlerror() << std::endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -153,15 +153,15 @@ DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& p
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << "DynamicLibrary::failed looking up " << procName << std::endl;
|
||||
NOTIFY(osg::WARN) << "DynamicLibrary::error " << strerror(errno) << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::failed looking up " << procName << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::error " << strerror(errno) << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
#else // other unix
|
||||
void* sym = dlsym( _handle, procName.c_str() );
|
||||
if (!sym) {
|
||||
NOTIFY(osg::WARN) << "DynamicLibrary::failed looking up " << procName << std::endl;
|
||||
NOTIFY(osg::WARN) << "DynamicLibrary::error " << dlerror() << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::failed looking up " << procName << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::error " << dlerror() << std::endl;
|
||||
}
|
||||
return sym;
|
||||
#endif
|
||||
|
@ -27,12 +27,12 @@ FileCache::FileCache(const std::string& path):
|
||||
osg::Referenced(true),
|
||||
_fileCachePath(path)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Constructed FileCache : "<<path<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Constructed FileCache : "<<path<<std::endl;
|
||||
}
|
||||
|
||||
FileCache::~FileCache()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Destructed FileCache "<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Destructed FileCache "<<std::endl;
|
||||
}
|
||||
|
||||
bool FileCache::isFileAppropriateForFileCache(const std::string& originalFileName) const
|
||||
@ -46,7 +46,7 @@ std::string FileCache::createCacheFileName(const std::string& originalFileName)
|
||||
osgDB::getServerAddress(originalFileName) + "/" +
|
||||
osgDB::getServerFileName(originalFileName);
|
||||
|
||||
NOTIFY(osg::INFO)<<"FileCache::createCacheFileName("<<originalFileName<<") = "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::createCacheFileName("<<originalFileName<<") = "<<cacheFileName<<std::endl;
|
||||
|
||||
return cacheFileName;
|
||||
}
|
||||
@ -65,7 +65,7 @@ ReaderWriter::ReadResult FileCache::readObject(const std::string& originalFileNa
|
||||
std::string cacheFileName = createCacheFileName(originalFileName);
|
||||
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FileCache::readObjectFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::readObjectFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
return osgDB::Registry::instance()->readObject(cacheFileName, options);
|
||||
}
|
||||
else
|
||||
@ -83,11 +83,11 @@ ReaderWriter::WriteResult FileCache::writeObject(const osg::Object& object, cons
|
||||
|
||||
if (!osgDB::fileExists(path) && !osgDB::makeDirectory(path))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"FileCache::writeObjectToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::writeObjectToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeObject(object, cacheFileName, options);
|
||||
if (result.success())
|
||||
{
|
||||
@ -103,7 +103,7 @@ ReaderWriter::ReadResult FileCache::readImage(const std::string& originalFileNam
|
||||
std::string cacheFileName = createCacheFileName(originalFileName);
|
||||
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FileCache::readImageFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::readImageFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
return osgDB::Registry::instance()->readImage(cacheFileName, options);
|
||||
}
|
||||
else
|
||||
@ -121,11 +121,11 @@ ReaderWriter::WriteResult FileCache::writeImage(const osg::Image& image, const s
|
||||
|
||||
if (!osgDB::fileExists(path) && !osgDB::makeDirectory(path))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"FileCache::writeImageToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::writeImageToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeImage(image, cacheFileName, options);
|
||||
if (result.success())
|
||||
{
|
||||
@ -141,7 +141,7 @@ ReaderWriter::ReadResult FileCache::readHeightField(const std::string& originalF
|
||||
std::string cacheFileName = createCacheFileName(originalFileName);
|
||||
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FileCache::readHeightFieldFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::readHeightFieldFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
return osgDB::Registry::instance()->readHeightField(cacheFileName, options);
|
||||
}
|
||||
else
|
||||
@ -159,11 +159,11 @@ ReaderWriter::WriteResult FileCache::writeHeightField(const osg::HeightField& hf
|
||||
|
||||
if (!osgDB::fileExists(path) && !osgDB::makeDirectory(path))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"FileCache::writeHeightFieldToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::writeHeightFieldToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeHeightField(hf, cacheFileName, options);
|
||||
if (result.success())
|
||||
{
|
||||
@ -179,7 +179,7 @@ ReaderWriter::ReadResult FileCache::readNode(const std::string& originalFileName
|
||||
std::string cacheFileName = createCacheFileName(originalFileName);
|
||||
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FileCache::readNodeFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::readNodeFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
return osgDB::Registry::instance()->readNode(cacheFileName, options, buildKdTreeIfRequired);
|
||||
}
|
||||
else
|
||||
@ -197,11 +197,11 @@ ReaderWriter::WriteResult FileCache::writeNode(const osg::Node& node, const std:
|
||||
|
||||
if (!osgDB::fileExists(path) && !osgDB::makeDirectory(path))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"FileCache::writeNodeToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::writeNodeToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeNode(node, cacheFileName, options);
|
||||
if (result.success())
|
||||
{
|
||||
@ -218,7 +218,7 @@ ReaderWriter::ReadResult FileCache::readShader(const std::string& originalFileNa
|
||||
std::string cacheFileName = createCacheFileName(originalFileName);
|
||||
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FileCache::readShaderFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::readShaderFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
return osgDB::Registry::instance()->readShader(cacheFileName, options);
|
||||
}
|
||||
else
|
||||
@ -236,11 +236,11 @@ ReaderWriter::WriteResult FileCache::writeShader(const osg::Shader& shader, cons
|
||||
|
||||
if (!osgDB::fileExists(path) && !osgDB::makeDirectory(path))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
|
||||
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"FileCache::writeShaderToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::writeShaderToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
|
||||
ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeShader(shader, cacheFileName, options);
|
||||
if (result.success())
|
||||
{
|
||||
@ -311,12 +311,12 @@ bool FileCache::removeFileFromBlackListed(const std::string& originalFileName) c
|
||||
|
||||
bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FileCache::loadDatabaseRevisionsForFile("<<originalFileName<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FileCache::loadDatabaseRevisionsForFile("<<originalFileName<<")"<<std::endl;
|
||||
|
||||
std::string revisionsFileName = originalFileName;
|
||||
if (getLowerCaseFileExtension(revisionsFileName)!="revisions") revisionsFileName += ".revisions";
|
||||
|
||||
NOTIFY(osg::INFO)<<" revisionsFileName("<<revisionsFileName<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" revisionsFileName("<<revisionsFileName<<")"<<std::endl;
|
||||
|
||||
osg::ref_ptr<DatabaseRevisions> dr_local;
|
||||
|
||||
@ -328,11 +328,11 @@ bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName
|
||||
ritr != _databaseRevisionsList.end() && !dr_local;
|
||||
++ritr)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" comparing "<<(*ritr)->getName()<<" to "<<revisionsFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" comparing "<<(*ritr)->getName()<<" to "<<revisionsFileName<<std::endl;
|
||||
|
||||
if ((*ritr)->getName()==revisionsFileName)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Already loaded"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Already loaded"<<std::endl;
|
||||
dr_local = *ritr;
|
||||
}
|
||||
}
|
||||
@ -341,17 +341,17 @@ bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName
|
||||
{
|
||||
if (!cacheFileName.empty() && osgDB::fileExists(cacheFileName))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" found revisions file in local cache, now loading it"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" found revisions file in local cache, now loading it"<<std::endl;
|
||||
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(cacheFileName);
|
||||
dr_local = dynamic_cast<DatabaseRevisions*>(object.get());
|
||||
if (dr_local)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" loaded local revisions File("<<cacheFileName<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" loaded local revisions File("<<cacheFileName<<")"<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" could not load found revisions file from local cache."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" could not load found revisions file from local cache."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,22 +371,22 @@ bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName
|
||||
{
|
||||
DatabaseRevision* revision_local = dr_local->getDatabaseRevision(i);
|
||||
DatabaseRevision* revision_remote = dr_remote->getDatabaseRevision(i);
|
||||
NOTIFY(osg::INFO)<<" Comparing local "<<revision_local->getName()<<" to remote "<<revision_remote->getName()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" Comparing local "<<revision_local->getName()<<" to remote "<<revision_remote->getName()<<std::endl;
|
||||
if (revision_local->getName()!=revision_remote->getName()) break;
|
||||
}
|
||||
needToWriteRevisionsFileToDisk = (i!=dr_local->getDatabaseRevisionList().size());
|
||||
NOTIFY(osg::INFO)<<"Local and remote revisions are different "<<needToWriteRevisionsFileToDisk<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Local and remote revisions are different "<<needToWriteRevisionsFileToDisk<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (needToWriteRevisionsFileToDisk)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
|
||||
if (!cacheFileName.empty()) writeObjectFile(*dr_remote, cacheFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"No need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"No need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
@ -396,17 +396,17 @@ bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName
|
||||
|
||||
if (dr.valid())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" loaded remote revisions File("<<revisionsFileName<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" loaded remote revisions File("<<revisionsFileName<<")"<<std::endl;
|
||||
|
||||
if (ritr != _databaseRevisionsList.end())
|
||||
{
|
||||
// replace already loaded DatabaseRevisions object
|
||||
NOTIFY(osg::INFO)<<"Replacing already loaded DatabaseRevisions object"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Replacing already loaded DatabaseRevisions object"<<std::endl;
|
||||
*ritr = dr;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Added newly loaded DatabaseRevisions object "<<dr->getName()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Added newly loaded DatabaseRevisions object "<<dr->getName()<<std::endl;
|
||||
_databaseRevisionsList.push_back(dr);
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName
|
||||
{
|
||||
DatabaseRevision* revision = itr->get();
|
||||
|
||||
NOTIFY(osg::INFO)<<" now loaded DatabaseRevisions "<<revision->getName()<<" FileList contents"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" now loaded DatabaseRevisions "<<revision->getName()<<" FileList contents"<<std::endl;
|
||||
if (revision->getFilesAdded())
|
||||
{
|
||||
FileList* fileList = readFileList(osgDB::concatPaths(revision->getDatabasePath(), revision->getFilesAdded()->getName()));
|
||||
@ -450,7 +450,7 @@ bool FileCache::loadDatabaseRevisionsForFile(const std::string& originalFileName
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<" failed to read revisions File, object.get()="<<object.get()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" failed to read revisions File, object.get()="<<object.get()<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -464,18 +464,18 @@ FileList* FileCache::readFileList(const std::string& originalFileName) const
|
||||
{
|
||||
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(cacheFileListName);
|
||||
fileList = dynamic_cast<osgDB::FileList*>(object.get());
|
||||
if (fileList) NOTIFY(osg::INFO)<<" loadeded FileList from local cache "<<fileList->getName()<<std::endl;
|
||||
if (fileList) OSG_NOTIFY(osg::INFO)<<" loadeded FileList from local cache "<<fileList->getName()<<std::endl;
|
||||
}
|
||||
|
||||
if (!fileList)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" complete_path="<<originalFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" complete_path="<<originalFileName<<std::endl;
|
||||
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(originalFileName+".curl");
|
||||
fileList = dynamic_cast<osgDB::FileList*>(object.get());
|
||||
if (fileList)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" loadeded FileList from remote system "<<fileList->getName()<<std::endl;
|
||||
NOTIFY(osg::INFO)<<" Need to write to local file cache "<<fileList->getName()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" loadeded FileList from remote system "<<fileList->getName()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" Need to write to local file cache "<<fileList->getName()<<std::endl;
|
||||
if (!cacheFileListName.empty()) writeObjectFile(*fileList, cacheFileListName);
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ bool osgDB::makeDirectory( const std::string &path )
|
||||
{
|
||||
if (path.empty())
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): cannot create an empty directory" << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): cannot create an empty directory" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ bool osgDB::makeDirectory( const std::string &path )
|
||||
return true;
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " <<
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " <<
|
||||
path << " already exists and is not a directory!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
@ -165,7 +165,7 @@ bool osgDB::makeDirectory( const std::string &path )
|
||||
break;
|
||||
|
||||
default:
|
||||
NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -190,7 +190,7 @@ bool osgDB::makeDirectory( const std::string &path )
|
||||
if( mkdir( dir.c_str(), 0755 )< 0 )
|
||||
#endif
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||
return false;
|
||||
}
|
||||
paths.pop();
|
||||
@ -224,7 +224,7 @@ bool osgDB::setCurrentWorkingDirectory( const std::string &newCurrentWorkingDire
|
||||
{
|
||||
if (newCurrentWorkingDirectory.empty())
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "osgDB::setCurrentWorkingDirectory(): called with empty string." << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::setCurrentWorkingDirectory(): called with empty string." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -306,15 +306,15 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis
|
||||
itr!=filepath.end();
|
||||
++itr)
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "itr='" <<*itr<< "'\n";
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "itr='" <<*itr<< "'\n";
|
||||
std::string path = itr->empty() ? filename : concatPaths(*itr, filename);
|
||||
|
||||
path = getRealPath(path);
|
||||
|
||||
NOTIFY(osg::DEBUG_INFO) << "FindFileInPath() : trying " << path << " ...\n";
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath() : trying " << path << " ...\n";
|
||||
if(fileExists(path))
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "FindFileInPath() : USING " << path << "\n";
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath() : USING " << path << "\n";
|
||||
return path;
|
||||
}
|
||||
#ifndef WIN32
|
||||
@ -389,7 +389,7 @@ std::string osgDB::findFileInDirectory(const std::string& fileName,const std::st
|
||||
realFileName = getSimpleFileName(fileName);
|
||||
}
|
||||
|
||||
NOTIFY(osg::DEBUG_INFO) << "findFileInDirectory() : looking for " << realFileName << " in " << realDirName << "...\n";
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "findFileInDirectory() : looking for " << realFileName << " in " << realDirName << "...\n";
|
||||
|
||||
if (realDirName.empty())
|
||||
{
|
||||
@ -534,21 +534,21 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
{
|
||||
if (source.empty() || destination.empty())
|
||||
{
|
||||
NOTIFY(osg::INFO) << "copyFile(): Empty file name." << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "copyFile(): Empty file name." << std::endl;
|
||||
return FileOpResult::BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
// Check if source and destination are the same
|
||||
if (source == destination || osgDB::getRealPath(source) == osgDB::getRealPath(destination))
|
||||
{
|
||||
NOTIFY(osg::INFO) << "copyFile(): Source and destination point to the same file: source=" << source << ", destination=" << destination << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "copyFile(): Source and destination point to the same file: source=" << source << ", destination=" << destination << std::endl;
|
||||
return FileOpResult::SOURCE_EQUALS_DESTINATION;
|
||||
}
|
||||
|
||||
// Check if source file exists
|
||||
if (!osgDB::fileExists(source))
|
||||
{
|
||||
NOTIFY(osg::INFO) << "copyFile(): Source file does not exist: " << source << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "copyFile(): Source file does not exist: " << source << std::endl;
|
||||
return FileOpResult::SOURCE_MISSING;
|
||||
}
|
||||
|
||||
@ -556,21 +556,21 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
osgDB::ifstream fin(source.c_str(), std::ios::in | std::ios::binary);
|
||||
if (!fin)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "copyFile(): Can't read source file: " << source << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Can't read source file: " << source << std::endl;
|
||||
return FileOpResult::SOURCE_NOT_OPENED; // Return success since it's not an output error.
|
||||
}
|
||||
|
||||
// Ensure the directory exists or else the FBX SDK will fail
|
||||
if (!osgDB::makeDirectoryForFile(destination))
|
||||
{
|
||||
NOTIFY(osg::INFO) << "Can't create directory for file '" << destination << "'. Copy may fail creating the file." << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "Can't create directory for file '" << destination << "'. Copy may fail creating the file." << std::endl;
|
||||
}
|
||||
|
||||
// Open destination file
|
||||
osgDB::ofstream fout(destination.c_str(), std::ios::out | std::ios::binary | std::ios::trunc);
|
||||
if (!fout)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "copyFile(): Can't write destination file: " << destination << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Can't write destination file: " << destination << std::endl;
|
||||
return FileOpResult::DESTINATION_NOT_OPENED;
|
||||
}
|
||||
|
||||
@ -585,13 +585,13 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
|
||||
if (!fout.good())
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "copyFile(): Error writing destination file: " << destination << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Error writing destination file: " << destination << std::endl;
|
||||
return FileOpResult::WRITE_ERROR;
|
||||
}
|
||||
|
||||
if (!fin.eof())
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "copyFile(): Error reading source file: " << source << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Error reading source file: " << source << std::endl;
|
||||
return FileOpResult::READ_ERROR;
|
||||
}
|
||||
|
||||
@ -687,7 +687,7 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Could not get application directory "
|
||||
OSG_NOTIFY(osg::WARN) << "Could not get application directory "
|
||||
"using Win32 API. It will not be searched." << std::endl;
|
||||
}
|
||||
|
||||
@ -717,14 +717,14 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Could not get dll directory "
|
||||
OSG_NOTIFY(osg::WARN) << "Could not get dll directory "
|
||||
"using Win32 API. It will not be searched." << std::endl;
|
||||
}
|
||||
FreeLibrary(thisModule);
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Could not get dll module handle "
|
||||
OSG_NOTIFY(osg::WARN) << "Could not get dll module handle "
|
||||
"using Win32 API. Dll directory will not be searched." << std::endl;
|
||||
}
|
||||
}
|
||||
@ -742,7 +742,7 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Could not get system directory using "
|
||||
OSG_NOTIFY(osg::WARN) << "Could not get system directory using "
|
||||
"Win32 API, using default directory." << std::endl;
|
||||
convertStringPathIntoFilePathList("C:\\Windows\\System32",
|
||||
filepath);
|
||||
@ -763,7 +763,7 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Could not get Windows directory using "
|
||||
OSG_NOTIFY(osg::WARN) << "Could not get Windows directory using "
|
||||
"Win32 API, using default directory." << std::endl;
|
||||
convertStringPathIntoFilePathList("C:\\Windows", filepath);
|
||||
convertStringPathIntoFilePathList("C:\\Windows\\System", filepath);
|
||||
@ -1027,7 +1027,7 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Application Bundle" << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Application Bundle" << std::endl;
|
||||
}
|
||||
|
||||
// Next, check the User's Application Support folder
|
||||
@ -1042,13 +1042,13 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
CFRelease( url );
|
||||
}
|
||||
else
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't create CFURLRef for User's application support Path" << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't create CFURLRef for User's application support Path" << std::endl;
|
||||
|
||||
url = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the User's Application Support Path" << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the User's Application Support Path" << std::endl;
|
||||
}
|
||||
|
||||
// Next, check the Local System's Application Support Folder
|
||||
@ -1064,13 +1064,13 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
CFRelease( url );
|
||||
}
|
||||
else
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't create CFURLRef for local System's ApplicationSupport Path" << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't create CFURLRef for local System's ApplicationSupport Path" << std::endl;
|
||||
|
||||
url = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Local System's Application Support Path" << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Local System's Application Support Path" << std::endl;
|
||||
}
|
||||
|
||||
// Finally, check the Network Application Support Folder
|
||||
@ -1088,14 +1088,14 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
CFRelease( url );
|
||||
}
|
||||
else
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't create CFURLRef for network Application Support Path" << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't create CFURLRef for network Application Support Path" << std::endl;
|
||||
|
||||
url = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// had to comment out as it segfauls the OSX app otherwise
|
||||
// NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Network Application Support Path" << std::endl;
|
||||
// OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Network Application Support Path" << std::endl;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@ -1161,7 +1161,7 @@ osgDB::FileOpResult::Value osgDB::copyFile(const std::string & source, const std
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Application Bundle." << std::endl;
|
||||
OSG_NOTIFY( osg::DEBUG_INFO ) << "Couldn't find the Application Bundle." << std::endl;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -193,7 +193,7 @@ Registry::Registry()
|
||||
if( (ptr = getenv("OSG_EXPIRY_DELAY")) != 0)
|
||||
{
|
||||
_expiryDelay = osg::asciiToDouble(ptr);
|
||||
NOTIFY(osg::INFO)<<"Registry : Expiry delay = "<<_expiryDelay<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Registry : Expiry delay = "<<_expiryDelay<<std::endl;
|
||||
}
|
||||
|
||||
const char* fileCachePath = getenv("OSG_FILE_CACHE");
|
||||
@ -381,7 +381,7 @@ Registry::~Registry()
|
||||
|
||||
void Registry::destruct()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Registry::destruct()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Registry::destruct()"<<std::endl;
|
||||
|
||||
// clean up the SharedStateManager
|
||||
_sharedStateManager = 0;
|
||||
@ -417,12 +417,12 @@ void Registry::initDataFilePathList()
|
||||
|
||||
if( (ptr = getenv( "OSG_FILE_PATH" )) )
|
||||
{
|
||||
//NOTIFY(DEBUG_INFO) << "OSG_FILE_PATH("<<ptr<<")"<<std::endl;
|
||||
//OSG_NOTIFY(DEBUG_INFO) << "OSG_FILE_PATH("<<ptr<<")"<<std::endl;
|
||||
convertStringPathIntoFilePathList(ptr, filepath);
|
||||
}
|
||||
else if( (ptr = getenv( "OSGFILEPATH" )) )
|
||||
{
|
||||
//NOTIFY(DEBUG_INFO) << "OSGFILEPATH("<<ptr<<")"<<std::endl;
|
||||
//OSG_NOTIFY(DEBUG_INFO) << "OSGFILEPATH("<<ptr<<")"<<std::endl;
|
||||
convertStringPathIntoFilePathList(ptr, filepath);
|
||||
}
|
||||
|
||||
@ -449,12 +449,12 @@ void Registry::initLibraryFilePathList()
|
||||
char* ptr;
|
||||
if( (ptr = getenv( "OSG_LIBRARY_PATH")) )
|
||||
{
|
||||
//NOTIFY(DEBUG_INFO) << "OSG_LIBRARY_PATH("<<ptr<<")"<<std::endl;
|
||||
//OSG_NOTIFY(DEBUG_INFO) << "OSG_LIBRARY_PATH("<<ptr<<")"<<std::endl;
|
||||
setLibraryFilePathList(ptr);
|
||||
}
|
||||
else if( (ptr = getenv( "OSG_LD_LIBRARY_PATH")) )
|
||||
{
|
||||
//NOTIFY(DEBUG_INFO) << "OSG_LD_LIBRARY_PATH("<<ptr<<")"<<std::endl;
|
||||
//OSG_NOTIFY(DEBUG_INFO) << "OSG_LD_LIBRARY_PATH("<<ptr<<")"<<std::endl;
|
||||
setLibraryFilePathList(ptr);
|
||||
}
|
||||
|
||||
@ -495,7 +495,7 @@ void Registry::addReaderWriter(ReaderWriter* rw)
|
||||
{
|
||||
if (rw==0L) return;
|
||||
|
||||
// NOTIFY(INFO) << "osg::Registry::addReaderWriter("<<rw->className()<<")"<< std::endl;
|
||||
// OSG_NOTIFY(INFO) << "osg::Registry::addReaderWriter("<<rw->className()<<")"<< std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_pluginMutex);
|
||||
|
||||
@ -508,7 +508,7 @@ void Registry::removeReaderWriter(ReaderWriter* rw)
|
||||
{
|
||||
if (rw==0L) return;
|
||||
|
||||
// NOTIFY(INFO) << "osg::Registry::removeReaderWriter();"<< std::endl;
|
||||
// OSG_NOTIFY(INFO) << "osg::Registry::removeReaderWriter();"<< std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_pluginMutex);
|
||||
|
||||
@ -536,7 +536,7 @@ bool Registry::readPluginAliasConfigurationFile( const std::string& file )
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty())
|
||||
{
|
||||
NOTIFY( osg::WARN) << "Can't find plugin alias config file \"" << file << "\"." << std::endl;
|
||||
OSG_NOTIFY( osg::WARN) << "Can't find plugin alias config file \"" << file << "\"." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -544,7 +544,7 @@ bool Registry::readPluginAliasConfigurationFile( const std::string& file )
|
||||
ifs.open( fileName.c_str() );
|
||||
if (!ifs.good())
|
||||
{
|
||||
NOTIFY( osg::WARN) << "Can't open plugin alias config file \"" << fileName << "\"." << std::endl;
|
||||
OSG_NOTIFY( osg::WARN) << "Can't open plugin alias config file \"" << fileName << "\"." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -562,7 +562,7 @@ bool Registry::readPluginAliasConfigurationFile( const std::string& file )
|
||||
if (spIdx == ln.npos)
|
||||
{
|
||||
// mapExt and toExt must be on the same line, separated by a space.
|
||||
NOTIFY( osg::WARN) << file << ", line " << lineNum << ": Syntax error: missing space in \"" << raw << "\"." << std::endl;
|
||||
OSG_NOTIFY( osg::WARN) << file << ", line " << lineNum << ": Syntax error: missing space in \"" << raw << "\"." << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -699,7 +699,7 @@ bool Registry::closeLibrary(const std::string& fileName)
|
||||
|
||||
void Registry::closeAllLibraries()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Registry::closeAllLibraries()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Registry::closeAllLibraries()"<<std::endl;
|
||||
OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_pluginMutex);
|
||||
_dlList.clear();
|
||||
}
|
||||
@ -740,7 +740,7 @@ ReaderWriter* Registry::getReaderWriterForExtension(const std::string& ext)
|
||||
|
||||
// now look for a plug-in to load the file.
|
||||
std::string libraryName = createLibraryNameForExtension(ext);
|
||||
NOTIFY(INFO) << "Now checking for plug-in "<<libraryName<< std::endl;
|
||||
OSG_NOTIFY(INFO) << "Now checking for plug-in "<<libraryName<< std::endl;
|
||||
if (loadLibrary(libraryName)==LOADED)
|
||||
{
|
||||
for(ReaderWriterList::iterator itr=_rwList.begin();
|
||||
@ -864,7 +864,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
|
||||
|
||||
if(fileExists(filename))
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
return filename;
|
||||
}
|
||||
|
||||
@ -891,7 +891,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
|
||||
|
||||
if(fileExists(simpleFileName))
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
return simpleFileName;
|
||||
}
|
||||
|
||||
@ -926,7 +926,7 @@ std::string Registry::findLibraryFileImplementation(const std::string& filename,
|
||||
|
||||
if(fileExists(filename))
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
return filename;
|
||||
}
|
||||
|
||||
@ -959,9 +959,9 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
|
||||
std::string::size_type endArchive = positionArchive + archiveExtension.length();
|
||||
std::string archiveName( readFunctor._filename.substr(0,endArchive));
|
||||
std::string fileName(readFunctor._filename.substr(endArchive+1,std::string::npos));
|
||||
NOTIFY(osg::INFO)<<"Contains archive : "<<readFunctor._filename<<std::endl;
|
||||
NOTIFY(osg::INFO)<<" archive : "<<archiveName<<std::endl;
|
||||
NOTIFY(osg::INFO)<<" filename : "<<fileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Contains archive : "<<readFunctor._filename<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" archive : "<<archiveName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" filename : "<<fileName<<std::endl;
|
||||
|
||||
ReaderWriter::ReadResult result = openArchiveImplementation(archiveName,ReaderWriter::READ, 4096, readFunctor._options);
|
||||
|
||||
@ -1011,7 +1011,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
|
||||
{
|
||||
if (ritr->status()==ReaderWriter::ReadResult::ERROR_IN_READING_FILE)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
return *ritr;
|
||||
}
|
||||
}
|
||||
@ -1023,7 +1023,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
|
||||
{
|
||||
if (ritr->status()==ReaderWriter::ReadResult::FILE_NOT_FOUND)
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
return *ritr;
|
||||
}
|
||||
}
|
||||
@ -1082,7 +1082,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
|
||||
{
|
||||
if (ritr->status()==ReaderWriter::ReadResult::ERROR_IN_READING_FILE)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
return *ritr;
|
||||
}
|
||||
}
|
||||
@ -1091,7 +1091,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
|
||||
{
|
||||
if (ritr->status()==ReaderWriter::ReadResult::FILE_NOT_FOUND)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
|
||||
return *ritr;
|
||||
}
|
||||
}
|
||||
@ -1124,7 +1124,7 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
|
||||
ObjectCache::iterator oitr=_objectCache.find(file);
|
||||
if (oitr!=_objectCache.end())
|
||||
{
|
||||
NOTIFY(INFO)<<"returning cached instanced of "<<file<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"returning cached instanced of "<<file<<std::endl;
|
||||
if (readFunctor.isValid(oitr->second.first.get())) return ReaderWriter::ReadResult(oitr->second.first.get(), ReaderWriter::ReadResult::FILE_LOADED_FROM_CACHE);
|
||||
else return ReaderWriter::ReadResult("Error file does not contain an osg::Object");
|
||||
}
|
||||
@ -1134,12 +1134,12 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
|
||||
if (rr.validObject())
|
||||
{
|
||||
// update cache with new entry.
|
||||
NOTIFY(INFO)<<"Adding to object cache "<<file<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"Adding to object cache "<<file<<std::endl;
|
||||
addEntryToObjectCache(file,rr.getObject());
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(INFO)<<"No valid object found for "<<file<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"No valid object found for "<<file<<std::endl;
|
||||
}
|
||||
|
||||
return rr;
|
||||
@ -1336,7 +1336,7 @@ ReaderWriter::ReadResult Registry::readNodeImplementation(const std::string& fil
|
||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
ReaderWriter::ReadResult result = readImplementation(ReadNodeFunctor(fileName, options),Options::CACHE_NODES);
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
NOTIFY(osg::NOTICE)<<"time to load "<<fileName<<" "<<osg::Timer::instance()->delta_m(startTick, endTick)<<"ms"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"time to load "<<fileName<<" "<<osg::Timer::instance()->delta_m(startTick, endTick)<<"ms"<<std::endl;
|
||||
return result;
|
||||
|
||||
#else
|
||||
|
@ -38,7 +38,7 @@ static double getHeightOfDriver()
|
||||
{
|
||||
height = osg::asciiToDouble(getenv("OSG_DRIVE_MANIPULATOR_HEIGHT"));
|
||||
}
|
||||
NOTIFY(osg::INFO)<<"DriveManipulator::_height set to =="<<height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DriveManipulator::_height set to =="<<height<<std::endl;
|
||||
return height;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ void TerrainManipulator::setNode(osg::Node* node)
|
||||
float(boundingSphere._radius) * minimumDistanceScale,
|
||||
0.00001f,1.0f);
|
||||
|
||||
NOTIFY(osg::INFO)<<"Setting terrain manipulator _minimumDistance to "<<_minimumDistance<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Setting terrain manipulator _minimumDistance to "<<_minimumDistance<<std::endl;
|
||||
}
|
||||
if (getAutoComputeHomePosition()) computeHomePosition();
|
||||
}
|
||||
@ -243,8 +243,8 @@ void TerrainManipulator::setByMatrix(const osg::Matrixd& matrix)
|
||||
osg::Vec3d lookVector(- matrix(2,0),-matrix(2,1),-matrix(2,2));
|
||||
osg::Vec3d eye(matrix(3,0),matrix(3,1),matrix(3,2));
|
||||
|
||||
NOTIFY(INFO)<<"eye point "<<eye<<std::endl;
|
||||
NOTIFY(INFO)<<"lookVector "<<lookVector<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"eye point "<<eye<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"lookVector "<<lookVector<<std::endl;
|
||||
|
||||
if (!_node)
|
||||
{
|
||||
@ -323,7 +323,7 @@ void TerrainManipulator::computePosition(const osg::Vec3d& eye,const osg::Vec3d&
|
||||
_distance = lv.length();
|
||||
_center = center;
|
||||
|
||||
NOTIFY(osg::INFO) << "In compute"<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "In compute"<< std::endl;
|
||||
|
||||
if (_node.valid())
|
||||
{
|
||||
@ -505,7 +505,7 @@ bool TerrainManipulator::calcMovement()
|
||||
if (!hitFound)
|
||||
{
|
||||
// ??
|
||||
NOTIFY(INFO)<<"TerrainManipulator unable to intersect with terrain."<<std::endl;
|
||||
OSG_NOTIFY(INFO)<<"TerrainManipulator unable to intersect with terrain."<<std::endl;
|
||||
}
|
||||
|
||||
coordinateFrame = getCoordinateFrame(_center);
|
||||
@ -519,13 +519,13 @@ bool TerrainManipulator::calcMovement()
|
||||
{
|
||||
_rotation = _rotation * pan_rotation;
|
||||
_previousUp = new_localUp;
|
||||
//NOTIFY(osg::NOTICE)<<"Rotating from "<<localUp<<" to "<<new_localUp<<" angle = "<<acos(localUp*new_localUp/(localUp.length()*new_localUp.length()))<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Rotating from "<<localUp<<" to "<<new_localUp<<" angle = "<<acos(localUp*new_localUp/(localUp.length()*new_localUp.length()))<<std::endl;
|
||||
|
||||
//clampOrientation();
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"New up orientation nearly inline - no need to rotate"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"New up orientation nearly inline - no need to rotate"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -573,7 +573,7 @@ void TerrainManipulator::clampOrientation()
|
||||
|
||||
if (sideVector.length()<0.1)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Side vector short "<<sideVector.length()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Side vector short "<<sideVector.length()<<std::endl;
|
||||
|
||||
sideVector = upVector^localUp;
|
||||
sideVector.normalize();
|
||||
|
@ -46,7 +46,7 @@ void EasyCurl::StreamObject::write(const char* ptr, size_t realsize)
|
||||
{
|
||||
if (!_foutOpened)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Writing to cache: "<<_cacheFileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Writing to cache: "<<_cacheFileName<<std::endl;
|
||||
_fout.open(_cacheFileName.c_str(), std::ios::out | std::ios::binary);
|
||||
_foutOpened = true;
|
||||
}
|
||||
@ -80,7 +80,7 @@ size_t EasyCurl::StreamMemoryCallback(void *ptr, size_t size, size_t nmemb, void
|
||||
//
|
||||
EasyCurl::EasyCurl()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"EasyCurl::EasyCurl()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"EasyCurl::EasyCurl()"<<std::endl;
|
||||
|
||||
_previousHttpAuthentication = 0;
|
||||
_connectTimeout = 0; // no timeout by default.
|
||||
@ -95,7 +95,7 @@ EasyCurl::EasyCurl()
|
||||
|
||||
EasyCurl::~EasyCurl()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"EasyCurl::~EasyCurl()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"EasyCurl::~EasyCurl()"<<std::endl;
|
||||
|
||||
if (_curl) curl_easy_cleanup(_curl);
|
||||
|
||||
@ -120,7 +120,7 @@ osgDB::ReaderWriter::ReadResult EasyCurl::read(const std::string& proxyAddress,
|
||||
|
||||
if(!proxyAddress.empty())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Setting proxy: "<<proxyAddress<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Setting proxy: "<<proxyAddress<<std::endl;
|
||||
curl_easy_setopt(_curl, CURLOPT_PROXY, proxyAddress.c_str()); //Sets proxy address and port on libcurl
|
||||
}
|
||||
|
||||
@ -232,9 +232,9 @@ osgDB::ReaderWriter::ReadResult EasyCurl::read(const std::string& proxyAddress,
|
||||
{
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x070c00
|
||||
NOTIFY(osg::NOTICE)<<"Error: libcurl read error, file="<<fileName<<" error = "<<curl_easy_strerror(res)<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: libcurl read error, file="<<fileName<<" error = "<<curl_easy_strerror(res)<<std::endl;
|
||||
#else
|
||||
NOTIFY(osg::NOTICE)<<"Error: libcurl read error, file="<<fileName<<" error no = "<<res<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: libcurl read error, file="<<fileName<<" error no = "<<res<<std::endl;
|
||||
#endif
|
||||
return osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED;
|
||||
}
|
||||
@ -258,7 +258,7 @@ ReaderWriterCURL::ReaderWriterCURL()
|
||||
|
||||
ReaderWriterCURL::~ReaderWriterCURL()
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"ReaderWriterCURL::~ReaderWriterCURL()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"ReaderWriterCURL::~ReaderWriterCURL()"<<std::endl;
|
||||
}
|
||||
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType, osgDB::ReaderWriter* rw, std::istream& fin, const osgDB::ReaderWriter::Options *options) const
|
||||
@ -294,7 +294,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"ReaderWriterCURL::readFile("<<fullFileName<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ReaderWriterCURL::readFile("<<fullFileName<<")"<<std::endl;
|
||||
|
||||
std::string proxyAddress, optProxy, optProxyPort;
|
||||
long connectTimeout = 0;
|
||||
@ -343,7 +343,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
|
||||
if (ext=="gz" || ext=="osgz" || ext=="ivez")
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CURL: Compressed file type "<<ext<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CURL: Compressed file type "<<ext<<std::endl;
|
||||
|
||||
#ifndef USE_ZLIB
|
||||
// don't have zlib so can't compile compressed formats
|
||||
@ -365,7 +365,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
ext = "ive";
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"CURL: assuming file type "<<ext<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CURL: assuming file type "<<ext<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -393,7 +393,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
|
||||
if (curlResult.status()==ReadResult::FILE_LOADED)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CURL: ReadResult::FILE_LOADED "<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CURL: ReadResult::FILE_LOADED "<<std::endl;
|
||||
|
||||
// Try to find a reader by file extension. If this fails, we will fetch the file
|
||||
// anyway and try to get a reader via mime-type.
|
||||
@ -405,7 +405,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
if ( !reader )
|
||||
{
|
||||
std::string mimeType = getEasyCurl().getResultMimeType(sp);
|
||||
NOTIFY(osg::INFO) << "CURL: Looking up extension for mime-type " << mimeType << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "CURL: Looking up extension for mime-type " << mimeType << std::endl;
|
||||
if ( mimeType.length() > 0 )
|
||||
{
|
||||
reader = osgDB::Registry::instance()->getReaderWriterForMimeType(mimeType);
|
||||
@ -415,7 +415,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
// If there is still no reader, fail.
|
||||
if ( !reader )
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: No ReaderWriter for file "<<fileName<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: No ReaderWriter for file "<<fileName<<std::endl;
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
|
||||
if (uncompress)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Curl:: plugin uncompressing "<<fileName<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Curl:: plugin uncompressing "<<fileName<<std::endl;
|
||||
|
||||
std::string uncompressed;
|
||||
if (!read(buffer, uncompressed))
|
||||
@ -448,7 +448,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CURL: not loading successfully "<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CURL: not loading successfully "<<std::endl;
|
||||
return curlResult;
|
||||
}
|
||||
}
|
||||
@ -530,7 +530,7 @@ bool ReaderWriterCURL::fileExists(const std::string& filename, const osgDB::Opti
|
||||
{
|
||||
if (osgDB::containsServerAddress(filename))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Checking if file exists using curl plugin: "<<filename<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Checking if file exists using curl plugin: "<<filename<<std::endl;
|
||||
|
||||
ReadResult result = readFile(OBJECT,filename,options);
|
||||
return result.status()==osgDB::ReaderWriter::ReadResult::FILE_LOADED;
|
||||
|
@ -153,7 +153,7 @@ DataInputStream::DataInputStream(std::istream* istream, const osgDB::ReaderWrite
|
||||
if (_options.get())
|
||||
{
|
||||
setLoadExternalReferenceFiles(_options->getOptionString().find("noLoadExternalReferenceFiles")==std::string::npos);
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataInputStream.setLoadExternalReferenceFiles()=" << getLoadExternalReferenceFiles() << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataInputStream.setLoadExternalReferenceFiles()=" << getLoadExternalReferenceFiles() << std::endl;
|
||||
}
|
||||
|
||||
if(!istream){
|
||||
@ -167,7 +167,7 @@ DataInputStream::DataInputStream(std::istream* istream, const osgDB::ReaderWrite
|
||||
if ( endianType != OPPOSITE_ENDIAN_TYPE ) {
|
||||
throwException("DataInputStream::DataInputStream(): This file has an unreadable endian type.") ;
|
||||
}
|
||||
NOTIFY(osg::INFO)<<"DataInputStream::DataInputStream: Reading a byteswapped file" << std::endl ;
|
||||
OSG_NOTIFY(osg::INFO)<<"DataInputStream::DataInputStream: Reading a byteswapped file" << std::endl ;
|
||||
_byteswap = 1 ;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ DataInputStream::DataInputStream(std::istream* istream, const osgDB::ReaderWrite
|
||||
|
||||
if (compressionLevel>0)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"compressed ive stream"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"compressed ive stream"<<std::endl;
|
||||
|
||||
unsigned int maxSize = readUInt();
|
||||
|
||||
@ -202,7 +202,7 @@ DataInputStream::DataInputStream(std::istream* istream, const osgDB::ReaderWrite
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"uncompressed ive stream"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"uncompressed ive stream"<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +238,7 @@ bool DataInputStream::uncompress(std::istream& fin, std::string& destination) co
|
||||
);
|
||||
if (ret != Z_OK)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"failed to init"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"failed to init"<<std::endl;
|
||||
return ret != 0;
|
||||
}
|
||||
|
||||
|
@ -172,22 +172,22 @@ DataOutputStream::DataOutputStream(std::ostream * ostream, const osgDB::ReaderWr
|
||||
} else if(optionsString.find("compressImageData")!=std::string::npos) {
|
||||
setIncludeImageMode(IMAGE_COMPRESS_DATA);
|
||||
}
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setIncludeImageMode()=" << getIncludeImageMode() << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setIncludeImageMode()=" << getIncludeImageMode() << std::endl;
|
||||
|
||||
setIncludeExternalReferences(optionsString.find("inlineExternalReferencesInIVEFile")!=std::string::npos);
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setIncludeExternalReferences()=" << getIncludeExternalReferences() << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setIncludeExternalReferences()=" << getIncludeExternalReferences() << std::endl;
|
||||
|
||||
setWriteExternalReferenceFiles(optionsString.find("noWriteExternalReferenceFiles")==std::string::npos);
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setWriteExternalReferenceFiles()=" << getWriteExternalReferenceFiles() << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setWriteExternalReferenceFiles()=" << getWriteExternalReferenceFiles() << std::endl;
|
||||
|
||||
setUseOriginalExternalReferences(optionsString.find("useOriginalExternalReferences")!=std::string::npos);
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setUseOriginalExternalReferences()=" << getUseOriginalExternalReferences() << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setUseOriginalExternalReferences()=" << getUseOriginalExternalReferences() << std::endl;
|
||||
|
||||
setOutputTextureFiles(optionsString.find("OutputTextureFiles")!=std::string::npos);
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setOutputTextureFiles()=" << getOutputTextureFiles() << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream.setOutputTextureFiles()=" << getOutputTextureFiles() << std::endl;
|
||||
|
||||
_compressionLevel = (optionsString.find("compressed")!=std::string::npos) ? 1 : 0;
|
||||
NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream._compressionLevel=" << _compressionLevel << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "ive::DataOutputStream._compressionLevel=" << _compressionLevel << std::endl;
|
||||
|
||||
std::string::size_type terrainErrorPos = optionsString.find("TerrainMaximumErrorToSizeRatio=");
|
||||
if (terrainErrorPos!=std::string::npos)
|
||||
@ -203,11 +203,11 @@ DataOutputStream::DataOutputStream(std::ostream * ostream, const osgDB::ReaderWr
|
||||
std::string numberString = optionsString.substr(endOfToken+1, numOfCharInNumber);
|
||||
_maximumErrorToSizeRatio = osg::asciiToDouble(numberString.c_str());
|
||||
|
||||
NOTIFY(osg::DEBUG_INFO)<<"TerrainMaximumErrorToSizeRatio = "<<_maximumErrorToSizeRatio<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"TerrainMaximumErrorToSizeRatio = "<<_maximumErrorToSizeRatio<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO)<<"Error no value to TerrainMaximumErrorToSizeRatio assigned"<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"Error no value to TerrainMaximumErrorToSizeRatio assigned"<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -215,7 +215,7 @@ DataOutputStream::DataOutputStream(std::ostream * ostream, const osgDB::ReaderWr
|
||||
#ifndef USE_ZLIB
|
||||
if (_compressionLevel>0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Compression not supported in this .ive version." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Compression not supported in this .ive version." << std::endl;
|
||||
_compressionLevel = 0;
|
||||
}
|
||||
#endif
|
||||
@ -296,7 +296,7 @@ bool DataOutputStream::compress(std::ostream& fout, const std::string& source) c
|
||||
|
||||
if (ret == Z_STREAM_ERROR)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Z_STREAM_ERROR"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Z_STREAM_ERROR"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -666,7 +666,7 @@ void DataOutputStream::writePackedFloatArray(const osg::FloatArray* a, float max
|
||||
|
||||
if (minValue==maxValue)
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO)<<"Writing out "<<size<<" same values "<<minValue<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"Writing out "<<size<<" same values "<<minValue<<std::endl;
|
||||
|
||||
writeBool(true);
|
||||
writeFloat(minValue);
|
||||
@ -705,14 +705,14 @@ void DataOutputStream::writePackedFloatArray(const osg::FloatArray* a, float max
|
||||
if (error_short>max_error_short) max_error_short = error_short;
|
||||
}
|
||||
|
||||
NOTIFY(osg::DEBUG_INFO)<<"maxError "<<maxError<<std::endl;
|
||||
NOTIFY(osg::DEBUG_INFO)<<"Values to write "<<size<<" max_error_byte = "<<max_error_byte<<" max_error_short="<<max_error_short<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"maxError "<<maxError<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"Values to write "<<size<<" max_error_byte = "<<max_error_byte<<" max_error_short="<<max_error_short<<std::endl;
|
||||
|
||||
|
||||
if (max_error_byte < maxError) packingSize = 1;
|
||||
else if (max_error_short < maxError) packingSize = 2;
|
||||
|
||||
NOTIFY(osg::DEBUG_INFO)<<"packingSize "<<packingSize<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO)<<"packingSize "<<packingSize<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ void Image::write(DataOutputStream* out)
|
||||
out->writeInt(r());
|
||||
|
||||
|
||||
NOTIFY(osg::DEBUG_INFO) << "image written '" << getFileName()<<"'\t"<<s()<<"\t"<<t()<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "image written '" << getFileName()<<"'\t"<<s()<<"\t"<<t()<<std::endl;
|
||||
|
||||
// Write formats, type and packing
|
||||
out->writeInt(getInternalTextureFormat());
|
||||
|
@ -134,7 +134,7 @@ void Uniform::write(DataOutputStream* out){
|
||||
}
|
||||
default:
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning : uniform "<<getType()<<"type not supported for writing."<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning : uniform "<<getType()<<"type not supported for writing."<<std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -253,7 +253,7 @@ void Uniform::read(DataInputStream* in)
|
||||
}
|
||||
default:
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning : uniform "<<getType()<<"type not supported for reading."<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning : uniform "<<getType()<<"type not supported for reading."<<std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ public:
|
||||
{
|
||||
if ( prop._name!=enumString )
|
||||
{
|
||||
NOTIFY(osg::WARN) << "AsciiInputIterator::readProperty(): Unmatched property "
|
||||
OSG_NOTIFY(osg::WARN) << "AsciiInputIterator::readProperty(): Unmatched property "
|
||||
<< enumString << ", expecting " << prop._name << std::endl;
|
||||
}
|
||||
prop._name = enumString;
|
||||
|
@ -121,11 +121,11 @@ class OSGReaderWriter : public ReaderWriter
|
||||
std::string filename = osgDB::Registry::instance()->createLibraryNameForExtension("deprecated_osg");
|
||||
if (osgDB::Registry::instance()->loadLibrary(filename)==osgDB::Registry::LOADED)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Constructor OSGReaderWriter - loaded OK"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Constructor OSGReaderWriter - loaded OK"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Constructor OSGReaderWriter - failed to load"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Constructor OSGReaderWriter - failed to load"<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -88,11 +88,11 @@ public:
|
||||
std::string filename = osgDB::Registry::instance()->createLibraryNameForExtension("serializers_osg");
|
||||
if (osgDB::Registry::instance()->loadLibrary(filename)==osgDB::Registry::LOADED)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Constructor ReaderWriterOSG2 - loaded OK"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Constructor ReaderWriterOSG2 - loaded OK"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Constructor ReaderWriterOSG2 - failed to load"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Constructor ReaderWriterOSG2 - failed to load"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ void GeometryTechnique::setFilterMatrixAs(FilterType filterType)
|
||||
|
||||
void GeometryTechnique::init()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Doing GeometryTechnique::init()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Doing GeometryTechnique::init()"<<std::endl;
|
||||
|
||||
if (!_terrainTile) return;
|
||||
|
||||
@ -140,7 +140,7 @@ Locator* GeometryTechnique::computeMasterLocator()
|
||||
Locator* masterLocator = elevationLocator ? elevationLocator : colorLocator;
|
||||
if (!masterLocator)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Problem, no locator found in any of the terrain layers"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Problem, no locator found in any of the terrain layers"<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -195,8 +195,8 @@ osg::Vec3d GeometryTechnique::computeCenterModel(Locator* masterLocator)
|
||||
}
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"bottomLeftNDC = "<<bottomLeftNDC<<std::endl;
|
||||
NOTIFY(osg::INFO)<<"topRightNDC = "<<topRightNDC<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"bottomLeftNDC = "<<bottomLeftNDC<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"topRightNDC = "<<topRightNDC<<std::endl;
|
||||
|
||||
buffer._transform = new osg::MatrixTransform;
|
||||
|
||||
@ -238,7 +238,7 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
|
||||
double i_sampleFactor = 1.0;
|
||||
double j_sampleFactor = 1.0;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Sample ratio="<<sampleRatio<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Sample ratio="<<sampleRatio<<std::endl;
|
||||
|
||||
if (sampleRatio!=1.0f)
|
||||
{
|
||||
@ -256,7 +256,7 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
|
||||
|
||||
|
||||
bool treatBoundariesToValidDataAsDefaultValue = _terrainTile->getTreatBoundariesToValidDataAsDefaultValue();
|
||||
NOTIFY(osg::INFO)<<"TreatBoundariesToValidDataAsDefaultValue="<<treatBoundariesToValidDataAsDefaultValue<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"TreatBoundariesToValidDataAsDefaultValue="<<treatBoundariesToValidDataAsDefaultValue<<std::endl;
|
||||
|
||||
float skirtHeight = 0.0f;
|
||||
HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>(elevationLayer);
|
||||
@ -362,7 +362,7 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
|
||||
{
|
||||
float value = 0.0f;
|
||||
validValue = elevationLayer->getValidValue(i_equiv,j_equiv, value);
|
||||
// NOTIFY(osg::INFO)<<"i="<<i<<" j="<<j<<" z="<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"i="<<i<<" j="<<j<<" z="<<value<<std::endl;
|
||||
ndc.z() = value*scaleHeight;
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
|
||||
|
||||
bool smallTile = numVertices <= 16384;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"smallTile = "<<smallTile<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"smallTile = "<<smallTile<<std::endl;
|
||||
|
||||
osg::ref_ptr<osg::DrawElements> elements = smallTile ?
|
||||
static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_TRIANGLES)) :
|
||||
@ -697,11 +697,11 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
|
||||
|
||||
|
||||
//osg::Timer_t before = osg::Timer::instance()->tick();
|
||||
//NOTIFY(osg::NOTICE)<<"osgTerrain::GeometryTechnique::build kd tree"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"osgTerrain::GeometryTechnique::build kd tree"<<std::endl;
|
||||
osg::ref_ptr<osg::KdTreeBuilder> builder = osgDB::Registry::instance()->getKdTreeBuilder()->clone();
|
||||
buffer._geode->accept(*builder);
|
||||
//osg::Timer_t after = osg::Timer::instance()->tick();
|
||||
//NOTIFY(osg::NOTICE)<<"KdTree build time "<<osg::Timer::instance()->delta_m(before, after)<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"KdTree build time "<<osg::Timer::instance()->delta_m(before, after)<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -759,19 +759,19 @@ void GeometryTechnique::applyColorLayers()
|
||||
|
||||
if (mipMapping && (s_NotPowerOfTwo || t_NotPowerOfTwo))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Disabling mipmapping for non power of two tile size("<<image->s()<<", "<<image->t()<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Disabling mipmapping for non power of two tile size("<<image->s()<<", "<<image->t()<<")"<<std::endl;
|
||||
texture2D->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
|
||||
}
|
||||
|
||||
|
||||
layerToTextureMap[colorLayer] = texture2D;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Creating new ImageLayer texture "<<layerNum<<" image->s()="<<image->s()<<" image->t()="<<image->t()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Creating new ImageLayer texture "<<layerNum<<" image->s()="<<image->s()<<" image->t()="<<image->t()<<std::endl;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Reusing ImageLayer texture "<<layerNum<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Reusing ImageLayer texture "<<layerNum<<std::endl;
|
||||
}
|
||||
|
||||
stateset->setTextureAttributeAndModes(layerNum, texture2D, osg::StateAttribute::ON);
|
||||
@ -885,7 +885,7 @@ void GeometryTechnique::traverse(osg::NodeVisitor& nv)
|
||||
|
||||
if (_terrainTile->getDirty())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"******* Doing init ***********"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"******* Doing init ***********"<<std::endl;
|
||||
_terrainTile->init();
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ bool ImageLayer::transform(float offset, float scale)
|
||||
{
|
||||
if (!_image.valid()) return false;
|
||||
|
||||
NOTIFY(osg::INFO)<<"ImageLayer::transform("<<offset<<","<<scale<<")"<<std::endl;;
|
||||
OSG_NOTIFY(osg::INFO)<<"ImageLayer::transform("<<offset<<","<<scale<<")"<<std::endl;;
|
||||
|
||||
processImage(_image.get(), TransformOperator(offset,scale));
|
||||
|
||||
@ -228,30 +228,30 @@ bool ImageLayer::getValue(unsigned int i, unsigned int j, float& value) const
|
||||
{
|
||||
case(GL_BYTE):
|
||||
value = *((const char*)data);
|
||||
// NOTIFY(osg::NOTICE)<<"byte "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"byte "<<value<<std::endl;
|
||||
break;
|
||||
case(GL_UNSIGNED_BYTE):
|
||||
value = *data;
|
||||
// NOTIFY(osg::NOTICE)<<"Unsigned byte "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Unsigned byte "<<value<<std::endl;
|
||||
break;
|
||||
case(GL_SHORT):
|
||||
value = *((const short*)data);
|
||||
// NOTIFY(osg::NOTICE)<<"Short "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Short "<<value<<std::endl;
|
||||
break;
|
||||
case(GL_UNSIGNED_SHORT):
|
||||
value = *((const unsigned short*)data);
|
||||
// NOTIFY(osg::NOTICE)<<"Unsigned Short "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Unsigned Short "<<value<<std::endl;
|
||||
break;
|
||||
case(GL_INT):
|
||||
value = *((const int*)data);
|
||||
// NOTIFY(osg::NOTICE)<<"Int "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Int "<<value<<std::endl;
|
||||
break;
|
||||
case(GL_UNSIGNED_INT):
|
||||
// NOTIFY(osg::NOTICE)<<"Unsigned Int "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Unsigned Int "<<value<<std::endl;
|
||||
value = *((const unsigned int*)data);
|
||||
break;
|
||||
case(GL_FLOAT):
|
||||
// NOTIFY(osg::NOTICE)<<"Float "<<value<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Float "<<value<<std::endl;
|
||||
value = *((const float*)data);
|
||||
break;
|
||||
default:
|
||||
@ -264,19 +264,19 @@ bool ImageLayer::getValue(unsigned int i, unsigned int j, float& value) const
|
||||
|
||||
bool ImageLayer::getValue(unsigned int i, unsigned int j, osg::Vec2& value) const
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Not implemented yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Not implemented yet"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ImageLayer::getValue(unsigned int i, unsigned int j, osg::Vec3& value) const
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Not implemented yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Not implemented yet"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ImageLayer::getValue(unsigned int i, unsigned int j, osg::Vec4& value) const
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Not implemented yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Not implemented yet"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -324,7 +324,7 @@ bool ContourLayer::transform(float offset, float scale)
|
||||
{
|
||||
if (!_tf) return false;
|
||||
|
||||
NOTIFY(osg::INFO)<<"ContourLayer::transform("<<offset<<","<<scale<<")"<<std::endl;;
|
||||
OSG_NOTIFY(osg::INFO)<<"ContourLayer::transform("<<offset<<","<<scale<<")"<<std::endl;;
|
||||
|
||||
osg::TransferFunction1D::ColorMap newColorMap = _tf->getColorMap();
|
||||
for(osg::TransferFunction1D::ColorMap::iterator itr = newColorMap.begin();
|
||||
@ -438,7 +438,7 @@ bool HeightFieldLayer::transform(float offset, float scale)
|
||||
osg::FloatArray* heights = _heightField->getFloatArray();
|
||||
if (!heights) return false;
|
||||
|
||||
NOTIFY(osg::INFO)<<"HeightFieldLayer::transform("<<offset<<","<<scale<<")"<<std::endl;;
|
||||
OSG_NOTIFY(osg::INFO)<<"HeightFieldLayer::transform("<<offset<<","<<scale<<")"<<std::endl;;
|
||||
|
||||
for(osg::FloatArray::iterator itr = heights->begin();
|
||||
itr != heights->end();
|
||||
|
@ -34,24 +34,24 @@ TerrainTechnique::~TerrainTechnique()
|
||||
|
||||
void TerrainTechnique::init()
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<className()<<"::initialize(..) not implementated yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<className()<<"::initialize(..) not implementated yet"<<std::endl;
|
||||
}
|
||||
|
||||
void TerrainTechnique::update(osgUtil::UpdateVisitor* uv)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<className()<<"::update(..) not implementated yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<className()<<"::update(..) not implementated yet"<<std::endl;
|
||||
if (_terrainTile) _terrainTile->osg::Group::traverse(*uv);
|
||||
}
|
||||
|
||||
void TerrainTechnique::cull(osgUtil::CullVisitor* cv)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<className()<<"::cull(..) not implementated yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<className()<<"::cull(..) not implementated yet"<<std::endl;
|
||||
if (_terrainTile) _terrainTile->osg::Group::traverse(*cv);
|
||||
}
|
||||
|
||||
void TerrainTechnique::cleanSceneGraph()
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<className()<<"::cleanSceneGraph(..) not implementated yet"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<className()<<"::cleanSceneGraph(..) not implementated yet"<<std::endl;
|
||||
}
|
||||
|
||||
void TerrainTechnique::traverse(osg::NodeVisitor& nv)
|
||||
|
@ -126,7 +126,7 @@ void TerrainTile::traverse(osg::NodeVisitor& nv)
|
||||
osgTerrain::Terrain* ts = dynamic_cast<Terrain*>(*itr);
|
||||
if (ts)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Assigning terrain system "<<ts<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Assigning terrain system "<<ts<<std::endl;
|
||||
setTerrain(ts);
|
||||
}
|
||||
}
|
||||
|
@ -169,17 +169,17 @@ void CullVisitor::computeNearPlane()
|
||||
++itr)
|
||||
{
|
||||
++numTests;
|
||||
// NOTIFY(osg::WARN)<<"testing computeNearestPointInFrustum with d_near = "<<itr->first<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"testing computeNearestPointInFrustum with d_near = "<<itr->first<<std::endl;
|
||||
value_type d_near = computeNearestPointInFrustum(itr->second._matrix, itr->second._planes,*(itr->second._drawable));
|
||||
if (d_near<_computed_znear)
|
||||
{
|
||||
_computed_znear = d_near;
|
||||
// NOTIFY(osg::WARN)<<"updating znear to "<<_computed_znear<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"updating znear to "<<_computed_znear<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// osg::Timer_t end_t = osg::Timer::instance()->tick();
|
||||
// NOTIFY(osg::NOTICE)<<"Took "<<osg::Timer::instance()->delta_m(start_t,end_t)<<"ms to test "<<numTests<<" out of "<<_nearPlaneCandidateMap.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Took "<<osg::Timer::instance()->delta_m(start_t,end_t)<<"ms to test "<<numTests<<" out of "<<_nearPlaneCandidateMap.size()<<std::endl;
|
||||
|
||||
_nearPlaneCandidateMap.clear();
|
||||
}
|
||||
@ -192,7 +192,7 @@ void CullVisitor::popProjectionMatrix()
|
||||
if (_computeNearFar && _computed_zfar>=_computed_znear)
|
||||
{
|
||||
|
||||
//NOTIFY(osg::INFO)<<"clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
|
||||
|
||||
|
||||
// adjust the projection matrix so that it encompases the local coords.
|
||||
@ -206,7 +206,7 @@ void CullVisitor::popProjectionMatrix()
|
||||
}
|
||||
else
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<"Not clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Not clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
|
||||
}
|
||||
|
||||
CullStack::popProjectionMatrix();
|
||||
@ -218,7 +218,7 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
|
||||
double epsilon = 1e-6;
|
||||
if (zfar<znear-epsilon)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"_clampProjectionMatrix not applied, invalid depth range, znear = "<<znear<<" zfar = "<<zfar<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"_clampProjectionMatrix not applied, invalid depth range, znear = "<<znear<<" zfar = "<<zfar<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -229,12 +229,12 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
|
||||
double average = (znear+zfar)*0.5;
|
||||
znear = average-epsilon;
|
||||
zfar = average+epsilon;
|
||||
// NOTIFY(osg::INFO) << "_clampProjectionMatrix widening znear and zfar to "<<znear<<" "<<zfar<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "_clampProjectionMatrix widening znear and zfar to "<<znear<<" "<<zfar<<std::endl;
|
||||
}
|
||||
|
||||
if (fabs(projection(0,3))<epsilon && fabs(projection(1,3))<epsilon && fabs(projection(2,3))<epsilon )
|
||||
{
|
||||
// NOTIFY(osg::INFO) << "Orthographic matrix before clamping"<<projection<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "Orthographic matrix before clamping"<<projection<<std::endl;
|
||||
|
||||
value_type delta_span = (zfar-znear)*0.02;
|
||||
if (delta_span<1.0) delta_span = 1.0;
|
||||
@ -248,12 +248,12 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
|
||||
projection(2,2)=-2.0f/(desired_zfar-desired_znear);
|
||||
projection(3,2)=-(desired_zfar+desired_znear)/(desired_zfar-desired_znear);
|
||||
|
||||
// NOTIFY(osg::INFO) << "Orthographic matrix after clamping "<<projection<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "Orthographic matrix after clamping "<<projection<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// NOTIFY(osg::INFO) << "Persepective matrix before clamping"<<projection<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "Persepective matrix before clamping"<<projection<<std::endl;
|
||||
|
||||
//std::cout << "_computed_znear"<<_computed_znear<<std::endl;
|
||||
//std::cout << "_computed_zfar"<<_computed_zfar<<std::endl;
|
||||
@ -285,7 +285,7 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
|
||||
0.0f,0.0f,ratio,0.0f,
|
||||
0.0f,0.0f,center*ratio,1.0f));
|
||||
|
||||
// NOTIFY(osg::INFO) << "Persepective matrix after clamping"<<projection<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "Persepective matrix after clamping"<<projection<<std::endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -336,7 +336,7 @@ struct ComputeNearestPointFunctor
|
||||
n2 >= _znear &&
|
||||
n3 >= _znear)
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Triangle totally beyond znear"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Triangle totally beyond znear"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ struct ComputeNearestPointFunctor
|
||||
n2 < 0.0 &&
|
||||
n3 < 0.0)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Triangle totally behind eye point"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Triangle totally behind eye point"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@ struct ComputeNearestPointFunctor
|
||||
unsigned int numOutside = ((d1<0.0)?1:0) + ((d2<0.0)?1:0) + ((d3<0.0)?1:0);
|
||||
if (numOutside==3)
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Triangle totally outside frustum "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Triangle totally outside frustum "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
|
||||
return;
|
||||
}
|
||||
unsigned int numInside = ((d1>=0.0)?1:0) + ((d2>=0.0)?1:0) + ((d3>=0.0)?1:0);
|
||||
@ -375,7 +375,7 @@ struct ComputeNearestPointFunctor
|
||||
active_mask = active_mask | selector_mask;
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"Triangle ok w.r.t plane "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Triangle ok w.r.t plane "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
|
||||
|
||||
selector_mask <<= 1;
|
||||
}
|
||||
@ -385,7 +385,7 @@ struct ComputeNearestPointFunctor
|
||||
_znear = osg::minimum(_znear,n1);
|
||||
_znear = osg::minimum(_znear,n2);
|
||||
_znear = osg::minimum(_znear,n3);
|
||||
// NOTIFY(osg::NOTICE)<<"Triangle all inside frustum "<<n1<<"\t"<<n2<<"\t"<<n3<<" number of plane="<<_planes->size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Triangle all inside frustum "<<n1<<"\t"<<n2<<"\t"<<n3<<" number of plane="<<_planes->size()<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ struct ComputeNearestPointFunctor
|
||||
// numPartiallyInside>0) so we have a triangle cutting an frustum wall,
|
||||
// this means that use brute force methods for deviding up triangle.
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"Using brute force method of triangle cutting frustum walls"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Using brute force method of triangle cutting frustum walls"<<std::endl;
|
||||
_polygonOriginal.clear();
|
||||
_polygonOriginal.push_back(DistancePoint(0,v1));
|
||||
_polygonOriginal.push_back(DistancePoint(0,v2));
|
||||
@ -458,7 +458,7 @@ struct ComputeNearestPointFunctor
|
||||
if (dist < _znear)
|
||||
{
|
||||
_znear = dist;
|
||||
//NOTIFY(osg::NOTICE)<<"Near plane updated "<<_znear<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Near plane updated "<<_znear<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -466,7 +466,7 @@ struct ComputeNearestPointFunctor
|
||||
|
||||
CullVisitor::value_type CullVisitor::computeNearestPointInFrustum(const osg::Matrix& matrix, const osg::Polytope::PlaneList& planes,const osg::Drawable& drawable)
|
||||
{
|
||||
// NOTIFY(osg::WARN)<<"CullVisitor::computeNearestPointInFrustum("<<getTraversalNumber()<<"\t"<<planes.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"CullVisitor::computeNearestPointInFrustum("<<getTraversalNumber()<<"\t"<<planes.size()<<std::endl;
|
||||
|
||||
osg::TriangleFunctor<ComputeNearestPointFunctor> cnpf;
|
||||
cnpf.set(_computed_znear, matrix, &planes);
|
||||
@ -488,8 +488,8 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::B
|
||||
std::swap(d_near,d_far);
|
||||
if ( !EQUAL_F(d_near, d_far) )
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
|
||||
NOTIFY(osg::WARN)<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,7 +520,7 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
|
||||
static double elapsed_time = 0.0;
|
||||
if (lastFrameNumber != getTraversalNumber())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Took "<<elapsed_time<<"ms to test "<<numBillboards<<" billboards"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Took "<<elapsed_time<<"ms to test "<<numBillboards<<" billboards"<<std::endl;
|
||||
numBillboards = 0;
|
||||
elapsed_time = 0.0;
|
||||
lastFrameNumber = getTraversalNumber();
|
||||
@ -539,14 +539,14 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
|
||||
d_near = distance(bb.corner(bbCornerNear),matrix);
|
||||
d_far = distance(bb.corner(bbCornerFar),matrix);
|
||||
|
||||
NOTIFY(osg::NOTICE).precision(15);
|
||||
OSG_NOTIFY(osg::NOTICE).precision(15);
|
||||
|
||||
if (false)
|
||||
{
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"TESTING Billboard near/far computation"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"TESTING Billboard near/far computation"<<std::endl;
|
||||
|
||||
// NOTIFY(osg::WARN)<<"Checking corners of billboard "<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"Checking corners of billboard "<<std::endl;
|
||||
// deprecated brute force way, use all corners of the bounding box.
|
||||
value_type nd_near, nd_far;
|
||||
nd_near = nd_far = distance(bb.corner(0),matrix);
|
||||
@ -555,16 +555,16 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
|
||||
value_type d = distance(bb.corner(i),matrix);
|
||||
if (d<nd_near) nd_near = d;
|
||||
if (d>nd_far) nd_far = d;
|
||||
NOTIFY(osg::NOTICE)<<"\ti="<<i<<"\td="<<d<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"\ti="<<i<<"\td="<<d<<std::endl;
|
||||
}
|
||||
|
||||
if (nd_near==d_near && nd_far==d_far)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"\tBillboard near/far computation correct "<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"\tBillboard near/far computation correct "<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"\tBillboard near/far computation ERROR\n\t\t"<<d_near<<"\t"<<nd_near
|
||||
OSG_NOTIFY(osg::NOTICE)<<"\tBillboard near/far computation ERROR\n\t\t"<<d_near<<"\t"<<nd_near
|
||||
<<"\n\t\t"<<d_far<<"\t"<<nd_far<<std::endl;
|
||||
}
|
||||
|
||||
@ -590,8 +590,8 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
|
||||
std::swap(d_near,d_far);
|
||||
if ( !EQUAL_F(d_near, d_far) )
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
|
||||
NOTIFY(osg::WARN)<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -610,7 +610,7 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
|
||||
{
|
||||
if (isBillboard)
|
||||
{
|
||||
// NOTIFY(osg::WARN)<<"Adding billboard into deffered list"<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"Adding billboard into deffered list"<<std::endl;
|
||||
|
||||
osg::Polytope transformed_frustum;
|
||||
transformed_frustum.setAndTransformProvidingInverse(getProjectionCullingStack().back().getFrustum(),matrix);
|
||||
@ -631,18 +631,18 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
|
||||
if (d_far<_computed_znear)
|
||||
{
|
||||
if (d_far>=0.0) _computed_znear = d_far;
|
||||
else NOTIFY(osg::WARN)<<" 1) sett near with dnear="<<d_near<<" dfar="<<d_far<< std::endl;
|
||||
else OSG_NOTIFY(osg::WARN)<<" 1) sett near with dnear="<<d_near<<" dfar="<<d_far<< std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_near>=0.0) _computed_znear = d_near;
|
||||
else NOTIFY(osg::WARN)<<" 2) sett near with d_near="<<d_near<< std::endl;
|
||||
else OSG_NOTIFY(osg::WARN)<<" 2) sett near with d_near="<<d_near<< std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (d_near<0.0) NOTIFY(osg::WARN)<<" 3) set near with d_near="<<d_near<< std::endl;
|
||||
//if (d_near<0.0) OSG_NOTIFY(osg::WARN)<<" 3) set near with d_near="<<d_near<< std::endl;
|
||||
_computed_znear = d_near;
|
||||
}
|
||||
}
|
||||
@ -681,7 +681,7 @@ void CullVisitor::updateCalculatedNearFar(const osg::Vec3& pos)
|
||||
if (d<_computed_znear)
|
||||
{
|
||||
_computed_znear = d;
|
||||
if (d<0.0) NOTIFY(osg::WARN)<<"Alerting billboard ="<<d<< std::endl;
|
||||
if (d<0.0) OSG_NOTIFY(osg::WARN)<<"Alerting billboard ="<<d<< std::endl;
|
||||
}
|
||||
if (d>_computed_zfar) _computed_zfar = d;
|
||||
}
|
||||
@ -772,13 +772,13 @@ void CullVisitor::apply(Geode& node)
|
||||
|
||||
if (osg::isNaN(depth))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"CullVisitor::apply(Geode&) detected NaN,"<<std::endl
|
||||
OSG_NOTIFY(osg::NOTICE)<<"CullVisitor::apply(Geode&) detected NaN,"<<std::endl
|
||||
<<" depth="<<depth<<", center=("<<bb.center()<<"),"<<std::endl
|
||||
<<" matrix="<<matrix<<std::endl;
|
||||
NOTIFY(osg::DEBUG_INFO) << " NodePath:" << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << " NodePath:" << std::endl;
|
||||
for (NodePath::const_iterator i = getNodePath().begin(); i != getNodePath().end(); ++i)
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << " \"" << (*i)->getName() << "\"" << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << " \"" << (*i)->getName() << "\"" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -839,7 +839,7 @@ void CullVisitor::apply(Billboard& node)
|
||||
{
|
||||
if (d<_computed_znear)
|
||||
{
|
||||
if (d<0.0) NOTIFY(osg::WARN)<<"Alerting billboard handling ="<<d<< std::endl;
|
||||
if (d<0.0) OSG_NOTIFY(osg::WARN)<<"Alerting billboard handling ="<<d<< std::endl;
|
||||
_computed_znear = d;
|
||||
}
|
||||
if (d>_computed_zfar) _computed_zfar = d;
|
||||
@ -850,13 +850,13 @@ void CullVisitor::apply(Billboard& node)
|
||||
|
||||
if (osg::isNaN(depth))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"CullVisitor::apply(Billboard&) detected NaN,"<<std::endl
|
||||
OSG_NOTIFY(osg::NOTICE)<<"CullVisitor::apply(Billboard&) detected NaN,"<<std::endl
|
||||
<<" depth="<<depth<<", pos=("<<pos<<"),"<<std::endl
|
||||
<<" *billboard_matrix="<<*billboard_matrix<<std::endl;
|
||||
NOTIFY(osg::DEBUG_INFO) << " NodePath:" << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << " NodePath:" << std::endl;
|
||||
for (NodePath::const_iterator i = getNodePath().begin(); i != getNodePath().end(); ++i)
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << " \"" << (*i)->getName() << "\"" << std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << " \"" << (*i)->getName() << "\"" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1025,7 +1025,7 @@ void CullVisitor::apply(Projection& node)
|
||||
ref_ptr<RefMatrix> matrix = createOrReuseMatrix(node.getMatrix());
|
||||
pushProjectionMatrix(matrix.get());
|
||||
|
||||
//NOTIFY(osg::INFO)<<"Push projection "<<*matrix<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Push projection "<<*matrix<<std::endl;
|
||||
|
||||
// note do culling check after the frustum has been updated to ensure
|
||||
// that the node is not culled prematurely.
|
||||
@ -1036,7 +1036,7 @@ void CullVisitor::apply(Projection& node)
|
||||
|
||||
popProjectionMatrix();
|
||||
|
||||
//NOTIFY(osg::INFO)<<"Pop projection "<<*matrix<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Pop projection "<<*matrix<<std::endl;
|
||||
|
||||
_computed_znear = previous_znear;
|
||||
_computed_zfar = previous_zfar;
|
||||
|
@ -155,7 +155,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & TESSELLATE_GEOMETRY)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TESSELLATE_GEOMETRY"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TESSELLATE_GEOMETRY"<<std::endl;
|
||||
|
||||
TessellateVisitor tsv;
|
||||
node->accept(tsv);
|
||||
@ -163,7 +163,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & REMOVE_LOADED_PROXY_NODES)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_LOADED_PROXY_NODES"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_LOADED_PROXY_NODES"<<std::endl;
|
||||
|
||||
RemoveLoadedProxyNodesVisitor rlpnv(this);
|
||||
node->accept(rlpnv);
|
||||
@ -173,7 +173,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & COMBINE_ADJACENT_LODS)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COMBINE_ADJACENT_LODS"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COMBINE_ADJACENT_LODS"<<std::endl;
|
||||
|
||||
CombineLODsVisitor clv(this);
|
||||
node->accept(clv);
|
||||
@ -182,7 +182,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & OPTIMIZE_TEXTURE_SETTINGS)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing OPTIMIZE_TEXTURE_SETTINGS"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing OPTIMIZE_TEXTURE_SETTINGS"<<std::endl;
|
||||
|
||||
TextureVisitor tv(true,true, // unref image
|
||||
false,false, // client storage
|
||||
@ -193,7 +193,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & SHARE_DUPLICATE_STATE)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SHARE_DUPLICATE_STATE"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SHARE_DUPLICATE_STATE"<<std::endl;
|
||||
|
||||
bool combineDynamicState = false;
|
||||
bool combineStaticState = true;
|
||||
@ -206,7 +206,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & TEXTURE_ATLAS_BUILDER)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TEXTURE_ATLAS_BUILDER"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TEXTURE_ATLAS_BUILDER"<<std::endl;
|
||||
|
||||
// traverse the scene collecting textures into texture atlas.
|
||||
TextureAtlasVisitor tav(this);
|
||||
@ -225,7 +225,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & COPY_SHARED_NODES)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COPY_SHARED_NODES"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COPY_SHARED_NODES"<<std::endl;
|
||||
|
||||
CopySharedSubgraphsVisitor cssv(this);
|
||||
node->accept(cssv);
|
||||
@ -234,13 +234,13 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & FLATTEN_STATIC_TRANSFORMS)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS"<<std::endl;
|
||||
|
||||
int i=0;
|
||||
bool result = false;
|
||||
do
|
||||
{
|
||||
NOTIFY(osg::DEBUG_INFO) << "** RemoveStaticTransformsVisitor *** Pass "<<i<<std::endl;
|
||||
OSG_NOTIFY(osg::DEBUG_INFO) << "** RemoveStaticTransformsVisitor *** Pass "<<i<<std::endl;
|
||||
FlattenStaticTransformsVisitor fstv(this);
|
||||
node->accept(fstv);
|
||||
result = fstv.removeTransforms(node);
|
||||
@ -255,7 +255,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS"<<std::endl;
|
||||
|
||||
// no combine any adjacent static transforms.
|
||||
FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor fstdssv(this);
|
||||
@ -265,7 +265,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & MERGE_GEODES)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
|
||||
|
||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
|
||||
@ -274,12 +274,12 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
|
||||
NOTIFY(osg::INFO)<<"MERGE_GEODES took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MERGE_GEODES took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
|
||||
}
|
||||
|
||||
if (options & CHECK_GEOMETRY)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing CHECK_GEOMETRY"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing CHECK_GEOMETRY"<<std::endl;
|
||||
|
||||
CheckGeometryVisitor mgv(this);
|
||||
node->accept(mgv);
|
||||
@ -287,7 +287,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & MAKE_FAST_GEOMETRY)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MAKE_FAST_GEOMETRY"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MAKE_FAST_GEOMETRY"<<std::endl;
|
||||
|
||||
MakeFastGeometryVisitor mgv(this);
|
||||
node->accept(mgv);
|
||||
@ -295,7 +295,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & MERGE_GEOMETRY)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEOMETRY"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEOMETRY"<<std::endl;
|
||||
|
||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
|
||||
@ -305,12 +305,12 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
|
||||
NOTIFY(osg::INFO)<<"MERGE_GEOMETRY took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MERGE_GEOMETRY took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
|
||||
}
|
||||
|
||||
if (options & TRISTRIP_GEOMETRY)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TRISTRIP_GEOMETRY"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TRISTRIP_GEOMETRY"<<std::endl;
|
||||
|
||||
TriStripVisitor tsv(this);
|
||||
node->accept(tsv);
|
||||
@ -319,7 +319,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & REMOVE_REDUNDANT_NODES)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
|
||||
|
||||
RemoveEmptyNodesVisitor renv(this);
|
||||
node->accept(renv);
|
||||
@ -340,7 +340,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
|
||||
|
||||
if (options & SPATIALIZE_GROUPS)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SPATIALIZE_GROUPS"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SPATIALIZE_GROUPS"<<std::endl;
|
||||
|
||||
SpatializeGroupsVisitor sv(this);
|
||||
node->accept(sv);
|
||||
@ -458,7 +458,7 @@ void Optimizer::StateVisitor::apply(osg::Geode& geode)
|
||||
|
||||
void Optimizer::StateVisitor::optimize()
|
||||
{
|
||||
NOTIFY(osg::INFO) << "Num of StateSet="<<_statesets.size()<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "Num of StateSet="<<_statesets.size()<< std::endl;
|
||||
|
||||
{
|
||||
// create map from state attributes to stateset which contain them.
|
||||
@ -539,15 +539,15 @@ void Optimizer::StateVisitor::optimize()
|
||||
// other.
|
||||
std::sort(attributeList.begin(),attributeList.end(),LessDerefFunctor<osg::StateAttribute>());
|
||||
|
||||
NOTIFY(osg::INFO) << "state attribute list"<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "state attribute list"<< std::endl;
|
||||
for(AttributeList::iterator aaitr = attributeList.begin();
|
||||
aaitr!=attributeList.end();
|
||||
++aaitr)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " "<<*aaitr << " "<<(*aaitr)->className()<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " "<<*aaitr << " "<<(*aaitr)->className()<< std::endl;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
|
||||
// find the duplicates.
|
||||
AttributeList::iterator first_unique = attributeList.begin();
|
||||
AttributeList::iterator current = first_unique;
|
||||
@ -556,13 +556,13 @@ void Optimizer::StateVisitor::optimize()
|
||||
{
|
||||
if (**current==**first_unique)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
|
||||
StateSetList& statesetlist = attributeToStateSetMap[*current];
|
||||
for(StateSetList::iterator sitr=statesetlist.begin();
|
||||
sitr!=statesetlist.end();
|
||||
++sitr)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
|
||||
osg::StateSet* stateset = sitr->first;
|
||||
unsigned int unit = sitr->second;
|
||||
if (unit==NON_TEXTURE_ATTRIBUTE) stateset->setAttribute(*first_unique);
|
||||
@ -591,15 +591,15 @@ void Optimizer::StateVisitor::optimize()
|
||||
// other.
|
||||
std::sort(uniformList.begin(),uniformList.end(),LessDerefFunctor<osg::Uniform>());
|
||||
|
||||
NOTIFY(osg::INFO) << "state uniform list"<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "state uniform list"<< std::endl;
|
||||
for(UniformList::iterator uuitr = uniformList.begin();
|
||||
uuitr!=uniformList.end();
|
||||
++uuitr)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " "<<*uuitr << " "<<(*uuitr)->getName()<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " "<<*uuitr << " "<<(*uuitr)->getName()<< std::endl;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO) << "searching for duplicate uniforms"<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "searching for duplicate uniforms"<< std::endl;
|
||||
// find the duplicates.
|
||||
UniformList::iterator first_unique_uniform = uniformList.begin();
|
||||
UniformList::iterator current_uniform = first_unique_uniform;
|
||||
@ -608,13 +608,13 @@ void Optimizer::StateVisitor::optimize()
|
||||
{
|
||||
if ((**current_uniform)==(**first_unique_uniform))
|
||||
{
|
||||
NOTIFY(osg::INFO) << " found duplicate uniform "<<(*current_uniform)->getName()<<" first_unique_uniform="<<*first_unique_uniform<<" current_uniform="<<*current_uniform<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " found duplicate uniform "<<(*current_uniform)->getName()<<" first_unique_uniform="<<*first_unique_uniform<<" current_uniform="<<*current_uniform<< std::endl;
|
||||
StateSetSet& statesetset = uniformToStateSetMap[*current_uniform];
|
||||
for(StateSetSet::iterator sitr=statesetset.begin();
|
||||
sitr!=statesetset.end();
|
||||
++sitr)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " replace duplicate "<<*current_uniform<<" with "<<*first_unique_uniform<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current_uniform<<" with "<<*first_unique_uniform<< std::endl;
|
||||
osg::StateSet* stateset = *sitr;
|
||||
stateset->addUniform(*first_unique_uniform);
|
||||
}
|
||||
@ -644,7 +644,7 @@ void Optimizer::StateVisitor::optimize()
|
||||
// other.
|
||||
std::sort(statesetSortList.begin(),statesetSortList.end(),LessDerefFunctor<osg::StateSet>());
|
||||
|
||||
NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
|
||||
// find the duplicates.
|
||||
StateSetSortList::iterator first_unique = statesetSortList.begin();
|
||||
StateSetSortList::iterator current = first_unique; ++current;
|
||||
@ -652,13 +652,13 @@ void Optimizer::StateVisitor::optimize()
|
||||
{
|
||||
if (**current==**first_unique)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
|
||||
ObjectSet& objSet = _statesets[*current];
|
||||
for(ObjectSet::iterator sitr=objSet.begin();
|
||||
sitr!=objSet.end();
|
||||
++sitr)
|
||||
{
|
||||
NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
|
||||
osg::Object* obj = *sitr;
|
||||
osg::Drawable* drawable = dynamic_cast<osg::Drawable*>(obj);
|
||||
if (drawable)
|
||||
@ -1104,9 +1104,9 @@ bool CollectLowestTransformsVisitor::removeTransforms(osg::Node* nodeWeCannotRem
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning:: during Optimize::CollectLowestTransformsVisitor::removeTransforms(Node*)"<<std::endl;
|
||||
NOTIFY(osg::WARN)<<" unhandled of setting of indentity matrix on "<< titr->first->className()<<std::endl;
|
||||
NOTIFY(osg::WARN)<<" model will appear in the incorrect position."<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning:: during Optimize::CollectLowestTransformsVisitor::removeTransforms(Node*)"<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<" unhandled of setting of indentity matrix on "<< titr->first->className()<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<" model will appear in the incorrect position."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1443,7 +1443,7 @@ void Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
|
||||
}
|
||||
}
|
||||
_redundantNodeList.clear();
|
||||
@ -1524,7 +1524,7 @@ void Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
|
||||
}
|
||||
}
|
||||
_redundantNodeList.clear();
|
||||
@ -1825,7 +1825,7 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
|
||||
if (geode.getNumDrawables()>=2)
|
||||
{
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Before "<<geode.getNumDrawables()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Before "<<geode.getNumDrawables()<<std::endl;
|
||||
|
||||
typedef std::vector<osg::Geometry*> DuplicateList;
|
||||
typedef std::map<osg::Geometry*,DuplicateList,LessGeometry> GeometryDuplicateMap;
|
||||
@ -1994,14 +1994,14 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
|
||||
geode.removeDrawable(rhs);
|
||||
|
||||
static int co = 0;
|
||||
NOTIFY(osg::INFO)<<"merged and removed Geometry "<<++co<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"merged and removed Geometry "<<++co<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"After "<<geode.getNumDrawables()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"After "<<geode.getNumDrawables()<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
@ -2281,7 +2281,7 @@ class MergeArrayVisitor : public osg::ArrayVisitor
|
||||
}
|
||||
}
|
||||
|
||||
virtual void apply(osg::Array&) { NOTIFY(osg::WARN) << "Warning: Optimizer's MergeArrayVisitor cannot merge Array type." << std::endl; }
|
||||
virtual void apply(osg::Array&) { OSG_NOTIFY(osg::WARN) << "Warning: Optimizer's MergeArrayVisitor cannot merge Array type." << std::endl; }
|
||||
|
||||
virtual void apply(osg::ByteArray& rhs) { if (_offset) _mergeAndOffset(rhs); else _merge(rhs); }
|
||||
virtual void apply(osg::ShortArray& rhs) { if (_offset) _mergeAndOffset(rhs); else _merge(rhs); }
|
||||
@ -2642,11 +2642,11 @@ bool Optimizer::SpatializeGroupsVisitor::divide(osg::Group* group, unsigned int
|
||||
bool yAxis = (bb.yMax()-bb.yMin())>divide_distance;
|
||||
bool zAxis = (bb.zMax()-bb.zMin())>divide_distance;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Dividing "<<group->className()<<" num children = "<<group->getNumChildren()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Dividing "<<group->className()<<" num children = "<<group->getNumChildren()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
|
||||
|
||||
if (!xAxis && !yAxis && !zAxis)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2810,18 +2810,18 @@ bool Optimizer::SpatializeGroupsVisitor::divide(osg::Geode* geode, unsigned int
|
||||
bool yAxis = (bb.yMax()-bb.yMin())>divide_distance;
|
||||
bool zAxis = (bb.zMax()-bb.zMin())>divide_distance;
|
||||
|
||||
NOTIFY(osg::INFO)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
|
||||
|
||||
if (!xAxis && !yAxis && !zAxis)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
osg::Node::ParentList parents = geode->getParents();
|
||||
if (parents.empty())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" Cannot perform spatialize on root Geode, add a Group above it to allow subdivision."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" Cannot perform spatialize on root Geode, add a Group above it to allow subdivision."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2866,12 +2866,12 @@ void Optimizer::CopySharedSubgraphsVisitor::apply(osg::Node& node)
|
||||
|
||||
void Optimizer::CopySharedSubgraphsVisitor::copySharedNodes()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Shared node "<<_sharedNodeList.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Shared node "<<_sharedNodeList.size()<<std::endl;
|
||||
for(SharedNodeList::iterator itr=_sharedNodeList.begin();
|
||||
itr!=_sharedNodeList.end();
|
||||
++itr)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" No parents "<<(*itr)->getNumParents()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" No parents "<<(*itr)->getNumParents()<<std::endl;
|
||||
osg::Node* node = *itr;
|
||||
for(unsigned int i=node->getNumParents()-1;i>0;--i)
|
||||
{
|
||||
@ -3038,7 +3038,7 @@ bool Optimizer::MergeGeodesVisitor::mergeGeodes(osg::Group& group)
|
||||
// if no geodes then just return.
|
||||
if (geodeDuplicateMap.empty()) return false;
|
||||
|
||||
NOTIFY(osg::INFO)<<"mergeGeodes in group '"<<group.getName()<<"' "<<geodeDuplicateMap.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"mergeGeodes in group '"<<group.getName()<<"' "<<geodeDuplicateMap.size()<<std::endl;
|
||||
|
||||
// merge
|
||||
for(GeodeDuplicateMap::iterator itr=geodeDuplicateMap.begin();
|
||||
@ -3245,7 +3245,7 @@ void Optimizer::TextureAtlasBuilder::buildAtlas()
|
||||
aitr != _atlasList.end() && !addedSourceToAtlas;
|
||||
++aitr)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"checking source "<<source->_image->getFileName()<<" to see it it'll fit in atlas "<<aitr->get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"checking source "<<source->_image->getFileName()<<" to see it it'll fit in atlas "<<aitr->get()<<std::endl;
|
||||
if ((*aitr)->doesSourceFit(source))
|
||||
{
|
||||
addedSourceToAtlas = true;
|
||||
@ -3253,13 +3253,13 @@ void Optimizer::TextureAtlasBuilder::buildAtlas()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<aitr->get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<aitr->get()<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (!addedSourceToAtlas)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"creating new Atlas for "<<source->_image->getFileName()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"creating new Atlas for "<<source->_image->getFileName()<<std::endl;
|
||||
|
||||
osg::ref_ptr<Atlas> atlas = new Atlas(_maximumAtlasWidth,_maximumAtlasHeight,_margin);
|
||||
_atlasList.push_back(atlas.get());
|
||||
@ -3578,7 +3578,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::doesSourceFit(Source* source)
|
||||
if ((_x + sourceImage->s() + 2*_margin) <= _maximumAtlasWidth)
|
||||
{
|
||||
// yes it fits :-)
|
||||
NOTIFY(osg::INFO)<<"Fits in current row"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Fits in current row"<<std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3586,7 +3586,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::doesSourceFit(Source* source)
|
||||
if ((_height + sourceImage->t() + 2*_margin) <= _maximumAtlasHeight)
|
||||
{
|
||||
// yes it fits :-)
|
||||
NOTIFY(osg::INFO)<<"Fits in next row"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Fits in next row"<<std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3599,7 +3599,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
|
||||
// double check source is compatible
|
||||
if (!doesSourceFit(source))
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3643,7 +3643,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
|
||||
// yes it fits, so add the source to the atlas's list of sources it contains
|
||||
_sourceList.push_back(source);
|
||||
|
||||
NOTIFY(osg::INFO)<<"current row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"current row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
|
||||
|
||||
// set up the source so it knows where it is in the atlas
|
||||
source->_x = _x + _margin;
|
||||
@ -3671,7 +3671,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
|
||||
// yes it fits, so add the source to the atlas' list of sources it contains
|
||||
_sourceList.push_back(source);
|
||||
|
||||
NOTIFY(osg::INFO)<<"next row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"next row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
|
||||
|
||||
// set up the source so it knows where it is in the atlas
|
||||
source->_x = _x + _margin;
|
||||
@ -3685,12 +3685,12 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
|
||||
|
||||
_height = _y + sourceImage->t() + 2*_margin;
|
||||
|
||||
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
|
||||
|
||||
// shouldn't get here, unless doesSourceFit isn't working...
|
||||
return false;
|
||||
@ -3704,7 +3704,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::clampToNearestPowerOfTwoSize()
|
||||
unsigned int h = 1;
|
||||
while (h<_height) h *= 2;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Clamping "<<_width<<", "<<_height<<" to "<<w<<","<<h<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Clamping "<<_width<<", "<<_height<<" to "<<w<<","<<h<<std::endl;
|
||||
|
||||
_width = w;
|
||||
_height = h;
|
||||
@ -3713,7 +3713,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::clampToNearestPowerOfTwoSize()
|
||||
|
||||
void Optimizer::TextureAtlasBuilder::Atlas::copySources()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Allocated to "<<_width<<","<<_height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Allocated to "<<_width<<","<<_height<<std::endl;
|
||||
_image->allocateImage(_width,_height,1,
|
||||
_image->getPixelFormat(),_image->getDataType(),
|
||||
_image->getPacking());
|
||||
@ -3725,7 +3725,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::copySources()
|
||||
for(unsigned int i=0; i<size; ++i) *(str++) = 0;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"Atlas::copySources() "<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Atlas::copySources() "<<std::endl;
|
||||
for(SourceList::iterator itr = _sourceList.begin();
|
||||
itr !=_sourceList.end();
|
||||
++itr)
|
||||
@ -3735,8 +3735,8 @@ void Optimizer::TextureAtlasBuilder::Atlas::copySources()
|
||||
|
||||
if (atlas)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Copying image "<<source->_image->getFileName()<<" to "<<source->_x<<" ,"<<source->_y<<std::endl;
|
||||
NOTIFY(osg::INFO)<<" image size "<<source->_image->s()<<","<<source->_image->t()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Copying image "<<source->_image->getFileName()<<" to "<<source->_x<<" ,"<<source->_y<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" image size "<<source->_image->s()<<","<<source->_image->t()<<std::endl;
|
||||
|
||||
const osg::Image* sourceImage = source->_image.get();
|
||||
osg::Image* atlasImage = atlas->_image.get();
|
||||
@ -4097,7 +4097,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
|
||||
if (texturesThatRepeatAndAreOutOfRange.count(texture)==0)
|
||||
{
|
||||
// safe to convert into CLAMP wrap mode.
|
||||
NOTIFY(osg::INFO)<<"Changing wrap mode to CLAMP"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Changing wrap mode to CLAMP"<<std::endl;
|
||||
texture->setWrap(osg::Texture2D::WRAP_S, osg::Texture::CLAMP);
|
||||
texture->setWrap(osg::Texture2D::WRAP_T, osg::Texture::CLAMP);
|
||||
}
|
||||
@ -4206,7 +4206,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
|
||||
{
|
||||
if (s_repeat || t_repeat)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning!!! shouldn't get here"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning!!! shouldn't get here"<<std::endl;
|
||||
}
|
||||
|
||||
stateset->setTextureAttribute(unit, newTexture);
|
||||
@ -4237,7 +4237,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
|
||||
|
||||
if (canTexMatBeFlattenedToAllDrawables)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"All drawables can be flattened "<<drawables.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"All drawables can be flattened "<<drawables.size()<<std::endl;
|
||||
for(Drawables::iterator ditr = drawables.begin();
|
||||
ditr != drawables.end();
|
||||
++ditr)
|
||||
@ -4257,13 +4257,13 @@ void Optimizer::TextureAtlasVisitor::optimize()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error, Optimizer::TextureAtlasVisitor::optimize() shouldn't ever get here..."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error, Optimizer::TextureAtlasVisitor::optimize() shouldn't ever get here..."<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Applying TexMat "<<drawables.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Applying TexMat "<<drawables.size()<<std::endl;
|
||||
stateset->setTextureAttribute(unit, new osg::TexMat(matrix));
|
||||
}
|
||||
}
|
||||
@ -4343,7 +4343,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -4384,7 +4384,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -4422,7 +4422,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
|
||||
traverse(*(new_lod.get()));
|
||||
}
|
||||
else
|
||||
NOTIFY(osg::NOTICE) << "No parent for this LOD" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "No parent for this LOD" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4460,7 +4460,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
|
||||
if(parent_group)
|
||||
parent_group->replaceChild(&geode, new_geode.get());
|
||||
else
|
||||
NOTIFY(osg::NOTICE) << "No parent for this Geode" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "No parent for this Geode" << std::endl;
|
||||
|
||||
transformGeode(*(new_geode.get()));
|
||||
}
|
||||
@ -4494,7 +4494,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
|
||||
if(parent_group)
|
||||
parent_group->replaceChild(&billboard, new_billboard.get());
|
||||
else
|
||||
NOTIFY(osg::NOTICE) << "No parent for this Billboard" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "No parent for this Billboard" << std::endl;
|
||||
|
||||
transformBillboard(*(new_billboard.get()));
|
||||
}
|
||||
|
@ -248,8 +248,8 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
depth = osg::maximum(depth,itr->second.depth());
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp viewport "<<_viewport->x()<<" "<<_viewport->y()<<" "<<_viewport->width()<<" "<<_viewport->height()<<std::endl;
|
||||
// NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp computed "<<width<<" "<<height<<" "<<depth<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp viewport "<<_viewport->x()<<" "<<_viewport->y()<<" "<<_viewport->width()<<" "<<_viewport->height()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp computed "<<width<<" "<<height<<" "<<depth<<std::endl;
|
||||
|
||||
// attach images that need to be copied after the stage is drawn.
|
||||
for(itr = bufferAttachments.begin();
|
||||
@ -333,7 +333,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
if (fbo_supported && !_fbo)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER_OBJECT"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER_OBJECT"<<std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*(_camera->getDataChangeMutex()));
|
||||
|
||||
@ -365,7 +365,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
if (colorSamples > samples)
|
||||
{
|
||||
NOTIFY(WARN) << "Multisample color samples must be less than or "
|
||||
OSG_NOTIFY(WARN) << "Multisample color samples must be less than or "
|
||||
"equal to samples. Setting color samples equal to samples." << std::endl;
|
||||
colorSamples = samples;
|
||||
}
|
||||
@ -512,7 +512,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x"<<std::hex<<status<<std::dec<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x"<<std::hex<<status<<std::dec<<std::endl;
|
||||
|
||||
fbo_supported = false;
|
||||
fbo_ext->glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
|
||||
@ -604,7 +604,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
traits->width = width;
|
||||
traits->height = height;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"traits = "<<traits->width<<" "<<traits->height<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"traits = "<<traits->width<<" "<<traits->height<<std::endl;
|
||||
|
||||
traits->pbuffer = (renderTargetImplementation==osg::Camera::PIXEL_BUFFER || renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT);
|
||||
traits->windowDecoration = (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW);
|
||||
@ -686,14 +686,14 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
{
|
||||
if (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Pbuffer ";
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Pbuffer ";
|
||||
}
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"does not support multiple color outputs."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"does not support multiple color outputs."<<std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -734,7 +734,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
if (context.valid() && context->realize())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Context has been realized "<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Context has been realized "<<std::endl;
|
||||
|
||||
// successfully set up graphics context as requested,
|
||||
// will assign this graphics context to the RenderStage and
|
||||
@ -749,18 +749,18 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
if (pBufferTexture && renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assign graphis context to Texture"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assign graphis context to Texture"<<std::endl;
|
||||
pBufferTexture->setReadPBuffer(context.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assigning texture to RenderStage so that it does the copy"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assigning texture to RenderStage so that it does the copy"<<std::endl;
|
||||
setTexture(pBufferTexture, level, face);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Failed to acquire Graphics Context"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Failed to acquire Graphics Context"<<std::endl;
|
||||
|
||||
if (renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT)
|
||||
{
|
||||
@ -782,7 +782,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
// finally if all else has failed, then the frame buffer fallback will come in to play.
|
||||
if (renderTargetImplementation==osg::Camera::FRAME_BUFFER)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER"<<std::endl;
|
||||
|
||||
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachments.begin();
|
||||
itr != bufferAttachments.end();
|
||||
@ -879,7 +879,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
|
||||
{
|
||||
if (read_fbo->isMultisample())
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Attempting to read from a"
|
||||
OSG_NOTIFY(osg::WARN) << "Attempting to read from a"
|
||||
" multisampled framebuffer object. Set a resolve"
|
||||
" framebuffer on the RenderStage to fix this." << std::endl;
|
||||
}
|
||||
@ -931,7 +931,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
|
||||
GLenum fbstatus = fbo_ext->glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
|
||||
if ( fbstatus != GL_FRAMEBUFFER_COMPLETE_EXT )
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"RenderStage::drawInner(,) FBO status = 0x"<<std::hex<<fbstatus<<std::dec<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"RenderStage::drawInner(,) FBO status = 0x"<<std::hex<<fbstatus<<std::dec<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1077,7 +1077,7 @@ struct DrawInnerOperation : public osg::Operation
|
||||
osg::GraphicsContext* context = dynamic_cast<osg::GraphicsContext*>(object);
|
||||
if (!context) return;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"DrawInnerOperation operator"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"DrawInnerOperation operator"<<std::endl;
|
||||
if (_stage && context)
|
||||
{
|
||||
RenderLeaf* previous = 0;
|
||||
@ -1132,7 +1132,7 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous)
|
||||
// now as an experiment.
|
||||
callingContext->releaseContext();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" enclosing state before - "<<state.getStateSetStackSize()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" enclosing state before - "<<state.getStateSetStackSize()<<std::endl;
|
||||
|
||||
useState = _graphicsContext->getState();
|
||||
useContext = _graphicsContext.get();
|
||||
@ -1151,7 +1151,7 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous)
|
||||
previous = 0;
|
||||
useContext->makeCurrent();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" nested state before - "<<useState->getStateSetStackSize()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" nested state before - "<<useState->getStateSetStackSize()<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1247,8 +1247,8 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous)
|
||||
|
||||
previous = saved_previous;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<" nested state after - "<<useState->getStateSetStackSize()<<std::endl;
|
||||
// NOTIFY(osg::NOTICE)<<" enclosing state after - "<<state.getStateSetStackSize()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" nested state after - "<<useState->getStateSetStackSize()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" enclosing state after - "<<state.getStateSetStackSize()<<std::endl;
|
||||
|
||||
callingContext->makeCurrent();
|
||||
}
|
||||
@ -1433,7 +1433,7 @@ void RenderStage::setMultisampleResolveFramebufferObject(osg::FrameBufferObject*
|
||||
{
|
||||
if (fbo && fbo->isMultisample())
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Resolve framebuffer must not be"
|
||||
OSG_NOTIFY(osg::WARN) << "Resolve framebuffer must not be"
|
||||
" multisampled." << std::endl;
|
||||
}
|
||||
_resolveFbo = fbo;
|
||||
|
@ -96,7 +96,7 @@ void CompositeViewer::constructorInit()
|
||||
|
||||
CompositeViewer::~CompositeViewer()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CompositeViewer::~CompositeViewer()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CompositeViewer::~CompositeViewer()"<<std::endl;
|
||||
|
||||
stopThreading();
|
||||
|
||||
@ -126,12 +126,12 @@ CompositeViewer::~CompositeViewer()
|
||||
(*citr)->close();
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO)<<"finished CompositeViewer::~CompositeViewer()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"finished CompositeViewer::~CompositeViewer()"<<std::endl;
|
||||
}
|
||||
|
||||
bool CompositeViewer::readConfiguration(const std::string& filename)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"CompositeViewer::readConfiguration("<<filename<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"CompositeViewer::readConfiguration("<<filename<<")"<<std::endl;
|
||||
osg::ref_ptr<osg::Object> obj = osgDB::readObjectFile(filename);
|
||||
osgViewer::View * view = dynamic_cast<osgViewer::View *>(obj.get());
|
||||
if (view)
|
||||
@ -329,7 +329,7 @@ void CompositeViewer::setReferenceTime(double time)
|
||||
|
||||
void CompositeViewer::viewerInit()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CompositeViewer::init()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CompositeViewer::init()"<<std::endl;
|
||||
|
||||
for(RefViews::iterator itr = _views.begin();
|
||||
itr != _views.end();
|
||||
@ -509,13 +509,13 @@ void CompositeViewer::getOperationThreads(OperationThreads& threads, bool onlyAc
|
||||
|
||||
void CompositeViewer::realize()
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<"CompositeViewer::realize()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"CompositeViewer::realize()"<<std::endl;
|
||||
|
||||
setCameraWithFocus(0);
|
||||
|
||||
if (_views.empty())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"CompositeViewer::realize() - not views to realize."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"CompositeViewer::realize() - not views to realize."<<std::endl;
|
||||
_done = true;
|
||||
return;
|
||||
}
|
||||
@ -525,7 +525,7 @@ void CompositeViewer::realize()
|
||||
|
||||
if (contexts.empty())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"CompositeViewer::realize() - No valid contexts found, setting up view across all screens."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"CompositeViewer::realize() - No valid contexts found, setting up view across all screens."<<std::endl;
|
||||
|
||||
// no windows are already set up so set up a default view
|
||||
_views[0]->setUpViewAcrossAllScreens();
|
||||
@ -535,7 +535,7 @@ void CompositeViewer::realize()
|
||||
|
||||
if (contexts.empty())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"CompositeViewer::realize() - failed to set up any windows"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"CompositeViewer::realize() - failed to set up any windows"<<std::endl;
|
||||
_done = true;
|
||||
return;
|
||||
}
|
||||
@ -679,7 +679,7 @@ void CompositeViewer::eventTraversal()
|
||||
|
||||
double beginEventTraversal = osg::Timer::instance()->delta_s(_startTick, osg::Timer::instance()->tick());
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"CompositeViewer::frameEventTraversal()."<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"CompositeViewer::frameEventTraversal()."<<std::endl;
|
||||
|
||||
// need to copy events from the GraphicsWindow's into local EventQueue;
|
||||
|
||||
@ -722,7 +722,7 @@ void CompositeViewer::eventTraversal()
|
||||
{
|
||||
osgGA::GUIEventAdapter* event = itr->get();
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"event->getGraphicsContext()="<<event->getGraphicsContext()<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"event->getGraphicsContext()="<<event->getGraphicsContext()<<std::endl;
|
||||
|
||||
bool pointerEvent = false;
|
||||
|
||||
@ -884,7 +884,7 @@ void CompositeViewer::eventTraversal()
|
||||
}
|
||||
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"mouseEventState Xmin = "<<eventState->getXmin()<<" Ymin="<<eventState->getYmin()<<" xMax="<<eventState->getXmax()<<" Ymax="<<eventState->getYmax()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"mouseEventState Xmin = "<<eventState->getXmin()<<" Ymin="<<eventState->getYmin()<<" xMax="<<eventState->getXmax()<<" Ymax="<<eventState->getYmax()<<std::endl;
|
||||
|
||||
|
||||
for(RefViews::iterator vitr = _views.begin();
|
||||
@ -897,7 +897,7 @@ void CompositeViewer::eventTraversal()
|
||||
}
|
||||
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
||||
|
||||
if ((_keyEventSetsDone!=0) || _quitEventSetsDone)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ static pascal OSStatus GraphicsWindowEventHandler(EventHandlerCallRef nextHandle
|
||||
Rect bounds;
|
||||
OSStatus result = eventNotHandledErr; /* report failure by default */
|
||||
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowEventHandler" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowEventHandler" << std::endl;
|
||||
|
||||
GraphicsWindowCarbon* w = (GraphicsWindowCarbon*)userData;
|
||||
if (!w)
|
||||
@ -247,7 +247,7 @@ void GraphicsWindowCarbon::init()
|
||||
_pixelFormat = PixelBufferCarbon::createPixelFormat(_traits.get());
|
||||
if (!_pixelFormat)
|
||||
{
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::init could not create a valid pixelformat" << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::init could not create a valid pixelformat" << std::endl;
|
||||
}
|
||||
_valid = (_pixelFormat != NULL);
|
||||
_initialized = true;
|
||||
@ -276,7 +276,7 @@ bool GraphicsWindowCarbon::setWindowDecorationImplementation(bool flag)
|
||||
|
||||
if (err != noErr)
|
||||
{
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::setWindowDecoration failed with " << err << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::setWindowDecoration failed with " << err << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -350,7 +350,7 @@ bool GraphicsWindowCarbon::realizeImplementation()
|
||||
if (!_initialized) return false;
|
||||
if (!_traits) return false;
|
||||
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowCarbon:: realizeIMplementation" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowCarbon:: realizeIMplementation" << std::endl;
|
||||
|
||||
setWindowDecoration(_traits->windowDecoration);
|
||||
useCursor(_traits->useCursor);
|
||||
@ -377,10 +377,10 @@ bool GraphicsWindowCarbon::realizeImplementation()
|
||||
err = CreateNewWindow(kDocumentWindowClass, attr, &bounds, &_window);
|
||||
|
||||
if (err) {
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::realizeImplementation() failed creating a window: " << err << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::realizeImplementation() failed creating a window: " << err << std::endl;
|
||||
return false;
|
||||
} else {
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowCarbon::realizeImplementation() - window created with bounds(" << bounds.top << ", " << bounds.left << ", " << bounds.bottom << ", " << bounds.right << ")" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowCarbon::realizeImplementation() - window created with bounds(" << bounds.top << ", " << bounds.left << ", " << bounds.bottom << ", " << bounds.right << ")" << std::endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -410,7 +410,7 @@ bool GraphicsWindowCarbon::realizeImplementation()
|
||||
|
||||
|
||||
if (!_context) {
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::realizeImplementation failed creating a context: " << aglGetError() << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::realizeImplementation failed creating a context: " << aglGetError() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ bool GraphicsWindowCarbon::realizeImplementation()
|
||||
#endif
|
||||
if (cgerr != kCGLNoError )
|
||||
{
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowCarbon:: Multi-threaded OpenGL Execution not available" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowCarbon:: Multi-threaded OpenGL Execution not available" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,12 +469,12 @@ bool GraphicsWindowCarbon::releaseContextImplementation()
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"makeCurrentImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
||||
// NOTIFY(osg::NOTICE)<<" glXMakeCurrent ("<<_display<<","<<_window<<","<<_glxContext<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"makeCurrentImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" glXMakeCurrent ("<<_display<<","<<_window<<","<<_glxContext<<std::endl;
|
||||
return (aglSetCurrentContext(NULL) == GL_TRUE);
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ bool GraphicsWindowCarbon::releaseContextImplementation()
|
||||
|
||||
void GraphicsWindowCarbon::closeImplementation()
|
||||
{
|
||||
// NOTIFY(osg::INFO) << "GraphicsWindowCarbon::closeImplementation" << std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "GraphicsWindowCarbon::closeImplementation" << std::endl;
|
||||
_valid = false;
|
||||
_realized = false;
|
||||
|
||||
@ -741,7 +741,7 @@ bool GraphicsWindowCarbon::handleKeyboardEvent(EventRef theEvent)
|
||||
UInt32 rawkey;
|
||||
GetEventParameter (theEvent,kEventParamKeyCode,typeUInt32, NULL,sizeof(rawkey), NULL,&rawkey);
|
||||
|
||||
// NOTIFY(osg::INFO) << "key code: " << rawkey << " modifiers: " << modifierKeys << std::endl;
|
||||
// OSG_NOTIFY(osg::INFO) << "key code: " << rawkey << " modifiers: " << modifierKeys << std::endl;
|
||||
|
||||
UInt32 dataSize;
|
||||
/* jbw check return status so that we don't allocate a huge array */
|
||||
@ -760,14 +760,14 @@ bool GraphicsWindowCarbon::handleKeyboardEvent(EventRef theEvent)
|
||||
case kEventRawKeyRepeat:
|
||||
{
|
||||
//getEventQueue()->getCurrentEventState()->setModKeyMask(modifierMask);
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowCarbon::keyPress" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowCarbon::keyPress" << std::endl;
|
||||
getEventQueue()->keyPress(keychar);
|
||||
break;
|
||||
}
|
||||
|
||||
case kEventRawKeyUp:
|
||||
{
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowCarbon::keyPress" << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowCarbon::keyPress" << std::endl;
|
||||
//getEventQueue()->getCurrentEventState()->setModKeyMask(modifierMask);
|
||||
getEventQueue()->keyRelease(keychar);
|
||||
break;
|
||||
@ -940,7 +940,7 @@ void GraphicsWindowCarbon::grabFocus()
|
||||
void GraphicsWindowCarbon::grabFocusIfPointerInWindow()
|
||||
{
|
||||
// TODO: implement
|
||||
NOTIFY(osg::ALWAYS) << "GraphicsWindowCarbon::grabFocusIfPointerInWindow" << std::endl;
|
||||
OSG_NOTIFY(osg::ALWAYS) << "GraphicsWindowCarbon::grabFocusIfPointerInWindow" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
@ -951,7 +951,7 @@ void GraphicsWindowCarbon::useCursor(bool cursorOn)
|
||||
_traits->useCursor = cursorOn;
|
||||
DarwinWindowingSystemInterface* wsi = dynamic_cast<DarwinWindowingSystemInterface*>(osg::GraphicsContext::getWindowingSystemInterface());
|
||||
if (wsi == NULL) {
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::useCursor :: could not get OSXCarbonWindowingSystemInterface" << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::useCursor :: could not get OSXCarbonWindowingSystemInterface" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -967,7 +967,7 @@ void GraphicsWindowCarbon::useCursor(bool cursorOn)
|
||||
break;
|
||||
}
|
||||
if (err != kCGErrorSuccess) {
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::useCursor failed with " << err << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::useCursor failed with " << err << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1001,7 +1001,7 @@ void GraphicsWindowCarbon::setCursor(MouseCursor mouseCursor)
|
||||
break;
|
||||
default:
|
||||
cursor = kThemeArrowCursor;
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::setCursor doesn't implement cursor: type = " << mouseCursor << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::setCursor doesn't implement cursor: type = " << mouseCursor << std::endl;
|
||||
}
|
||||
|
||||
_currentCursor = mouseCursor;
|
||||
@ -1026,7 +1026,7 @@ void GraphicsWindowCarbon::requestWarpPointer(float x,float y)
|
||||
|
||||
DarwinWindowingSystemInterface* wsi = dynamic_cast<DarwinWindowingSystemInterface*>(osg::GraphicsContext::getWindowingSystemInterface());
|
||||
if (wsi == NULL) {
|
||||
NOTIFY(osg::WARN) << "GraphicsWindowCarbon::useCursor :: could not get OSXCarbonWindowingSystemInterface" << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "GraphicsWindowCarbon::useCursor :: could not get OSXCarbonWindowingSystemInterface" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ class Win32WindowingSystem : public osg::GraphicsContext::WindowingSystemInterfa
|
||||
|
||||
static void reportError( const std::string& msg )
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Error: " << msg.c_str() << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Error: " << msg.c_str() << std::endl;
|
||||
}
|
||||
|
||||
static void reportError( const std::string& msg, unsigned int errorCode )
|
||||
@ -349,7 +349,7 @@ static void reportError( const std::string& msg, unsigned int errorCode )
|
||||
return;
|
||||
}
|
||||
|
||||
NOTIFY(osg::WARN) << "Windows Error #" << errorCode << ": " << msg.c_str();
|
||||
OSG_NOTIFY(osg::WARN) << "Windows Error #" << errorCode << ": " << msg.c_str();
|
||||
|
||||
LPVOID lpMsgBuf;
|
||||
|
||||
@ -361,12 +361,12 @@ static void reportError( const std::string& msg, unsigned int errorCode )
|
||||
0,
|
||||
NULL)!=0)
|
||||
{
|
||||
NOTIFY(osg::WARN) << ". Reason: " << LPTSTR(lpMsgBuf) << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << ". Reason: " << LPTSTR(lpMsgBuf) << std::endl;
|
||||
::LocalFree(lpMsgBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN) << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -792,7 +792,7 @@ bool Win32WindowingSystem::getScreenInformation( const osg::GraphicsContext::Scr
|
||||
{
|
||||
if (si.displayNum>0)
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Win32WindowingSystem::getScreenInformation() - The screen identifier on the Win32 platform must always use display number 0. Value received was " << si.displayNum << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Win32WindowingSystem::getScreenInformation() - The screen identifier on the Win32 platform must always use display number 0. Value received was " << si.displayNum << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -801,7 +801,7 @@ bool Win32WindowingSystem::getScreenInformation( const osg::GraphicsContext::Scr
|
||||
|
||||
if (si.screenNum>=static_cast<int>(displayDevices.size()))
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Win32WindowingSystem::getScreenInformation() - Cannot get information for screen " << si.screenNum << " because it does not exist." << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Win32WindowingSystem::getScreenInformation() - Cannot get information for screen " << si.screenNum << " because it does not exist." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -844,7 +844,7 @@ void Win32WindowingSystem::getScreenSettings( const osg::GraphicsContext::Screen
|
||||
if (resolution.refreshRate == 0 || resolution.refreshRate == 1) {
|
||||
// Windows specific: 0 and 1 represent the hhardware's default refresh rate.
|
||||
// If someone knows how to get this refresh rate (in Hz)...
|
||||
NOTIFY(osg::NOTICE) << "Win32WindowingSystem::getScreenSettings() is not fully implemented (cannot retreive the hardware's default refresh rate)."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Win32WindowingSystem::getScreenSettings() is not fully implemented (cannot retreive the hardware's default refresh rate)."<<std::endl;
|
||||
resolution.refreshRate = 0;
|
||||
}
|
||||
} else
|
||||
@ -932,7 +932,7 @@ void Win32WindowingSystem::enumerateScreenSettings(const osg::GraphicsContext::S
|
||||
|
||||
if (si.displayNum>0)
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Win32WindowingSystem::enumerateScreenSettings() - The screen identifier on the Win32 platform must always use display number 0. Value received was " << si.displayNum << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Win32WindowingSystem::enumerateScreenSettings() - The screen identifier on the Win32 platform must always use display number 0. Value received was " << si.displayNum << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -941,7 +941,7 @@ void Win32WindowingSystem::enumerateScreenSettings(const osg::GraphicsContext::S
|
||||
|
||||
if (si.screenNum>=static_cast<int>(displayDevices.size()))
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Win32WindowingSystem::enumerateScreenSettings() - Cannot get information for screen " << si.screenNum << " because it does not exist." << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Win32WindowingSystem::enumerateScreenSettings() - Cannot get information for screen " << si.screenNum << " because it does not exist." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1517,7 +1517,7 @@ static int ChooseMatchingPixelFormat( HDC hdc, int screenNum, const WGLIntegerAt
|
||||
::DescribePixelFormat(hdc, pixelFormatIndex ,sizeof(PIXELFORMATDESCRIPTOR),&pixelFormat);
|
||||
if (((pixelFormat.dwFlags & PFD_GENERIC_FORMAT) != 0) && ((pixelFormat.dwFlags & PFD_GENERIC_ACCELERATED) == 0))
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Rendering in software: pixelFormatIndex " << pixelFormatIndex << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Rendering in software: pixelFormatIndex " << pixelFormatIndex << std::endl;
|
||||
}
|
||||
return pixelFormatIndex;
|
||||
}
|
||||
@ -1562,7 +1562,7 @@ bool GraphicsWindowWin32::setPixelFormat()
|
||||
unsigned int bpp;
|
||||
Win32WindowingSystem::getInterface()->getScreenColorDepth(*_traits.get(), bpp);
|
||||
if (bpp < 32) {
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowWin32::setPixelFormat() - Display setting is not 32 bit colors, "
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowWin32::setPixelFormat() - Display setting is not 32 bit colors, "
|
||||
<< bpp
|
||||
<< " bits per pixel on screen #"
|
||||
<< _traits->screenNum
|
||||
@ -1585,7 +1585,7 @@ bool GraphicsWindowWin32::setPixelFormat()
|
||||
return false;
|
||||
}
|
||||
|
||||
NOTIFY(osg::INFO) << "GraphicsWindowWin32::setPixelFormat() - Found a matching pixel format but without the WGL_SWAP_METHOD_ARB specification for screen #"
|
||||
OSG_NOTIFY(osg::INFO) << "GraphicsWindowWin32::setPixelFormat() - Found a matching pixel format but without the WGL_SWAP_METHOD_ARB specification for screen #"
|
||||
<< _traits->screenNum
|
||||
<< std::endl;
|
||||
}
|
||||
@ -1614,10 +1614,10 @@ HGLRC GraphicsWindowWin32::createContextImplementation()
|
||||
|
||||
if( OSG_GL3_FEATURES )
|
||||
{
|
||||
NOTIFY( osg::INFO ) << "GL3: Attempting to create OpenGL3 context." << std::endl;
|
||||
NOTIFY( osg::INFO ) << "GL3: version: " << _traits->glContextVersion << std::endl;
|
||||
NOTIFY( osg::INFO ) << "GL3: context flags: " << _traits->glContextFlags << std::endl;
|
||||
NOTIFY( osg::INFO ) << "GL3: profile: " << _traits->glContextProfileMask << std::endl;
|
||||
OSG_NOTIFY( osg::INFO ) << "GL3: Attempting to create OpenGL3 context." << std::endl;
|
||||
OSG_NOTIFY( osg::INFO ) << "GL3: version: " << _traits->glContextVersion << std::endl;
|
||||
OSG_NOTIFY( osg::INFO ) << "GL3: context flags: " << _traits->glContextFlags << std::endl;
|
||||
OSG_NOTIFY( osg::INFO ) << "GL3: profile: " << _traits->glContextProfileMask << std::endl;
|
||||
|
||||
Win32WindowingSystem::OpenGLContext openGLContext;
|
||||
if( !Win32WindowingSystem::getInterface()->getSampleOpenGLContext( openGLContext, _hdc, _screenOriginX, _screenOriginY ) )
|
||||
@ -1645,7 +1645,7 @@ HGLRC GraphicsWindowWin32::createContextImplementation()
|
||||
istr >> major >> dot >> minor;
|
||||
if( major < 3 )
|
||||
{
|
||||
NOTIFY( osg::WARN ) << "GL3: Non-GL3 version number: " << _traits->glContextVersion << std::endl;
|
||||
OSG_NOTIFY( osg::WARN ) << "GL3: Non-GL3 version number: " << _traits->glContextVersion << std::endl;
|
||||
}
|
||||
|
||||
attribs[ idx++ ] = WGL_CONTEXT_MAJOR_VERSION_ARB;
|
||||
@ -1672,7 +1672,7 @@ HGLRC GraphicsWindowWin32::createContextImplementation()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY( osg::INFO ) << "GL3: context created successfully." << std::endl;
|
||||
OSG_NOTIFY( osg::INFO ) << "GL3: context created successfully." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1942,7 +1942,7 @@ void GraphicsWindowWin32::grabFocus()
|
||||
{
|
||||
if (!::SetForegroundWindow(_hwnd))
|
||||
{
|
||||
NOTIFY(osg::WARN) << "Warning: GraphicsWindowWin32::grabFocus() - Failed grabbing the focus" << std::endl;
|
||||
OSG_NOTIFY(osg::WARN) << "Warning: GraphicsWindowWin32::grabFocus() - Failed grabbing the focus" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,12 +44,12 @@ bool checkEGLError(const char* str)
|
||||
EGLint err = eglGetError();
|
||||
if (err != EGL_SUCCESS)
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning: "<<str<<" EGL error "<<std::hex<<err<<std::dec<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning: "<<str<<" EGL error "<<std::hex<<err<<std::dec<<std::endl;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::WARN)<<"EGL reports no errors: "<<str<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"EGL reports no errors: "<<str<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -299,7 +299,7 @@ bool GraphicsWindowX11::createVisualInfo()
|
||||
int depth = DefaultDepth( _display, _traits->screenNum );
|
||||
if (XMatchVisualInfo( _display, _traits->screenNum, depth, TrueColor, _visualInfo )==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::createVisualInfo() failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::createVisualInfo() failed."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -371,7 +371,7 @@ bool GraphicsWindowX11::checkAndSendEventFullScreenIfNeeded(Display* display, in
|
||||
{
|
||||
osg::GraphicsContext::WindowingSystemInterface *wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (wsi == NULL) {
|
||||
NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ bool GraphicsWindowX11::setWindowDecorationImplementation(bool flag)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: GraphicsWindowX11::setBorder(" << flag << ") - couldn't change decorations." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: GraphicsWindowX11::setBorder(" << flag << ") - couldn't change decorations." << std::endl;
|
||||
result = false;
|
||||
}
|
||||
|
||||
@ -635,7 +635,7 @@ void GraphicsWindowX11::init()
|
||||
|
||||
if (!_display)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Unable to open display \"" << XDisplayName(_traits->displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to open display \"" << XDisplayName(_traits->displayName().c_str()) << "\"."<<std::endl;
|
||||
_valid = false;
|
||||
return;
|
||||
}
|
||||
@ -647,7 +647,7 @@ void GraphicsWindowX11::init()
|
||||
EGLint eglMajorVersion, eglMinorVersion;
|
||||
if (!eglInitialize(_eglDisplay, &eglMajorVersion, &eglMinorVersion))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() failed."<<std::endl;
|
||||
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
@ -655,14 +655,14 @@ void GraphicsWindowX11::init()
|
||||
return;
|
||||
}
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() succeded eglMajorVersion="<<eglMajorVersion<<" iMinorVersion="<<eglMinorVersion<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() succeded eglMajorVersion="<<eglMajorVersion<<" iMinorVersion="<<eglMinorVersion<<std::endl;
|
||||
|
||||
#else
|
||||
// Query for GLX extension
|
||||
int errorBase, eventBase;
|
||||
if( glXQueryExtension( _display, &errorBase, &eventBase) == False )
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: " << XDisplayName(_traits->displayName().c_str()) <<" has no GLX extension." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: " << XDisplayName(_traits->displayName().c_str()) <<" has no GLX extension." << std::endl;
|
||||
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
@ -671,7 +671,7 @@ void GraphicsWindowX11::init()
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"GLX extension, errorBase="<<errorBase<<" eventBase="<<eventBase<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLX extension, errorBase="<<errorBase<<" eventBase="<<eventBase<<std::endl;
|
||||
|
||||
if (!createVisualInfo())
|
||||
{
|
||||
@ -681,11 +681,11 @@ void GraphicsWindowX11::init()
|
||||
_traits->alpha /= 2;
|
||||
_traits->depth /= 2;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Relaxing traits"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Relaxing traits"<<std::endl;
|
||||
|
||||
if (!createVisualInfo())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Not able to create requested visual." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Not able to create requested visual." << std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
_valid = false;
|
||||
@ -708,7 +708,7 @@ void GraphicsWindowX11::init()
|
||||
return;
|
||||
}
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - window created ="<<_valid<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - window created ="<<_valid<<std::endl;
|
||||
|
||||
EGLConfig eglConfig = 0;
|
||||
|
||||
@ -732,7 +732,7 @@ void GraphicsWindowX11::init()
|
||||
int numConfigs;
|
||||
if (!eglChooseConfig(_eglDisplay, configAttribs, &eglConfig, 1, &numConfigs) || (numConfigs != 1))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglChooseConfig() failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglChooseConfig() failed."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_valid = false;
|
||||
_display = 0;
|
||||
@ -744,7 +744,7 @@ void GraphicsWindowX11::init()
|
||||
_eglSurface = eglCreateWindowSurface(_eglDisplay, eglConfig, (EGLNativeWindowType)_window, NULL);
|
||||
if (_eglSurface == EGL_NO_SURFACE)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateWindowSurface(..) failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateWindowSurface(..) failed."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_valid = false;
|
||||
_display = 0;
|
||||
@ -764,7 +764,7 @@ void GraphicsWindowX11::init()
|
||||
_context = eglCreateContext(_eglDisplay, eglConfig, sharedContext, contextAttribs);
|
||||
if (_context == EGL_NO_CONTEXT)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateContext(..) failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateContext(..) failed."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_valid = false;
|
||||
_display = 0;
|
||||
@ -781,7 +781,7 @@ void GraphicsWindowX11::init()
|
||||
|
||||
if (!_context)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Unable to create OpenGL graphics context."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to create OpenGL graphics context."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
_valid = false;
|
||||
@ -828,7 +828,7 @@ bool GraphicsWindowX11::createWindow()
|
||||
swatt.override_redirect = true;
|
||||
mask |= CWOverrideRedirect;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Setting override redirect"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Setting override redirect"<<std::endl;
|
||||
}
|
||||
|
||||
_window = XCreateWindow( _display, _parent,
|
||||
@ -840,7 +840,7 @@ bool GraphicsWindowX11::createWindow()
|
||||
|
||||
if (!_window)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Unable to create Window."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to create Window."<<std::endl;
|
||||
_context = 0;
|
||||
return false;
|
||||
}
|
||||
@ -885,7 +885,7 @@ bool GraphicsWindowX11::createWindow()
|
||||
resized( watt.x, watt.y, watt.width, watt.height );
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"After sync apply.x = "<<watt.x<<" watt.y="<<watt.y<<" width="<<watt.width<<" height="<<watt.height<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"After sync apply.x = "<<watt.x<<" watt.y="<<watt.y<<" width="<<watt.width<<" height="<<watt.height<<std::endl;
|
||||
|
||||
|
||||
XSelectInput( _eventDisplay, _window, ExposureMask | StructureNotifyMask |
|
||||
@ -904,20 +904,20 @@ bool GraphicsWindowX11::setWindow(Window window)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Window already created; it cannot be changed";
|
||||
OSG_NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Window already created; it cannot be changed";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Invalid window handle passed ";
|
||||
OSG_NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Invalid window handle passed ";
|
||||
return false;
|
||||
}
|
||||
|
||||
_window = window;
|
||||
if (_window==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Unable to retrieve native window handle";
|
||||
OSG_NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Unable to retrieve native window handle";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -947,7 +947,7 @@ bool GraphicsWindowX11::realizeImplementation()
|
||||
{
|
||||
if (_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::realizeImplementation() Already realized"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::realizeImplementation() Already realized"<<std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -969,7 +969,7 @@ bool GraphicsWindowX11::makeCurrentImplementation()
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -986,7 +986,7 @@ bool GraphicsWindowX11::releaseContextImplementation()
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do release context."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do release context."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1002,7 +1002,7 @@ bool GraphicsWindowX11::releaseContextImplementation()
|
||||
|
||||
void GraphicsWindowX11::closeImplementation()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Closing GraphicsWindowX11"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Closing GraphicsWindowX11"<<std::endl;
|
||||
|
||||
if (_eventDisplay)
|
||||
{
|
||||
@ -1060,7 +1060,7 @@ void GraphicsWindowX11::swapBuffersImplementation()
|
||||
{
|
||||
if (!_realized) return;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"swapBuffersImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"swapBuffersImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
||||
|
||||
#ifdef OSG_USE_EGL
|
||||
eglSwapBuffers( _eglDisplay, _eglSurface );
|
||||
@ -1081,7 +1081,7 @@ void GraphicsWindowX11::swapBuffersImplementation()
|
||||
{
|
||||
if (static_cast<Atom>(ev.xclient.data.l[0]) == _deleteWindow)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DeleteWindow event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DeleteWindow event received"<<std::endl;
|
||||
getEventQueue()->closeWindow();
|
||||
}
|
||||
}
|
||||
@ -1100,7 +1100,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
double resizeTime = eventTime;
|
||||
_timeOfLastCheckEvents = getEventQueue()->getTime();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::checkEvents() : getEventQueue()->getCurrentEventState()->getGraphicsContext()="<<getEventQueue()->getCurrentEventState()->getGraphicsContext()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::checkEvents() : getEventQueue()->getCurrentEventState()->getGraphicsContext()="<<getEventQueue()->getCurrentEventState()->getGraphicsContext()<<std::endl;
|
||||
|
||||
int windowX = _traits->x;
|
||||
int windowY = _traits->y;
|
||||
@ -1111,7 +1111,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
|
||||
Time firstEventTime = 0;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Check events"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Check events"<<std::endl;
|
||||
while( XPending(display) )
|
||||
{
|
||||
XEvent ev;
|
||||
@ -1121,36 +1121,36 @@ void GraphicsWindowX11::checkEvents()
|
||||
{
|
||||
case ClientMessage:
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"ClientMessage event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"ClientMessage event received"<<std::endl;
|
||||
if (static_cast<Atom>(ev.xclient.data.l[0]) == _deleteWindow)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"DeleteWindow event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DeleteWindow event received"<<std::endl;
|
||||
// FIXME only do if _ownsWindow ?
|
||||
destroyWindowRequested = true;
|
||||
getEventQueue()->closeWindow(eventTime);
|
||||
}
|
||||
}
|
||||
case Expose :
|
||||
NOTIFY(osg::INFO)<<"Expose x="<<ev.xexpose.x<<" y="<<ev.xexpose.y<<" width="<<ev.xexpose.width<<", height="<<ev.xexpose.height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Expose x="<<ev.xexpose.x<<" y="<<ev.xexpose.y<<" width="<<ev.xexpose.width<<", height="<<ev.xexpose.height<<std::endl;
|
||||
break;
|
||||
|
||||
case GravityNotify :
|
||||
NOTIFY(osg::INFO)<<"GravityNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GravityNotify event received"<<std::endl;
|
||||
break;
|
||||
|
||||
case ReparentNotify:
|
||||
NOTIFY(osg::INFO)<<"ReparentNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ReparentNotify event received"<<std::endl;
|
||||
break;
|
||||
|
||||
case DestroyNotify :
|
||||
NOTIFY(osg::NOTICE)<<"DestroyNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DestroyNotify event received"<<std::endl;
|
||||
_realized = false;
|
||||
_valid = false;
|
||||
break;
|
||||
|
||||
case ConfigureNotify :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"ConfigureNotify x="<<ev.xconfigure.x<<" y="<<ev.xconfigure.y<<" width="<<ev.xconfigure.width<<", height="<<ev.xconfigure.height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ConfigureNotify x="<<ev.xconfigure.x<<" y="<<ev.xconfigure.y<<" width="<<ev.xconfigure.width<<", height="<<ev.xconfigure.height<<std::endl;
|
||||
|
||||
if (windowX != ev.xconfigure.x ||
|
||||
windowX != ev.xconfigure.y ||
|
||||
@ -1170,13 +1170,13 @@ void GraphicsWindowX11::checkEvents()
|
||||
|
||||
case MapNotify :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"MapNotify"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MapNotify"<<std::endl;
|
||||
XWindowAttributes watt;
|
||||
do
|
||||
XGetWindowAttributes(display, _window, &watt );
|
||||
while( watt.map_state != IsViewable );
|
||||
|
||||
NOTIFY(osg::INFO)<<"MapNotify x="<<watt.x<<" y="<<watt.y<<" width="<<watt.width<<", height="<<watt.height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MapNotify x="<<watt.x<<" y="<<watt.y<<" width="<<watt.width<<", height="<<watt.height<<std::endl;
|
||||
|
||||
if (windowWidth != watt.width || windowHeight != watt.height)
|
||||
{
|
||||
@ -1190,14 +1190,14 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
case FocusIn :
|
||||
NOTIFY(osg::INFO)<<"FocusIn event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FocusIn event received"<<std::endl;
|
||||
flushKeyEvents();
|
||||
break;
|
||||
|
||||
case UnmapNotify :
|
||||
case FocusOut :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FocusOut/UnmapNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FocusOut/UnmapNotify event received"<<std::endl;
|
||||
if (ev.type == FocusOut && ev.xfocus.mode != NotifyNormal) break;
|
||||
|
||||
char modMap[32];
|
||||
@ -1220,14 +1220,14 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
case EnterNotify :
|
||||
NOTIFY(osg::INFO)<<"EnterNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"EnterNotify event received"<<std::endl;
|
||||
_modifierState = ev.xcrossing.state;
|
||||
syncLocks();
|
||||
break;
|
||||
|
||||
case KeymapNotify :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"KeymapNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"KeymapNotify event received"<<std::endl;
|
||||
|
||||
// KeymapNotify is guaranteed to directly follow either a FocusIn or
|
||||
// an EnterNotify event. We are only interested in the FocusIn case.
|
||||
@ -1270,7 +1270,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
case MappingNotify :
|
||||
NOTIFY(osg::INFO)<<"MappingNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MappingNotify event received"<<std::endl;
|
||||
if (ev.xmapping.request == MappingModifier) rescanModifierMapping();
|
||||
break;
|
||||
|
||||
@ -1330,7 +1330,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
transformMouseXY(mx, my);
|
||||
getEventQueue()->mouseMotion(mx, my, eventTime);
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"MotionNotify wx="<<wx<<" wy="<<wy<<" mx="<<mx<<" my="<<my<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"MotionNotify wx="<<wx<<" wy="<<wy<<" mx="<<mx<<" my="<<my<<std::endl;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -1430,7 +1430,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
default:
|
||||
NOTIFY(osg::NOTICE)<<"Other event "<<ev.type<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Other event "<<ev.type<<std::endl;
|
||||
break;
|
||||
|
||||
}
|
||||
@ -1643,30 +1643,30 @@ typedef int (*X11ErrorHandler)(Display*, XErrorEvent*);
|
||||
|
||||
int X11ErrorHandling(Display* display, XErrorEvent* event)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Got an X11ErrorHandling call display="<<display<<" event="<<event<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Got an X11ErrorHandling call display="<<display<<" event="<<event<<std::endl;
|
||||
|
||||
char buffer[256];
|
||||
XGetErrorText( display, event->error_code, buffer, 256);
|
||||
|
||||
NOTIFY(osg::NOTICE) << buffer << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Major opcode: " << (int)event->request_code << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Minor opcode: " << (int)event->minor_code << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Error code: " << (int)event->error_code << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Request serial: " << event->serial << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Current serial: " << NextRequest( display ) - 1 << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << buffer << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Major opcode: " << (int)event->request_code << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Minor opcode: " << (int)event->minor_code << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error code: " << (int)event->error_code << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Request serial: " << event->serial << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Current serial: " << NextRequest( display ) - 1 << std::endl;
|
||||
|
||||
switch( event->error_code )
|
||||
{
|
||||
case BadValue:
|
||||
NOTIFY(osg::NOTICE) << " Value: " << event->resourceid << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << " Value: " << event->resourceid << std::endl;
|
||||
break;
|
||||
|
||||
case BadAtom:
|
||||
NOTIFY(osg::NOTICE) << " AtomID: " << event->resourceid << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << " AtomID: " << event->resourceid << std::endl;
|
||||
break;
|
||||
|
||||
default:
|
||||
NOTIFY(osg::NOTICE) << " ResourceID: " << event->resourceid << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << " ResourceID: " << event->resourceid << std::endl;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@ -1682,7 +1682,7 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
// responsibility of the user.
|
||||
bool _setScreen(const osg::GraphicsContext::ScreenIdentifier& si, unsigned int width, unsigned int height, unsigned int colorDepth, double rate) {
|
||||
if (colorDepth>0)
|
||||
NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::_setScreen() is not fully implemented (missing depth)."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::_setScreen() is not fully implemented (missing depth)."<<std::endl;
|
||||
|
||||
Display* display = XOpenDisplay(si.displayName().c_str());
|
||||
|
||||
@ -1692,7 +1692,7 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
|
||||
if(!sc)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to create XRRScreenConfiguration on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to create XRRScreenConfiguration on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1734,11 +1734,11 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
|
||||
if(rate > 0.0f && !rateFound)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to find valid refresh rate " << rate << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to find valid refresh rate " << rate << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
}
|
||||
else if(XRRSetScreenConfigAndRate(display, sc, DefaultRootWindow(display), i, currentRot, static_cast<short>(rate), CurrentTime) != RRSetConfigSuccess)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to set resolution to " << width << "x" << height << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to set resolution to " << width << "x" << height << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1754,7 +1754,7 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1767,7 +1767,7 @@ protected:
|
||||
public:
|
||||
X11WindowingSystemInterface()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"X11WindowingSystemInterface()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"X11WindowingSystemInterface()"<<std::endl;
|
||||
|
||||
|
||||
// Install an X11 error handler, if the application has not already done so.
|
||||
@ -1781,13 +1781,13 @@ public:
|
||||
if ( currentHandler == defHandler )
|
||||
{
|
||||
// No application error handler, use ours.
|
||||
// NOTIFY(osg::INFO)<<"Set osgViewer X11 error handler"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Set osgViewer X11 error handler"<<std::endl;
|
||||
_errorHandlerSet = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Application error handler exists, leave it set.
|
||||
// NOTIFY(osg::INFO)<<"Existing application X11 error handler set"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Existing application X11 error handler set"<<std::endl;
|
||||
_errorHandlerSet = 0;
|
||||
XSetErrorHandler(currentHandler);
|
||||
}
|
||||
@ -1795,12 +1795,12 @@ public:
|
||||
#if 0
|
||||
if (XInitThreads() == 0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Error: XInitThreads() failed. Aborting." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error: XInitThreads() failed. Aborting." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO) << "X11WindowingSystemInterface, xInitThreads() multi-threaded X support initialized.\n";
|
||||
OSG_NOTIFY(osg::INFO) << "X11WindowingSystemInterface, xInitThreads() multi-threaded X support initialized.\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1816,7 +1816,7 @@ public:
|
||||
osg::Referenced::getDeleteHandler()->flushAll();
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"~X11WindowingSystemInterface()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"~X11WindowingSystemInterface()"<<std::endl;
|
||||
|
||||
// Unset our X11 error handler, providing the application has not replaced it.
|
||||
|
||||
@ -1825,12 +1825,12 @@ public:
|
||||
X11ErrorHandler currentHandler = XSetErrorHandler(NULL);
|
||||
if ( currentHandler == X11ErrorHandling )
|
||||
{
|
||||
// NOTIFY(osg::INFO)<<"osgViewer X11 error handler removed"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"osgViewer X11 error handler removed"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not our error handler, leave it set.
|
||||
// NOTIFY(osg::INFO)<<"Application X11 error handler left"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Application X11 error handler left"<<std::endl;
|
||||
XSetErrorHandler(currentHandler);
|
||||
}
|
||||
}
|
||||
@ -1848,7 +1848,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "A Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\""<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "A Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\""<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -1883,7 +1883,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
resolution.width = 0;
|
||||
resolution.height = 0;
|
||||
resolution.colorDepth = 0;
|
||||
@ -1896,7 +1896,7 @@ public:
|
||||
#ifdef OSGVIEWER_USE_XRANDR
|
||||
_setScreen(si, resolution.width, resolution.height, resolution.colorDepth, resolution.refreshRate);
|
||||
#else
|
||||
NOTIFY(osg::NOTICE) << "You must build osgViewer with Xrandr 1.2 or higher for setScreenSettings support!" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "You must build osgViewer with Xrandr 1.2 or higher for setScreenSettings support!" << std::endl;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@ -1919,7 +1919,7 @@ public:
|
||||
{
|
||||
for(int i=0; i<nsizes; ++i)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Screen size "<<screenSizes[i].width<<" "<<screenSizes[i].height<<" "<<screenSizes[i].mwidth<<" "<<screenSizes[i].mheight<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Screen size "<<screenSizes[i].width<<" "<<screenSizes[i].height<<" "<<screenSizes[i].mwidth<<" "<<screenSizes[i].mheight<<std::endl;
|
||||
|
||||
int nrates;
|
||||
short * rates = XRRRates (display, si.screenNum, i, &nrates);
|
||||
@ -1927,7 +1927,7 @@ public:
|
||||
{
|
||||
for(int j=0; j<nrates; ++j)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" rates "<<rates[j]<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" rates "<<rates[j]<<std::endl;
|
||||
|
||||
resolutionList.push_back(osg::GraphicsContext::ScreenSettings(
|
||||
screenSizes[i].width,
|
||||
@ -1954,7 +1954,7 @@ public:
|
||||
|
||||
if (resolutionList.empty())
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::enumerateScreenSettings() not supported." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::enumerateScreenSettings() not supported." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1986,13 +1986,13 @@ struct RegisterWindowingSystemInterfaceProxy
|
||||
{
|
||||
RegisterWindowingSystemInterfaceProxy()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
osg::GraphicsContext::setWindowingSystemInterface(new X11WindowingSystemInterface);
|
||||
}
|
||||
|
||||
~RegisterWindowingSystemInterfaceProxy()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"~RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"~RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
|
||||
if (osg::Referenced::getDeleteHandler())
|
||||
{
|
||||
|
@ -432,21 +432,21 @@ void Renderer::draw()
|
||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(_camera->getView());
|
||||
osgDB::DatabasePager* databasePager = view ? view->getDatabasePager() : 0;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Drawing buffer "<<_currentDraw<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Drawing buffer "<<_currentDraw<<std::endl;
|
||||
|
||||
if (_done)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Renderer::release() causing draw to exit"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Renderer::release() causing draw to exit"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_graphicsThreadDoesCull)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Renderer::draw() completing early due to change in _graphicsThreadDoesCull flag."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Renderer::draw() completing early due to change in _graphicsThreadDoesCull flag."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"RenderingOperation"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"RenderingOperation"<<std::endl;
|
||||
|
||||
osg::Stats* stats = sceneView->getCamera()->getStats();
|
||||
osg::State* state = sceneView->getState();
|
||||
@ -461,7 +461,7 @@ void Renderer::draw()
|
||||
|
||||
if (sceneView->getDynamicObjectCount()==0 && state->getDynamicObjectRenderingCompletedCallback())
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Completed in cull"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Completed in cull"<<std::endl;
|
||||
state->getDynamicObjectRenderingCompletedCallback()->completed(state);
|
||||
}
|
||||
|
||||
@ -515,8 +515,8 @@ void Renderer::draw()
|
||||
|
||||
osg::Timer_t afterDrawTick = osg::Timer::instance()->tick();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Time wait for draw = "<<osg::Timer::instance()->delta_m(startDrawTick, beforeDrawTick)<<std::endl;
|
||||
// NOTIFY(osg::NOTICE)<<" time for draw = "<<osg::Timer::instance()->delta_m(beforeDrawTick, afterDrawTick)<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Time wait for draw = "<<osg::Timer::instance()->delta_m(startDrawTick, beforeDrawTick)<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" time for draw = "<<osg::Timer::instance()->delta_m(beforeDrawTick, afterDrawTick)<<std::endl;
|
||||
|
||||
if (stats && stats->collectStats("rendering"))
|
||||
{
|
||||
@ -687,9 +687,9 @@ void Renderer::flushAndCompile(double currentElapsedFrameTime, osgUtil::SceneVie
|
||||
double compileTime = availableTime - flushTime;
|
||||
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<"total availableTime = "<<availableTime*1000.0<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" flushTime = "<<flushTime*1000.0<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" compileTime = "<<compileTime*1000.0<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"total availableTime = "<<availableTime*1000.0<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" flushTime = "<<flushTime*1000.0<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" compileTime = "<<compileTime*1000.0<<std::endl;
|
||||
#endif
|
||||
|
||||
if (compileThread)
|
||||
@ -705,7 +705,7 @@ void Renderer::flushAndCompile(double currentElapsedFrameTime, osgUtil::SceneVie
|
||||
if (flushTime>0.0) compileTime += flushTime;
|
||||
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<" revised compileTime = "<<compileTime*1000.0<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" revised compileTime = "<<compileTime*1000.0<<std::endl;
|
||||
#endif
|
||||
|
||||
if (databasePager && databasePager->requiresExternalCompileGLObjects(sceneView->getState()->getContextID()))
|
||||
@ -737,7 +737,7 @@ void Renderer::operator () (osg::GraphicsContext* context)
|
||||
|
||||
void Renderer::release()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Renderer::release()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Renderer::release()"<<std::endl;
|
||||
_done = true;
|
||||
|
||||
_availableQueue.release();
|
||||
|
@ -502,7 +502,7 @@ struct ViewSceneStatsTextDrawCallback : public virtual osg::Drawable::DrawCallba
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN)<<std::endl<<"No valid view to collect scene stats from"<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<std::endl<<"No valid view to collect scene stats from"<<std::endl;
|
||||
|
||||
text->setText("");
|
||||
}
|
||||
|
@ -48,14 +48,14 @@ public:
|
||||
{
|
||||
if (_pathToCoordinateSystemNode.empty())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Found CoordianteSystemNode node"<<std::endl;
|
||||
NOTIFY(osg::INFO)<<" CoordinateSystem = "<<node.getCoordinateSystem()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Found CoordianteSystemNode node"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" CoordinateSystem = "<<node.getCoordinateSystem()<<std::endl;
|
||||
_pathToCoordinateSystemNode = getNodePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Found additional CoordianteSystemNode node, but ignoring"<<std::endl;
|
||||
NOTIFY(osg::INFO)<<" CoordinateSystem = "<<node.getCoordinateSystem()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Found additional CoordianteSystemNode node, but ignoring"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" CoordinateSystem = "<<node.getCoordinateSystem()<<std::endl;
|
||||
}
|
||||
traverse(node);
|
||||
}
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
virtual osg::CoordinateFrame getCoordinateFrame(const osg::Vec3d& position) const
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"getCoordinateFrame("<<position<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"getCoordinateFrame("<<position<<")"<<std::endl;
|
||||
|
||||
osg::NodePath tmpPath = _view->getCoordinateSystemNodePath();
|
||||
|
||||
@ -105,19 +105,19 @@ public:
|
||||
// reapply the position.
|
||||
coordinateFrame.setTrans(pos);
|
||||
|
||||
NOTIFY(osg::INFO)<<"csn->computeLocalCoordinateFrame(position)* osg::computeLocalToWorld(tmpPath)"<<coordinateFrame<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"csn->computeLocalCoordinateFrame(position)* osg::computeLocalToWorld(tmpPath)"<<coordinateFrame<<std::endl;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"osg::computeLocalToWorld(tmpPath)"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"osg::computeLocalToWorld(tmpPath)"<<std::endl;
|
||||
coordinateFrame = osg::computeLocalToWorld(tmpPath);
|
||||
}
|
||||
return coordinateFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" no coordinate system found, using default orientation"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" no coordinate system found, using default orientation"<<std::endl;
|
||||
return osg::Matrixd::translate(position);
|
||||
}
|
||||
}
|
||||
@ -133,7 +133,7 @@ View::View():
|
||||
_fusionDistanceMode(osgUtil::SceneView::PROPORTIONAL_TO_SCREEN_DISTANCE),
|
||||
_fusionDistanceValue(1.0f)
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Constructing osgViewer::View"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Constructing osgViewer::View"<<std::endl;
|
||||
|
||||
_startTick = 0;
|
||||
|
||||
@ -174,7 +174,7 @@ View::View(const osgViewer::View& view, const osg::CopyOp& copyop):
|
||||
|
||||
View::~View()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Destructing osgViewer::View"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Destructing osgViewer::View"<<std::endl;
|
||||
}
|
||||
|
||||
void View::take(osg::View& rhs)
|
||||
@ -234,7 +234,7 @@ osg::GraphicsOperation* View::createRenderer(osg::Camera* camera)
|
||||
|
||||
void View::init()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::init()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::init()"<<std::endl;
|
||||
|
||||
osg::ref_ptr<osgGA::GUIEventAdapter> initEvent = _eventQueue->createEvent();
|
||||
initEvent->setEventType(osgGA::GUIEventAdapter::FRAME);
|
||||
@ -258,7 +258,7 @@ void View::setSceneData(osg::Node* node)
|
||||
|
||||
if (scene)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setSceneData() Sharing scene "<<scene.get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setSceneData() Sharing scene "<<scene.get()<<std::endl;
|
||||
_scene = scene;
|
||||
}
|
||||
else
|
||||
@ -267,11 +267,11 @@ void View::setSceneData(osg::Node* node)
|
||||
{
|
||||
// we are not the only reference to the Scene so we cannot reuse it.
|
||||
_scene = new Scene;
|
||||
NOTIFY(osg::INFO)<<"View::setSceneData() Allocating new scene"<<_scene.get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setSceneData() Allocating new scene"<<_scene.get()<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setSceneData() Reusing exisitng scene"<<_scene.get()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setSceneData() Reusing exisitng scene"<<_scene.get()<<std::endl;
|
||||
}
|
||||
|
||||
_scene->setSceneData(node);
|
||||
@ -431,7 +431,7 @@ void View::setUpViewAcrossAllScreens()
|
||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (!wsi)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"View::setUpViewAcrossAllScreens() : Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"View::setUpViewAcrossAllScreens() : Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -473,12 +473,12 @@ void View::setUpViewAcrossAllScreens()
|
||||
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());
|
||||
if (gw)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" GraphicsWindow has been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" GraphicsWindow has been created successfully."<<std::endl;
|
||||
gw->getEventQueue()->getCurrentEventState()->setWindowRectangle(0, 0, width, height );
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
}
|
||||
|
||||
double newAspectRatio = double(traits->width) / double(traits->height);
|
||||
@ -542,13 +542,13 @@ void View::setUpViewAcrossAllScreens()
|
||||
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());
|
||||
if (gw)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" GraphicsWindow has been created successfully."<<gw<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" GraphicsWindow has been created successfully."<<gw<<std::endl;
|
||||
|
||||
gw->getEventQueue()->getCurrentEventState()->setWindowRectangle(traits->x, traits->y, traits->width, traits->height );
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
}
|
||||
|
||||
camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
|
||||
@ -606,12 +606,12 @@ void View::setUpViewInWindow(int x, int y, int width, int height, unsigned int s
|
||||
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());
|
||||
if (gw)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setUpViewOnSingleScreen - GraphicsWindow has been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setUpViewOnSingleScreen - GraphicsWindow has been created successfully."<<std::endl;
|
||||
gw->getEventQueue()->getCurrentEventState()->setWindowRectangle(x, y, width, height );
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
}
|
||||
|
||||
double fovy, aspectRatio, zNear, zFar;
|
||||
@ -637,7 +637,7 @@ void View::setUpViewOnSingleScreen(unsigned int screenNum)
|
||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (!wsi)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"View::setUpViewOnSingleScreen() : Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"View::setUpViewOnSingleScreen() : Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -673,12 +673,12 @@ void View::setUpViewOnSingleScreen(unsigned int screenNum)
|
||||
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());
|
||||
if (gw)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setUpViewOnSingleScreen - GraphicsWindow has been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setUpViewOnSingleScreen - GraphicsWindow has been created successfully."<<std::endl;
|
||||
gw->getEventQueue()->getCurrentEventState()->setWindowRectangle(0, 0, width, height );
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
|
||||
}
|
||||
|
||||
double fovy, aspectRatio, zNear, zFar;
|
||||
@ -710,8 +710,8 @@ static osg::Geometry* create3DSphericalDisplayDistortionMesh(const osg::Vec3& or
|
||||
|
||||
osg::Vec3d projector = eye - osg::Vec3d(0.0,0.0, distance);
|
||||
|
||||
NOTIFY(osg::INFO)<<"create3DSphericalDisplayDistortionMesh : Projector position = "<<projector<<std::endl;
|
||||
NOTIFY(osg::INFO)<<"create3DSphericalDisplayDistortionMesh : distance = "<<distance<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"create3DSphericalDisplayDistortionMesh : Projector position = "<<projector<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"create3DSphericalDisplayDistortionMesh : distance = "<<distance<<std::endl;
|
||||
|
||||
|
||||
// create the quad to visualize.
|
||||
@ -760,7 +760,7 @@ static osg::Geometry* create3DSphericalDisplayDistortionMesh(const osg::Vec3& or
|
||||
|
||||
if (theta<0.0) theta += 2.0*osg::PI;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"theta = "<<theta<< "phi="<<phi<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"theta = "<<theta<< "phi="<<phi<<std::endl;
|
||||
|
||||
osg::Vec3 texcoord(sin(phi) * cos(theta),
|
||||
sin(phi) * sin(theta),
|
||||
@ -782,7 +782,7 @@ static osg::Geometry* create3DSphericalDisplayDistortionMesh(const osg::Vec3& or
|
||||
|
||||
cursor += dx;
|
||||
}
|
||||
// NOTIFY(osg::NOTICE)<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -798,7 +798,7 @@ static osg::Geometry* create3DSphericalDisplayDistortionMesh(const osg::Vec3& or
|
||||
if (phi > osg::PI_2) phi = osg::PI_2;
|
||||
if (theta<0.0) theta += 2.0*osg::PI;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"theta = "<<theta<< "phi="<<phi<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"theta = "<<theta<< "phi="<<phi<<std::endl;
|
||||
|
||||
double f = distance * sin(phi);
|
||||
double e = distance * cos(phi) + sqrt( sphere_radius*sphere_radius - f*f);
|
||||
@ -826,7 +826,7 @@ static osg::Geometry* create3DSphericalDisplayDistortionMesh(const osg::Vec3& or
|
||||
|
||||
cursor += dx;
|
||||
}
|
||||
// NOTIFY(osg::NOTICE)<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -855,11 +855,11 @@ static osg::Geometry* create3DSphericalDisplayDistortionMesh(const osg::Vec3& or
|
||||
|
||||
void View::setUpViewFor3DSphericalDisplay(double radius, double collar, unsigned int screenNum, osg::Image* intensityMap, const osg::Matrixd& projectorMatrix)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setUpViewFor3DSphericalDisplay(rad="<<radius<<", cllr="<<collar<<", sn="<<screenNum<<", im="<<intensityMap<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setUpViewFor3DSphericalDisplay(rad="<<radius<<", cllr="<<collar<<", sn="<<screenNum<<", im="<<intensityMap<<")"<<std::endl;
|
||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (!wsi)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -891,7 +891,7 @@ void View::setUpViewFor3DSphericalDisplay(double radius, double collar, unsigned
|
||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||
if (!gc)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindow has not been created successfully."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1099,8 +1099,8 @@ static osg::Geometry* createParoramicSphericalDisplayDistortionMesh(const osg::V
|
||||
osg::Vec3d projector = eye - osg::Vec3d(0.0,0.0, distance);
|
||||
|
||||
|
||||
NOTIFY(osg::INFO)<<"createParoramicSphericalDisplayDistortionMesh : Projector position = "<<projector<<std::endl;
|
||||
NOTIFY(osg::INFO)<<"createParoramicSphericalDisplayDistortionMesh : distance = "<<distance<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"createParoramicSphericalDisplayDistortionMesh : Projector position = "<<projector<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"createParoramicSphericalDisplayDistortionMesh : distance = "<<distance<<std::endl;
|
||||
|
||||
// create the quad to visualize.
|
||||
osg::Geometry* geometry = new osg::Geometry();
|
||||
@ -1228,12 +1228,12 @@ static osg::Geometry* createParoramicSphericalDisplayDistortionMesh(const osg::V
|
||||
|
||||
void View::setUpViewForPanoramicSphericalDisplay(double radius, double collar, unsigned int screenNum, osg::Image* intensityMap, const osg::Matrixd& projectorMatrix)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setUpViewForPanoramicSphericalDisplay(rad="<<radius<<", cllr="<<collar<<", sn="<<screenNum<<", im="<<intensityMap<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setUpViewForPanoramicSphericalDisplay(rad="<<radius<<", cllr="<<collar<<", sn="<<screenNum<<", im="<<intensityMap<<")"<<std::endl;
|
||||
|
||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (!wsi)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1266,7 +1266,7 @@ void View::setUpViewForPanoramicSphericalDisplay(double radius, double collar, u
|
||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||
if (!gc)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindow has not been created successfully."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1358,12 +1358,12 @@ void View::setUpViewForPanoramicSphericalDisplay(double radius, double collar, u
|
||||
|
||||
void View::setUpViewForWoWVxDisplay(unsigned int screenNum, unsigned char wow_content, unsigned char wow_factor, unsigned char wow_offset, float wow_disparity_Zd, float wow_disparity_vz, float wow_disparity_M, float wow_disparity_C)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::setUpViewForWoWVxDisplay(...)"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::setUpViewForWoWVxDisplay(...)"<<std::endl;
|
||||
|
||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (!wsi)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1394,7 +1394,7 @@ void View::setUpViewForWoWVxDisplay(unsigned int screenNum, unsigned char wow_co
|
||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||
if (!gc)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindow has not been created successfully."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindow has not been created successfully."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1608,7 +1608,7 @@ void View::setUpViewForWoWVxDisplay(unsigned int screenNum, unsigned char wow_co
|
||||
|
||||
void View::assignSceneDataToCameras()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"View::assignSceneDataToCameras()"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"View::assignSceneDataToCameras()"<<std::endl;
|
||||
|
||||
osg::Node* sceneData = _scene.valid() ? _scene->getSceneData() : 0;
|
||||
|
||||
@ -1653,7 +1653,7 @@ void View::requestRedraw()
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::requestRedraw(), No viewer base has been assigned yet."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::requestRedraw(), No viewer base has been assigned yet."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1665,13 +1665,13 @@ void View::requestContinuousUpdate(bool flag)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::requestContinuousUpdate(), No viewer base has been assigned yet."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::requestContinuousUpdate(), No viewer base has been assigned yet."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void View::requestWarpPointer(float x,float y)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::requestWarpPointer("<<x<<","<<y<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::requestWarpPointer("<<x<<","<<y<<")"<<std::endl;
|
||||
|
||||
float local_x, local_y;
|
||||
const osg::Camera* camera = getCameraContainingPosition(x, y, local_x, local_y);
|
||||
@ -1691,7 +1691,7 @@ void View::requestWarpPointer(float x,float y)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"View::requestWarpPointer failed no camera containing pointer"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"View::requestWarpPointer failed no camera containing pointer"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1740,7 +1740,7 @@ const osg::Camera* View::getCameraContainingPosition(float x, float y, float& lo
|
||||
local_x = new_x;
|
||||
local_y = new_y;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Returning master camera"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Returning master camera"<<std::endl;
|
||||
|
||||
return _camera.get();
|
||||
}
|
||||
@ -1761,7 +1761,7 @@ const osg::Camera* View::getCameraContainingPosition(float x, float y, float& lo
|
||||
slave._camera->getAllowEventFocus() &&
|
||||
slave._camera->getRenderTargetImplementation()==osg::Camera::FRAME_BUFFER)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Testing slave camera "<<slave._camera->getName()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Testing slave camera "<<slave._camera->getName()<<std::endl;
|
||||
|
||||
const osg::Camera* camera = slave._camera.get();
|
||||
const osg::Viewport* viewport = camera ? camera->getViewport() : 0;
|
||||
@ -1773,15 +1773,15 @@ const osg::Camera* View::getCameraContainingPosition(float x, float y, float& lo
|
||||
|
||||
osg::Vec3d new_coord = osg::Vec3d(x,y,0.0) * matrix;
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<" x="<<x<<" y="<<y<<std::endl;;
|
||||
//NOTIFY(osg::NOTICE)<<" eventState->getXmin()="<<eventState->getXmin()<<" eventState->getXmax()="<<eventState->getXmax()<<std::endl;;
|
||||
//NOTIFY(osg::NOTICE)<<" new_coord "<<new_coord<<std::endl;;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<" x="<<x<<" y="<<y<<std::endl;;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<" eventState->getXmin()="<<eventState->getXmin()<<" eventState->getXmax()="<<eventState->getXmax()<<std::endl;;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<" new_coord "<<new_coord<<std::endl;;
|
||||
|
||||
if (viewport &&
|
||||
new_coord.x() >= (viewport->x()-epsilon) && new_coord.y() >= (viewport->y()-epsilon) &&
|
||||
new_coord.x() < (viewport->x()+viewport->width()-1.0+epsilon) && new_coord.y() <= (viewport->y()+viewport->height()-1.0+epsilon) )
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<" in viewport "<<std::endl;;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" in viewport "<<std::endl;;
|
||||
|
||||
local_x = new_coord.x();
|
||||
local_y = new_coord.y();
|
||||
@ -1790,7 +1790,7 @@ const osg::Camera* View::getCameraContainingPosition(float x, float y, float& lo
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<" not in viewport "<<viewport->x()<<" "<<(viewport->x()+viewport->width())<<std::endl;;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" not in viewport "<<viewport->x()<<" "<<(viewport->x()+viewport->width())<<std::endl;;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1815,13 +1815,13 @@ bool View::computeIntersections(float x,float y, osgUtil::LineSegmentIntersector
|
||||
osg::ref_ptr< osgUtil::LineSegmentIntersector > picker = new osgUtil::LineSegmentIntersector(cf, local_x, local_y);
|
||||
|
||||
#if 0
|
||||
NOTIFY(osg::NOTICE)<<"View::computeIntersections(x="<<x<<", y="<<y<<", local_x="<<local_x<<", local_y="<<local_y<<") "<<cf<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" viewport ("<<camera->getViewport()->x()<<","<<camera->getViewport()->y()<<","<<camera->getViewport()->width()<<","<<camera->getViewport()->height()<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"View::computeIntersections(x="<<x<<", y="<<y<<", local_x="<<local_x<<", local_y="<<local_y<<") "<<cf<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" viewport ("<<camera->getViewport()->x()<<","<<camera->getViewport()->y()<<","<<camera->getViewport()->width()<<","<<camera->getViewport()->height()<<")"<<std::endl;
|
||||
|
||||
const osg::GraphicsContext::Traits* traits = camera->getGraphicsContext() ? camera->getGraphicsContext()->getTraits() : 0;
|
||||
if (traits)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<" window ("<<traits->x<<","<<traits->y<<","<<traits->width<<","<<traits->height<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" window ("<<traits->x<<","<<traits->y<<","<<traits->width<<","<<traits->height<<")"<<std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1864,16 +1864,16 @@ bool View::computeIntersections(float x,float y, osgUtil::LineSegmentIntersector
|
||||
double timeKdTree = osg::Timer::instance()->delta_m(after_dummy, after_kdTree_2);
|
||||
double timeConventional = osg::Timer::instance()->delta_m(after_kdTree_2, after);
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"Using Dummy "<<timeDummy<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" KdTrees "<<timeKdTree
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Using Dummy "<<timeDummy<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" KdTrees "<<timeKdTree
|
||||
<<"\tNum intersects = "<<intersectsBeforeConventional-intersectsBeforeKdTree<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" KdTrees - Traversal "<<timeKdTree-timeDummy<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" Conventional "<<timeConventional
|
||||
OSG_NOTIFY(osg::NOTICE)<<" KdTrees - Traversal "<<timeKdTree-timeDummy<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" Conventional "<<timeConventional
|
||||
<<"\tNum intersects = "<<intersectsAfterConventional-intersectsBeforeConventional<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" Conventional - Traversal "<<timeConventional-timeDummy<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" Delta "<<timeConventional/timeKdTree<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<" Delta sans Traversal "<<(timeConventional-timeDummy)/(timeKdTree-timeDummy)<<std::endl;
|
||||
NOTIFY(osg::NOTICE)<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" Conventional - Traversal "<<timeConventional-timeDummy<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" Delta "<<timeConventional/timeKdTree<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" Delta sans Traversal "<<(timeConventional-timeDummy)/(timeKdTree-timeDummy)<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<std::endl;
|
||||
#endif
|
||||
|
||||
if (picker->containsIntersections())
|
||||
|
@ -100,7 +100,7 @@ Viewer::Viewer(osg::ArgumentParser& arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Invalid clear color \""<<colorStr<<"\""<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Invalid clear color \""<<colorStr<<"\""<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,13 +209,13 @@ void Viewer::constructorInit()
|
||||
|
||||
Viewer::~Viewer()
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Viewer::~Viewer()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Viewer::~Viewer()"<<std::endl;
|
||||
|
||||
|
||||
Threads threads;
|
||||
getAllThreads(threads);
|
||||
|
||||
NOTIFY(osg::INFO)<<"Viewer::~Viewer():: start destructor getThreads = "<<threads.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::~Viewer():: start destructor getThreads = "<<threads.size()<<std::endl;
|
||||
|
||||
|
||||
stopThreading();
|
||||
@ -237,11 +237,11 @@ Viewer::~Viewer()
|
||||
(*citr)->close();
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"finish Viewer::~Viewer()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"finish Viewer::~Viewer()"<<std::endl;
|
||||
|
||||
getAllThreads(threads);
|
||||
|
||||
NOTIFY(osg::INFO)<<"Viewer::~Viewer() end destrcutor getThreads = "<<threads.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::~Viewer() end destrcutor getThreads = "<<threads.size()<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
@ -288,19 +288,19 @@ void Viewer::take(View& rhs)
|
||||
|
||||
bool Viewer::readConfiguration(const std::string& filename)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Viewer::readConfiguration("<<filename<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::readConfiguration("<<filename<<")"<<std::endl;
|
||||
|
||||
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(filename);
|
||||
if (!object)
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Error: Unable to load configuration file \""<<filename<<"\""<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to load configuration file \""<<filename<<"\""<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
CompositeViewer* compositeViewer = dynamic_cast<CompositeViewer*>(object.get());
|
||||
if (compositeViewer)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Config file \""<<filename<<"\" containing CompositeViewer cannot be loaded by Viewer."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Config file \""<<filename<<"\" containing CompositeViewer cannot be loaded by Viewer."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ bool Viewer::readConfiguration(const std::string& filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Config file \""<<filename<<"\" does not contain a valid Viewer configuration."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Config file \""<<filename<<"\" does not contain a valid Viewer configuration."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -424,7 +424,7 @@ GraphicsWindowEmbedded* Viewer::setUpViewerAsEmbeddedInWindow(int x, int y, int
|
||||
|
||||
void Viewer::realize()
|
||||
{
|
||||
//NOTIFY(osg::INFO)<<"Viewer::realize()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::INFO)<<"Viewer::realize()"<<std::endl;
|
||||
|
||||
setCameraWithFocus(0);
|
||||
|
||||
@ -433,7 +433,7 @@ void Viewer::realize()
|
||||
|
||||
if (contexts.empty())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Viewer::realize() - No valid contexts found, setting up view across all screens."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::realize() - No valid contexts found, setting up view across all screens."<<std::endl;
|
||||
|
||||
// no windows are already set up so set up a default view
|
||||
|
||||
@ -478,7 +478,7 @@ void Viewer::realize()
|
||||
|
||||
if (contexts.empty())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Viewer::realize() - failed to set up any windows"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Viewer::realize() - failed to set up any windows"<<std::endl;
|
||||
_done = true;
|
||||
return;
|
||||
}
|
||||
@ -608,7 +608,7 @@ void Viewer::eventTraversal()
|
||||
|
||||
double beginEventTraversal = osg::Timer::instance()->delta_s(_startTick, osg::Timer::instance()->tick());
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Viewer::frameEventTraversal()."<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Viewer::frameEventTraversal()."<<std::endl;
|
||||
|
||||
// need to copy events from the GraphicsWindow's into local EventQueue;
|
||||
osgGA::EventQueue::Events events;
|
||||
@ -684,7 +684,7 @@ void Viewer::eventTraversal()
|
||||
x >= viewport->x() && y >= viewport->y() &&
|
||||
x <= (viewport->x()+viewport->width()) && y <= (viewport->y()+viewport->height()) )
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"setCamera with focus "<<camera->getName()<<" x="<<x<<" y="<<y<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"setCamera with focus "<<camera->getName()<<" x="<<x<<" y="<<y<<std::endl;
|
||||
setCameraWithFocus(camera);
|
||||
}
|
||||
}
|
||||
@ -712,7 +712,7 @@ void Viewer::eventTraversal()
|
||||
x = new_coord.x();
|
||||
y = new_coord.y();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"pointer event new_coord.x()="<<new_coord.x()<<" new_coord.y()="<<new_coord.y()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"pointer event new_coord.x()="<<new_coord.x()<<" new_coord.y()="<<new_coord.y()<<std::endl;
|
||||
|
||||
event->setInputRange(eventState->getXmin(), eventState->getYmin(), eventState->getXmax(), eventState->getYmax());
|
||||
event->setX(x);
|
||||
@ -724,7 +724,7 @@ void Viewer::eventTraversal()
|
||||
{
|
||||
x = eventState->getXmin() + (x/double(gw->getTraits()->width))*(eventState->getXmax() - eventState->getXmin());
|
||||
y = eventState->getYmin() + (y/double(gw->getTraits()->height))*(eventState->getYmax() - eventState->getYmin());
|
||||
// NOTIFY(osg::NOTICE)<<"new x = "<<x<<" new y = "<<y<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"new x = "<<x<<" new y = "<<y<<std::endl;
|
||||
|
||||
event->setInputRange(eventState->getXmin(), eventState->getYmin(), eventState->getXmax(), eventState->getYmax());
|
||||
event->setX(x);
|
||||
@ -747,8 +747,8 @@ void Viewer::eventTraversal()
|
||||
event->setButtonMask(eventState->getButtonMask());
|
||||
event->setMouseYOrientation(eventState->getMouseYOrientation());
|
||||
}
|
||||
//NOTIFY(osg::NOTICE)<<" mouse x = "<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
// NOTIFY(osg::NOTICE)<<" mouse Xmin = "<<event->getXmin()<<" Ymin="<<event->getYmin()<<" xMax="<<event->getXmax()<<" Ymax="<<event->getYmax()<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<" mouse x = "<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" mouse Xmin = "<<event->getXmin()<<" Ymin="<<event->getYmin()<<" xMax="<<event->getXmax()<<" Ymax="<<event->getYmax()<<std::endl;
|
||||
}
|
||||
|
||||
for(itr = gw_events.begin();
|
||||
@ -781,7 +781,7 @@ void Viewer::eventTraversal()
|
||||
}
|
||||
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"mouseEventState Xmin = "<<eventState->getXmin()<<" Ymin="<<eventState->getYmin()<<" xMax="<<eventState->getXmax()<<" Ymax="<<eventState->getYmax()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"mouseEventState Xmin = "<<eventState->getXmin()<<" Ymin="<<eventState->getYmin()<<" xMax="<<eventState->getXmax()<<" Ymax="<<eventState->getYmax()<<std::endl;
|
||||
|
||||
|
||||
_eventQueue->frame( getFrameStamp()->getReferenceTime() );
|
||||
@ -789,7 +789,7 @@ void Viewer::eventTraversal()
|
||||
|
||||
|
||||
#if 0
|
||||
// NOTIFY(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
||||
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
||||
itr != events.end();
|
||||
++itr)
|
||||
@ -798,43 +798,43 @@ void Viewer::eventTraversal()
|
||||
switch(event->getEventType())
|
||||
{
|
||||
case(osgGA::GUIEventAdapter::PUSH):
|
||||
NOTIFY(osg::NOTICE)<<" PUSH "<<event->getButton()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" PUSH "<<event->getButton()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::RELEASE):
|
||||
NOTIFY(osg::NOTICE)<<" RELEASE "<<event->getButton()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" RELEASE "<<event->getButton()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::DRAG):
|
||||
NOTIFY(osg::NOTICE)<<" DRAG "<<event->getButtonMask()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" DRAG "<<event->getButtonMask()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::MOVE):
|
||||
NOTIFY(osg::NOTICE)<<" MOVE "<<event->getButtonMask()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" MOVE "<<event->getButtonMask()<<" x="<<event->getX()<<" y="<<event->getY()<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::SCROLL):
|
||||
NOTIFY(osg::NOTICE)<<" SCROLL "<<event->getScrollingMotion()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" SCROLL "<<event->getScrollingMotion()<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::KEYDOWN):
|
||||
NOTIFY(osg::NOTICE)<<" KEYDOWN '"<<(char)event->getKey()<<"'"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" KEYDOWN '"<<(char)event->getKey()<<"'"<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::KEYUP):
|
||||
NOTIFY(osg::NOTICE)<<" KEYUP '"<<(char)event->getKey()<<"'"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" KEYUP '"<<(char)event->getKey()<<"'"<<std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::RESIZE):
|
||||
NOTIFY(osg::NOTICE)<<" RESIZE "<<event->getWindowX()<<"/"<<event->getWindowY()<<" x "<<event->getWindowWidth()<<"/"<<event->getWindowHeight() << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" RESIZE "<<event->getWindowX()<<"/"<<event->getWindowY()<<" x "<<event->getWindowWidth()<<"/"<<event->getWindowHeight() << std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::QUIT_APPLICATION):
|
||||
NOTIFY(osg::NOTICE)<<" QUIT_APPLICATION " << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<" QUIT_APPLICATION " << std::endl;
|
||||
break;
|
||||
case(osgGA::GUIEventAdapter::FRAME):
|
||||
// NOTIFY(osg::NOTICE)<<" FRAME "<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" FRAME "<<std::endl;
|
||||
break;
|
||||
default:
|
||||
// NOTIFY(osg::NOTICE)<<" Event not handled"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<" Event not handled"<<std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Events "<<events.size()<<std::endl;
|
||||
|
||||
if ((_keyEventSetsDone!=0) || _quitEventSetsDone)
|
||||
{
|
||||
|
@ -200,7 +200,7 @@ void ViewerBase::stopThreading()
|
||||
{
|
||||
if (!_threadsRunning) return;
|
||||
|
||||
NOTIFY(osg::INFO)<<"ViewerBase::stopThreading() - stopping threading"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ViewerBase::stopThreading() - stopping threading"<<std::endl;
|
||||
|
||||
Contexts contexts;
|
||||
getContexts(contexts);
|
||||
@ -255,14 +255,14 @@ void ViewerBase::stopThreading()
|
||||
_endRenderingDispatchBarrier = 0;
|
||||
_endDynamicDrawBlock = 0;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Viewer::stopThreading() - stopped threading."<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::stopThreading() - stopped threading."<<std::endl;
|
||||
}
|
||||
|
||||
void ViewerBase::startThreading()
|
||||
{
|
||||
if (_threadsRunning) return;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Viewer::startThreading() - starting threading"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::startThreading() - starting threading"<<std::endl;
|
||||
|
||||
// release any context held by the main thread.
|
||||
releaseContext();
|
||||
@ -272,7 +272,7 @@ void ViewerBase::startThreading()
|
||||
Contexts contexts;
|
||||
getContexts(contexts);
|
||||
|
||||
NOTIFY(osg::INFO)<<"Viewer::startThreading() - contexts.size()="<<contexts.size()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Viewer::startThreading() - contexts.size()="<<contexts.size()<<std::endl;
|
||||
|
||||
Cameras cameras;
|
||||
getCameras(cameras);
|
||||
@ -298,7 +298,7 @@ void ViewerBase::startThreading()
|
||||
numThreadsOnEndBarrier = 1;
|
||||
break;
|
||||
default:
|
||||
NOTIFY(osg::NOTICE)<<"Error: Threading model not selected"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Threading model not selected"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ void ViewerBase::startThreading()
|
||||
{
|
||||
if ((*scitr)->getSceneData())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Making scene thread safe"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Making scene thread safe"<<std::endl;
|
||||
|
||||
// make sure that existing scene graph objects are allocated with thread safe ref/unref
|
||||
(*scitr)->getSceneData()->setThreadSafeRefUnref(true);
|
||||
@ -392,7 +392,7 @@ void ViewerBase::startThreading()
|
||||
|
||||
if (!gc->isRealized())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"ViewerBase::startThreading() : Realizng window "<<gc<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ViewerBase::startThreading() : Realizng window "<<gc<<std::endl;
|
||||
gc->realize();
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ void ViewerBase::startThreading()
|
||||
osg::Camera* camera = *camItr;
|
||||
if (camera->getCameraThread() && !camera->getCameraThread()->isRunning())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" camera->getCameraThread()-> "<<camera->getCameraThread()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" camera->getCameraThread()-> "<<camera->getCameraThread()<<std::endl;
|
||||
camera->getCameraThread()->startThread();
|
||||
}
|
||||
}
|
||||
@ -508,7 +508,7 @@ void ViewerBase::startThreading()
|
||||
osg::GraphicsContext* gc = (*citr);
|
||||
if (gc->getGraphicsThread() && !gc->getGraphicsThread()->isRunning())
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" gc->getGraphicsThread()->startThread() "<<gc->getGraphicsThread()<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" gc->getGraphicsThread()->startThread() "<<gc->getGraphicsThread()<<std::endl;
|
||||
gc->getGraphicsThread()->startThread();
|
||||
// OpenThreads::Thread::YieldCurrentThread();
|
||||
}
|
||||
@ -516,7 +516,7 @@ void ViewerBase::startThreading()
|
||||
|
||||
_threadsRunning = true;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Set up threading"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Set up threading"<<std::endl;
|
||||
}
|
||||
|
||||
void ViewerBase::getWindows(Windows& windows, bool onlyValid)
|
||||
@ -540,7 +540,7 @@ void ViewerBase::checkWindowStatus()
|
||||
Contexts contexts;
|
||||
getContexts(contexts);
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Viewer::checkWindowStatus() - "<<contexts.size()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Viewer::checkWindowStatus() - "<<contexts.size()<<std::endl;
|
||||
|
||||
if (contexts.size()==0)
|
||||
{
|
||||
@ -619,7 +619,7 @@ void ViewerBase::frame(double simulationTime)
|
||||
{
|
||||
if (_done) return;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<std::endl<<"CompositeViewer::frame()"<<std::endl<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<std::endl<<"CompositeViewer::frame()"<<std::endl<<std::endl;
|
||||
|
||||
if (_firstFrame)
|
||||
{
|
||||
@ -656,7 +656,7 @@ void ViewerBase::renderingTraversals()
|
||||
if (view)
|
||||
{
|
||||
const osg::Matrixd& m = view->getCamera()->getInverseViewMatrix();
|
||||
NOTIFY(osg::NOTICE)<<"View "<<view<<", Master Camera position("<<m.getTrans()<<"), rotation("<<m.getRotate()<<")"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"View "<<view<<", Master Camera position("<<m.getTrans()<<"), rotation("<<m.getRotate()<<")"<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -753,7 +753,7 @@ void ViewerBase::renderingTraversals()
|
||||
}
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<std::endl<<"Start frame"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<std::endl<<"Start frame"<<std::endl;
|
||||
|
||||
|
||||
Contexts contexts;
|
||||
@ -803,7 +803,7 @@ void ViewerBase::renderingTraversals()
|
||||
}
|
||||
}
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Joing _endRenderingDispatchBarrier block "<<_endRenderingDispatchBarrier.get()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Joing _endRenderingDispatchBarrier block "<<_endRenderingDispatchBarrier.get()<<std::endl;
|
||||
|
||||
// wait till the rendering dispatch is done.
|
||||
if (_endRenderingDispatchBarrier.valid()) _endRenderingDispatchBarrier->block();
|
||||
@ -839,12 +839,12 @@ void ViewerBase::renderingTraversals()
|
||||
{
|
||||
// osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
_endDynamicDrawBlock->block();
|
||||
// NOTIFY(osg::NOTICE)<<"Time waiting "<<osg::Timer::instance()->delta_m(startTick, osg::Timer::instance()->tick())<<std::endl;;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Time waiting "<<osg::Timer::instance()->delta_m(startTick, osg::Timer::instance()->tick())<<std::endl;;
|
||||
}
|
||||
|
||||
if (_releaseContextAtEndOfFrameHint && doneMakeCurrentInThisThread)
|
||||
{
|
||||
//NOTIFY(osg::NOTICE)<<"Doing release context"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"Doing release context"<<std::endl;
|
||||
releaseContext();
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ void WindowSizeHandler::toggleFullscreen(osgViewer::GraphicsWindow *window)
|
||||
|
||||
if (wsi == NULL)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void WindowSizeHandler::toggleFullscreen(osgViewer::GraphicsWindow *window)
|
||||
resolution = _resolutionList[_currentResolutionIndex];
|
||||
window->setWindowDecoration(true);
|
||||
window->setWindowRectangle((screenWidth - (int)resolution.x()) / 2, (screenHeight - (int)resolution.y()) / 2, (int)resolution.x(), (int)resolution.y());
|
||||
NOTIFY(osg::INFO) << "Screen resolution = " << (int)resolution.x() << "x" << (int)resolution.y() << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "Screen resolution = " << (int)resolution.x() << "x" << (int)resolution.y() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -196,7 +196,7 @@ void WindowSizeHandler::changeWindowedResolution(osgViewer::GraphicsWindow *wind
|
||||
|
||||
if (wsi == NULL)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ void WindowSizeHandler::changeWindowedResolution(osgViewer::GraphicsWindow *wind
|
||||
resolution = _resolutionList[_currentResolutionIndex];
|
||||
window->setWindowDecoration(true);
|
||||
window->setWindowRectangle((screenWidth - (int)resolution.x()) / 2, (screenHeight - (int)resolution.y()) / 2, (int)resolution.x(), (int)resolution.y());
|
||||
NOTIFY(osg::INFO) << "Screen resolution = " << (int)resolution.x() << "x" << (int)resolution.y() << std::endl;
|
||||
OSG_NOTIFY(osg::INFO) << "Screen resolution = " << (int)resolution.x() << "x" << (int)resolution.y() << std::endl;
|
||||
|
||||
window->grabFocusIfPointerInWindow();
|
||||
}
|
||||
@ -330,28 +330,28 @@ bool ThreadingHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIAction
|
||||
{
|
||||
case(osgViewer::ViewerBase::SingleThreaded):
|
||||
viewerBase->setThreadingModel(osgViewer::ViewerBase::CullDrawThreadPerContext);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'CullDrawThreadPerContext' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'CullDrawThreadPerContext' selected."<<std::endl;
|
||||
break;
|
||||
case(osgViewer::ViewerBase::CullDrawThreadPerContext):
|
||||
viewerBase->setThreadingModel(osgViewer::ViewerBase::DrawThreadPerContext);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'DrawThreadPerContext' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'DrawThreadPerContext' selected."<<std::endl;
|
||||
break;
|
||||
case(osgViewer::ViewerBase::DrawThreadPerContext):
|
||||
viewerBase->setThreadingModel(osgViewer::ViewerBase::CullThreadPerCameraDrawThreadPerContext);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'CullThreadPerCameraDrawThreadPerContext' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'CullThreadPerCameraDrawThreadPerContext' selected."<<std::endl;
|
||||
break;
|
||||
case(osgViewer::ViewerBase::CullThreadPerCameraDrawThreadPerContext):
|
||||
viewerBase->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'SingleThreaded' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'SingleThreaded' selected."<<std::endl;
|
||||
break;
|
||||
#if 1
|
||||
case(osgViewer::ViewerBase::AutomaticSelection):
|
||||
viewerBase->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'SingleThreaded' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'SingleThreaded' selected."<<std::endl;
|
||||
#else
|
||||
case(osgViewer::ViewerBase::AutomaticSelection):
|
||||
viewerBase->setThreadingModel(viewer->suggestBestThreadingModel());
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'AutomaticSelection' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'AutomaticSelection' selected."<<std::endl;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@ -365,11 +365,11 @@ bool ThreadingHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIAction
|
||||
{
|
||||
case(osgViewer::Viewer::BeforeSwapBuffers):
|
||||
viewer->setEndBarrierPosition(osgViewer::Viewer::AfterSwapBuffers);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'AfterSwapBuffers' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'AfterSwapBuffers' selected."<<std::endl;
|
||||
break;
|
||||
case(osgViewer::Viewer::AfterSwapBuffers):
|
||||
viewer->setEndBarrierPosition(osgViewer::Viewer::BeforeSwapBuffers);
|
||||
NOTIFY(osg::NOTICE)<<"Threading model 'BeforeSwapBuffers' selected."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Threading model 'BeforeSwapBuffers' selected."<<std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -480,7 +480,7 @@ bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GU
|
||||
}
|
||||
ss << "."<<osgDB::getFileExtension(_filename);
|
||||
|
||||
NOTIFY(osg::NOTICE) << "Recording camera path to file " << ss.str() << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Recording camera path to file " << ss.str() << std::endl;
|
||||
_fout.open( ss.str().c_str() );
|
||||
|
||||
// make sure doubles are not trucated by default stream precision = 6
|
||||
@ -488,7 +488,7 @@ bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GU
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Recording camera path."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Recording camera path."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -521,7 +521,7 @@ bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GU
|
||||
// In the future this will need to be written continuously, rather
|
||||
// than all at once.
|
||||
osgDB::ofstream out(_filename.c_str());
|
||||
NOTIFY(osg::NOTICE)<<"Writing camera file: "<<_filename<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Writing camera file: "<<_filename<<std::endl;
|
||||
_animPath->write(out);
|
||||
out.close();
|
||||
}
|
||||
@ -585,7 +585,7 @@ bool LODScaleHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionA
|
||||
if (ea.getKey() == _keyEventIncreaseLODScale)
|
||||
{
|
||||
camera->setLODScale(camera->getLODScale()*1.1);
|
||||
NOTIFY(osg::NOTICE)<<"LODScale = "<<camera->getLODScale()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"LODScale = "<<camera->getLODScale()<<std::endl;
|
||||
|
||||
aa.requestRedraw();
|
||||
return true;
|
||||
@ -594,7 +594,7 @@ bool LODScaleHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionA
|
||||
else if (ea.getKey() == _keyEventDecreaseLODScale)
|
||||
{
|
||||
camera->setLODScale(camera->getLODScale()/1.1);
|
||||
NOTIFY(osg::NOTICE)<<"LODScale = "<<camera->getLODScale()<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"LODScale = "<<camera->getLODScale()<<std::endl;
|
||||
|
||||
aa.requestRedraw();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user