[Qgis-developer] Where can I find "add feature" code?

Alexandre Neto senhor.neto at gmail.com
Mon May 20 06:32:56 PDT 2013


Mathias,

Thank you very much! I will take a look in both places.

Best regards,

Alexandre Neto

On Mon, May 20, 2013 at 12:55 PM, Matthias Kuhn <matthias.kuhn at gmx.ch>wrote:

> Hi Alexander,
>
> You probably would want to create your own class which inherits
> QgsMapTool to receive the mouse events and manage the rubberband.
>
> You'll find the code for the add feature tool in
> src/app/qgsmaptooladdfeature.{h|cpp} if you're looking for C++ code.
>
> The attached link [1] points to a map tool I wrote (in python) which
> makes use of a line rubberband and some additional snapping stuff.
>
> Regards,
> Matthias
>
> [1]:
> https://github.com/qgep/QGEP/blob/master/qgepplugin/tools/qgepmaptools.py
>
> On Mon 20 Mai 2013 12:30:22 CEST, Alexandre Neto wrote:
> > Hello all,
> >
> > I'm looking for "add feature" code for inspiration for a plugin. But I
> > can't seam to find it. My idea was to see the correct procedure to
> > draw in canvas (respecting topology, avoid intersection, and so on).
> >
> > For what I have read, I think the procedure is something like:
> >
> > - Start a rubberBand;
> > - On left-click add points to the rubberBand;
> > - Update rubberband drawing as mouse moves;
> > - On right-click finish rubberband;
> > - Use finished rubberband somewhere (in my case use it to replace a
> > feature geometry)
> >
> > Thanks,
> >
> > Alexandre Neto
> >
> >
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130520/7748bbed/attachment.html>


More information about the Qgis-developer mailing list