From Marco Jez, improvements to osgIntrospection, and new automatically generated
osgWrappers/osg set.
This commit is contained in:
@@ -76,9 +76,22 @@
|
||||
using namespace ive;
|
||||
using namespace std;
|
||||
|
||||
void DataInputStream::setOptions(const osgDB::ReaderWriter::Options* options)
|
||||
{
|
||||
_options = options;
|
||||
|
||||
if (_options.get())
|
||||
{
|
||||
setLoadExternalReferenceFiles(_options->getOptionString().find("noLoadExternalReferenceFiles")==std::string::npos);
|
||||
osg::notify(osg::DEBUG_INFO) << "ive::DataInputStream.setLoadExternalReferenceFiles()=" << getLoadExternalReferenceFiles() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
DataInputStream::DataInputStream(std::istream* istream)
|
||||
{
|
||||
unsigned int endianType ;
|
||||
|
||||
_loadExternalReferenceFiles = false;
|
||||
|
||||
_verboseOutput = false;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
DataInputStream(std::istream* istream);
|
||||
~DataInputStream();
|
||||
|
||||
void setOptions(const osgDB::ReaderWriter::Options* options) { _options = options; }
|
||||
void setOptions(const osgDB::ReaderWriter::Options* options);
|
||||
const osgDB::ReaderWriter::Options* getOptions() const { return _options.get(); }
|
||||
|
||||
unsigned int getVersion();
|
||||
@@ -83,6 +83,10 @@ public:
|
||||
osg::Shape* readShape();
|
||||
osg::Node* readNode();
|
||||
|
||||
// Set and get if must be generated external reference ive files
|
||||
void setLoadExternalReferenceFiles(bool b) {_loadExternalReferenceFiles=b;};
|
||||
bool getLoadExternalReferenceFiles() {return _loadExternalReferenceFiles;};
|
||||
|
||||
typedef std::map<std::string, osg::ref_ptr<osg::Image> > ImageMap;
|
||||
typedef std::map<int,osg::ref_ptr<osg::StateSet> > StateSetMap;
|
||||
typedef std::map<int,osg::ref_ptr<osg::StateAttribute> > StateAttributeMap;
|
||||
@@ -104,6 +108,8 @@ private:
|
||||
DrawableMap _drawableMap;
|
||||
ShapeMap _shapeMap;
|
||||
NodeMap _nodeMap;
|
||||
|
||||
bool _loadExternalReferenceFiles;
|
||||
|
||||
osg::ref_ptr<const osgDB::ReaderWriter::Options> _options;
|
||||
|
||||
|
||||
@@ -166,17 +166,21 @@ void ProxyNode::read(DataInputStream* in)
|
||||
fpl.pop_front();
|
||||
}
|
||||
|
||||
for(i=0; i<numFileNames; i++)
|
||||
if( in->getLoadExternalReferenceFiles() )
|
||||
{
|
||||
if(i>=numChildren && !getFileName(i).empty())
|
||||
for(i=0; i<numFileNames; i++)
|
||||
{
|
||||
osgDB::FilePathList& fpl = ((osgDB::ReaderWriter::Options*)in->getOptions())->getDatabasePathList();
|
||||
fpl.push_front( fpl.empty() ? osgDB::getFilePath(getFileName(i)) : fpl.front()+'/'+ osgDB::getFilePath(getFileName(i)));
|
||||
osg::Node *node = osgDB::readNodeFile(getFileName(i), in->getOptions());
|
||||
fpl.pop_front();
|
||||
if(node)
|
||||
if(i>=numChildren && !getFileName(i).empty())
|
||||
{
|
||||
insertChild(i, node);
|
||||
osgDB::FilePathList& fpl = ((osgDB::ReaderWriter::Options*)in->getOptions())->getDatabasePathList();
|
||||
fpl.push_front( fpl.empty() ? osgDB::getFilePath(getFileName(i)) : fpl.front()+'/'+ osgDB::getFilePath(getFileName(i)));
|
||||
osg::Node *node = osgDB::readNodeFile(getFileName(i), in->getOptions());
|
||||
fpl.pop_front();
|
||||
|
||||
if(node)
|
||||
{
|
||||
insertChild(i, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user