osgEarth 2.1.1
Public Member Functions | Private Attributes

osgEarth::TMSCache Class Reference

Inheritance diagram for osgEarth::TMSCache:
Collaboration diagram for osgEarth::TMSCache:

List of all members.

Public Member Functions

 TMSCache (const TMSCacheOptions &options=TMSCacheOptions())
 TMSCache (const TMSCache &rhs, const osg::CopyOp &op=osg::CopyOp::DEEP_COPY_ALL)
 META_Object (osgEarth, TMSCache)
const bool & getInvertY ()
void setInvertY (const bool &invertY)
virtual std::string getFilename (const TileKey &key, const CacheSpec &spec) const

Private Attributes

bool _invertY
TMSCacheOptions _options

Detailed Description

Disk-based cache that stores image tiles according the the OSGeo TMS specification. TODO: move this imlpementation into a proper driver plugin

Definition at line 448 of file Caching.


Constructor & Destructor Documentation

TMSCache::TMSCache ( const TMSCacheOptions options = TMSCacheOptions())

Definition at line 474 of file Caching.cpp.

                                                   :
DiskCache( options ),
_options( options )
{
    setName( "tms" );
}
TMSCache::TMSCache ( const TMSCache rhs,
const osg::CopyOp &  op = osg::CopyOp::DEEP_COPY_ALL 
)

Definition at line 481 of file Caching.cpp.

                                                             :
DiskCache( rhs, op ),
_options( rhs._options )
{
    //nop
}

Member Function Documentation

std::string TMSCache::getFilename ( const TileKey key,
const CacheSpec spec 
) const [virtual]

Gets the filename to cache to for the given TileKey

Reimplemented from osgEarth::DiskCache.

Definition at line 489 of file Caching.cpp.

{
        unsigned int x,y;
    key.getTileXY(x, y);

    unsigned int lod = key.getLevelOfDetail();
    
    unsigned int numCols, numRows;
    key.getProfile()->getNumTiles(lod, numCols, numRows);
    if ( _options.invertY() == false )
    {
        y = numRows - y - 1;
    }

    std::stringstream buf;
    buf << getPath() << "/" << spec.cacheId() << "/" << lod << "/" << x << "/" << y << "." << spec.format();
        std::string bufStr;
        bufStr = buf.str();
    return bufStr;
}

Here is the call graph for this function:

const bool& osgEarth::TMSCache::getInvertY ( ) [inline]

Gets whether or not to invert the y tile index

Definition at line 459 of file Caching.

{return _invertY; }
osgEarth::TMSCache::META_Object ( osgEarth  ,
TMSCache   
)
void osgEarth::TMSCache::setInvertY ( const bool &  invertY) [inline]

Sets whether or not to invert the y tile index

Definition at line 464 of file Caching.

{_invertY = invertY;}

Member Data Documentation

Definition at line 472 of file Caching.

Reimplemented from osgEarth::DiskCache.

Definition at line 473 of file Caching.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines