Added file search path to ESRI reader.

This commit is contained in:
Robert Osfield
2006-08-11 13:06:36 +00:00
parent 306743c903
commit 6b3fbb53f8

View File

@@ -1,4 +1,5 @@
#include <osgDB/FileNameUtils>
#include <osgDB/FileUtils>
#include <osgDB/Registry>
#include "ESRIShape.h"
@@ -19,12 +20,15 @@ class ESRIShapeReaderWriter : public osgDB::ReaderWriter
virtual ReadResult readObject(const std::string& fileName, const Options* opt) const
{ return readNode(fileName,opt); }
virtual ReadResult readNode(const std::string& fileName, const Options* ) const
virtual ReadResult readNode(const std::string& file, const Options* options) const
{
std::string ext = osgDB::getFileExtension(fileName);
std::string ext = osgDB::getFileExtension(file);
if (!acceptsExtension(ext))
return ReadResult::FILE_NOT_HANDLED;
std::string fileName = osgDB::findDataFile(file, options);
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
ESRIShape::ESRIShapeParser sp(fileName);
return sp.getGeode();
}