Ground work for full .osg support for osg::TransferFunction*
This commit is contained in:
@@ -32,6 +32,12 @@ bool TransferFunctionProperty_readLocalData(osg::Object& obj, osgDB::Input &fr)
|
||||
|
||||
bool itrAdvanced = false;
|
||||
|
||||
osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osg::TransferFunction>());
|
||||
if (readObject.valid()) itrAdvanced = true;
|
||||
|
||||
osg::TransferFunction* tf = dynamic_cast<osg::TransferFunction*>(readObject.get());
|
||||
if (tf) tfp.setTransferFunction(tf);
|
||||
|
||||
return itrAdvanced;
|
||||
}
|
||||
|
||||
@@ -39,5 +45,8 @@ bool TransferFunctionProperty_writeLocalData(const osg::Object& obj, osgDB::Outp
|
||||
{
|
||||
const osgVolume::TransferFunctionProperty& tfp = static_cast<const osgVolume::TransferFunctionProperty&>(obj);
|
||||
|
||||
const osg::TransferFunction* tf = tfp.getTransferFunction();
|
||||
if (tf) fw.writeObject(*tf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user