Conversion of osg::notify to OSG_INFO etc.

This commit is contained in:
Robert Osfield
2010-05-28 15:52:45 +00:00
parent 3b3e0d7cdd
commit bbed35c659
17 changed files with 172 additions and 172 deletions

View File

@@ -42,11 +42,11 @@ osgDB::Archive* osgDB::openArchive(const std::string& filename, ReaderWriter::Ar
Archive::Archive()
{
osg::notify(osg::INFO)<<"Archive::Archive() open"<<std::endl;
OSG_INFO<<"Archive::Archive() open"<<std::endl;
}
Archive::~Archive()
{
osg::notify(osg::INFO)<<"Archive::~Archive() closed"<<std::endl;
OSG_INFO<<"Archive::~Archive() closed"<<std::endl;
}

View File

@@ -93,7 +93,7 @@ public:
if ( ret == Z_STREAM_ERROR )
{
osg::notify(osg::NOTICE) << "Z_STREAM_ERROR" << std::endl;
OSG_NOTICE << "Z_STREAM_ERROR" << std::endl;
return false;
}
@@ -131,7 +131,7 @@ public:
if ( ret!=Z_OK )
{
osg::notify(osg::INFO) << "failed to init" << std::endl;
OSG_INFO << "failed to init" << std::endl;
return ret!=0;
}

View File

@@ -48,7 +48,7 @@ std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength)
int destLen = WideCharToMultiByte(CP_UTF8, 0, source, sourceLength, 0, 0, 0, 0);
if (destLen <= 0)
{
osg::notify(osg::WARN) << "Cannot convert UTF-16 string to UTF-8." << std::endl;
OSG_WARN << "Cannot convert UTF-16 string to UTF-8." << std::endl;
return std::string();
}
@@ -57,14 +57,14 @@ std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength)
if (destLen <= 0)
{
osg::notify(osg::WARN) << "Cannot convert UTF-16 string to UTF-8." << std::endl;
OSG_WARN << "Cannot convert UTF-16 string to UTF-8." << std::endl;
return std::string();
}
return sDest;
#else
//TODO: Implement for other platforms
osg::notify(osg::WARN) << "ConvertUTF16toUTF8 not implemented." << std::endl;
OSG_WARN << "ConvertUTF16toUTF8 not implemented." << std::endl;
return std::string();
#endif
}
@@ -80,7 +80,7 @@ std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength)
int destLen = MultiByteToWideChar(CP_UTF8, 0, source, sourceLength, 0, 0);
if (destLen <= 0)
{
osg::notify(osg::WARN) << "Cannot convert UTF-8 string to UTF-16." << std::endl;
OSG_WARN << "Cannot convert UTF-8 string to UTF-16." << std::endl;
return std::wstring();
}
@@ -89,14 +89,14 @@ std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength)
if (destLen <= 0)
{
osg::notify(osg::WARN) << "Cannot convert UTF-8 string to UTF-16." << std::endl;
OSG_WARN << "Cannot convert UTF-8 string to UTF-16." << std::endl;
return std::wstring();
}
return sDest;
#else
//TODO: Implement for other platforms
osg::notify(osg::WARN) << "ConvertUTF8toUTF16 not implemented." << std::endl;
OSG_WARN << "ConvertUTF8toUTF16 not implemented." << std::endl;
return std::wstring();
#endif
}
@@ -112,7 +112,7 @@ std::string convertStringFromCurrentCodePageToUTF8(const char* source, unsigned
int utf16Length = MultiByteToWideChar(CP_ACP, 0, source, sourceLength, 0, 0);
if (utf16Length <= 0)
{
osg::notify(osg::WARN) << "Cannot convert multi-byte string to UTF-8." << std::endl;
OSG_WARN << "Cannot convert multi-byte string to UTF-8." << std::endl;
return std::string();
}
@@ -120,7 +120,7 @@ std::string convertStringFromCurrentCodePageToUTF8(const char* source, unsigned
utf16Length = MultiByteToWideChar(CP_ACP, 0, source, sourceLength, &sUTF16[0], utf16Length);
if (utf16Length <= 0)
{
osg::notify(osg::WARN) << "Cannot convert multi-byte string to UTF-8." << std::endl;
OSG_WARN << "Cannot convert multi-byte string to UTF-8." << std::endl;
return std::string();
}
@@ -144,7 +144,7 @@ std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned
int destLen = WideCharToMultiByte(CP_ACP, 0, utf16.c_str(), sourceLength, 0, 0, 0, 0);
if (destLen <= 0)
{
osg::notify(osg::WARN) << "Cannot convert multi-byte string to UTF-8." << std::endl;
OSG_WARN << "Cannot convert multi-byte string to UTF-8." << std::endl;
return std::string();
}
@@ -152,7 +152,7 @@ std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned
destLen = WideCharToMultiByte(CP_ACP, 0, utf16.c_str(), sourceLength, &sDest[0], destLen, 0, 0);
if (destLen <= 0)
{
osg::notify(osg::WARN) << "Cannot convert multi-byte string to UTF-8." << std::endl;
OSG_WARN << "Cannot convert multi-byte string to UTF-8." << std::endl;
return std::string();
}

View File

@@ -78,7 +78,7 @@ DatabaseRevision::~DatabaseRevision()
bool DatabaseRevision::isFileBlackListed(const std::string& filename) const
{
osg::notify(osg::INFO)<<"DatabaseRevision("<<getName()<<")::isFileBlackListed("<<filename<<")"<<std::endl;
OSG_INFO<<"DatabaseRevision("<<getName()<<")::isFileBlackListed("<<filename<<")"<<std::endl;
if (_databasePath.length()>=filename.length()) return false;
if (filename.compare(0,_databasePath.length(), _databasePath)!=0) return false;
@@ -160,7 +160,7 @@ bool DatabaseRevisions::isFileBlackListed(const std::string& filename) const
{
if ((*itr)->isFileBlackListed(filename))
{
osg::notify(osg::INFO)<<"File is black listed "<<filename<<std::endl;
OSG_INFO<<"File is black listed "<<filename<<std::endl;
return true;
}
}
@@ -169,7 +169,7 @@ bool DatabaseRevisions::isFileBlackListed(const std::string& filename) const
bool DatabaseRevisions::removeFile(const std::string& filename)
{
osg::notify(osg::INFO)<<"Remove file "<<filename<<std::endl;
OSG_INFO<<"Remove file "<<filename<<std::endl;
bool removed = false;
for(DatabaseRevisionList::iterator itr = _revisionList.begin();

View File

@@ -81,14 +81,14 @@ void DeprecatedDotOsgWrapperManager::addDotOsgWrapper(DotOsgWrapper* wrapper)
{
if (wrapper==0L) return;
//notify(INFO) << "osg::Registry::addDotOsgWrapper("<<wrapper->getName()<<")"<< std::endl;
//OSG_INFO << "osg::Registry::addDotOsgWrapper("<<wrapper->getName()<<")"<< std::endl;
const DotOsgWrapper::Associates& assoc = wrapper->getAssociates();
for(DotOsgWrapper::Associates::const_iterator itr=assoc.begin();
itr!=assoc.end();
++itr)
{
//notify(INFO) << " ("<<*itr<<")"<< std::endl;
//OSG_INFO << " ("<<*itr<<")"<< std::endl;
}
const std::string& name = wrapper->getName();
@@ -260,7 +260,7 @@ osg::Object* DeprecatedDotOsgWrapperManager::readObjectOfType(const basic_type_w
const osg::Object* proto = wrapper->getPrototype();
if (proto==NULL)
{
osg::notify(osg::WARN)<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<< std::endl;
OSG_WARN<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<< std::endl;
return NULL;
}
@@ -384,7 +384,7 @@ osg::Object* DeprecatedDotOsgWrapperManager::readObject(DotOsgWrapperMap& dowMap
const osg::Object* proto = wrapper->getPrototype();
if (proto==NULL)
{
osg::notify(osg::WARN)<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<< std::endl;
OSG_WARN<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<< std::endl;
return NULL;
}

View File

@@ -50,14 +50,14 @@ DynamicLibrary::DynamicLibrary(const std::string& name, HANDLE handle)
{
_name = name;
_handle = handle;
OSG_NOTIFY(osg::INFO)<<"Opened DynamicLibrary "<<_name<<std::endl;
OSG_INFO<<"Opened DynamicLibrary "<<_name<<std::endl;
}
DynamicLibrary::~DynamicLibrary()
{
if (_handle)
{
OSG_NOTIFY(osg::INFO)<<"Closing DynamicLibrary "<<_name<<std::endl;
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.
OSG_NOTIFY(osg::INFO) << "DynamicLibrary::failed loading \""<<libraryName<<"\""<<std::endl;
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))
{
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;
OSG_WARN << "Warning: dynamic library '" << libraryName << "' exists, but an error occurred while trying to open it:" << std::endl;
OSG_WARN << dlerror() << std::endl;
}
else
{
OSG_NOTIFY(osg::INFO) << "Warning: dynamic library '" << libraryName << "' does not exist (or isn't readable):" << std::endl;
OSG_NOTIFY(osg::INFO) << dlerror() << std::endl;
OSG_INFO << "Warning: dynamic library '" << libraryName << "' does not exist (or isn't readable):" << std::endl;
OSG_INFO << dlerror() << std::endl;
}
}
#endif
@@ -153,15 +153,15 @@ DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& p
}
else
{
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::failed looking up " << procName << std::endl;
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::error " << strerror(errno) << std::endl;
OSG_WARN << "DynamicLibrary::failed looking up " << procName << std::endl;
OSG_WARN << "DynamicLibrary::error " << strerror(errno) << std::endl;
return NULL;
}
#else // other unix
void* sym = dlsym( _handle, procName.c_str() );
if (!sym) {
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::failed looking up " << procName << std::endl;
OSG_NOTIFY(osg::WARN) << "DynamicLibrary::error " << dlerror() << std::endl;
OSG_WARN << "DynamicLibrary::failed looking up " << procName << std::endl;
OSG_WARN << "DynamicLibrary::error " << dlerror() << std::endl;
}
return sym;
#endif

View File

@@ -27,12 +27,12 @@ FileCache::FileCache(const std::string& path):
osg::Referenced(true),
_fileCachePath(path)
{
OSG_NOTIFY(osg::INFO)<<"Constructed FileCache : "<<path<<std::endl;
OSG_INFO<<"Constructed FileCache : "<<path<<std::endl;
}
FileCache::~FileCache()
{
OSG_NOTIFY(osg::INFO)<<"Destructed FileCache "<<std::endl;
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);
OSG_NOTIFY(osg::INFO)<<"FileCache::createCacheFileName("<<originalFileName<<") = "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::INFO)<<"FileCache::readObjectFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
OSG_NOTICE<<"Could not create cache directory: "<<path<<std::endl;
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
}
OSG_NOTIFY(osg::INFO)<<"FileCache::writeObjectToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::INFO)<<"FileCache::readImageFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
OSG_NOTICE<<"Could not create cache directory: "<<path<<std::endl;
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
}
OSG_NOTIFY(osg::INFO)<<"FileCache::writeImageToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::INFO)<<"FileCache::readHeightFieldFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
OSG_NOTICE<<"Could not create cache directory: "<<path<<std::endl;
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
}
OSG_NOTIFY(osg::INFO)<<"FileCache::writeHeightFieldToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::INFO)<<"FileCache::readNodeFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
OSG_NOTICE<<"Could not create cache directory: "<<path<<std::endl;
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
}
OSG_NOTIFY(osg::INFO)<<"FileCache::writeNodeToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::INFO)<<"FileCache::readShaderFromCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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))
{
OSG_NOTIFY(osg::NOTICE)<<"Could not create cache directory: "<<path<<std::endl;
OSG_NOTICE<<"Could not create cache directory: "<<path<<std::endl;
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
}
OSG_NOTIFY(osg::INFO)<<"FileCache::writeShaderToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
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)
{
OSG_NOTIFY(osg::INFO)<<"FileCache::loadDatabaseRevisionsForFile("<<originalFileName<<")"<<std::endl;
OSG_INFO<<"FileCache::loadDatabaseRevisionsForFile("<<originalFileName<<")"<<std::endl;
std::string revisionsFileName = originalFileName;
if (getLowerCaseFileExtension(revisionsFileName)!="revisions") revisionsFileName += ".revisions";
OSG_NOTIFY(osg::INFO)<<" revisionsFileName("<<revisionsFileName<<")"<<std::endl;
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)
{
OSG_NOTIFY(osg::INFO)<<" comparing "<<(*ritr)->getName()<<" to "<<revisionsFileName<<std::endl;
OSG_INFO<<" comparing "<<(*ritr)->getName()<<" to "<<revisionsFileName<<std::endl;
if ((*ritr)->getName()==revisionsFileName)
{
OSG_NOTIFY(osg::INFO)<<"Already loaded"<<std::endl;
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))
{
OSG_NOTIFY(osg::INFO)<<" found revisions file in local cache, now loading it"<<std::endl;
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)
{
OSG_NOTIFY(osg::INFO)<<" loaded local revisions File("<<cacheFileName<<")"<<std::endl;
OSG_INFO<<" loaded local revisions File("<<cacheFileName<<")"<<std::endl;
}
}
else
{
OSG_NOTIFY(osg::INFO)<<" could not load found revisions file from local cache."<<std::endl;
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);
OSG_NOTIFY(osg::INFO)<<" Comparing local "<<revision_local->getName()<<" to remote "<<revision_remote->getName()<<std::endl;
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());
OSG_NOTIFY(osg::INFO)<<"Local and remote revisions are different "<<needToWriteRevisionsFileToDisk<<std::endl;
OSG_INFO<<"Local and remote revisions are different "<<needToWriteRevisionsFileToDisk<<std::endl;
}
}
if (needToWriteRevisionsFileToDisk)
{
OSG_NOTIFY(osg::INFO)<<"Need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
OSG_INFO<<"Need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
if (!cacheFileName.empty()) writeObjectFile(*dr_remote, cacheFileName);
}
else
{
OSG_NOTIFY(osg::INFO)<<"No need to write DatabaseRevions "<<revisionsFileName<<" to local FileCache"<<std::endl;
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())
{
OSG_NOTIFY(osg::INFO)<<" loaded remote revisions File("<<revisionsFileName<<")"<<std::endl;
OSG_INFO<<" loaded remote revisions File("<<revisionsFileName<<")"<<std::endl;
if (ritr != _databaseRevisionsList.end())
{
// replace already loaded DatabaseRevisions object
OSG_NOTIFY(osg::INFO)<<"Replacing already loaded DatabaseRevisions object"<<std::endl;
OSG_INFO<<"Replacing already loaded DatabaseRevisions object"<<std::endl;
*ritr = dr;
}
else
{
OSG_NOTIFY(osg::INFO)<<"Added newly loaded DatabaseRevisions object "<<dr->getName()<<std::endl;
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();
OSG_NOTIFY(osg::INFO)<<" now loaded DatabaseRevisions "<<revision->getName()<<" FileList contents"<<std::endl;
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
{
OSG_NOTIFY(osg::NOTICE)<<" failed to read revisions File, object.get()="<<object.get()<<std::endl;
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) OSG_NOTIFY(osg::INFO)<<" loadeded FileList from local cache "<<fileList->getName()<<std::endl;
if (fileList) OSG_INFO<<" loadeded FileList from local cache "<<fileList->getName()<<std::endl;
}
if (!fileList)
{
OSG_NOTIFY(osg::INFO)<<" complete_path="<<originalFileName<<std::endl;
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)
{
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;
OSG_INFO<<" loadeded FileList from remote system "<<fileList->getName()<<std::endl;
OSG_INFO<<" Need to write to local file cache "<<fileList->getName()<<std::endl;
if (!cacheFileListName.empty()) writeObjectFile(*fileList, cacheFileListName);
}
}

View File

@@ -123,7 +123,7 @@ bool osgDB::makeDirectory( const std::string &path )
{
if (path.empty())
{
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): cannot create an empty directory" << std::endl;
OSG_DEBUG << "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
{
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " <<
OSG_DEBUG << "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:
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
OSG_DEBUG << "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
{
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
return false;
}
paths.pop();
@@ -224,7 +224,7 @@ bool osgDB::setCurrentWorkingDirectory( const std::string &newCurrentWorkingDire
{
if (newCurrentWorkingDirectory.empty())
{
OSG_NOTIFY(osg::DEBUG_INFO) << "osgDB::setCurrentWorkingDirectory(): called with empty string." << std::endl;
OSG_DEBUG << "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)
{
OSG_NOTIFY(osg::DEBUG_INFO) << "itr='" <<*itr<< "'\n";
OSG_DEBUG << "itr='" <<*itr<< "'\n";
std::string path = itr->empty() ? filename : concatPaths(*itr, filename);
path = getRealPath(path);
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath() : trying " << path << " ...\n";
OSG_DEBUG << "FindFileInPath() : trying " << path << " ...\n";
if(fileExists(path))
{
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath() : USING " << path << "\n";
OSG_DEBUG << "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);
}
OSG_NOTIFY(osg::DEBUG_INFO) << "findFileInDirectory() : looking for " << realFileName << " in " << realDirName << "...\n";
OSG_DEBUG << "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())
{
OSG_NOTIFY(osg::INFO) << "copyFile(): Empty file name." << std::endl;
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))
{
OSG_NOTIFY(osg::INFO) << "copyFile(): Source and destination point to the same file: source=" << source << ", destination=" << destination << std::endl;
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))
{
OSG_NOTIFY(osg::INFO) << "copyFile(): Source file does not exist: " << source << std::endl;
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)
{
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Can't read source file: " << source << std::endl;
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))
{
OSG_NOTIFY(osg::INFO) << "Can't create directory for file '" << destination << "'. Copy may fail creating the file." << std::endl;
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)
{
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Can't write destination file: " << destination << std::endl;
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())
{
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Error writing destination file: " << destination << std::endl;
OSG_NOTICE << "copyFile(): Error writing destination file: " << destination << std::endl;
return FileOpResult::WRITE_ERROR;
}
if (!fin.eof())
{
OSG_NOTIFY(osg::NOTICE) << "copyFile(): Error reading source file: " << source << std::endl;
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
{
OSG_NOTIFY(osg::WARN) << "Could not get application directory "
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
{
OSG_NOTIFY(osg::WARN) << "Could not get dll directory "
OSG_WARN << "Could not get dll directory "
"using Win32 API. It will not be searched." << std::endl;
}
FreeLibrary(thisModule);
}
else
{
OSG_NOTIFY(osg::WARN) << "Could not get dll module handle "
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
{
OSG_NOTIFY(osg::WARN) << "Could not get system directory using "
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
{
OSG_NOTIFY(osg::WARN) << "Could not get Windows directory using "
OSG_WARN << "Could not get Windows directory using "
"Win32 API, using default directory." << std::endl;
convertStringPathIntoFilePathList("C:\\Windows", filepath);
convertStringPathIntoFilePathList("C:\\Windows\\System", filepath);

View File

@@ -150,7 +150,7 @@ int ImagePager::ImageThread::cancel()
{
// commenting out debug info as it was cashing crash on exit, presumable
// due to osg::notify or std::cout destructing earlier than this destructor.
// osg::notify(osg::DEBUG_INFO)<<"Waiting for DatabasePager to cancel"<<std::endl;
// OSG_DEBUG<<"Waiting for DatabasePager to cancel"<<std::endl;
OpenThreads::Thread::YieldCurrentThread();
}
@@ -162,7 +162,7 @@ int ImagePager::ImageThread::cancel()
void ImagePager::ImageThread::run()
{
osg::notify(osg::INFO)<<"ImagePager::ImageThread::run() "<<this<<std::endl;
OSG_INFO<<"ImagePager::ImageThread::run() "<<this<<std::endl;
bool firstTime = true;
osg::ref_ptr<ImagePager::ReadQueue> read_queue;
@@ -232,7 +232,7 @@ void ImagePager::ImageThread::run()
} while (!testCancel() && !_done);
osg::notify(osg::INFO)<<"ImagePager::ImageThread::done()"<<std::endl;
OSG_INFO<<"ImagePager::ImageThread::done()"<<std::endl;
}
@@ -296,7 +296,7 @@ osg::Image* ImagePager::readImageFile(const std::string& fileName)
void ImagePager::requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp*)
{
osg::notify(osg::INFO)<<"ImagePager::requestNodeFile("<<fileName<<")"<<std::endl;
OSG_INFO<<"ImagePager::requestNodeFile("<<fileName<<")"<<std::endl;
osg::ref_ptr<ImageRequest> request = new ImageRequest;
request->_timeToMergeBy = timeToMergeBy;
@@ -329,7 +329,7 @@ void ImagePager::requestImageFile(const std::string& fileName,osg::Object* attac
bool ImagePager::requiresUpdateSceneGraph() const
{
//osg::notify(osg::NOTICE)<<"ImagePager::requiresUpdateSceneGraph()"<<std::endl;
//OSG_NOTICE<<"ImagePager::requiresUpdateSceneGraph()"<<std::endl;
return !(_completedQueue->_requestList.empty());
}
@@ -350,7 +350,7 @@ void ImagePager::updateSceneGraph(const osg::FrameStamp&)
}
else
{
osg::notify(osg::NOTICE)<<"ImagePager::updateSceneGraph() : error, image request attachment type not handled yet."<<std::endl;
OSG_NOTICE<<"ImagePager::updateSceneGraph() : error, image request attachment type not handled yet."<<std::endl;
}
}

View File

@@ -61,7 +61,7 @@ InputStream::InputStream( const osgDB::Options* options )
}
}
else
osg::notify(osg::WARN) << "InputStream: Unknown option " << option << std::endl;
OSG_WARN << "InputStream: Unknown option " << option << std::endl;
}
}
if ( schema.empty() )
@@ -501,13 +501,13 @@ osg::Image* InputStream::readImage()
image = rr.takeImage();
else
{
osg::notify(osg::WARN) << "InputStream::readImage(): "
OSG_WARN << "InputStream::readImage(): "
<< rr.message() << std::endl;
}
}
else
{
osg::notify(osg::WARN) << "InputStream::readImage(): Unable to find a plugin for "
OSG_WARN << "InputStream::readImage(): Unable to find a plugin for "
<< ext << std::endl;
}
delete[] data;
@@ -553,7 +553,7 @@ osg::Object* InputStream::readObject( osg::Object* existingObj )
ObjectWrapper* wrapper = Registry::instance()->getObjectWrapperManager()->findWrapper( className );
if ( !wrapper )
{
osg::notify(osg::WARN) << "InputStream::readObject(): Unsupported wrapper class "
OSG_WARN << "InputStream::readObject(): Unsupported wrapper class "
<< className << std::endl;
advanceToCurrentEndBracket();
return NULL;
@@ -571,7 +571,7 @@ osg::Object* InputStream::readObject( osg::Object* existingObj )
ObjectWrapper* assocWrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(*itr);
if ( !assocWrapper )
{
osg::notify(osg::WARN) << "InputStream::readObject(): Unsupported associated class "
OSG_WARN << "InputStream::readObject(): Unsupported associated class "
<< *itr << std::endl;
continue;
}
@@ -643,7 +643,7 @@ InputStream::ReadType InputStream::start( InputIterator* inIterator )
// Check file version
if ( version!=PLUGIN_VERSION )
{
osg::notify(osg::WARN) << "InputStream: Input data version " << version
OSG_WARN << "InputStream: Input data version " << version
<< " may be incompatible with current reader version "
<< PLUGIN_VERSION << std::endl;
}
@@ -665,7 +665,7 @@ void InputStream::decompress()
BaseCompressor* compressor = Registry::instance()->getObjectWrapperManager()->findCompressor(compressorName);
if ( !compressor )
{
osg::notify(osg::WARN) << "InputStream::decompress(): No such compressor "
OSG_WARN << "InputStream::decompress(): No such compressor "
<< compressorName << std::endl;
}
@@ -694,7 +694,7 @@ void InputStream::setWrapperSchema( const std::string& name, const std::string&
ObjectWrapper* wrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(name);
if ( !wrapper )
{
osg::notify(osg::WARN) << "InputStream::setSchema(): Unsupported wrapper class "
OSG_WARN << "InputStream::setSchema(): Unsupported wrapper class "
<< name << std::endl;
return;
}

View File

@@ -98,7 +98,7 @@ bool ObjectWrapper::read( InputStream& is, osg::Object& obj )
itr!=_serializers.end(); ++itr )
{
if ( (*itr)->read(is, obj) ) continue;
osg::notify(osg::WARN) << "ObjectWrapper::read(): Error reading property "
OSG_WARN << "ObjectWrapper::read(): Error reading property "
<< _name << "::" << (*itr)->getName() << std::endl;
readOK = false;
}
@@ -112,7 +112,7 @@ bool ObjectWrapper::write( OutputStream& os, const osg::Object& obj )
itr!=_serializers.end(); ++itr )
{
if ( (*itr)->write(os, obj) ) continue;
osg::notify(osg::WARN) << "ObjectWrapper::write(): Error writing property "
OSG_WARN << "ObjectWrapper::write(): Error writing property "
<< _name << "::" << (*itr)->getName() << std::endl;
writeOK = false;
}
@@ -131,7 +131,7 @@ bool ObjectWrapper::readSchema( const StringList& properties )
{
if ( serializersSize<i )
{
osg::notify(osg::WARN) << "ObjectWrapper::readSchema(): Wrapper " << _name
OSG_WARN << "ObjectWrapper::readSchema(): Wrapper " << _name
<< ": Incompatible serializers size" << std::endl;
break;
}
@@ -153,7 +153,7 @@ bool ObjectWrapper::readSchema( const StringList& properties )
}
if ( !hasSerializer )
{
osg::notify(osg::WARN) << "ObjectWrapper::readSchema(): Wrapper " << _name
OSG_WARN << "ObjectWrapper::readSchema(): Wrapper " << _name
<< ": Unknown property " << prop << std::endl;
}
}
@@ -433,7 +433,7 @@ void ObjectWrapperManager::addWrapper( ObjectWrapper* wrapper )
WrapperMap::iterator itr = _wrappers.find( wrapper->getName() );
if ( itr!=_wrappers.end() )
{
osg::notify(osg::WARN) << "ObjectWrapperManager::addWrapper(): '" << wrapper->getName()
OSG_WARN << "ObjectWrapperManager::addWrapper(): '" << wrapper->getName()
<< "' already exists." << std::endl;
}
_wrappers[wrapper->getName()] = wrapper;
@@ -480,7 +480,7 @@ void ObjectWrapperManager::addCompressor( BaseCompressor* compressor )
CompressorMap::iterator itr = _compressors.find( compressor->getName() );
if ( itr!=_compressors.end() )
{
osg::notify(osg::WARN) << "ObjectWrapperManager::addCompressor(): '" << compressor->getName()
OSG_WARN << "ObjectWrapperManager::addCompressor(): '" << compressor->getName()
<< "' already exists." << std::endl;
}
_compressors[compressor->getName()] = compressor;

View File

@@ -194,13 +194,13 @@ std::string Output::getFileNameForOutput(const std::string& filename) const
case(FULL_PATH):
{
// need to think about how best to implement this first...
osg::notify(osg::WARN)<<"Warning: Output::getFileNameForOutput() does not support FULL_PATH yet."<< std::endl;
OSG_WARN<<"Warning: Output::getFileNameForOutput() does not support FULL_PATH yet."<< std::endl;
return filename;
}
case(RELATIVE_PATH):
{
// need to think about how best to implement this as well...
osg::notify(osg::WARN)<<"Warning: Output::getFileNameForOutput() does not support RELATIVE_PATH yet."<< std::endl;
OSG_WARN<<"Warning: Output::getFileNameForOutput() does not support RELATIVE_PATH yet."<< std::endl;
return filename;
}
case(FILENAME_ONLY):

View File

@@ -58,7 +58,7 @@ OutputStream::OutputStream( const osgDB::Options* options )
else if ( keyAndValues[1]=="WriteOut" ) _writeImageHint = WRITE_EXTERNAL_FILE;
}
else
osg::notify(osg::WARN) << "OutputStream: Unknown option " << option << std::endl;
OSG_WARN << "OutputStream: Unknown option " << option << std::endl;
}
}
}
@@ -321,11 +321,11 @@ void OutputStream::writeImage( const osg::Image* img )
if ( decision==IMAGE_WRITE_OUT || _writeImageHint==WRITE_EXTERNAL_FILE )
{
bool result = osgDB::writeImageFile( *img, img->getFileName() );
osg::notify(osg::NOTICE) << "OutputStream::writeImage(): Write image data to external file "
OSG_NOTICE << "OutputStream::writeImage(): Write image data to external file "
<< img->getFileName() << std::endl;
if ( !result )
{
osg::notify(osg::WARN) << "OutputStream::writeImage(): Failed to write "
OSG_WARN << "OutputStream::writeImage(): Failed to write "
<< img->getFileName() << std::endl;
}
}
@@ -384,7 +384,7 @@ void OutputStream::writeImage( const osg::Image* img )
}
else
{
osg::notify(osg::WARN) << "OutputStream::writeImage(): Failed to open image file "
OSG_WARN << "OutputStream::writeImage(): Failed to open image file "
<< img->getFileName() << std::endl;
*this << (unsigned int)0;
}
@@ -416,7 +416,7 @@ void OutputStream::writeObject( const osg::Object* obj )
ObjectWrapper* wrapper = Registry::instance()->getObjectWrapperManager()->findWrapper( name );
if ( !wrapper )
{
osg::notify(osg::WARN) << "OutputStream::writeObject(): Unsupported wrapper class "
OSG_WARN << "OutputStream::writeObject(): Unsupported wrapper class "
<< name << std::endl;
*this << END_BRACKET << std::endl;
return;
@@ -430,7 +430,7 @@ void OutputStream::writeObject( const osg::Object* obj )
ObjectWrapper* assocWrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(assocName);
if ( !assocWrapper )
{
osg::notify(osg::WARN) << "OutputStream::writeObject(): Unsupported associated class "
OSG_WARN << "OutputStream::writeObject(): Unsupported associated class "
<< assocName << std::endl;
continue;
}
@@ -494,7 +494,7 @@ void OutputStream::start( OutputIterator* outIterator, OutputStream::WriteType t
BaseCompressor* compressor = Registry::instance()->getObjectWrapperManager()->findCompressor(_compressorName);
if ( !compressor )
{
osg::notify(osg::WARN) << "OutputStream::start(): No such compressor "
OSG_WARN << "OutputStream::start(): No such compressor "
<< _compressorName << std::endl;
_compressorName.clear();
}

View File

@@ -33,7 +33,7 @@ Object* osgDB::readObjectFile(const std::string& filename,const Options* options
{
ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options);
if (rr.validObject()) return rr.takeObject();
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -42,7 +42,7 @@ Image* osgDB::readImageFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename,options);
if (rr.validImage()) return rr.takeImage();
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -50,7 +50,7 @@ Shader* osgDB::readShaderFile(const std::string& filename,const Options* options
{
ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options);
if (rr.validShader()) return rr.takeShader();
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -59,7 +59,7 @@ HeightField* osgDB::readHeightFieldFile(const std::string& filename,const Option
{
ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options);
if (rr.validHeightField()) return rr.takeHeightField();
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -138,7 +138,7 @@ Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options
if (image->isImageTranslucent())
{
osg::notify()<<"Image "<<image->getFileName()<<" is translucent; setting up blending."<<std::endl;
OSG_INFO<<"Image "<<image->getFileName()<<" is translucent; setting up blending."<<std::endl;
geode->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON);
geode->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
}
@@ -254,7 +254,7 @@ osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,c
{
ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options);
if (rr.validObject()) return osg::ref_ptr<osg::Object>(rr.getObject());
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -262,7 +262,7 @@ osg::ref_ptr<osg::Image> osgDB::readRefImageFile(const std::string& filename,con
{
ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename,options);
if (rr.validImage()) return osg::ref_ptr<osg::Image>(rr.getImage());
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -270,7 +270,7 @@ osg::ref_ptr<osg::Shader> osgDB::readRefShaderFile(const std::string& filename,c
{
ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options);
if (rr.validShader()) return osg::ref_ptr<osg::Shader>(rr.getShader());
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -278,7 +278,7 @@ osg::ref_ptr<osg::HeightField> osgDB::readRefHeightFieldFile(const std::string&
{
ReaderWriter::ReadResult rr = Registry::instance()->readHeightField(filename,options);
if (rr.validHeightField()) return osg::ref_ptr<osg::HeightField>(rr.getHeightField());
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
@@ -286,6 +286,6 @@ osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const
{
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename,options);
if (rr.validNode()) return osg::ref_ptr<osg::Node>(rr.getNode());
if (rr.error()) notify(WARN) << rr.message() << std::endl;
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}

View File

@@ -174,7 +174,7 @@ Registry* Registry::instance(bool erase)
Registry::Registry()
{
// comment out because it was causing problems under OSX - causing it to crash osgconv when constructing ostream in osg::notify().
// notify(INFO) << "Constructing osg::Registry"<<std::endl;
// OSG_INFO << "Constructing osg::Registry"<<std::endl;
_buildKdTreesHint = Options::NO_PREFERENCE;
_kdTreeBuilder = new osg::KdTreeBuilder;
@@ -193,7 +193,7 @@ Registry::Registry()
if( (ptr = getenv("OSG_EXPIRY_DELAY")) != 0)
{
_expiryDelay = osg::asciiToDouble(ptr);
OSG_NOTIFY(osg::INFO)<<"Registry : Expiry delay = "<<_expiryDelay<<std::endl;
OSG_INFO<<"Registry : Expiry delay = "<<_expiryDelay<<std::endl;
}
const char* fileCachePath = getenv("OSG_FILE_CACHE");
@@ -382,7 +382,7 @@ Registry::~Registry()
void Registry::destruct()
{
// OSG_NOTIFY(osg::NOTICE)<<"Registry::destruct()"<<std::endl;
// OSG_NOTICE<<"Registry::destruct()"<<std::endl;
// clean up the SharedStateManager
_sharedStateManager = 0;
@@ -672,7 +672,7 @@ bool Registry::closeLibrary(const std::string& fileName)
void Registry::closeAllLibraries()
{
// OSG_NOTIFY(osg::NOTICE)<<"Registry::closeAllLibraries()"<<std::endl;
// OSG_NOTICE<<"Registry::closeAllLibraries()"<<std::endl;
OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_pluginMutex);
_dlList.clear();
}
@@ -837,7 +837,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
if(fileExists(filename))
{
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return filename;
}
@@ -864,7 +864,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
if(fileExists(simpleFileName))
{
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return simpleFileName;
}
@@ -899,7 +899,7 @@ std::string Registry::findLibraryFileImplementation(const std::string& filename,
if(fileExists(filename))
{
OSG_NOTIFY(osg::DEBUG_INFO) << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
return filename;
}
@@ -932,9 +932,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));
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;
OSG_INFO<<"Contains archive : "<<readFunctor._filename<<std::endl;
OSG_INFO<<" archive : "<<archiveName<<std::endl;
OSG_INFO<<" filename : "<<fileName<<std::endl;
ReaderWriter::ReadResult result = openArchiveImplementation(archiveName,ReaderWriter::READ, 4096, readFunctor._options);
@@ -984,7 +984,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
{
if (ritr->status()==ReaderWriter::ReadResult::ERROR_IN_READING_FILE)
{
// OSG_NOTIFY(osg::NOTICE)<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
// OSG_NOTICE<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
return *ritr;
}
}
@@ -996,7 +996,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
{
if (ritr->status()==ReaderWriter::ReadResult::FILE_NOT_FOUND)
{
//OSG_NOTIFY(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
//OSG_NOTICE<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
return *ritr;
}
}
@@ -1055,7 +1055,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
{
if (ritr->status()==ReaderWriter::ReadResult::ERROR_IN_READING_FILE)
{
// OSG_NOTIFY(osg::NOTICE)<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
// OSG_NOTICE<<"Warning: error reading file \""<<readFunctor._filename<<"\""<<std::endl;
return *ritr;
}
}
@@ -1064,7 +1064,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
{
if (ritr->status()==ReaderWriter::ReadResult::FILE_NOT_FOUND)
{
// OSG_NOTIFY(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
// OSG_NOTICE<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
return *ritr;
}
}
@@ -1309,7 +1309,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();
OSG_NOTIFY(osg::NOTICE)<<"time to load "<<fileName<<" "<<osg::Timer::instance()->delta_m(startTick, endTick)<<"ms"<<std::endl;
OSG_NOTICE<<"time to load "<<fileName<<" "<<osg::Timer::instance()->delta_m(startTick, endTick)<<"ms"<<std::endl;
return result;
#else

View File

@@ -27,7 +27,7 @@ using namespace osgDB;
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
@@ -35,7 +35,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename, co
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
@@ -43,21 +43,21 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename, const
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}

View File

@@ -29,7 +29,7 @@ XmlNode* osgDB::readXmlFile(const std::string& filename,const Options* options)
if (!input)
{
osg::notify(osg::NOTICE)<<"Could not open XML file: "<<filename<<std::endl;
OSG_NOTICE<<"Could not open XML file: "<<filename<<std::endl;
return 0;
}
@@ -40,7 +40,7 @@ XmlNode* osgDB::readXmlFile(const std::string& filename,const Options* options)
}
else
{
osg::notify(osg::NOTICE)<<"Could not find XML file: "<<filename<<std::endl;
OSG_NOTICE<<"Could not find XML file: "<<filename<<std::endl;
return 0;
}
}
@@ -67,7 +67,7 @@ XmlNode* osgDB::readXmlStream(std::istream& fin)
if (!input)
{
osg::notify(osg::NOTICE)<<"Could not attach to XML stream."<<std::endl;
OSG_NOTICE<<"Could not attach to XML stream."<<std::endl;
return 0;
}
@@ -138,10 +138,10 @@ void XmlNode::Input::skipWhiteSpace()
{
while(_currentPos<_buffer.size() && (_buffer[_currentPos]==' ' || _buffer[_currentPos]=='\t'))
{
// osg::notify(osg::NOTICE)<<"_currentPos="<<_currentPos<<"_buffer.size()="<<_buffer.size()<<" v="<<_buffer[_currentPos]<<std::endl;
// OSG_NOTICE<<"_currentPos="<<_currentPos<<"_buffer.size()="<<_buffer.size()<<" v="<<_buffer[_currentPos]<<std::endl;
++_currentPos;
}
//osg::notify(osg::NOTICE)<<"done"<<std::endl;
//OSG_NOTICE<<"done"<<std::endl;
}
XmlNode::XmlNode()
@@ -167,12 +167,12 @@ bool XmlNode::read(Input& input)
commentNode->contents = input.substr(0, end);
if (end!=std::string::npos)
{
osg::notify(osg::INFO)<<"Valid Comment record ["<<commentNode->contents<<"]"<<std::endl;
OSG_INFO<<"Valid Comment record ["<<commentNode->contents<<"]"<<std::endl;
input += (end+3);
}
else
{
osg::notify(osg::NOTICE)<<"Error: Unclosed Comment record ["<<commentNode->contents<<"]"<<std::endl;
OSG_NOTICE<<"Error: Unclosed Comment record ["<<commentNode->contents<<"]"<<std::endl;
input += end;
}
}
@@ -183,17 +183,17 @@ bool XmlNode::read(Input& input)
std::string comment = input.substr(0, end);
if (end!=std::string::npos)
{
osg::notify(osg::INFO)<<"Valid end tag ["<<comment<<"]"<<std::endl;
OSG_INFO<<"Valid end tag ["<<comment<<"]"<<std::endl;
input += (end+1);
}
else
{
osg::notify(osg::NOTICE)<<"Error: Unclosed end tag ["<<comment<<"]"<<std::endl;
OSG_NOTICE<<"Error: Unclosed end tag ["<<comment<<"]"<<std::endl;
input += end;
}
if (comment==name) osg::notify(osg::INFO)<<"end tag is matched correctly"<<std::endl;
else osg::notify(osg::NOTICE)<<"Error: end tag is not matched correctly"<<std::endl;
if (comment==name) { OSG_INFO<<"end tag is matched correctly"<<std::endl; }
else { OSG_NOTICE<<"Error: end tag is not matched correctly"<<std::endl; }
return true;
}
@@ -208,12 +208,12 @@ bool XmlNode::read(Input& input)
commentNode->contents = input.substr(0, end);
if (end!=std::string::npos)
{
osg::notify(osg::INFO)<<"Valid infomation record ["<<commentNode->contents<<"]"<<std::endl;
OSG_INFO<<"Valid infomation record ["<<commentNode->contents<<"]"<<std::endl;
input += (end+2);
}
else
{
osg::notify(osg::NOTICE)<<"Error: Unclosed infomation record ["<<commentNode->contents<<"]"<<std::endl;
OSG_NOTICE<<"Error: Unclosed infomation record ["<<commentNode->contents<<"]"<<std::endl;
input += end;
}
}
@@ -286,13 +286,13 @@ bool XmlNode::read(Input& input)
if (prev_pos == input.currentPosition())
{
osg::notify(osg::NOTICE)<<"Error, parser iterator note advanced, position: "<<input.substr(0,50)<<std::endl;
OSG_NOTICE<<"Error, parser iterator note advanced, position: "<<input.substr(0,50)<<std::endl;
++input;
}
if (!option.empty())
{
osg::notify(osg::INFO)<<"Assigning option "<<option<<" with value "<<value<<std::endl;
OSG_INFO<<"Assigning option "<<option<<" with value "<<value<<std::endl;
childNode->properties[option] = value;
}
}
@@ -301,18 +301,18 @@ bool XmlNode::read(Input& input)
{
++input;
osg::notify(osg::INFO)<<"Valid tag ["<<childNode->name<<"]"<<std::endl;
OSG_INFO<<"Valid tag ["<<childNode->name<<"]"<<std::endl;
if (c=='/')
{
if ((c=input[0])>=0 && c=='>')
{
++input;
osg::notify(osg::INFO)<<"tag is closed correctly"<<std::endl;
OSG_INFO<<"tag is closed correctly"<<std::endl;
childNode->type = ATOM;
}
else
osg::notify(osg::NOTICE)<<"Error: tag is not closed correctly"<<std::endl;
OSG_NOTICE<<"Error: tag is not closed correctly"<<std::endl;
}
else
{
@@ -324,7 +324,7 @@ bool XmlNode::read(Input& input)
}
else
{
osg::notify(osg::NOTICE)<<"Unclosed tag ["<<childNode->name<<"]"<<std::endl;
OSG_NOTICE<<"Unclosed tag ["<<childNode->name<<"]"<<std::endl;
return false;
}
@@ -342,12 +342,12 @@ bool XmlNode::read(Input& input)
if (input._controlToCharacterMap.count(value)!=0)
{
c = input._controlToCharacterMap[value];
osg::notify(osg::INFO)<<"Read control character "<<value<<" converted to "<<char(c)<<std::endl;
OSG_INFO<<"Read control character "<<value<<" converted to "<<char(c)<<std::endl;
contents.push_back(c);
}
else
{
osg::notify(osg::NOTICE)<<"Warning: read control character "<<value<<", but have no mapping to convert it to."<<std::endl;
OSG_NOTICE<<"Warning: read control character "<<value<<", but have no mapping to convert it to."<<std::endl;
}
}
else