osgEarth 2.1.1
Defines | Functions

/home/cube/sources/osgearth/src/osgEarthDrivers/wms/TileService.cpp File Reference

#include "TileService"
#include <osgEarth/XmlUtils>
#include <osgEarth/HTTPClient>
#include <osg/io_utils>
#include <osgDB/FileNameUtils>
#include <osgDB/FileUtils>
Include dependency graph for TileService.cpp:

Go to the source code of this file.

Defines

#define ELEM_WMS_TILE_SERVICE   "wms_tile_service"
#define ELEM_SERVICE   "service"
#define ATTR_VERSION   "version"
#define ELEM_NAME   "name"
#define ELEM_TITLE   "title"
#define ELEM_ABSTRACT   "abstract"
#define ELEM_ACCESSCONSTRAINTS   "accessconstraints"
#define ELEM_TILEDPATTERNS   "tiledpatterns"
#define ELEM_TILEPATTERN   "tilepattern"
#define ELEM_TILEDGROUP   "tiledgroup"
#define ELEM_LATLONBOUNDINGBOX   "latlonboundingbox"
#define ATTR_MINX   "minx"
#define ATTR_MINY   "miny"
#define ATTR_MAXX   "maxx"
#define ATTR_MAXY   "maxy"

Functions

std::string extractBetween (const std::string &str, const string &lhs, const string &rhs)
void readBoundingBox (XmlElement *e_bb, double &minX, double &minY, double &maxX, double &maxY)
void addTilePatterns (XmlElement *e_root, TileService *tileService)

Define Documentation

#define ATTR_MAXX   "maxx"

Definition at line 207 of file TileService.cpp.

#define ATTR_MAXY   "maxy"

Definition at line 208 of file TileService.cpp.

#define ATTR_MINX   "minx"

Definition at line 205 of file TileService.cpp.

#define ATTR_MINY   "miny"

Definition at line 206 of file TileService.cpp.

#define ATTR_VERSION   "version"

Definition at line 195 of file TileService.cpp.

#define ELEM_ABSTRACT   "abstract"

Definition at line 198 of file TileService.cpp.

#define ELEM_ACCESSCONSTRAINTS   "accessconstraints"

Definition at line 199 of file TileService.cpp.

#define ELEM_LATLONBOUNDINGBOX   "latlonboundingbox"

Definition at line 204 of file TileService.cpp.

#define ELEM_NAME   "name"

Definition at line 196 of file TileService.cpp.

#define ELEM_SERVICE   "service"

Definition at line 194 of file TileService.cpp.

#define ELEM_TILEDGROUP   "tiledgroup"

Definition at line 203 of file TileService.cpp.

#define ELEM_TILEDPATTERNS   "tiledpatterns"

Definition at line 201 of file TileService.cpp.

#define ELEM_TILEPATTERN   "tilepattern"

Definition at line 202 of file TileService.cpp.

#define ELEM_TITLE   "title"

Definition at line 197 of file TileService.cpp.

#define ELEM_WMS_TILE_SERVICE   "wms_tile_service"

Definition at line 193 of file TileService.cpp.


Function Documentation

void addTilePatterns ( XmlElement e_root,
TileService tileService 
)

Definition at line 244 of file TileService.cpp.

{
    //Read all the TilePatterns
    XmlNodeList tile_patterns = e_root->getSubElements( ELEM_TILEPATTERN );
    for( XmlNodeList::const_iterator i = tile_patterns.begin(); i != tile_patterns.end(); i++ )
    {            
        //We only really care about a single access pattern, so extract it
        string txt = static_cast<XmlElement*>( i->get() )->getText();
        //Access patterns are separated by whitespace 
        std::string whitespace (" \t\f\v\n\r");
        string::size_type len = txt.find_first_of(whitespace);
        if (len != string::npos)
        {
            txt = trim(txt.substr(0, len));
        }
        TilePattern pattern(txt);
        tileService->getPatterns().push_back(pattern);
    }

    //Read all TilePatterns in the TiledGroups
    XmlNodeList tiled_groups = e_root->getSubElements(ELEM_TILEDGROUP);
    for( XmlNodeList::const_iterator i = tiled_groups.begin(); i != tiled_groups.end(); i++ )
    {
        addTilePatterns(static_cast<XmlElement*>(i->get()), tileService);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string extractBetween ( const std::string &  str,
const string &  lhs,
const string &  rhs 
)

Definition at line 34 of file TileService.cpp.

{
    std::string result;
    string::size_type start = str.find(lhs);
    if (start != string::npos)
    {
        start += lhs.length();
        string::size_type count = str.size() - start;
        string::size_type end = str.find(rhs, start); 
        if (end != string::npos) count = end-start;
        result = str.substr(start, count);
    }
    return result;
}

Here is the caller graph for this function:

void readBoundingBox ( XmlElement e_bb,
double &  minX,
double &  minY,
double &  maxX,
double &  maxY 
)

Definition at line 233 of file TileService.cpp.

{
    if (e_bb)
    {
        minX = as<double>(e_bb->getAttr( ATTR_MINX ), minX);
        minY = as<double>(e_bb->getAttr( ATTR_MINY ), minY);
        maxX = as<double>(e_bb->getAttr( ATTR_MAXX ), maxX);
        maxY = as<double>(e_bb->getAttr( ATTR_MAXY ), maxY);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines