Added support for read the various animaton materials/paths from http

This commit is contained in:
Robert Osfield
2009-05-14 13:05:32 +00:00
parent cbd07774f0
commit c72124e449
5 changed files with 298 additions and 193 deletions

View File

@@ -94,7 +94,7 @@ public:
_stringKeyMap["F12"]=osgGA::GUIEventAdapter::KEY_F12;
_notifyLevel = osg::INFO;
_notifyLevel = osg::NOTICE;
}
virtual const char* className() const
@@ -1444,7 +1444,7 @@ class OSGDB_EXPORT MyReadFileCallback : public virtual osgDB::ReadFileCallback
osgDB::ReaderWriter::ReadResult readLocal(ObjectType type, const std::string& filename, const osgDB::Options* options)
{
osg::notify(osg::INFO)<<"Trying local file "<<filename<<std::endl;
osg::notify(osg::NOTICE)<<"Trying local file "<<filename<<std::endl;
switch(type)
{
@@ -1465,7 +1465,7 @@ class OSGDB_EXPORT MyReadFileCallback : public virtual osgDB::ReadFileCallback
if (!fileCache) fileCache = osgDB::Registry::instance()->getFileCache();
if (!fileCache) return osgDB::ReaderWriter::ReadResult::FILE_NOT_FOUND;
osg::notify(osg::INFO)<<"Trying fileCache "<<filename<<std::endl;
osg::notify(osg::NOTICE)<<"Trying fileCache "<<filename<<std::endl;
osgDB::ReaderWriter::ReadResult result;
if (fileCache && fileCache->isFileAppropriateForFileCache(filename))
@@ -1511,7 +1511,7 @@ class OSGDB_EXPORT MyReadFileCallback : public virtual osgDB::ReadFileCallback
osgDB::ReaderWriter::ReadResult readServer(ObjectType type, const std::string& filename, const osgDB::Options* options)
{
osg::notify(osg::INFO)<<"Trying server file "<<filename<<std::endl;
osg::notify(osg::NOTICE)<<"Trying server file "<<filename<<std::endl;
osgDB::ReaderWriter::ReadResult result;
osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("curl");
@@ -1549,6 +1549,7 @@ class OSGDB_EXPORT MyReadFileCallback : public virtual osgDB::ReadFileCallback
fileCache->writeObject(*result.getObject(),filename,options);
break;
case(IMAGE):
result.getImage()->setFileName(filename);
fileCache->writeImage(*result.getImage(),filename,options);
break;
case(HEIGHT_FIELD):
@@ -1607,7 +1608,7 @@ class OSGDB_EXPORT MyReadFileCallback : public virtual osgDB::ReadFileCallback
if (!fileCache) fileCache = osgDB::Registry::instance()->getFileCache();
if (fileCache && !fileCache->isFileAppropriateForFileCache(filename)) fileCache = 0;
osg::notify(osg::INFO)<<"reading file "<<filename<<std::endl;
osg::notify(osg::NOTICE)<<"reading file "<<filename<<std::endl;
ObjectCache::iterator itr = _objectCache.find(filename);
if (itr != _objectCache.end())
{
@@ -1659,6 +1660,11 @@ class OSGDB_EXPORT MyReadFileCallback : public virtual osgDB::ReadFileCallback
return osgDB::ReaderWriter::ReadResult::FILE_NOT_FOUND;
}
virtual osgDB::ReaderWriter::ReadResult readObject(const std::string& filename, const osgDB::Options* options)
{
return read(OBJECT, filename, options);
}
virtual osgDB::ReaderWriter::ReadResult readImage(const std::string& filename, const osgDB::Options* options)
{
return read(IMAGE, filename, options);