-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to fetch MapToolNodeTool's currently selected feature from within python #34
Conversation
That indeed could be very handy for plugins. |
I am afraid that your changes cannot be merged since they are not portable. What you do is that you try to access code in QGIS binary from a library and that is not allowed on some platforms (I think Mac, maybe windows too?). Moving the QgsMapToolNodeTool class to gui library could help, however there are some dependencies on other app classes that would have to be resolved before that. I am curious why do you need this functionality and whether a different solution would not be better... |
wonder-sk, thanks for your comments. I understand the reasons why it's not portable. I'll take a look into moving QgsMapToolNodeTool into GUI library, but I can't promise I'll handle it myself. I need this feature to ensure that edit process of our graph-like structure in QGIS is as smooth as possible. Graph edges are represented as 2-point line strings. Edges are directed. Hence we needed a way to modify a direction of an edge while modifying it's geometry using node tool. So we took Swap Directions plugin and modified it to work with currently edited feature. Previously it was working with currently selected features. This change reduces number of clicks considerably for us when doing day-to-day work. |
A possible solution may be to implement reverse line functionality directly into node tool: e.g. pressing 'R' would reverse the currently selected line(s). |
I think the correct way to handle this would be to move all map tools into the gui class for 3rd party apps to use then we could expose a "Current Working Feature" method for each tool, however as as wondre-sk mentioned there are app dependencies. |
Martin could we get some movement on this pull request it - either rejecting it or applying it? |
(hmm, github didn't notify me that new commits were added) Unfortunately we cannot merge this as-is. As mentioned earlier, the node tool would have to go into GUI library. Right now the changes in glebar's branch try to use include files from APP and that is wrong. |
Thanks Martin - I will leave it out of the 1.8 branch then Gieber - I'm closing the pull request for now - please feel free to resubmit when Martin's reservations are addressed! Regards Tim |
No problem. Although I doubt I will have enough resources to do appropriate changes. I'm maintaning a branch with the change and it works well for our humble needs |
A small change in the sip files to allow fetching currently selected feature by MapToolNodeTool. This was helpful for our in-house plugin and I hope it may be a very basic foundation for further exposing existing features of QGIS to Python.