diff --git a/include/osg/PagedLOD b/include/osg/PagedLOD index 0e76a8139..1972f9448 100644 --- a/include/osg/PagedLOD +++ b/include/osg/PagedLOD @@ -126,6 +126,13 @@ class OSG_EXPORT PagedLOD : public LOD /** Get the number of children that the PagedLOD must keep around, even if they are older than their expiry time.*/ unsigned int getNumChildrenThatCannotBeExpired() const { return _numChildrenThatCannotBeExpired; } + /** Set wether you want to disable the paging in of external nodes.*/ + void setDisableExternalChildrenPaging(bool flag) { _disableExternalChildrenPaging = flag; } + + bool getDisableExternalChildrenPaging() const { return _disableExternalChildrenPaging; } + + + /** Remove the children from the PagedLOD which haven't been visited since specified expiry time and expiry frame number. * The removed children are added to the removeChildren list passed into the method, * this allows the children to be deleted later at the caller's discretion. @@ -147,6 +154,8 @@ class OSG_EXPORT PagedLOD : public LOD int _frameNumberOfLastTraversal; unsigned int _numChildrenThatCannotBeExpired; + bool _disableExternalChildrenPaging; + PerRangeDataList _perRangeDataList; }; diff --git a/src/osg/PagedLOD.cpp b/src/osg/PagedLOD.cpp index 513d01acf..bfd15bdf0 100644 --- a/src/osg/PagedLOD.cpp +++ b/src/osg/PagedLOD.cpp @@ -54,6 +54,7 @@ PagedLOD::PagedLOD() _centerMode = USER_DEFINED_CENTER; _radius = -1; _numChildrenThatCannotBeExpired = 0; + _disableExternalChildrenPaging = false; } PagedLOD::PagedLOD(const PagedLOD& plod,const CopyOp& copyop): @@ -62,6 +63,7 @@ PagedLOD::PagedLOD(const PagedLOD& plod,const CopyOp& copyop): _databasePath(plod._databasePath), _frameNumberOfLastTraversal(plod._frameNumberOfLastTraversal), _numChildrenThatCannotBeExpired(plod._numChildrenThatCannotBeExpired), + _disableExternalChildrenPaging(plod._disableExternalChildrenPaging), _perRangeDataList(plod._perRangeDataList) { } @@ -198,7 +200,9 @@ void PagedLOD::traverse(NodeVisitor& nv) } // now request the loading of the next unloaded child. - if (nv.getDatabaseRequestHandler() && numChildren<_perRangeDataList.size()) + if (!_disableExternalChildrenPaging && + nv.getDatabaseRequestHandler() && + numChildren<_perRangeDataList.size()) { // compute priority from where abouts in the required range the distance falls. float priority = (_rangeList[numChildren].second-required_range)/(_rangeList[numChildren].second-_rangeList[numChildren].first); diff --git a/src/osgPlugins/ive/IveVersion.h b/src/osgPlugins/ive/IveVersion.h index b0287616e..c99fd7753 100644 --- a/src/osgPlugins/ive/IveVersion.h +++ b/src/osgPlugins/ive/IveVersion.h @@ -49,8 +49,9 @@ #define VERSION_0038 38 #define VERSION_0039 39 #define VERSION_0040 40 +#define VERSION_0041 41 -#define VERSION VERSION_0040 +#define VERSION VERSION_0041 /* The BYTE_SEX tag is used to check the endian of the IVE file being read in. The IVE format diff --git a/src/osgPlugins/ive/PagedLOD.cpp b/src/osgPlugins/ive/PagedLOD.cpp index a8c6e753d..b85383648 100644 --- a/src/osgPlugins/ive/PagedLOD.cpp +++ b/src/osgPlugins/ive/PagedLOD.cpp @@ -37,6 +37,10 @@ void PagedLOD::write(DataOutputStream* out) out->writeFloat(getRadius()); out->writeUInt(getNumChildrenThatCannotBeExpired()); + if ( out->getVersion() >= VERSION_0041 ) + { + out->writeBool(getDisableExternalChildrenPaging()); + } unsigned int numChildrenToWriteOut = 0; @@ -140,6 +144,11 @@ void PagedLOD::read(DataInputStream* in) setRadius(in->readFloat()); setNumChildrenThatCannotBeExpired(in->readUInt()); + if ( in->getVersion() >= VERSION_0041 ) + { + setDisableExternalChildrenPaging(in->readBool()); + } + // Read groups properties. // Read number of children. diff --git a/src/osgPlugins/osg/PagedLOD.cpp b/src/osgPlugins/osg/PagedLOD.cpp index b9e953172..88b271384 100644 --- a/src/osgPlugins/osg/PagedLOD.cpp +++ b/src/osgPlugins/osg/PagedLOD.cpp @@ -53,6 +53,13 @@ bool PagedLOD_readLocalData(Object& obj, Input& fr) iteratorAdvanced = true; } + bool flag; + if (fr.read("DisableExternalChildrenPaging", flag)) + { + lod.setDisableExternalChildrenPaging(flag); + iteratorAdvanced = true; + } + bool matchFirst; if ((matchFirst=fr.matchSequence("FileNameList {")) || fr.matchSequence("FileNameList %i {")) { @@ -122,6 +129,9 @@ bool PagedLOD_writeLocalData(const Object& obj, Output& fw) fw.indent() << "NumChildrenThatCannotBeExpired "<