Added .ive reading/writing support for osgVolume::Property classes

This commit is contained in:
Robert Osfield
2009-05-06 13:47:08 +00:00
parent 2b09b0dffa
commit 92afb370e8
20 changed files with 773 additions and 72 deletions

View File

@@ -19,6 +19,7 @@
#include "StateSet.h"
#include "AnimationPathCallback.h"
#include "ClusterCullingCallback.h"
#include "VolumePropertyAdjustmentCallback.h"
using namespace ive;
@@ -76,6 +77,17 @@ void Node::write(DataOutputStream* out){
}
}
if (out->getVersion() >= VERSION_0039)
{
osgVolume::PropertyAdjustmentCallback* pac = dynamic_cast<osgVolume::PropertyAdjustmentCallback*>(getEventCallback());
out->writeBool(pac!=0);
if(pac)
{
((ive::VolumePropertyAdjustmentCallback*)pac)->write(out);
}
}
if (out->getVersion() >= VERSION_0010)
{
const osg::BoundingSphere& bs = getInitialBound();
@@ -141,7 +153,26 @@ void Node::read(DataInputStream* in){
setCullCallback(ccc);
}
}
if (in->getVersion() >= VERSION_0039)
{
if(in->readBool())
{
int pacID = in->peekInt();
if (pacID==IVEVOLUMEPROPERTYADJUSTMENTCALLBACK)
{
osgVolume::PropertyAdjustmentCallback* pac = new osgVolume::PropertyAdjustmentCallback();
((ive::VolumePropertyAdjustmentCallback*)(pac))->read(in);
setEventCallback(pac);
}
else
{
throw Exception("Unknown event callback identification in Node::read()");
}
}
}
if (in->getVersion() >= VERSION_0010)
{
if (in->readBool())