[QGIS-Developer] API break: snapSegment

lbartoletti at tuxfamily.org lbartoletti at tuxfamily.org
Mon Oct 2 00:04:10 PDT 2017


Hi Martin,

You rock!

Thanks.

On 2017-09-29 09:15, Martin Dobias wrote:
> Hi Loïc
> 
> On Tue, Sep 26, 2017 at 11:08 PM, L.Bartoletti
> <lbartoletti at tuxfamily.org> wrote:
>> Hi,
>> 
>> For a few days now QgsMapMouseEvent:: snapSegment is no longer usable
>> (moved). I need these tools to create circles with tangents
>> (https://github.com/qgis/QGIS/pull/4947).
>> 
>> Is there another way to get segments by snapping?
> 
> Yes - here's the code you need to snap to segments - equivalent to a
> snapSegment() call:
> 
> struct EdgesOnlyFilter : public QgsPointLocator::MatchFilter
> {
>   bool acceptMatch( const QgsPointLocator::Match &m ) override {
> return m.hasEdge(); }
> };
> 
> EdgesOnlyFilter filter;
> match = mapCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
> 
> Regards
> Martin


More information about the QGIS-Developer mailing list