Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -28,7 +28,7 @@ InputStream::InputStream( const osgDB::Options* options )
|
||||
{
|
||||
if ( !options ) return;
|
||||
_options = options;
|
||||
|
||||
|
||||
std::string schema;
|
||||
if ( options->getPluginStringData("ForceReadingImage")=="true" )
|
||||
_forceReadingImage = true;
|
||||
@@ -43,7 +43,7 @@ InputStream::InputStream( const osgDB::Options* options )
|
||||
s_lastSchema = schema;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( schema.empty() )
|
||||
{
|
||||
resetSchema();
|
||||
@@ -223,16 +223,16 @@ InputStream& InputStream::operator>>( osg::Matrixd& mat )
|
||||
osg::Array* InputStream::readArray()
|
||||
{
|
||||
osg::ref_ptr<osg::Array> array = NULL;
|
||||
|
||||
|
||||
unsigned int id = 0;
|
||||
*this >> PROPERTY("ArrayID") >> id;
|
||||
|
||||
|
||||
ArrayMap::iterator itr = _arrayMap.find( id );
|
||||
if ( itr!=_arrayMap.end() )
|
||||
{
|
||||
return itr->second.get();
|
||||
}
|
||||
|
||||
|
||||
DEF_MAPPEE(ArrayType, type);
|
||||
*this >> type;
|
||||
switch ( type.get() )
|
||||
@@ -387,7 +387,7 @@ osg::Array* InputStream::readArray()
|
||||
default:
|
||||
throwException( "InputStream::readArray(): Unsupported array type." );
|
||||
}
|
||||
|
||||
|
||||
if ( getException() ) return NULL;
|
||||
_arrayMap[id] = array;
|
||||
|
||||
@@ -397,11 +397,11 @@ osg::Array* InputStream::readArray()
|
||||
osg::PrimitiveSet* InputStream::readPrimitiveSet()
|
||||
{
|
||||
osg::ref_ptr<osg::PrimitiveSet> primitive = NULL;
|
||||
|
||||
|
||||
DEF_MAPPEE(PrimitiveType, type);
|
||||
DEF_MAPPEE(PrimitiveType, mode);
|
||||
*this >> type >> mode;
|
||||
|
||||
|
||||
switch ( type.get() )
|
||||
{
|
||||
case ID_DRAWARRAYS:
|
||||
@@ -471,12 +471,12 @@ osg::PrimitiveSet* InputStream::readPrimitiveSet()
|
||||
default:
|
||||
throwException( "InputStream::readPrimitiveSet(): Unsupported array type." );
|
||||
}
|
||||
|
||||
|
||||
if ( getException() ) return NULL;
|
||||
return primitive.release();
|
||||
}
|
||||
|
||||
osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
{
|
||||
|
||||
std::string className="osg::Image";
|
||||
@@ -498,22 +498,22 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
osg::ref_ptr<osg::Image> image = NULL;
|
||||
|
||||
|
||||
switch ( decision )
|
||||
{
|
||||
case IMAGE_INLINE_DATA:
|
||||
if ( isBinary() )
|
||||
{
|
||||
image = new osg::Image;
|
||||
|
||||
|
||||
// _origin, _s & _t & _r, _internalTextureFormat
|
||||
int origin, s, t, r, internalFormat;
|
||||
*this >> origin >> s >> t >> r >> internalFormat;
|
||||
|
||||
|
||||
// _pixelFormat, _dataType, _packing, _allocationMode
|
||||
int pixelFormat, dataType, packing, mode;
|
||||
*this >> pixelFormat >> dataType >> packing >> mode;
|
||||
|
||||
|
||||
// _data
|
||||
unsigned int size = 0; *this >> size;
|
||||
if ( size )
|
||||
@@ -522,7 +522,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
if ( !data )
|
||||
throwException( "InputStream::readImage() Out of memory." );
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
|
||||
readCharArray( data, size );
|
||||
image->setOrigin( (osg::Image::Origin)origin );
|
||||
image->setImage( s, t, r, internalFormat, pixelFormat, dataType,
|
||||
@@ -554,7 +554,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
if ( getException() ) return NULL;
|
||||
}
|
||||
readCharArray( data, size );
|
||||
|
||||
|
||||
std::string ext = osgDB::getFileExtension( name );
|
||||
osgDB::ReaderWriter* reader =
|
||||
osgDB::Registry::instance()->getReaderWriterForExtension( ext );
|
||||
@@ -562,7 +562,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
{
|
||||
std::stringstream inputStream;
|
||||
inputStream.write( data, size );
|
||||
|
||||
|
||||
osgDB::ReaderWriter::ReadResult rr = reader->readImage( inputStream );
|
||||
if ( rr.validImage() )
|
||||
image = rr.takeImage();
|
||||
@@ -587,7 +587,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ( readFromExternal )
|
||||
{
|
||||
image = osgDB::readImageFile( name, getOptions() );
|
||||
@@ -610,7 +610,7 @@ osg::Object* InputStream::readObject( osg::Object* existingObj )
|
||||
unsigned int id = 0;
|
||||
*this >> className >> BEGIN_BRACKET >> PROPERTY("UniqueID") >> id;
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
|
||||
IdentifierMap::iterator itr = _identifierMap.find( id );
|
||||
if ( itr!=_identifierMap.end() )
|
||||
{
|
||||
@@ -635,7 +635,7 @@ osg::Object* InputStream::readObjectFields( const std::string& className, unsign
|
||||
return NULL;
|
||||
}
|
||||
_fields.push_back( className );
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Object> obj = existingObj ? existingObj : wrapper->getProto()->cloneType();
|
||||
_identifierMap[id] = obj;
|
||||
if ( obj.valid() )
|
||||
@@ -651,10 +651,10 @@ osg::Object* InputStream::readObjectFields( const std::string& className, unsign
|
||||
continue;
|
||||
}
|
||||
_fields.push_back( assocWrapper->getName() );
|
||||
|
||||
|
||||
assocWrapper->read( *this, *obj );
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
|
||||
_fields.pop_back();
|
||||
}
|
||||
}
|
||||
@@ -669,11 +669,11 @@ void InputStream::readSchema( std::istream& fin )
|
||||
while ( std::getline(fin, line) )
|
||||
{
|
||||
if ( line[0]=='#' ) continue; // Comment
|
||||
|
||||
|
||||
StringList keyAndValue;
|
||||
split( line, keyAndValue, '=' );
|
||||
if ( keyAndValue.size()<2 ) continue;
|
||||
|
||||
|
||||
setWrapperSchema( osgDB::trimEnclosingSpaces(keyAndValue[0]),
|
||||
osgDB::trimEnclosingSpaces(keyAndValue[1]) );
|
||||
}
|
||||
@@ -683,7 +683,7 @@ InputStream::ReadType InputStream::start( InputIterator* inIterator )
|
||||
{
|
||||
_fields.clear();
|
||||
_fields.push_back( "Start" );
|
||||
|
||||
|
||||
ReadType type = READ_UNKNOWN;
|
||||
_in = inIterator;
|
||||
if ( !_in )
|
||||
@@ -691,7 +691,7 @@ InputStream::ReadType InputStream::start( InputIterator* inIterator )
|
||||
if ( getException() ) return type;
|
||||
|
||||
_in->setInputStream(this);
|
||||
|
||||
|
||||
// Check OSG header information
|
||||
unsigned int version = 0;
|
||||
if ( isBinary() )
|
||||
@@ -699,7 +699,7 @@ InputStream::ReadType InputStream::start( InputIterator* inIterator )
|
||||
unsigned int typeValue;
|
||||
*this >> typeValue >> version;
|
||||
type = static_cast<ReadType>(typeValue);
|
||||
|
||||
|
||||
unsigned int attributes; *this >> attributes;
|
||||
if ( attributes&0x2 ) _useSchemaData = true;
|
||||
}
|
||||
@@ -709,12 +709,12 @@ InputStream::ReadType InputStream::start( InputIterator* inIterator )
|
||||
if ( typeString=="Scene" ) type = READ_SCENE;
|
||||
else if ( typeString=="Image" ) type = READ_IMAGE;
|
||||
else if ( typeString=="Object" ) type = READ_OBJECT;
|
||||
|
||||
|
||||
std::string osgName, osgVersion;
|
||||
*this >> PROPERTY("#Version") >> version;
|
||||
*this >> PROPERTY("#Generator") >> osgName >> osgVersion;
|
||||
}
|
||||
|
||||
|
||||
// Record file version for back-compatibility checking of wrappers
|
||||
_fileVersion = version;
|
||||
_fields.pop_back();
|
||||
@@ -725,20 +725,20 @@ void InputStream::decompress()
|
||||
{
|
||||
if ( !isBinary() ) return;
|
||||
_fields.clear();
|
||||
|
||||
|
||||
std::string compressorName; *this >> compressorName;
|
||||
if ( compressorName!="0" )
|
||||
{
|
||||
std::string data;
|
||||
_fields.push_back( "Decompression" );
|
||||
|
||||
|
||||
BaseCompressor* compressor = Registry::instance()->getObjectWrapperManager()->findCompressor(compressorName);
|
||||
if ( !compressor )
|
||||
{
|
||||
OSG_WARN << "InputStream::decompress(): No such compressor "
|
||||
<< compressorName << std::endl;
|
||||
}
|
||||
|
||||
|
||||
if ( !compressor->decompress(*(_in->getStream()), data) )
|
||||
throwException( "InputStream: Failed to decompress stream." );
|
||||
if ( getException() ) return;
|
||||
@@ -747,7 +747,7 @@ void InputStream::decompress()
|
||||
_in->setStream( _dataDecompress );
|
||||
_fields.pop_back();
|
||||
}
|
||||
|
||||
|
||||
if ( _useSchemaData )
|
||||
{
|
||||
_fields.push_back( "SchemaData" );
|
||||
@@ -769,7 +769,7 @@ void InputStream::setWrapperSchema( const std::string& name, const std::string&
|
||||
<< name << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
StringList schema, methods, keyAndValue;
|
||||
std::vector<int> types;
|
||||
split( properties, schema );
|
||||
|
||||
Reference in New Issue
Block a user