本文整理汇总了C++中dataextentlist::const_iterator::description方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::description方法的具体用法?C++ const_iterator::description怎么用?C++ const_iterator::description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataextentlist::const_iterator
的用法示例。
在下文中一共展示了const_iterator::description方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static XmlDocument*
tileMapToXmlDocument(const TileMap* tileMap)
{
//Create the root XML document
osg::ref_ptr<XmlDocument> doc = new XmlDocument();
doc->setName( ELEM_TILEMAP );
doc->getAttrs()[ ATTR_VERSION ] = tileMap->getVersion();
doc->getAttrs()[ ATTR_TILEMAPSERVICE ] = tileMap->getTileMapService();
doc->addSubElement( ELEM_TITLE, tileMap->getTitle() );
doc->addSubElement( ELEM_ABSTRACT, tileMap->getAbstract() );
doc->addSubElement( ELEM_SRS, tileMap->getSRS() );
doc->addSubElement( ELEM_VERTICAL_SRS, tileMap->getVerticalSRS() );
osg::ref_ptr<XmlElement> e_bounding_box = new XmlElement( ELEM_BOUNDINGBOX );
double minX, minY, maxX, maxY;
tileMap->getExtents( minX, minY, maxX, maxY );
e_bounding_box->getAttrs()[ATTR_MINX] = toString(minX, DOUBLE_PRECISION);
e_bounding_box->getAttrs()[ATTR_MINY] = toString(minY, DOUBLE_PRECISION);
e_bounding_box->getAttrs()[ATTR_MAXX] = toString(maxX, DOUBLE_PRECISION);
e_bounding_box->getAttrs()[ATTR_MAXY] = toString(maxY, DOUBLE_PRECISION);
doc->getChildren().push_back(e_bounding_box.get() );
osg::ref_ptr<XmlElement> e_origin = new XmlElement( ELEM_ORIGIN );
e_origin->getAttrs()[ATTR_X] = toString(tileMap->getOriginX(), DOUBLE_PRECISION);
e_origin->getAttrs()[ATTR_Y] = toString(tileMap->getOriginY(), DOUBLE_PRECISION);
doc->getChildren().push_back(e_origin.get());
osg::ref_ptr<XmlElement> e_tile_format = new XmlElement( ELEM_TILE_FORMAT );
e_tile_format->getAttrs()[ ATTR_EXTENSION ] = tileMap->getFormat().getExtension();
e_tile_format->getAttrs()[ ATTR_MIME_TYPE ] = tileMap->getFormat().getMimeType();
e_tile_format->getAttrs()[ ATTR_WIDTH ] = toString<unsigned int>(tileMap->getFormat().getWidth());
e_tile_format->getAttrs()[ ATTR_HEIGHT ] = toString<unsigned int>(tileMap->getFormat().getHeight());
doc->getChildren().push_back(e_tile_format.get());
osg::ref_ptr< const osgEarth::Profile > profile = tileMap->createProfile();
osg::ref_ptr<XmlElement> e_tile_sets = new XmlElement ( ELEM_TILESETS );
std::string profileString = "none";
if (profile->isEquivalentTo(osgEarth::Registry::instance()->getGlobalGeodeticProfile()))
{
profileString = "global-geodetic";
}
else if (profile->isEquivalentTo(osgEarth::Registry::instance()->getSphericalMercatorProfile()))
{
profileString = "global-mercator";
}
else
{
profileString = "local";
}
e_tile_sets->getAttrs()[ ATTR_PROFILE ] = profileString;
for (TileMap::TileSetList::const_iterator itr = tileMap->getTileSets().begin(); itr != tileMap->getTileSets().end(); ++itr)
{
osg::ref_ptr<XmlElement> e_tile_set = new XmlElement( ELEM_TILESET );
e_tile_set->getAttrs()[ATTR_HREF] = itr->getHref();
e_tile_set->getAttrs()[ATTR_ORDER] = toString<unsigned int>(itr->getOrder());
e_tile_set->getAttrs()[ATTR_UNITSPERPIXEL] = toString(itr->getUnitsPerPixel(), DOUBLE_PRECISION);
e_tile_sets->getChildren().push_back( e_tile_set.get() );
}
doc->getChildren().push_back(e_tile_sets.get());
//Write out the data areas
if (tileMap->getDataExtents().size() > 0)
{
osg::ref_ptr<XmlElement> e_data_extents = new XmlElement( ELEM_DATA_EXTENTS );
for (DataExtentList::const_iterator itr = tileMap->getDataExtents().begin(); itr != tileMap->getDataExtents().end(); ++itr)
{
osg::ref_ptr<XmlElement> e_data_extent = new XmlElement( ELEM_DATA_EXTENT );
e_data_extent->getAttrs()[ATTR_MINX] = toString(itr->xMin(), DOUBLE_PRECISION);
e_data_extent->getAttrs()[ATTR_MINY] = toString(itr->yMin(), DOUBLE_PRECISION);
e_data_extent->getAttrs()[ATTR_MAXX] = toString(itr->xMax(), DOUBLE_PRECISION);
e_data_extent->getAttrs()[ATTR_MAXY] = toString(itr->yMax(), DOUBLE_PRECISION);
if ( itr->minLevel().isSet() )
e_data_extent->getAttrs()[ATTR_MIN_LEVEL] = toString<unsigned int>(*itr->minLevel());
if ( itr->maxLevel().isSet() )
e_data_extent->getAttrs()[ATTR_MAX_LEVEL] = toString<unsigned int>(*itr->maxLevel());
if ( itr->description().isSet() )
e_data_extent->getAttrs()[ATTR_DESCRIPTION] = *itr->description();
e_data_extents->getChildren().push_back( e_data_extent );
}
doc->getChildren().push_back( e_data_extents.get() );
}
return doc.release();
}