- // Return this tile's offset
- inline Point3D get_offset() const { return offset; }
-
- // Update the ssg transform node for this tile so it can be
- // properly drawn relative to our (0,0,0) point
- void prep_ssg_node( const Point3D& p, float vis);
+ /**
+ * Return the "bucket" for this tile
+ */
+ inline const SGBucket& get_tile_bucket() const { return tile_bucket; }
+
+ /**
+ * Add terrain mesh and ground lighting to scene graph.
+ */
+ void addToSceneGraph( osg::Group *terrain_branch);
+
+ /**
+ * disconnect terrain mesh and ground lighting nodes from scene
+ * graph for this tile.
+ */
+ void removeFromSceneGraph();
+
+ /**
+ * Refresh a tile, reload the node from disk.
+ */
+ void refresh();
+
+ /**
+ * return the scenegraph node for the terrain
+ */
+ osg::LOD *getNode() const { return _node.get(); }
+
+ inline double get_time_expired() const { return _time_expired; }
+ inline void update_time_expired( double time_expired ) { if (_time_expired<time_expired) _time_expired = time_expired; }
+
+ inline void set_priority(float priority) { _priority=priority; }
+ inline float get_priority() const { return _priority; }
+ inline void set_current_view(bool current_view) { _current_view = current_view; }
+ inline bool is_current_view() const { return _current_view; }
+
+ /**
+ * Return true if the tile entry is still needed, otherwise return false
+ * indicating that the tile is no longer in active use.
+ */
+ inline bool is_expired(double current_time) const { return (_current_view) ? false : (current_time > _time_expired); }
+
+ // Get the ref_ptr to the DatabaseRequest object, in order to pass
+ // this to the pager.
+ osg::ref_ptr<osg::Referenced>& getDatabaseRequest()
+ {
+ return _databaseRequest;
+ }