Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

gleber
Copy link

@gleber gleber commented Aug 5, 2011

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.

@NathanW2
Copy link
Member

NathanW2 commented Aug 6, 2011

That indeed could be very handy for plugins.

@wonder-sk
Copy link
Member

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...

@gleber
Copy link
Author

gleber commented Aug 9, 2011

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.

@wonder-sk
Copy link
Member

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).

@NathanW2
Copy link
Member

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.

@timlinux
Copy link
Member

Martin could we get some movement on this pull request it - either rejecting it or applying it?

@wonder-sk
Copy link
Member

(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.

@timlinux
Copy link
Member

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

@timlinux timlinux closed this Mar 31, 2012
@gleber
Copy link
Author

gleber commented Apr 3, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants