]> git.mxchange.org Git - simgear.git/blob - simgear/scene/model/SGPagedLOD.hxx
Use a more relevant library name
[simgear.git] / simgear / scene / model / SGPagedLOD.hxx
1 // Copyright (C) 2008 Till Busch buti@bux.at
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License as
5 // published by the Free Software Foundation; either version 2 of the
6 // License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16
17 #ifndef SGPAGEDLOD_HXX
18 #define SGPAGEDLOD_HXX 1
19
20 #include <osg/PagedLOD>
21 #include <osgDB/ReaderWriter>
22 #include <simgear/props/props.hxx>
23
24 namespace osgDB {
25 class DatabasePager;
26 }
27
28
29 namespace simgear
30 {
31
32 class SGPagedLOD : public osg::PagedLOD
33 {
34 public:
35     SGPagedLOD();
36
37     SGPagedLOD(const SGPagedLOD&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
38
39     META_Node(simgear, SGPagedLOD);
40
41     // virtual void traverse(osg::NodeVisitor& nv);
42     virtual void forceLoad(osgDB::DatabasePager* dbp);
43
44     // reimplemented to notify the loading through ModelData
45     bool addChild(osg::Node *child);
46
47     void setReaderWriterOptions(osgDB::ReaderWriter::Options *o) {
48         _readerWriterOptions=o;
49         _readerWriterOptions->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
50     }
51
52     osgDB::ReaderWriter::Options * getReaderWriterOptions() {
53         return _readerWriterOptions.get();
54     }
55
56 protected:
57     virtual ~SGPagedLOD();
58     osg::ref_ptr<osgDB::ReaderWriter::Options> _readerWriterOptions;
59     SGPropertyNode_ptr _props;
60 };
61 }
62 #endif