本文整理汇总了C++中Polyline::load方法的典型用法代码示例。如果您正苦于以下问题:C++ Polyline::load方法的具体用法?C++ Polyline::load怎么用?C++ Polyline::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyline
的用法示例。
在下文中一共展示了Polyline::load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
/**
* Loads the globe from a YAML file.
* @param node YAML node.
*/
void RuleGlobe::load(const YAML::Node &node)
{
if (node["data"])
{
loadDat(CrossPlatform::getDataFile(node["data"].as<std::string>()));
}
for (YAML::const_iterator i = node["polygons"].begin(); i != node["polygons"].end(); ++i)
{
Polygon *polygon = new Polygon(3);
polygon->load(*i);
_polygons.push_back(polygon);
}
for (YAML::const_iterator i = node["polylines"].begin(); i != node["polylines"].end(); ++i)
{
Polyline *polyline = new Polyline(3);
polyline->load(*i);
_polylines.push_back(polyline);
}
}
示例2: load
/**
* Loads the globe from a YAML file.
* @param node YAML node.
*/
void RuleGlobe::load(const YAML::Node &node)
{
if (node["data"])
{
for (std::list<Polygon*>::iterator i = _polygons.begin(); i != _polygons.end(); ++i)
{
delete *i;
}
_polygons.clear();
loadDat(CrossPlatform::getDataFile(node["data"].as<std::string>()));
}
if (node["polygons"])
{
for (std::list<Polygon*>::iterator i = _polygons.begin(); i != _polygons.end(); ++i)
{
delete *i;
}
_polygons.clear();
for (YAML::const_iterator i = node["polygons"].begin(); i != node["polygons"].end(); ++i)
{
Polygon *polygon = new Polygon(3);
polygon->load(*i);
_polygons.push_back(polygon);
}
}
if (node["polylines"])
{
for (std::list<Polyline*>::iterator i = _polylines.begin(); i != _polylines.end(); ++i)
{
delete *i;
}
_polylines.clear();
for (YAML::const_iterator i = node["polylines"].begin(); i != node["polylines"].end(); ++i)
{
Polyline *polyline = new Polyline(3);
polyline->load(*i);
_polylines.push_back(polyline);
}
}
if (node["textures"])
{
for (std::map<int, Texture*>::iterator i = _textures.begin(); i != _textures.end(); ++i)
{
delete i->second;
}
_textures.clear();
for (YAML::const_iterator i = node["textures"].begin(); i != node["textures"].end(); ++i)
{
int id = (*i)["id"].as<int>();
Texture *texture = new Texture(id);
texture->load(*i);
_textures[id] = texture;
}
}
Globe::COUNTRY_LABEL_COLOR = node["countryColor"].as<int>(Globe::COUNTRY_LABEL_COLOR);
Globe::CITY_LABEL_COLOR = node["cityColor"].as<int>(Globe::CITY_LABEL_COLOR);
Globe::BASE_LABEL_COLOR = node["baseColor"].as<int>(Globe::BASE_LABEL_COLOR);
Globe::LINE_COLOR = node["lineColor"].as<int>(Globe::LINE_COLOR);
if (node["oceanPalette"])
{
Globe::OCEAN_COLOR = Palette::blockOffset(node["oceanPalette"].as<int>(Globe::OCEAN_COLOR));
}
}