17 #include <osg/MatrixTransform>
18 #include <osgDB/Options>
22 class DtOsgCullVisitor;
34 float distanceNear,
float distanceFar,
float tileRadius,
35 float childTileRadius,
const osg::Vec3d& fileCenter,
36 const osg::Vec3d& childrenCenter,
bool sparseChildren,
37 bool substitutiveChildren,
const osg::Matrixd& fileTranslation,
38 osgDB::Options* options);
43 virtual const char*
className()
const {
return "DtHierarchicalPagedLod"; }
52 virtual void traverse(osg::NodeVisitor& nv);
55 virtual void traverseAll(osg::NodeVisitor& nv);
58 virtual void traverseActive(osg::NodeVisitor& nv);
62 virtual void cullActive(osg::NodeVisitor& nv);
68 void cullActive3D(osg::NodeVisitor& nv);
71 virtual osg::BoundingSphere computeBound()
const;
75 virtual void traverseFile(osg::NodeVisitor& nv,
float distance );
79 virtual void traverseChildren(osg::NodeVisitor& nv);
82 virtual bool fileInRange(
float distance)
const;
85 virtual float fileRangeDistance(osg::NodeVisitor& nv)
const;
88 virtual float childRangeDistance( osg::NodeVisitor& nv )
const;
91 void pageInFile(osg::NodeVisitor& nv,
float distance);
95 void pageOutFile(
int lastCullTime, osg::NodeList& toRemove);
99 bool fileNotLoaded()
const;
102 bool fileIsPaging()
const;
105 bool fileIsLoaded()
const;
108 virtual bool fileInChildRange(
float distance)
const;
111 void pageInChildren(osg::NodeVisitor& nv,
float distance);
114 void pageOutChildren(
int lastCullTime, osg::NodeList& toRemove);
117 bool childrenLoaded()
const;
121 osg::ref_ptr<osg::Node> fileNode();
124 virtual bool addPagedInChild(Node* child);
127 virtual void adjustLOD( Node* child);
133 bool fileInRange2D(
float distance,
float cull);
139 bool fileInChildRange2D(
float cull,
float lod );
142 void setThreadSafeRefUnref(
bool threadSafe);
145 virtual void resizeGLObjectBuffers(
unsigned int maxSize);
150 virtual void releaseGLObjects(osg::State* state)
const;
153 virtual std::string fileName()
const;
156 virtual const std::vector<osg::ref_ptr<DtHierarchicalPagedLod> >& children()
const;
160 virtual const osg::Matrix& fileTranslation()
const;
180 _parents.push_back(&parent);
184 virtual bool addChild( Node *child )
186 return myParent.addPagedInChild(child);
205 std::vector<osg::ref_ptr<DtHierarchicalPagedLod> >
myChildren;