diff --git a/include/osgpcl/outofcore_octree_reader.h b/include/osgpcl/outofcore_octree_reader.h index 574b2a9..c98425e 100644 --- a/include/osgpcl/outofcore_octree_reader.h +++ b/include/osgpcl/outofcore_octree_reader.h @@ -153,6 +153,8 @@ namespace osgpcl const osg::Vec3d& getBBmin(){return bbmin_;} bool isLeaf(){return isLeaf_;} void setLeaf(bool enable){isLeaf_=enable;} + + void addCacheHint( const osgDB::Options::CacheHintOptions cho ); }; }; diff --git a/src/outofcore_octree_reader.cpp b/src/outofcore_octree_reader.cpp index 4b916a3..c6e7159 100644 --- a/src/outofcore_octree_reader.cpp +++ b/src/outofcore_octree_reader.cpp @@ -199,6 +199,7 @@ namespace osgpcl isRoot_(true),depth_(0), max_depth_(0), depth_set_(false), bbmin_(0,0,0),bbmax_(0,0,0), isLeaf_(false) { + addCacheHint( osgDB::Options::CACHE_NODES ); } OutofCoreOctreeReader::OutOfCoreOptions::OutOfCoreOptions ( @@ -206,6 +207,7 @@ namespace osgpcl isRoot_(true),depth_(0), max_depth_(0), depth_set_(false), bbmin_(0,0,0),bbmax_(0,0,0), isLeaf_(false) { + addCacheHint( osgDB::Options::CACHE_NODES ); } OutofCoreOctreeReader::OutOfCoreOptions::OutOfCoreOptions ( @@ -213,6 +215,7 @@ namespace osgpcl CloudReaderOptions(factory, 1), isRoot_(true),depth_(0), max_depth_(0), depth_set_(false), bbmin_(0,0,0),bbmax_(0,0,0), isLeaf_(false) { + addCacheHint( osgDB::Options::CACHE_NODES ); this->init(octree_ ); } @@ -282,6 +285,8 @@ namespace osgpcl this->sampling_rate_ = options.sampling_rate_; this->isLeaf_ = options.isLeaf_; this->depth_set_ = options.depth_set_; + + this->setObjectCacheHint( options.getObjectCacheHint() ); } void OutofCoreOctreeReader::OutOfCoreOptions::getBoundingBox ( @@ -290,6 +295,16 @@ namespace osgpcl bbmin = bbmin_; bbmax = bbmax_; } + + void OutofCoreOctreeReader::OutOfCoreOptions::addCacheHint ( + const osgDB::Options::CacheHintOptions cho) + { + const osgDB::Options::CacheHintOptions cacheHint = + static_cast( getObjectCacheHint() + | cho ) + ; + setObjectCacheHint( cacheHint ); + } }