osgEarth 2.1.1
Public Types | Public Member Functions | Protected Attributes

osgEarth::WMSCapabilities Class Reference

Inheritance diagram for osgEarth::WMSCapabilities:
Collaboration diagram for osgEarth::WMSCapabilities:

List of all members.

Public Types

typedef std::vector< std::string > FormatList

Public Member Functions

 WMSCapabilities ()
const std::string & getVersion ()
void setVersion (const std::string &version)
FormatListgetFormats ()
Layer::LayerListgetLayers ()
std::string suggestExtension ()
LayergetLayerByName (const std::string &name)

Protected Attributes

FormatList _formats
Layer::LayerList _layers
std::string _version

Detailed Description

WMS Capabilities

Definition at line 188 of file Capabilities.


Member Typedef Documentation

typedef std::vector<std::string> osgEarth::WMSCapabilities::FormatList

A list of supported formats

Definition at line 204 of file Capabilities.


Constructor & Destructor Documentation

WMSCapabilities::WMSCapabilities ( )

Definition at line 99 of file Capabilities.cpp.

{
}

Member Function Documentation

FormatList& osgEarth::WMSCapabilities::getFormats ( ) [inline]

Gets the list of supported formats

Definition at line 209 of file Capabilities.

{return _formats;}
WMSLayer * WMSCapabilities::getLayerByName ( const std::string &  name)

Finds the child Layer with the given name.

Returns:
The Layer with the given name or NULL if not found.

Definition at line 130 of file Capabilities.cpp.

Layer::LayerList& osgEarth::WMSCapabilities::getLayers ( ) [inline]

Gets the Layer's for the Capabilities.

Definition at line 214 of file Capabilities.

{return _layers;}
const std::string& osgEarth::WMSCapabilities::getVersion ( ) [inline]

Gets the WMS capabilities version

Definition at line 196 of file Capabilities.

{return _version;}
void osgEarth::WMSCapabilities::setVersion ( const std::string &  version) [inline]

Sets the WMS capabilities version

Definition at line 201 of file Capabilities.

{_version = version;}
std::string WMSCapabilities::suggestExtension ( )

Suggests an extension to use for WMS layers defined for the service. This function will analyze the list of formats contained in the Capabilities request and recommend the first format that has an OpenSceneGraph ReaderWriter that can support it's extension.

Returns:
The suggested extension.

Definition at line 103 of file Capabilities.cpp.

{
    //Default to png
    std::string ext = "png";

    //Find the first format that we have an osg ReaderWriter for
    for (unsigned int i = 0; i < _formats.size(); ++i)
    {
        std::string format = _formats[i];
        //Strip off the "image/"
        if ((format.length() > 6) && (format.compare(0,6,"image/") == 0))
        {
            format = format.substr(6);
            //See if we have a ReaderWriter for the extension
            osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension( format );
            if (rw)
            {
                ext = format;
                OE_DEBUG << "suggestExtension found ReaderWriter for " << ext << std::endl;
                break;
            }
        }
    }
    return ext;
}

Member Data Documentation

Definition at line 234 of file Capabilities.

Definition at line 235 of file Capabilities.

std::string osgEarth::WMSCapabilities::_version [protected]

Definition at line 236 of file Capabilities.


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