Moved the responsibility for finding file to load on to the ReaderWriter plugins,
instead of osgDB::Registry where it original lay. This has been done to allow fileName strings to be encode data rather than just file names, such as one requires when using PagedLOD along with plugins for doing dynamic tesselation.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <osg/Geometry>
|
||||
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <iostream>
|
||||
@@ -22,10 +23,13 @@ class ReaderWriter3DC : public osgDB::ReaderWriter
|
||||
osgDB::equalCaseInsensitive(extension,"asc");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
std::cout << "try to read file "<<fileName<<std::endl;
|
||||
|
||||
|
||||
@@ -20,12 +20,14 @@ ReaderWriterIV::ReaderWriterIV()
|
||||
|
||||
// Read file and convert to OSG
|
||||
osgDB::ReaderWriter::ReadResult
|
||||
ReaderWriterIV::readNode(const std::string& fileName,
|
||||
ReaderWriterIV::readNode(const std::string& file,
|
||||
const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(fileName);
|
||||
if (!acceptsExtension(ext))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO) << "osgDB::ReaderWriterIV::readNode() Reading file "
|
||||
<< fileName.data() << std::endl;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
@@ -318,12 +319,14 @@ class ReaderWriterBMP : public osgDB::ReaderWriter
|
||||
virtual const char* className() { return "BMP Image Reader"; }
|
||||
virtual bool acceptsExtension(const std::string& extension) { return osgDB::equalCaseInsensitive(extension,"bmp"); }
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
int height_ret;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -324,8 +325,14 @@ class ReaderWriterDDS : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"dds");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::Image* osgImage = ReadDDSFile(fileName.c_str());
|
||||
if (osgImage==NULL) return ReadResult::FILE_NOT_HANDLED;
|
||||
return osgImage;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
@@ -69,12 +70,14 @@ osgDB::RegisterReaderWriterProxy<ReaderWriterDirectX> g_readerWriter_DirectX_Pro
|
||||
|
||||
|
||||
// Read node
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterDirectX::readNode(const std::string& fileName,
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterDirectX::readNode(const std::string& file,
|
||||
const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(fileName);
|
||||
if (!acceptsExtension(ext))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO) << "ReaderWriterDirectX::readNode(" << fileName.c_str() << ")\n";
|
||||
|
||||
|
||||
@@ -799,20 +799,25 @@ class ReaderWriterDW : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"dw");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName,const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readNode(const std::string& file,const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
_dwobj obj;
|
||||
enum reading {NONE, MATERIAL, OBJECT};
|
||||
//unsigned short nrecs=0; // number of records read after a divider (numVerts, numFaces, numOpenings...)
|
||||
int nexpected=0; // number of records to be read in a block
|
||||
dwmaterial *matpalet=NULL;
|
||||
int nmat=-1; // current element of matpalet being modified
|
||||
int nmn=0; // number of materials found
|
||||
reading rdg=NONE;
|
||||
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
|
||||
_dwobj obj;
|
||||
enum reading {NONE, MATERIAL, OBJECT};
|
||||
//unsigned short nrecs=0; // number of records read after a divider (numVerts, numFaces, numOpenings...)
|
||||
int nexpected=0; // number of records to be read in a block
|
||||
dwmaterial *matpalet=NULL;
|
||||
int nmat=-1; // current element of matpalet being modified
|
||||
int nmn=0; // number of materials found
|
||||
reading rdg=NONE;
|
||||
|
||||
char buff[256];
|
||||
|
||||
notify(INFO)<< "ReaderWriterDW::readNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <osg/GL>
|
||||
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <iostream>
|
||||
@@ -748,11 +749,14 @@ class ReaderWriterATTR : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"attr");
|
||||
}
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
// options
|
||||
char buf[256];
|
||||
int version=0;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
using namespace flt;
|
||||
|
||||
@@ -22,10 +23,13 @@ osgDB::ReaderWriter::ReadResult ReaderWriterFLT::readObject(const std::string& f
|
||||
}
|
||||
|
||||
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterFLT::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options)
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterFLT::readNode(const std::string& file, const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
if( !acceptsExtension(osgDB::getFileExtension(fileName) ))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::ref_ptr<FltFile> read = new FltFile;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include "FreeTypeLibrary.h"
|
||||
@@ -21,10 +22,13 @@ class ReaderWriterFreeType : public osgDB::ReaderWriter
|
||||
osgDB::equalCaseInsensitive(extension,"fnt"); // Windows bitmap fonts
|
||||
}
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osgText::Font* font = FreeTypeLibrary::instance()->getFont(fileName,0);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/ImageOptions>
|
||||
|
||||
#include <gdal_priv.h>
|
||||
@@ -18,11 +19,14 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"gdal") || osgDB::equalCaseInsensitive(extension,"gdal");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options* options)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
//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 );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
initGDAL();
|
||||
|
||||
std::auto_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly));
|
||||
@@ -46,10 +50,10 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
|
||||
osgDB::ImageOptions::TexCoordRange* texCoordRange = 0;
|
||||
|
||||
const osgDB::ImageOptions* imageOptions = dynamic_cast<const osgDB::ImageOptions*>(options);
|
||||
osgDB::ImageOptions* imageOptions = dynamic_cast<osgDB::ImageOptions*>(const_cast<osgDB::ReaderWriter::Options*>(options));
|
||||
if (imageOptions)
|
||||
{
|
||||
std::cout<<"Got ImageOptions"<<std::endl;
|
||||
osg::notify(osg::INFO)<<"Got ImageOptions"<<std::endl;
|
||||
|
||||
int margin = 0;
|
||||
switch(imageOptions->_sourceImageWindowMode)
|
||||
@@ -71,7 +75,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
((double)(windowY+windowHeight) -(desiredY+desiredHeight))/(double)windowHeight,
|
||||
(desiredWidth)/(double)windowWidth,
|
||||
(desiredHeight)/(double)windowHeight);
|
||||
std::cout<<"tex coord range "<<texCoordRange->_x<<" "<<texCoordRange->_y<<" "<<texCoordRange->_w<<" "<<texCoordRange->_h<<std::endl;
|
||||
osg::notify(osg::INFO)<<"tex coord range "<<texCoordRange->_x<<" "<<texCoordRange->_y<<" "<<texCoordRange->_w<<" "<<texCoordRange->_h<<std::endl;
|
||||
}
|
||||
break;
|
||||
case(osgDB::ImageOptions::PIXEL_WINDOW):
|
||||
@@ -85,6 +89,13 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
break;
|
||||
}
|
||||
|
||||
// reapply the window coords to the pixel window so that calling code
|
||||
// knows the original pixel size
|
||||
imageOptions->_sourcePixelWindow.windowX = windowX;
|
||||
imageOptions->_sourcePixelWindow.windowY = windowY;
|
||||
imageOptions->_sourcePixelWindow.windowWidth = windowWidth;
|
||||
imageOptions->_sourcePixelWindow.windowHeight = windowHeight;
|
||||
|
||||
switch(imageOptions->_destinationImageWindowMode)
|
||||
{
|
||||
case(osgDB::ImageOptions::RATIO_WINDOW):
|
||||
@@ -111,31 +122,31 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
// windowWidth = destWidth;
|
||||
// windowHeight = destHeight;
|
||||
|
||||
std::cout << " windowX = "<<windowX<<std::endl;
|
||||
std::cout << " windowY = "<<windowY<<std::endl;
|
||||
std::cout << " windowWidth = "<<windowWidth<<std::endl;
|
||||
std::cout << " windowHeight = "<<windowHeight<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowX = "<<windowX<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowY = "<<windowY<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowWidth = "<<windowWidth<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowHeight = "<<windowHeight<<std::endl;
|
||||
|
||||
std::cout << std::endl;
|
||||
osg::notify(osg::INFO) << std::endl;
|
||||
|
||||
std::cout << " destX = "<<destX<<std::endl;
|
||||
std::cout << " destY = "<<destY<<std::endl;
|
||||
std::cout << " destWidth = "<<destWidth<<std::endl;
|
||||
std::cout << " destHeight = "<<destHeight<<std::endl;
|
||||
osg::notify(osg::INFO) << " destX = "<<destX<<std::endl;
|
||||
osg::notify(osg::INFO) << " destY = "<<destY<<std::endl;
|
||||
osg::notify(osg::INFO) << " destWidth = "<<destWidth<<std::endl;
|
||||
osg::notify(osg::INFO) << " destHeight = "<<destHeight<<std::endl;
|
||||
|
||||
std::cout << std::endl;
|
||||
osg::notify(osg::INFO) << std::endl;
|
||||
|
||||
std::cout << " GetRaterCount() "<< dataset->GetRasterCount()<<std::endl;
|
||||
std::cout << " GetProjectionRef() "<< dataset->GetProjectionRef()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetRaterCount() "<< dataset->GetRasterCount()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetProjectionRef() "<< dataset->GetProjectionRef()<<std::endl;
|
||||
|
||||
|
||||
double geoTransform[6];
|
||||
if (dataset->GetGeoTransform(geoTransform)==CE_None)
|
||||
{
|
||||
std::cout << " GetGeoTransform "<< std::endl;
|
||||
std::cout << " Origin = "<<geoTransform[0]<<" "<<geoTransform[3]<<std::endl;
|
||||
std::cout << " Pixel X = "<<geoTransform[1]<<" "<<geoTransform[4]<<std::endl;
|
||||
std::cout << " Pixel Y = "<<geoTransform[2]<<" "<<geoTransform[5]<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetGeoTransform "<< std::endl;
|
||||
osg::notify(osg::INFO) << " Origin = "<<geoTransform[0]<<" "<<geoTransform[3]<<std::endl;
|
||||
osg::notify(osg::INFO) << " Pixel X = "<<geoTransform[1]<<" "<<geoTransform[4]<<std::endl;
|
||||
osg::notify(osg::INFO) << " Pixel Y = "<<geoTransform[2]<<" "<<geoTransform[5]<<std::endl;
|
||||
}
|
||||
|
||||
int numBands = dataset->GetRasterCount();
|
||||
@@ -159,12 +170,12 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
|
||||
GDALRasterBand* band = dataset->GetRasterBand(b);
|
||||
|
||||
std::cout << " Band "<<b<<std::endl;
|
||||
osg::notify(osg::INFO) << " Band "<<b<<std::endl;
|
||||
|
||||
std::cout << " GetOverviewCount() = "<< band->GetOverviewCount()<<std::endl;
|
||||
std::cout << " GetColorTable() = "<< band->GetColorTable()<<std::endl;
|
||||
std::cout << " DataTypeName() = "<< GDALGetDataTypeName(band->GetRasterDataType())<<std::endl;
|
||||
std::cout << " ColorIntepretationName() = "<< GDALGetColorInterpretationName(band->GetColorInterpretation())<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetOverviewCount() = "<< band->GetOverviewCount()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetColorTable() = "<< band->GetColorTable()<<std::endl;
|
||||
osg::notify(osg::INFO) << " DataTypeName() = "<< GDALGetDataTypeName(band->GetRasterDataType())<<std::endl;
|
||||
osg::notify(osg::INFO) << " ColorIntepretationName() = "<< GDALGetColorInterpretationName(band->GetColorInterpretation())<<std::endl;
|
||||
|
||||
if (band->GetColorInterpretation()==GCI_GrayIndex) bandGray = band;
|
||||
else if (band->GetColorInterpretation()==GCI_RedBand) bandRed = band;
|
||||
@@ -180,12 +191,12 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
// minmax[1] = band->GetMaximum(&gotMax);
|
||||
// if (!(gotMin && gotMax))
|
||||
// {
|
||||
// std::cout<<" computing min max"<<std::endl;
|
||||
// osg::notify(osg::INFO)<<" computing min max"<<std::endl;
|
||||
// GDALComputeRasterMinMax(band,TRUE,minmax);
|
||||
// }
|
||||
//
|
||||
// std::cout << " min "<<minmax[0]<<std::endl;
|
||||
// std::cout << " max "<<minmax[1]<<std::endl;
|
||||
// osg::notify(osg::INFO) << " min "<<minmax[0]<<std::endl;
|
||||
// osg::notify(osg::INFO) << " max "<<minmax[1]<<std::endl;
|
||||
|
||||
if (dataType==0)
|
||||
{
|
||||
@@ -232,7 +243,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
pixelFormat = GL_RGBA;
|
||||
internalFormat = GL_RGBA;
|
||||
|
||||
std::cout << "reading RGBA"<<std::endl;
|
||||
osg::notify(osg::INFO) << "reading RGBA"<<std::endl;
|
||||
|
||||
bandRed->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+0),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
bandGreen->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+1),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
@@ -251,7 +262,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
pixelFormat = GL_RGB;
|
||||
internalFormat = GL_RGB;
|
||||
|
||||
std::cout << "reading RGB"<<std::endl;
|
||||
osg::notify(osg::INFO) << "reading RGB"<<std::endl;
|
||||
|
||||
bandRed->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+0),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
bandGreen->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+1),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
@@ -270,7 +281,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
pixelFormat = GL_LUMINANCE_ALPHA;
|
||||
internalFormat = GL_LUMINANCE_ALPHA;
|
||||
|
||||
std::cout << "reading grey + alpha"<<std::endl;
|
||||
osg::notify(osg::INFO) << "reading grey + alpha"<<std::endl;
|
||||
|
||||
bandGray->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+0),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
bandAlpha->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+1),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
@@ -285,7 +296,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
pixelFormat = GL_LUMINANCE;
|
||||
internalFormat = GL_LUMINANCE;
|
||||
|
||||
std::cout << "reading grey"<<std::endl;
|
||||
osg::notify(osg::INFO) << "reading grey"<<std::endl;
|
||||
|
||||
bandGray->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+0),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
}
|
||||
@@ -299,7 +310,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
pixelFormat = GL_ALPHA;
|
||||
internalFormat = GL_ALPHA;
|
||||
|
||||
std::cout << "reading alpha"<<std::endl;
|
||||
osg::notify(osg::INFO) << "reading alpha"<<std::endl;
|
||||
|
||||
bandAlpha->RasterIO(GF_Read,windowX,windowY,windowWidth,windowHeight,(void*)(imageData+0),destWidth,destHeight,targetGDALType,pixelSpace,lineSpace);
|
||||
|
||||
@@ -307,7 +318,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "not found any usable bands in file."<<std::endl;
|
||||
osg::notify(osg::INFO) << "not found any usable bands in file."<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +375,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
const osgDB::ImageOptions* imageOptions = dynamic_cast<const osgDB::ImageOptions*>(options);
|
||||
if (imageOptions)
|
||||
{
|
||||
std::cout<<"Got ImageOptions"<<std::endl;
|
||||
osg::notify(osg::INFO)<<"Got ImageOptions"<<std::endl;
|
||||
|
||||
int margin = 0;
|
||||
switch(imageOptions->_sourceImageWindowMode)
|
||||
@@ -386,7 +397,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
((double)(windowY+windowHeight) -(desiredY+desiredHeight))/(double)windowHeight,
|
||||
(desiredWidth)/(double)windowWidth,
|
||||
(desiredHeight)/(double)windowHeight);
|
||||
std::cout<<"tex coord range "<<texCoordRange->_x<<" "<<texCoordRange->_y<<" "<<texCoordRange->_w<<" "<<texCoordRange->_h<<std::endl;
|
||||
osg::notify(osg::INFO)<<"tex coord range "<<texCoordRange->_x<<" "<<texCoordRange->_y<<" "<<texCoordRange->_w<<" "<<texCoordRange->_h<<std::endl;
|
||||
}
|
||||
break;
|
||||
case(osgDB::ImageOptions::PIXEL_WINDOW):
|
||||
@@ -426,30 +437,30 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
// windowWidth = destWidth;
|
||||
// windowHeight = destHeight;
|
||||
|
||||
std::cout << " windowX = "<<windowX<<std::endl;
|
||||
std::cout << " windowY = "<<windowY<<std::endl;
|
||||
std::cout << " windowWidth = "<<windowWidth<<std::endl;
|
||||
std::cout << " windowHeight = "<<windowHeight<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowX = "<<windowX<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowY = "<<windowY<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowWidth = "<<windowWidth<<std::endl;
|
||||
osg::notify(osg::INFO) << " windowHeight = "<<windowHeight<<std::endl;
|
||||
|
||||
std::cout << std::endl;
|
||||
osg::notify(osg::INFO) << std::endl;
|
||||
|
||||
std::cout << " destX = "<<destX<<std::endl;
|
||||
std::cout << " destY = "<<destY<<std::endl;
|
||||
std::cout << " destWidth = "<<destWidth<<std::endl;
|
||||
std::cout << " destHeight = "<<destHeight<<std::endl;
|
||||
osg::notify(osg::INFO) << " destX = "<<destX<<std::endl;
|
||||
osg::notify(osg::INFO) << " destY = "<<destY<<std::endl;
|
||||
osg::notify(osg::INFO) << " destWidth = "<<destWidth<<std::endl;
|
||||
osg::notify(osg::INFO) << " destHeight = "<<destHeight<<std::endl;
|
||||
|
||||
std::cout << std::endl;
|
||||
osg::notify(osg::INFO) << std::endl;
|
||||
|
||||
std::cout << " GetRaterCount() "<< dataset->GetRasterCount()<<std::endl;
|
||||
std::cout << " GetProjectionRef() "<< dataset->GetProjectionRef()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetRaterCount() "<< dataset->GetRasterCount()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetProjectionRef() "<< dataset->GetProjectionRef()<<std::endl;
|
||||
|
||||
|
||||
double geoTransform[6];
|
||||
std::cout << " GetGeoTransform == "<< dataset->GetGeoTransform(geoTransform)<<" == CE_None"<<std::endl;
|
||||
std::cout << " GetGeoTransform "<< std::endl;
|
||||
std::cout << " Origin = "<<geoTransform[0]<<" "<<geoTransform[3]<<std::endl;
|
||||
std::cout << " Pixel X = "<<geoTransform[1]<<" "<<geoTransform[4]<<std::endl;
|
||||
std::cout << " Pixel Y = "<<geoTransform[2]<<" "<<geoTransform[5]<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetGeoTransform == "<< dataset->GetGeoTransform(geoTransform)<<" == CE_None"<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetGeoTransform "<< std::endl;
|
||||
osg::notify(osg::INFO) << " Origin = "<<geoTransform[0]<<" "<<geoTransform[3]<<std::endl;
|
||||
osg::notify(osg::INFO) << " Pixel X = "<<geoTransform[1]<<" "<<geoTransform[4]<<std::endl;
|
||||
osg::notify(osg::INFO) << " Pixel Y = "<<geoTransform[2]<<" "<<geoTransform[5]<<std::endl;
|
||||
|
||||
|
||||
double TopLeft[2],BottomLeft[2],BottomRight[2],TopRight[2];
|
||||
@@ -463,12 +474,12 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
TopRight[1] = TopLeft[1]+geoTransform[4]*(dataWidth-1);
|
||||
|
||||
|
||||
std::cout << "TopLeft "<<TopLeft[0]<<"\t"<<TopLeft[1]<<std::endl;
|
||||
std::cout << "BottomLeft "<<BottomLeft[0]<<"\t"<<BottomLeft[1]<<std::endl;
|
||||
std::cout << "BottomRight "<<BottomRight[0]<<"\t"<<BottomRight[1]<<std::endl;
|
||||
std::cout << "TopRight "<<TopRight[0]<<"\t"<<TopRight[1]<<std::endl;
|
||||
osg::notify(osg::INFO) << "TopLeft "<<TopLeft[0]<<"\t"<<TopLeft[1]<<std::endl;
|
||||
osg::notify(osg::INFO) << "BottomLeft "<<BottomLeft[0]<<"\t"<<BottomLeft[1]<<std::endl;
|
||||
osg::notify(osg::INFO) << "BottomRight "<<BottomRight[0]<<"\t"<<BottomRight[1]<<std::endl;
|
||||
osg::notify(osg::INFO) << "TopRight "<<TopRight[0]<<"\t"<<TopRight[1]<<std::endl;
|
||||
|
||||
std::cout<<" GDALGetGCPCount "<<dataset->GetGCPCount()<<std::endl;
|
||||
osg::notify(osg::INFO)<<" GDALGetGCPCount "<<dataset->GetGCPCount()<<std::endl;
|
||||
|
||||
int numBands = dataset->GetRasterCount();
|
||||
|
||||
@@ -484,21 +495,21 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
|
||||
GDALRasterBand* band = dataset->GetRasterBand(b);
|
||||
|
||||
std::cout << " Band "<<b<<std::endl;
|
||||
osg::notify(osg::INFO) << " Band "<<b<<std::endl;
|
||||
|
||||
std::cout << " GetOverviewCount() = "<< band->GetOverviewCount()<<std::endl;
|
||||
std::cout << " GetColorTable() = "<< band->GetColorTable()<<std::endl;
|
||||
std::cout << " DataTypeName() = "<< GDALGetDataTypeName(band->GetRasterDataType())<<std::endl;
|
||||
std::cout << " ColorIntepretationName() = "<< GDALGetColorInterpretationName(band->GetColorInterpretation())<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetOverviewCount() = "<< band->GetOverviewCount()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetColorTable() = "<< band->GetColorTable()<<std::endl;
|
||||
osg::notify(osg::INFO) << " DataTypeName() = "<< GDALGetDataTypeName(band->GetRasterDataType())<<std::endl;
|
||||
osg::notify(osg::INFO) << " ColorIntepretationName() = "<< GDALGetColorInterpretationName(band->GetColorInterpretation())<<std::endl;
|
||||
|
||||
|
||||
std::cout << std::endl;
|
||||
std::cout << " GetNoDataValue() = "<< band->GetNoDataValue()<<std::endl;
|
||||
std::cout << " GetMinimum() = "<< band->GetMinimum()<<std::endl;
|
||||
std::cout << " GetMaximum() = "<< band->GetMaximum()<<std::endl;
|
||||
std::cout << " GetOffset() = "<< band->GetOffset()<<std::endl;
|
||||
std::cout << " GetScale() = "<< band->GetScale()<<std::endl;
|
||||
std::cout << " GetUnitType() = '"<< band->GetUnitType()<<"'"<<std::endl;
|
||||
osg::notify(osg::INFO) << std::endl;
|
||||
osg::notify(osg::INFO) << " GetNoDataValue() = "<< band->GetNoDataValue()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetMinimum() = "<< band->GetMinimum()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetMaximum() = "<< band->GetMaximum()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetOffset() = "<< band->GetOffset()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetScale() = "<< band->GetScale()<<std::endl;
|
||||
osg::notify(osg::INFO) << " GetUnitType() = '"<< band->GetUnitType()<<"'"<<std::endl;
|
||||
|
||||
|
||||
if (band->GetColorInterpretation()==GCI_GrayIndex) bandGray = band;
|
||||
@@ -515,12 +526,12 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
// minmax[1] = band->GetMaximum(&gotMax);
|
||||
// if (!(gotMin && gotMax))
|
||||
// {
|
||||
// std::cout<<" computing min max"<<std::endl;
|
||||
// osg::notify(osg::INFO)<<" computing min max"<<std::endl;
|
||||
// GDALComputeRasterMinMax(band,TRUE,minmax);
|
||||
// }
|
||||
//
|
||||
// std::cout << " min "<<minmax[0]<<std::endl;
|
||||
// std::cout << " max "<<minmax[1]<<std::endl;
|
||||
// osg::notify(osg::INFO) << " min "<<minmax[0]<<std::endl;
|
||||
// osg::notify(osg::INFO) << " max "<<minmax[1]<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -553,7 +564,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
// }
|
||||
|
||||
// now need to flip since the OSG's origin is in lower left corner.
|
||||
std::cout<<"flipping"<<std::endl;
|
||||
osg::notify(osg::INFO)<<"flipping"<<std::endl;
|
||||
unsigned int copy_r = hf->getNumRows()-1;
|
||||
for(unsigned int r=0;r<copy_r;++r,--copy_r)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <osgSim/LightPointNode>
|
||||
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/WriteFile>
|
||||
@@ -399,11 +400,14 @@ class ReaderWriterGEO : public osgDB::ReaderWriter
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const Options* opt) { return readNode(fileName,opt); }
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const Options*)
|
||||
virtual ReadResult readNode(const std::string& file, const Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
std::ifstream fin(fileName.c_str(), std::ios::binary | std::ios::in );
|
||||
if (fin.is_open() )
|
||||
{ // read the input file.
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <osg/GL>
|
||||
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
|
||||
@@ -323,12 +324,14 @@ class ReaderWriterGIF : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"gif");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
int height_ret;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
using namespace osg;
|
||||
@@ -19,10 +20,13 @@ class IVEReaderWriter : public ReaderWriter
|
||||
return equalCaseInsensitive(extension,"ive");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const Options* options)
|
||||
virtual ReadResult readNode(const std::string& file, const Options* options)
|
||||
{
|
||||
std::string ext = getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
std::ifstream istream(fileName.c_str(), std::ios::in | std::ios::binary);
|
||||
return readNode(istream,options);
|
||||
|
||||
@@ -178,13 +178,16 @@ class ReaderWriterJP2 : public osgDB::ReaderWriter
|
||||
osgDB::equalCaseInsensitive(extension,"jpc");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options* options)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
if(!osgDB::fileExists(fileName))
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if(fileName.empty())
|
||||
{
|
||||
// note from Robert, Dec03, I find returning a valid image when no
|
||||
// file exists a bit odd...
|
||||
osg::Image *img = new osg::Image;
|
||||
img->setFileName(fileName);
|
||||
return img;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
@@ -279,11 +280,14 @@ class ReaderWriterJPEG : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"jpeg") || osgDB::equalCaseInsensitive(extension,"jpg");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
int height_ret;
|
||||
|
||||
@@ -86,7 +86,7 @@ class ReaderWriter3DS : public osgDB::ReaderWriter
|
||||
virtual const char* className() { return "3DS Auto Studio Reader"; }
|
||||
virtual bool acceptsExtension(const std::string& extension) { return osgDB::equalCaseInsensitive(extension,"3ds"); }
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*);
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options*);
|
||||
|
||||
typedef std::vector<int> FaceList;
|
||||
typedef std::map<std::string,osg::StateSet*> GeoStateMap;
|
||||
@@ -394,9 +394,15 @@ osg::Node* ReaderWriter3DS::processNode(StateSetMap drawStateMap,Lib3dsFile *f,L
|
||||
}
|
||||
|
||||
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriter3DS::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriter3DS::readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
Lib3dsFile *f = lib3ds_file_load(fileName.c_str());
|
||||
if (f==NULL) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
|
||||
@@ -191,10 +191,14 @@ public:
|
||||
return osgDB::equalCaseInsensitive(extension,"logo");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO)<< "ReaderWriterLOGO::readNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
osg::Geode *geode = new osg::Geode;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <osgUtil/SmoothingVisitor>
|
||||
#include <osgUtil/Tesselator>
|
||||
@@ -46,8 +47,14 @@ public:
|
||||
return osgDB::equalCaseInsensitive(extension,"lwo") || osgDB::equalCaseInsensitive(extension,"lw") || osgDB::equalCaseInsensitive(extension,"geo");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
ReadResult result = readNode_LWO1(fileName,options);
|
||||
if (result.success()) return result;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
@@ -59,9 +60,15 @@ public:
|
||||
osgDB::RegisterReaderWriterProxy<ReaderWriterMD2> g_readerWriter_MD2_Proxy;
|
||||
|
||||
osgDB::ReaderWriter::ReadResult
|
||||
ReaderWriterMD2::readNode (const std::string& filename,
|
||||
ReaderWriterMD2::readNode (const std::string& file,
|
||||
const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string filename = osgDB::findDataFile( file );
|
||||
if (filename.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
return load_md2 (filename.data());
|
||||
}
|
||||
|
||||
|
||||
@@ -152,11 +152,13 @@ osgDB::RegisterReaderWriterProxy<ReaderWriterOBJ> g_objReaderWriterProxy;
|
||||
|
||||
|
||||
// read file and convert to OSG.
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
GLMmodel* obj = glmReadOBJ((char*) fileName.c_str());
|
||||
if (!obj)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "osg/Image"
|
||||
#include "osg/Group"
|
||||
#include <osg/Image>
|
||||
#include <osg/Group>
|
||||
|
||||
#include "osgDB/FileNameUtils"
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
@@ -21,11 +22,14 @@ class OSGReaderWriter : public ReaderWriter
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const Options* opt) { return readNode(fileName,opt); }
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const Options* opt)
|
||||
virtual ReadResult readNode(const std::string& file, const Options* opt)
|
||||
{
|
||||
std::string ext = getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
std::ifstream fin(fileName.c_str());
|
||||
if (fin)
|
||||
{
|
||||
|
||||
@@ -30,11 +30,14 @@ class sgReaderWriterOSGTGZ : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"osgtgz");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
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 );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO)<<"sgReaderWriterOSGTGZ::readNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
char dirname[128];
|
||||
|
||||
@@ -94,8 +94,11 @@ class ReaderWriterPFB : public osgDB::ReaderWriter
|
||||
false;
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) fileName = file; // let Peformer see if it can file the filep
|
||||
|
||||
osg::notify(osg::INFO)<<"ReaderWriterPFB::readImage( "<<fileName.c_str()<<" )\n";
|
||||
initPerformer();
|
||||
|
||||
@@ -146,11 +149,14 @@ class ReaderWriterPFB : public osgDB::ReaderWriter
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO)<<"ReaderWriterPFB::readNode( "<<fileName.c_str()<<" )\n";
|
||||
initPerformer();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
@@ -193,8 +194,13 @@ class ReaderWriterPIC : public osgDB::ReaderWriter
|
||||
virtual const char* className() { return "PIC Image Reader"; }
|
||||
virtual bool acceptsExtension(const std::string& extension) { return osgDB::equalCaseInsensitive(extension,"pic"); }
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <osg/Endian>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/FileNameUtils>
|
||||
|
||||
using namespace osg;
|
||||
@@ -35,11 +36,13 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
||||
virtual const char* className() { return "PNG Image Reader/Writer"; }
|
||||
virtual bool acceptsExtension(const std::string& extension) { return osgDB::equalCaseInsensitive(extension,"png"); }
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
if( !acceptsExtension(osgDB::getFileExtension(fileName) ))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
int trans = PNG_ALPHA;
|
||||
FILE *fp = NULL;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -24,10 +25,13 @@ class ReaderWriterPNM : public osgDB::ReaderWriter
|
||||
osgDB::equalCaseInsensitive(extension, "pbm");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
if( !acceptsExtension(osgDB::getFileExtension(fileName) ))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
FILE *fp = NULL;
|
||||
char line[300];
|
||||
|
||||
@@ -28,7 +28,7 @@ class ReaderWriterQT : public osgDB::ReaderWriter
|
||||
virtual bool acceptsExtension(const std::string& extension)
|
||||
{
|
||||
// this should be the only image importer required on the Mac
|
||||
// dont know what else it supports, but these will do
|
||||
// dont know what else it supports, but these will do
|
||||
return osgDB::equalCaseInsensitive(extension,"rgb") ||
|
||||
osgDB::equalCaseInsensitive(extension,"rgba") ||
|
||||
osgDB::equalCaseInsensitive(extension,"jpg") ||
|
||||
@@ -43,110 +43,113 @@ class ReaderWriterQT : public osgDB::ReaderWriter
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
long origWidth, origHeight,buffWidth,buffHeight,buffDepth,origDepth;
|
||||
|
||||
// NOTE - implememntation means that this will always return 32 bits, so it is hard to work out if
|
||||
// an image was monochrome. So it will waste texture memory unless it gets a monochrome hint.
|
||||
|
||||
unsigned char *pixels = LoadBufferFromDarwinPath ( fileName.c_str(), &origWidth,&origHeight,&origDepth,
|
||||
&buffWidth,&buffHeight,
|
||||
&buffDepth);
|
||||
|
||||
// IMPORTANT -
|
||||
// origDepth in BYTES, buffDepth in BITS
|
||||
|
||||
if (pixels == 0) {
|
||||
std::cerr << "LoadBufferFromDarwinPath failed " << fileName.c_str() << QTfailureMessage() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
long origWidth, origHeight,buffWidth,buffHeight,buffDepth,origDepth;
|
||||
|
||||
// NOTE - implememntation means that this will always return 32 bits, so it is hard to work out if
|
||||
// an image was monochrome. So it will waste texture memory unless it gets a monochrome hint.
|
||||
|
||||
unsigned int pixelFormat;
|
||||
|
||||
switch(origDepth) {
|
||||
case 1 :
|
||||
pixelFormat = GL_RGB;
|
||||
break;
|
||||
case 2 :
|
||||
pixelFormat = GL_LUMINANCE_ALPHA;
|
||||
break;
|
||||
case 3 :
|
||||
pixelFormat = GL_RGB;
|
||||
break;
|
||||
case 4 :
|
||||
pixelFormat = GL_RGBA;
|
||||
break;
|
||||
default :
|
||||
std::cerr << "Unknown file type in " << fileName.c_str() << " with " << origDepth << std::endl;
|
||||
pixelFormat = (GLenum)-1;
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
{
|
||||
unsigned char *srcp=pixels, *dstp=pixels;
|
||||
unsigned char *pixels = LoadBufferFromDarwinPath ( fileName.c_str(), &origWidth,&origHeight,&origDepth,
|
||||
&buffWidth,&buffHeight,
|
||||
&buffDepth);
|
||||
|
||||
// IMPORTANT -
|
||||
// origDepth in BYTES, buffDepth in BITS
|
||||
|
||||
if (pixels == 0) {
|
||||
std::cerr << "LoadBufferFromDarwinPath failed " << fileName.c_str() << QTfailureMessage() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int pixelFormat;
|
||||
|
||||
switch(origDepth) {
|
||||
case 1 :
|
||||
pixelFormat = GL_RGB;
|
||||
break;
|
||||
case 2 :
|
||||
pixelFormat = GL_LUMINANCE_ALPHA;
|
||||
break;
|
||||
case 3 :
|
||||
pixelFormat = GL_RGB;
|
||||
break;
|
||||
case 4 :
|
||||
pixelFormat = GL_RGBA;
|
||||
break;
|
||||
default :
|
||||
std::cerr << "Unknown file type in " << fileName.c_str() << " with " << origDepth << std::endl;
|
||||
pixelFormat = (GLenum)-1;
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
{
|
||||
unsigned char *srcp=pixels, *dstp=pixels;
|
||||
|
||||
int i, j;
|
||||
int i, j;
|
||||
|
||||
// swizzle entire image in-place
|
||||
for (i=0; i<buffHeight; i++ ) {
|
||||
unsigned char r, g, b, a;
|
||||
switch (origDepth) {
|
||||
/*
|
||||
since 8-bit tgas will get expanded into colour, have to use RGB code for 8-bit images
|
||||
|
||||
case 1 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
dstp[0]=srcp[2];
|
||||
srcp+=4;
|
||||
dstp++;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case 2 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
dstp[1]=srcp[0];
|
||||
dstp[0]=srcp[2];
|
||||
srcp+=4;
|
||||
dstp+=2;
|
||||
}
|
||||
break;
|
||||
case 1 :
|
||||
case 3 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
dstp[0]=srcp[1];
|
||||
dstp[1]=srcp[2];
|
||||
dstp[2]=srcp[3];
|
||||
srcp+=4;
|
||||
dstp+=3;
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
r=srcp[1];
|
||||
g=srcp[2];
|
||||
b=srcp[3];
|
||||
a=srcp[0];
|
||||
|
||||
dstp[0]=r;
|
||||
dstp[1]=g;
|
||||
dstp[2]=b;
|
||||
dstp[3]=a;
|
||||
|
||||
srcp+=4;
|
||||
dstp+=4;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
// std::cerr << "ERROR IN RETURNED PIXEL DEPTH, CANNOT COPE" << std::endl;
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// swizzle entire image in-place
|
||||
for (i=0; i<buffHeight; i++ ) {
|
||||
unsigned char r, g, b, a;
|
||||
switch (origDepth) {
|
||||
/*
|
||||
since 8-bit tgas will get expanded into colour, have to use RGB code for 8-bit images
|
||||
|
||||
case 1 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
dstp[0]=srcp[2];
|
||||
srcp+=4;
|
||||
dstp++;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case 2 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
dstp[1]=srcp[0];
|
||||
dstp[0]=srcp[2];
|
||||
srcp+=4;
|
||||
dstp+=2;
|
||||
}
|
||||
break;
|
||||
case 1 :
|
||||
case 3 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
dstp[0]=srcp[1];
|
||||
dstp[1]=srcp[2];
|
||||
dstp[2]=srcp[3];
|
||||
srcp+=4;
|
||||
dstp+=3;
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
for (j=0; j<buffWidth; j++ ) {
|
||||
r=srcp[1];
|
||||
g=srcp[2];
|
||||
b=srcp[3];
|
||||
a=srcp[0];
|
||||
|
||||
dstp[0]=r;
|
||||
dstp[1]=g;
|
||||
dstp[2]=b;
|
||||
dstp[3]=a;
|
||||
|
||||
srcp+=4;
|
||||
dstp+=4;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
// std::cerr << "ERROR IN RETURNED PIXEL DEPTH, CANNOT COPE" << std::endl;
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image* image = new Image();
|
||||
image->setFileName(fileName.c_str());
|
||||
@@ -155,8 +158,8 @@ class ReaderWriterQT : public osgDB::ReaderWriter
|
||||
pixelFormat,
|
||||
GL_UNSIGNED_BYTE,
|
||||
pixels,
|
||||
osg::Image::USE_NEW_DELETE );
|
||||
|
||||
osg::Image::USE_NEW_DELETE );
|
||||
|
||||
notify(INFO) << "image read ok "<<buffWidth<<" "<<buffHeight<<std::endl;
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "osg/Image"
|
||||
#include "osg/Notify"
|
||||
#include <osg/Image>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osg/Geode>
|
||||
|
||||
#include "osg/GL"
|
||||
#include <osg/GL>
|
||||
|
||||
#include "osgDB/FileNameUtils"
|
||||
#include "osgDB/Registry"
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -354,10 +355,13 @@ class ReaderWriterRGB : public osgDB::ReaderWriter
|
||||
osgDB::equalCaseInsensitive(extension,"bw");
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
rawImageRec *raw;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
@@ -477,8 +478,13 @@ class ReaderWriterTGA : public osgDB::ReaderWriter
|
||||
virtual const char* className() { return "TGA Image Reader"; }
|
||||
virtual bool acceptsExtension(const std::string& extension) { return osgDB::equalCaseInsensitive(extension,"tga"); }
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
|
||||
@@ -31,11 +31,14 @@ class ReaderWriterTGZ : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"tgz");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO)<< "ReaderWriterTGZ::readNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
char dirname[128];
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <osg/GL>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osgDB/FileNameUtils>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -411,8 +412,14 @@ class ReaderWriterTIFF : public osgDB::ReaderWriter
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
int height_ret;
|
||||
|
||||
@@ -21,7 +21,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::readNode(const std::string& fil
|
||||
if( !acceptsExtension(osgDB::getFileExtension(fileName) ))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
osg::ref_ptr<txp::TerrapageNode> pager = new TerrapageNode;
|
||||
osg::ref_ptr<txp::TerrapageNode> pager = new TerrapageNode;
|
||||
|
||||
pager->setDatabaseName(fileName);
|
||||
|
||||
|
||||
@@ -29,12 +29,15 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension,"zip");
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(fileName);
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
osg::notify(osg::INFO)<<"ReaderWriterZIP::readNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
char dirname[128];
|
||||
|
||||
Reference in New Issue
Block a user