Ejemplo n.º 1
0
 inline void insert_into_view_arg(value_type& dest, const arg_type& arg) {
   typedef typename polygon_set_traits<arg_type>::iterator_type literator;
   literator itr1, itr2;
   itr1 = polygon_set_traits<arg_type>::begin(arg);
   itr2 = polygon_set_traits<arg_type>::end(arg);
   dest.insert(itr1, itr2);
 }
  void execute_boolean_op(value_type& output_, const geometry_type_1& lvalue_, const geometry_type_2& rvalue_) {
    typedef geometry_type_1 ltype;
    typedef geometry_type_2 rtype;
    typedef typename polygon_set_traits<ltype>::coordinate_type coordinate_type;
    value_type linput_;
    value_type rinput_;
    insert_into_view_arg(linput_, lvalue_);
    insert_into_view_arg(rinput_, rvalue_);
    polygon_45_set_data<coordinate_type> l45, r45, o45;
    if(linput_.downcast(l45) && rinput_.downcast(r45)) {
      //the op codes are screwed up between 45 and arbitrary
#ifdef BOOST_POLYGON_MSVC
#pragma warning (disable: 4127)
#endif
      if(op_type < 2)
        l45.template applyAdaptiveBoolean_<op_type>(o45, r45);
      else if(op_type == 2)
        l45.template applyAdaptiveBoolean_<3>(o45, r45);
      else
        l45.template applyAdaptiveBoolean_<2>(o45, r45);
#ifdef BOOST_POLYGON_MSVC
#pragma warning (default: 4127)
#endif
      output_.insert(o45);
    } else {
      arbitrary_boolean_op<coordinate_type> abo;
      abo.execute(output_, linput_.begin(), linput_.end(),
                  rinput_.begin(), rinput_.end(), op_type);
    }
  }
Ejemplo n.º 3
0
    void operator()(FeatureType & f, uint32_t)
    {
        ++m_totalCount;
        string s1, s2;
        f.GetPreferredNames(s1, s2);
        if (!s1.empty())
            ++m_namesCount;

        m_currFeatureTypes.clear();
        f.ForEachType([this](uint32_t type)
        {
            m_currFeatureTypes.push_back(type);
        });
        CHECK(!m_currFeatureTypes.empty(), ("Feature without any type???"));

        auto found = m_stats.insert(make_pair(m_currFeatureTypes, 1));
        if (!found.second)
            found.first->second++;
    }
Ejemplo n.º 4
0
	enumtype* add(int enumo,const char* sym)
	{

		values.insert(std::make_pair(enumo,rb_intern(sym)));
		return this;
	}