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


C++ SelectionMap::find方法代码示例

本文整理汇总了C++中SelectionMap::find方法的典型用法代码示例。如果您正苦于以下问题:C++ SelectionMap::find方法的具体用法?C++ SelectionMap::find怎么用?C++ SelectionMap::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SelectionMap的用法示例。


在下文中一共展示了SelectionMap::find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: add_rings

inline OutputIterator add_rings(SelectionMap const& map,
            Geometry1 const& geometry1, Geometry2 const& geometry2,
            RingCollection const& collection,
            OutputIterator out)
{
    typedef typename SelectionMap::const_iterator iterator;

    for (iterator it = boost::begin(map);
        it != boost::end(map);
        ++it)
    {
        if (! it->second.discarded
            && it->second.parent.source_index == -1)
        {
            GeometryOut result;
            convert_and_add(result, geometry1, geometry2, collection,
                    it->first, it->second.reversed, false);

            // Add children
            for (typename std::vector<ring_identifier>::const_iterator child_it
                        = it->second.children.begin();
                child_it != it->second.children.end();
                ++child_it)
            {
                iterator mit = map.find(*child_it);
                if (mit != map.end()
                    && ! mit->second.discarded)
                {
                    convert_and_add(result, geometry1, geometry2, collection,
                            *child_it, mit->second.reversed, true);
                }
            }
            *out++ = result;
        }
    }
    return out;
}
开发者ID:AndresGalaviz,项目名称:NAO,代码行数:37,代码来源:add_rings.hpp

示例2: add_rings

inline OutputIterator add_rings(SelectionMap const& map,
            Geometry1 const& geometry1, Geometry2 const& geometry2,
            RingCollection const& collection,
            OutputIterator out)
{
    typedef typename SelectionMap::const_iterator iterator;
	typedef typename SelectionMap::mapped_type property_type;
	typedef typename property_type::area_type area_type;

	area_type const zero = 0;
	std::size_t const min_num_points = core_detail::closure::minimum_ring_size
		<
			geometry::closure
				<
					typename boost::range_value
                        <
                            RingCollection const
                        >::type
                >::value
        >::value;


    for (iterator it = boost::begin(map);
        it != boost::end(map);
        ++it)
    {
        if (! it->second.discarded
            && it->second.parent.source_index == -1)
        {
            GeometryOut result;
            convert_and_add(result, geometry1, geometry2, collection,
                    it->first, it->second.reversed, false);

            // Add children
            for (typename std::vector<ring_identifier>::const_iterator child_it
                        = it->second.children.begin();
                child_it != it->second.children.end();
                ++child_it)
            {
                iterator mit = map.find(*child_it);
                if (mit != map.end()
                    && ! mit->second.discarded)
                {
                    convert_and_add(result, geometry1, geometry2, collection,
                            *child_it, mit->second.reversed, true);
                }
            }

			// Only add rings if they satisfy minimal requirements.
			// This cannot be done earlier (during traversal), not
			// everything is figured out yet (sum of positive/negative rings)
			// TODO: individual rings can still contain less than 3 points.
			if (geometry::num_points(result) >= min_num_points
				&& math::larger(geometry::area(result), zero))
			{
				*out++ = result;
			}
        }
    }
    return out;
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:61,代码来源:add_rings.hpp


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