1 // Copyright (C) 2008 Till Busch buti@bux.at
2 // Copyright (C) 2011 Mathias Froehlich
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef CHECKSCENERYVISITOR_HXX
19 #define CHECKSCENERYVISITOR_HXX
21 #include <osg/NodeVisitor>
31 // Checks the scene graph for PagedLOD or ProxyNodes that are within range
32 // (compared to postion) and injects them into the DatabasePager.
33 // After visiting, isLoaded() returns true if all models in range
36 class CheckSceneryVisitor : public osg::NodeVisitor
39 CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range, osg::FrameStamp* framestamp);
41 virtual void apply(osg::Node& node);
42 virtual void apply(osg::ProxyNode& node);
43 virtual void apply(osg::PagedLOD& node);
44 virtual void apply(osg::Transform& node);
46 bool isLoaded() const {
49 void setLoaded(bool l) {
52 const osg::Vec3 &getPosition() const {