00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifdef HAVE_CONFIG_H
00018 # include <simgear_config.h>
00019 #endif
00020
00021 #include <osgDB/ReadFile>
00022 #include <osgDB/Input>
00023 #include <osgDB/ParameterOutput>
00024
00025 #include <simgear/debug/logstream.hxx>
00026 #include <simgear/structure/OSGVersion.hxx>
00027
00028 #include "modellib.hxx"
00029 #include "SGReaderWriterXMLOptions.hxx"
00030 #include "SGPagedLOD.hxx"
00031
00032 #include <simgear/math/SGMath.hxx>
00033
00034 using namespace osg;
00035 using namespace simgear;
00036
00037 SGPagedLOD::SGPagedLOD()
00038 : PagedLOD()
00039 {
00040 }
00041
00042 SGPagedLOD::~SGPagedLOD()
00043 {
00044
00045 }
00046
00047 SGPagedLOD::SGPagedLOD(const SGPagedLOD& plod,const CopyOp& copyop)
00048 : osg::PagedLOD(plod, copyop),
00049 _readerWriterOptions(plod._readerWriterOptions)
00050 {
00051 }
00052
00053 bool SGPagedLOD::addChild(osg::Node *child)
00054 {
00055 if (!PagedLOD::addChild(child))
00056 return false;
00057
00058 setRadius(getBound().radius());
00059 setCenter(getBound().center());
00060 return true;
00061 }
00062
00063 void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp)
00064 {
00065
00066
00067 unsigned childNum = getNumChildren();
00068 setTimeStamp(childNum, 0);
00069 double priority=1.0;
00070 dbp->requestNodeFile(getFileName(childNum),this,priority,0,
00071 getDatabaseRequest(childNum),
00072 _readerWriterOptions.get());
00073 }
00074
00075 bool SGPagedLOD_writeLocalData(const Object& obj, osgDB::Output& fw)
00076 {
00077 return true;
00078 }
00079
00080 namespace
00081 {
00082 osgDB::RegisterDotOsgWrapperProxy sgPagedLODProxy
00083 (
00084 new SGPagedLOD,
00085 "simgear::SGPagedLOD",
00086 "Object Node LOD PagedLOD SGPagedLOD Group",
00087 0,
00088 &SGPagedLOD_writeLocalData
00089 );
00090 }