Problem using intersection algorithm with example code supplied

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem using intersection algorithm with example code supplied

Lionel_1
Hi,

I would like to use Boost Geometry in my current library project. I would need Union Intersection functionality among others.
While I could use successfully boost concepts directly I haven't been able to use legacy structures. I have tried the example code from "Adapting a legacy Object Model" .

Whereas I could make it work when using a Point Collection as return geometry,  I got the following  compilation errors  when returning a Polygon collection:

'push_back' : is not a member of 'QRing'

Code:

void main(void)
{
        QLineString line1;
        line1.points.push_back(&QPoint(0.,0.));
        line1.points.push_back(&QPoint(4., 0.));
        line1.points.push_back(&QPoint(0., 4.));

        QLineString line2;
        line1.points.push_back(&QPoint(2.,0.));
        line1.points.push_back(&QPoint(7., 0.));
        line1.points.push_back(&QPoint(0., 8.));

        QPolygon poly1;
        QRing ring1;
        ring1.lines.push_back(&line1);
        poly1.exterior= &ring1;

        QPolygon poly2;
        QRing ring2;
        ring2.lines.push_back(&line2);
        poly1.exterior = &ring2;

        std::vector<QPolygon> output;
        boost::geometry::intersection(poly1, poly2, output);
}

I have adapted the QRing class as described, and it seems either that I have done something wrong (but I can't see what), or that there is something missing. Has anyone a clue about it?

Thanks for taking the time to read me,

-Lio
Loading...