Boost logo

Geometry :

Subject: [geometry] Problem using intersection algorithm with example code supplied
From: Lionel_1 (lionelcayla_at_[hidden])
Date: 2014-11-26 08:22:12


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"
<http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/examples/example__adapting_a_legacy_geometry_object_model.html>
.

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

--
View this message in context: http://boost-geometry.203548.n3.nabble.com/Problem-using-intersection-algorithm-with-example-code-supplied-tp4026348.html
Sent from the Boost Geometry mailing list archive at Nabble.com.

Geometry list run by mateusz at loskot.net