]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.hxx
Clean fg_init.hxx
[flightgear.git] / src / Scenery / tilemgr.hxx
index 63a04927314e2a5694d90779db394ded65896708..6b415e53b6e8a94401ea83e2a8bb4860b009afd3 100644 (file)
 #ifndef _TILEMGR_HXX
 #define _TILEMGR_HXX
 
-
-#ifndef __cplusplus                                                          
-# error This library requires C++
-#endif                                   
-
 #include <simgear/compiler.h>
-#include <simgear/math/point3d.hxx>
-#include <simgear/scene/model/location.hxx>
 
 #include <simgear/bucket/newbucket.hxx>
-#include "newcache.hxx"
-
-#if defined(USE_MEM) || defined(WIN32)
-#  define FG_MEM_COPY(to,from,n)        memcpy(to, from, n)
-#else
-#  define FG_MEM_COPY(to,from,n)        bcopy(from, to, n)
-#endif
+#include <simgear/scene/tgdb/TileEntry.hxx>
+#include <simgear/scene/tgdb/TileCache.hxx>
 
-// forward declaration
-class FGTileEntry;
+class SGReaderWriterBTGOptions;
 
-class osg::Node;
+namespace osg
+{
+class Node;
+}
 
-class FGTileMgr {
+class FGTileMgr : public simgear::ModelLoadHelper {
 
 private:
 
@@ -72,32 +62,27 @@ private:
     SGBucket previous_bucket;
     SGBucket current_bucket;
     SGBucket pending;
-       
-    FGTileEntry *current_tile;
-       
+    osg::ref_ptr<SGReaderWriterBTGOptions> _options;
+
     // x and y distance of tiles to load/draw
     float vis;
     int xrange, yrange;
-       
+
     // current longitude latitude
     double longitude;
     double latitude;
-    double altitude_m;
 
     /**
      * tile cache
      */
-    FGNewCache tile_cache;
+    simgear::TileCache tile_cache;
 
 public:
-
-    // Constructor
     FGTileMgr();
 
-    // Destructor
     ~FGTileMgr();
 
-    // Initialize the Tile Manager subsystem
+    // Initialize the Tile Manager
     int init();
 
     // Update the various queues maintained by the tilemagr (private
@@ -108,7 +93,7 @@ public:
     // local chunks.  If the chunk isn't already in the cache, then
     // read it from disk.
     int update( double visibility_meters );
-    int update( SGLocation *location, double visibility_meters);
+    int update( const SGGeod& location, double visibility_meters);
 
     // Prepare the ssg nodes corresponding to each tile.  For each
     // tile, set the ssg transform and update it's range selector
@@ -121,10 +106,10 @@ public:
     /// Returns true if scenery is avaliable for the given lat, lon position
     /// within a range of range_m.
     /// lat and lon are expected to be in degrees.
-    bool scenery_available(double lat, double lon, double range_m);
+    bool scenery_available(const SGGeod& position, double range_m);
 
     // Load a model for a tile
-    static osg::Node* loadTileModel(const string& modelPath, bool cacheModel);
+    osg::Node* loadTileModel(const string& modelPath, bool cacheModel);
 
     // Returns true if all the tiles in the tile cache have been loaded
     bool isSceneryLoaded();