Fixed handling of write and reading of straight Node objects in the scene graph.

This commit is contained in:
Robert Osfield 2011-02-26 16:04:34 +00:00
parent d88a6af8c1
commit 454e2df32b
2 changed files with 13 additions and 1 deletions

View File

@ -60,6 +60,7 @@
#include "PolygonStipple.h"
#include "Node.h"
#include "Group.h"
#include "MatrixTransform.h"
#include "Camera.h"
@ -1854,6 +1855,10 @@ osg::Node* DataInputStream::readNode()
node = new osgVolume::VolumeTile();
((ive::VolumeTile*)(node.get()))->read(this);
}
else if(nodeTypeID== IVENODE){
node = new osg::Node();
((ive::Node*)(node.get()))->read(this);
}
else{
throwException("Unknown node identification in DataInputStream::readNode()");
}

View File

@ -62,6 +62,7 @@
#include "Light.h"
#include "PolygonStipple.h"
#include "Node.h"
#include "Group.h"
#include "MatrixTransform.h"
#include "Camera.h"
@ -1410,8 +1411,14 @@ void DataOutputStream::writeNode(const osg::Node* node)
((ive::LightPointNode*)(node))->write(this);
}
else
{
if (typeid(node)!=typeid(osg::Node))
{
OSG_WARN<<"Unknown node in Group::write(), className()="<<node->className()<<std::endl;
}
((ive::Node*)(node))->write(this);
// throwException(std::string("Unknown node in Group::write(), className()=")+node->className());
}