当前位置: 首页>>代码示例>>C++>>正文


C++ Polyline::load方法代码示例

本文整理汇总了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);
	}
}
开发者ID:AMDmi3,项目名称:OpenXcom,代码行数:23,代码来源:RuleGlobe.cpp

示例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));
    }
}
开发者ID:redv,项目名称:OpenXcom,代码行数:68,代码来源:RuleGlobe.cpp


注:本文中的Polyline::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。