Boost logo

Geometry :

Subject: [ggl] Clipping/Intersecting efficiency
From: Chris Browet (cbro)
Date: 2009-05-31 05:59:58


2009/5/31 Barend Gehrels <Barend.Gehrels_at_[hidden]>

> Hi Chris,
>
> Thanks for this, it would already be half the problem gone. If you could
> commit this to the sandbox, it would be great.
>
> OK, done.
>

Thanks

>
>
>
> In this case, what should be defined as a point_2d? point*, right?
>
> Not point* but probably just "point" in your case? It should not be dynamic
> to avoid the same problems. If your "point" is not registered you can
> register it in the same way (without *).
>
> Just looked into the Merkaartor sources. I would advice to register QPointF
> as being recognized by the GGL. You can then define a linestring of
> QPointF's and no further conversions are necessary. So something like:
> GEOMETRY_REGISTER_POINT_2D_GET_SET(QPointF, qreal, cs::cartesian, x, y,
> setX, setY)
>
> and then ggl::linestring<QPointF> can be used, so your clip should look
> like (didn't test):
>
> typedef ggl::linestring<QPointF> q_line;
> std::vector<q_line> clipped;
> ggl::strategy::intersection::liang_barsky<ggl::box_2d, QPointF>
> strategy;
> ggl::impl::intersection::clip_linestring_with_box<q_line>(clipRect,
> in, std::back_inserter(clipped), strategy);
> ...
> p->thePath.lineTo(it1->toPoint());
>
> You can, by the way, also register QRect as a box type.
> However, I didn't see a point* in your source so maybe I looked at the
> wrong place.
>
>
Actually, my "point" is the "TrackPoint". In the case of clipping, my "Road"
(=linestring) keeps a list of "TrackPoint*" children.
When clipping (in Road::buildPath), the goal is to be able to use a
std::vector<TrackPoint*> as the source of the intersection, to avoid having
to recreate a linestring_2d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20090531/a5bfbe63/attachment-0001.html


Geometry list run by mateusz at loskot.net