Added support for new PagedLOD Radius and NumChildrenThatCannorBeExpired variables

to .osg and .ive support.
This commit is contained in:
Robert Osfield
2003-12-09 14:06:48 +00:00
parent f46cbe60dc
commit d76cef6f8e
2 changed files with 28 additions and 0 deletions

View File

@@ -30,6 +30,11 @@ void PagedLOD::write(DataOutputStream* out){
else
throw Exception("PagedLOD::write(): Could not cast this osg::PagedLOD to an osg::LOD.");
out->writeFloat(getRadius());
out->writeUInt(getNumChildrenThatCannotBeExpired());
unsigned int numChildrenToWriteOut = 0;
int i;
@@ -88,6 +93,9 @@ void PagedLOD::read(DataInputStream* in){
else
throw Exception("Group::read(): Could not cast this osg::Group to an osg::Node.");
setRadius(in->readFloat());
setNumChildrenThatCannotBeExpired(in->readUInt());
// Read groups properties.
// Read number of children.

View File

@@ -27,6 +27,22 @@ bool PagedLOD_readLocalData(Object& obj, Input& fr)
PagedLOD& lod = static_cast<PagedLOD&>(obj);
float radius;
if (fr[0].matchWord("Radius") && fr[1].getFloat(radius))
{
lod.setRadius(radius);
fr+=2;
iteratorAdvanced = true;
}
unsigned int num;
if (fr[0].matchWord("NumChildrenThatCannotBeExpired") && fr[1].getUInt(num))
{
lod.setNumChildrenThatCannotBeExpired(num);
fr+=2;
iteratorAdvanced = true;
}
bool matchFirst;
if ((matchFirst=fr.matchSequence("FileNameList {")) || fr.matchSequence("FileNameList %i {"))
{
@@ -91,6 +107,10 @@ bool PagedLOD_writeLocalData(const Object& obj, Output& fw)
{
const PagedLOD& lod = static_cast<const PagedLOD&>(obj);
fw.indent() << "Radius "<<lod.getRadius()<<std::endl;
fw.indent() << "NumChildrenThatCannotBeExpired "<<lod.getNumChildrenThatCannotBeExpired()<<std::endl;
fw.indent() << "FileNameList "<<lod.getNumFileNames()<<" {"<< std::endl;
fw.moveIn();