VR-Forces 4.0.4 Class Documentation
include/vantageTerrainImplementation/osgEarthTerrainSourceTracker.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2010 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00008 
00009 #pragma once
00010 
00011 #include <vantageTerrainImplementation/terrainSourceTracker.h>
00012 #include <vantageTerrainImplementation/pageInVisitor.h>
00013 #include <vantageTerrainImplementation/bulletUtil.h>
00014 #include <vantageTerrainImplementation/vantageTerrainImplementationDefines.h>
00015 #include <vantageTerrainImplementation/vantageTerrainImplementationUtil.h>
00016 
00017 #include <vrfutil/vertexList.h>
00018 
00019 //Mak Terrain Toolkit includes
00020 #include <geometry/sphere.h>
00021 
00022 #include <vlutil/vlSmartPointers.h>
00023 
00024 #include <osgTerrain/TerrainTile>
00025 #include <osgEarth/Profile>
00026 #include <osgEarth/TileKey>
00027 
00028 #include <string>
00029 #include <list>
00030 
00031 class DtPageInTilesCommand;
00032 class DtPageOutTilesCommand;
00033 
00034 typedef std::list< osgEarth::TileKey > DtTileKeyList;
00035 
00036 class DT_DLL_vantageTerrainImplementation DtOsgEarthTerrainSourceTracker : public DtTerrainSourceTracker
00037 {
00038 public:
00039 
00040    DtOsgEarthTerrainSourceTracker(DtPagerCommandQueue* commandQueue, 
00041       const osgEarth::Profile* profile, unsigned int lod);
00042 
00043    virtual ~DtOsgEarthTerrainSourceTracker();
00044 
00048    virtual void addPagedInTile(const osgEarth::TileKey tileKey, DtTileData* tileData);
00049 
00051    virtual void removePagedInTile(const osgEarth::TileKey tileKey);
00052 
00059    virtual bool dataAvailable(DtPagingMetaDataPtr metaData, 
00060       DtTerrainPagingGeometryPtr geometry);
00061 
00069    virtual void pageInData(DtPagingMetaDataPtr metaData,
00070       DtTerrainPagingGeometryPtr geometry);
00071 
00077    virtual unsigned int findOldestPagedData(unsigned int& numTrianglesOut);
00078 
00081    virtual void pageOutOldestData(const int priority);
00082 
00084    virtual void drawDebugInfo(btIDebugDraw* debugDrawer);
00085 
00087    virtual bool canPageOutData(unsigned int intersectId);
00088 
00089 protected:
00090 
00091    virtual DtPageInTilesCommand* createPageInTilesCommand(
00092       DtPagingMetaDataPtr metaData);
00093 
00094    virtual DtPageOutTilesCommand* createPageOutTilesCommand(
00095       DtPagingMetaDataPtr metaData);
00096 
00098    virtual void tilesInGeometry(DtTerrainPagingGeometryPtr geometry, 
00099       DtTileKeyList& tilesOut);
00100 
00105    virtual void pageOutData(const DtTileKeyList tilesToRemove, const int priority);
00106 
00107    virtual void tilesUnderChord(const DtChord& chord, 
00108       DtTileKeyList& tilesOut);
00109 
00110    virtual void tilesInSphere(const DtSphere& sphere,
00111       DtTileKeyList& tilesOut);
00112 
00113    virtual void tilesInShape(const DtLocalVertexList&  vertices,
00114       DtTileKeyList& tilesOut);
00115 
00116    virtual bool dataAvailable(DtTileKeyList& keyList, 
00117       const unsigned int intersectId = 0);
00118 
00119    virtual void drawTile(btIDebugDraw* debugDrawer, const DtTileData& tileData);
00120 
00121 protected:
00122 
00124    DtPagedTilesMap myPagedInTiles;
00125 
00126    std::set<osgEarth::TileKey> myTilesPendingRemoval;
00127 
00128    osg::ref_ptr<const osgEarth::Profile> myProfile;
00129 
00130    unsigned int myLOD;
00131 
00132    osgEarth::TileKey* myOldestPagedObject;
00133 
00134    bool myRecomputeOldestPagedObject;
00135 };
00136 
00137 

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)