[Qgis-developer] standardisation of the editing map tools: modify behaviour of press-pan-release tools

Leyan ouyang.leyan.ml at hotmail.com
Sat Sep 27 04:36:43 PDT 2014


On 09/26/2014 10:35 PM, Olivier Dalang wrote:
>
> While on the topic of map tools, I was thinking of the following 
> improvements to the QgsMapTool class:
>
> *1. Implement snapping directly in the QgsMapTool class rather than in 
> each subclass*
> From what I understand of the source, currently, more or less every 
> subclass of QgsMapTools provides it's own logic for snapping (or more 
> generally: for conversion from pixel coordinates click to map 
> coordinates click). In this context, I don't see how we can achieve 
> cleanly a cross-tool numerical input system.
>
I am not sure exactly what you mean, the snapping is mostly done by a 
QgsMapCanvasSnapper object, by calling snapToBackgroundLayers that will 
take a point and return snapping results. I am not sure numerical input 
system is linked to snapping as when you enter a numerical value for a 
position, you expect to go exactly to this position, not snap the value 
to a nearby node.
>
> *2. Implement pre-click highlighting of features/nodes/edges/rings/... 
> (depending on what the current tool accepts)*
> This type of visual feedback will make editing much more intuitive. 
> Take the "move node" tool. It's only by mistake that user can learn 
> that it also acts on edges. Take the move tool : when two features 
> overlap, you have no idea on which feature you'll act. Etc. This could 
> also be done directly in QgsMapTool, so that we are sure it's 
> consistent across tools.
>
Pre-click highlighting would require rubberband display on onMouseMove 
events, right ? I tried something similar when I modified the remove 
part tool, it had awful performance.

Now that I think of it, I saw a trick for webdev where they use timers 
to limit the number of mouse move events fired, it may be worth a try.

Leyan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140927/108761ae/attachment.html>


More information about the Qgis-developer mailing list