Boost logo

Boost :

Subject: Re: [boost] [Polygon] What does this error mean?
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2009-09-02 14:59:53


Phil Endecott wrote:
> Simonson, Lucanus J wrote:
>> I boils down to the fact that you are using std::pair<int, int> for
>> your interval return type in get() in the screen_box_t traits, but
>> did not register it as a type of interval concept or define traits
>> for it. If
>> you set up the interval_traits for std::pair and register it with a
>> specialization of geometry_concept for interval_concept you should
>> be fine.
>
> I've added this:
>
> template <>
> struct geometry_concept< std::pair<screen_coord_t,screen_coord_t> > {
> typedef interval_concept type;
> };
>
> template <>
> struct interval_traits< std::pair<screen_coord_t,screen_coord_t> > {
> typedef screen_coord_t coordinate_type;
> static inline coordinate_type get(const
> std::pair<screen_coord_t,screen_coord_t>& interval,
> direction_1d dir) {
> return (dir==LOW) ? interval.first : interval.second;
> }
> };
>
> and I seem to be getting much the same error.
>
> Any ideas?
>

The error the above should fix is:

/usr/local/src/gtl/boost/polygon/rectangle_concept.hpp:192: error: no
matching function for call to
'set(boost::polygon::rectangle_data<int>&,
boost::polygon::orientation_2d_enum, std::pair<int, int>)'

Is that error still present?

Try using the rectangle and interval concepts for simple things like accessing their coordinate values to get more straightforward errors. Once you have interval and rectangle setup it should work just like the point and polygon examples.

Luke


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk