<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 09/26/2014 10:35 PM, Olivier Dalang
wrote:<br>
</div>
<blockquote
cite="mid:CAExk7p1W8TJPyYp+Nx_nZ7iw3TkGLwTj3yn_sKxDN0Cxe+TPbQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<p>While on the topic of map tools, I was thinking of the
following improvements to the QgsMapTool class:</p>
<p><b>1. Implement snapping directly in the QgsMapTool class
rather than in each subclass</b><br>
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.</p>
</div>
</blockquote>
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.<br>
<blockquote
cite="mid:CAExk7p1W8TJPyYp+Nx_nZ7iw3TkGLwTj3yn_sKxDN0Cxe+TPbQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<p><b>2. Implement pre-click highlighting of
features/nodes/edges/rings/... (depending on what the
current tool accepts)</b><br>
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.</p>
</div>
</blockquote>
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. <br>
<br>
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.<br>
<br>
Leyan<br>
<br>
</body>
</html>