VR-Forces 4.0.4 Class Documentation
include/vantageTerrainImplementation/osgEarthTerrainSourcePager.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2010 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00006 #pragma once
00007 
00010 
00013 
00014 #include <vantageTerrainImplementation/vantageTerrainImplementationDefines.h>
00015 #include <vantageTerrainImplementation/osgEarthTerrainSourceTracker.h>
00016 #include <vantageTerrainImplementation/pageInVisitor.h>
00017 
00018 #include <osgEarth/MapNode>
00019 
00020 #include <tbb/concurrent_queue.h>
00021 
00022 #include <osgTerrain/Terrain>
00023 
00024 typedef std::map<osgEarth::TileKey, osg::ref_ptr<osg::Node> > DtTerrainTileMap;
00025 
00028 class DT_DLL_vantageTerrainImplementation DtOsgEarthTerrainSourcePager : 
00029    public DtTerrainSourcePager
00030 {
00031 public:
00032 
00033    DtOsgEarthTerrainSourcePager(DtVantageTerrainEngine* terrainEngine, 
00034       osgEarth::MapNode* mapNode);
00035 
00036    virtual ~DtOsgEarthTerrainSourcePager();
00037 
00039    virtual DtTerrainSourceTracker* createTerrainSourceTracker();
00040 
00046    virtual bool pageInTiles(DtTileKeyList& tileIds, 
00047                             const unsigned int intersectId = 0);
00048 
00054    virtual bool pageOutTiles(const DtTileKeyList& tilesToRemove);
00055 
00057    virtual void updatePageTracker(const unsigned int intersectId = 0);
00058 
00059 protected:
00060 
00068    virtual bool addCollisionObject(osg::ref_ptr<osg::Node> node,
00069       unsigned int& numTrianglesOut);
00070   
00081    virtual bool pageInTile(const osgEarth::TileKey& tileKey, 
00082                            const unsigned int intersectId = 0);
00083 
00089    virtual bool pageOutTile(const osgEarth::TileKey& tileKey);
00090 
00098    virtual DtTileData* createTileData(const osgEarth::TileKey& tileKey, 
00099       const unsigned int& numTriangles, 
00100       const unsigned int intersectId = 0) const;
00101 
00104    virtual const unsigned int determineTrackerLod();
00105 
00106    virtual DtNodeId osgNodeId(osg::Node* node);
00107    virtual osg::Node* nodeFromId(DtNodeId nodeId);
00108 
00109 
00110 protected:
00111 
00114    virtual void createEmptyTile(const osgEarth::TileKey& tileKey,
00115       const unsigned int intersectId = 0);
00116 
00118    osgEarth::MapNode* myMapNode;
00119 
00121 
00122    osg::ref_ptr<osgTerrain::Terrain> myOsgTerrain;
00124 
00126    DtTerrainTileMap myPagedInTilesMap;
00127 
00128 };
00129 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)