|
osgEarth 2.1.1
|
Inheritance diagram for TileService:
Collaboration diagram for TileService:Public Types | |
| typedef std::vector< TilePattern > | TilePatternList |
Public Member Functions | |
| TileService () | |
| TilePatternList & | getPatterns () |
| const std::string & | getName () |
| void | setName (const std::string &name) |
| const std::string & | getTitle () |
| void | setTitle (const std::string &title) |
| const std::string & | getAbstract () |
| void | setAbstract (const std::string &value) |
| const std::string & | getVersion () |
| void | setVersion (const std::string &version) |
| const std::string & | getAccessConstraints () |
| void | setAccessConstraints (const std::string &accessConstraints) |
| const osg::Vec2d & | getDataMin () |
| void | setDataMin (const osg::Vec2d &min) |
| const osg::Vec2d & | getDataMax () |
| void | setDataMax (const osg::Vec2d &max) |
| void | getMatchingPatterns (const std::string &layers, const std::string &format, const std::string &styles, const std::string &srs, unsigned int imageWidth, unsigned int imageHeight, TilePatternList &out_patterns) |
| const osgEarth::Profile * | createProfile (TilePatternList &patterns) |
Private Attributes | |
| std::string | _name |
| std::string | _title |
| std::string | _abstract |
| std::string | _version |
| std::string | _accessConstraints |
| osg::Vec2d | _dataMin |
| osg::Vec2d | _dataMax |
| std::vector< TilePattern > | _patterns |
Definition at line 99 of file TileService.
| typedef std::vector<TilePattern> TileService::TilePatternList |
A list of TilePatterns
Definition at line 105 of file TileService.
| TileService::TileService | ( | ) |
Definition at line 119 of file TileService.cpp.
| const Profile * TileService::createProfile | ( | TilePatternList & | patterns | ) |
Given a list of patterns with matching parameters, compute a Profile.
Definition at line 146 of file TileService.cpp.
{
//Assume that all the values in the patterns are equal except for the bounding boxes
const Profile* profile = NULL;
if (patterns.size() > 0)
{
double maxWidth = -1;
double maxHeight = -1;
osg::Vec2d topLeftMin;
osg::Vec2d topLeftMax;
//Find the lowest resolution pattern.
for (unsigned int i = 0; i < patterns.size(); ++i)
{
if (maxWidth < patterns[i].getTileWidth() &&
maxHeight < patterns[i].getTileHeight())
{
maxWidth = patterns[i].getTileWidth();
maxHeight = patterns[i].getTileHeight();
topLeftMin = patterns[i].getTopLeftMin();
topLeftMax = patterns[i].getTopLeftMax();
}
}
double dataWidth = _dataMax.x() - _dataMin.x();
double dataHeight = _dataMax.y() - _dataMin.y();
double tileWidth = topLeftMax.x() - topLeftMin.x();
double tileHeight = topLeftMax.y() - topLeftMin.y();
unsigned int w = (unsigned int) ceil(dataWidth / tileWidth );
unsigned int h = (unsigned int) ceil(dataHeight / tileHeight);
double xmin = topLeftMin.x();
double xmax = xmin + (double)w * tileWidth;
double ymax = topLeftMax.y();
double ymin = ymax - (double)h * tileHeight;
profile = Profile::create( patterns[0].getSRS(), xmin, ymin, xmax, ymax, "", w, h);
}
return profile;
}
| const std::string& TileService::getAbstract | ( | ) | [inline] |
Gets the abstract of this TileService
Definition at line 133 of file TileService.
{return _abstract;}
| const std::string& TileService::getAccessConstraints | ( | ) | [inline] |
Gets the access constraints of this TileService
Definition at line 153 of file TileService.
{return _accessConstraints;}
| const osg::Vec2d& TileService::getDataMax | ( | ) | [inline] |
Gets the upper right corner of the data bounding box.
Definition at line 173 of file TileService.
{return _dataMax;}
| const osg::Vec2d& TileService::getDataMin | ( | ) | [inline] |
Gets the lower left corner of the data bounding box.
Definition at line 163 of file TileService.
{return _dataMin;}
| void TileService::getMatchingPatterns | ( | const std::string & | layers, |
| const std::string & | format, | ||
| const std::string & | styles, | ||
| const std::string & | srs, | ||
| unsigned int | imageWidth, | ||
| unsigned int | imageHeight, | ||
| TilePatternList & | out_patterns | ||
| ) |
Gets the TilePatterns from this TileService with the matching parameters.
| layers | The WMS layers |
| format | The WMS format |
| styles | The WMS styles |
| srs | The spatial reference |
| imageWidth | The image width |
| imageHeight | The image height |
| patterns | The TilePatternList to populate with the matching TilePatterns. |
Definition at line 125 of file TileService.cpp.
{
out_patterns.clear();
for (TilePatternList::iterator i = _patterns.begin(); i < _patterns.end(); ++i)
{
if (osgDB::equalCaseInsensitive(i->getLayers(), layers) &&
osgDB::equalCaseInsensitive(i->getFormat(),format) &&
osgDB::equalCaseInsensitive(i->getStyles(), styles) &&
osgDB::equalCaseInsensitive(i->getSRS(), srs) &&
(i->getImageWidth() == (int)imageWidth) &&
(i->getImageHeight() == (int)imageHeight))
{
out_patterns.push_back(*i);
}
}
}
| const std::string& TileService::getName | ( | ) | [inline] |
| TilePatternList& TileService::getPatterns | ( | ) | [inline] |
Gets the TilePatterns defined in this TileService
Definition at line 108 of file TileService.
{return _patterns;}
Here is the caller graph for this function:| const std::string& TileService::getTitle | ( | ) | [inline] |
| const std::string& TileService::getVersion | ( | ) | [inline] |
| void TileService::setAbstract | ( | const std::string & | value | ) | [inline] |
Sets the abstract of this TileService
Definition at line 138 of file TileService.
{_abstract = value;}
| void TileService::setAccessConstraints | ( | const std::string & | accessConstraints | ) | [inline] |
Sets the access constraints of this TileService
Definition at line 158 of file TileService.
{_accessConstraints = accessConstraints;}
| void TileService::setDataMax | ( | const osg::Vec2d & | max | ) | [inline] |
Sets the upper right corner of the data bounding box.
Definition at line 178 of file TileService.
{_dataMax = max;}
| void TileService::setDataMin | ( | const osg::Vec2d & | min | ) | [inline] |
Sets the lower left corner of the data bounding box
Definition at line 168 of file TileService.
{_dataMin = min;}
| void TileService::setName | ( | const std::string & | name | ) | [inline] |
| void TileService::setTitle | ( | const std::string & | title | ) | [inline] |
| void TileService::setVersion | ( | const std::string & | version | ) | [inline] |
Sets the version of this TileService
Definition at line 148 of file TileService.
{_version = version;}
std::string TileService::_abstract [private] |
Definition at line 211 of file TileService.
std::string TileService::_accessConstraints [private] |
Definition at line 213 of file TileService.
osg::Vec2d TileService::_dataMax [private] |
Definition at line 216 of file TileService.
osg::Vec2d TileService::_dataMin [private] |
Definition at line 215 of file TileService.
std::string TileService::_name [private] |
Definition at line 209 of file TileService.
std::vector<TilePattern> TileService::_patterns [private] |
Definition at line 218 of file TileService.
std::string TileService::_title [private] |
Definition at line 210 of file TileService.
std::string TileService::_version [private] |
Definition at line 212 of file TileService.
1.7.3