From Marco Jez, improvements to osgIntrospection, and new automatically generated

osgWrappers/osg set.
This commit is contained in:
Robert Osfield
2005-04-07 20:00:17 +00:00
parent 5b4482c70d
commit 7a27a0bef7
132 changed files with 8608 additions and 301 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}
}
}
}