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 <[email protected]>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 > > [email protected] > > http://lists.osgeo.org/mailman/listinfo/qgis-developer > > >
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
