Feature: pivy-trackers + editable context menus = smoother workflow?

Need help, or want to share a macro? Post here!
User avatar
Kunda1
Posts: 8386
Joined: Thu Jan 05, 2017 9:03 pm

Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Kunda1 » Mon Mar 02, 2020 5:58 pm

Context
A feature request was opened over at https://github.com/joelgraff/pivy_trackers/issues/19
Pivy-trackers seems intended to liberate the user from the combo view sidebar, by remaining in the scengraph. Is it in the scope of this project to have the ability to create a 'destructible' dialog box with an editing field that allows the user (should they choose to or not) to edit the field in order to insert a more precise value then what the scengraph would allow?

In other words bring the a very abbreviated version of the properties panel to the pointer instead of vice-versa.

I stressed the word 'destructible' and the ability for the user to not engage the dialog since that could inhibit someone's workflow. So the idea is that the context menu would disappear if the user didn't engage with it
The conversation continues on from there. I've opened this thread to move the discussion here for more eyes and *gulp* opinions :mrgreen:

Image
From: https://forum.freecadweb.org/viewtopic. ... &start=890
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1791
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Joel_graff » Mon Mar 02, 2020 6:40 pm

I'd work on incorporating it if someone could mock up a Python class that handles the dialog creation / destruction. :)

I actually know nothing about that in particular. Mostly it's a question of how it integrates into the UI, I think.

EDIT:

Reposting from the GitHub issue discussion:
luzpaz:

This reminds me a lot of @triplus's work I wonder if he'd be able to shed more light on the user interaction side of things because of the different addons he's created for FC, specifically:
https://github.com/triplus/PieMenu
https://github.com/triplus/ShortCuts
https://github.com/triplus/Launcher
HakanSeven12:

I think you want something like that but editable
https://wiki.freecadweb.org/Macro_FCInfoToMouse
...and a link to the Transportation Engineering thread which shows a little of what pivy_trackers does for reference:

https://forum.freecadweb.org/viewtopic. ... &start=890
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby microelly2 » Tue Mar 03, 2020 12:45 pm

I think a tooltipp is a nice small text object which can display information

if the mouse is near to an interesting object popup the tooltipp with the relevant information under the mouse
at this moment wait for a some keyboard actions and record them into the tooltip text.
if the last keyboard is enter or escape store or purge the recorded informtion.
If there is a long time of no keyboard activity or a big move of the mouse hide the tipp and forget all.

here is some code how to get the tooltip activated
https://doc.qt.io/qt-5/qtwidgets-widget ... ample.html
User avatar
Kunda1
Posts: 8386
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Kunda1 » Tue Mar 03, 2020 2:17 pm

What's the better way to do this in regards to the UI mock-up? Should the UI information be provided within the code directly or should it be imported as a .UI file?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1791
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Joel_graff » Tue Mar 03, 2020 8:18 pm

Kunda1 wrote:
Tue Mar 03, 2020 2:17 pm
What's the better way to do this in regards to the UI mock-up? Should the UI information be provided within the code directly or should it be imported as a .UI file?
Either way would work. I prefer UI files, but hardcoding the solution in a Python class would probably work for a limited case like this.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
Kunda1
Posts: 8386
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Kunda1 » Tue Mar 03, 2020 8:38 pm

Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 8386
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Kunda1 » Thu Mar 05, 2020 9:13 pm

How does one go about testing this?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 8386
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Kunda1 » Fri Mar 06, 2020 3:45 pm

moved to the Python Scripting subforum
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby microelly2 » Fri Mar 06, 2020 6:05 pm

phpBB [video]

here my idea with a QLabel

the detail

Code: Select all

                cursor2=QtGui.QCursor()
                p = cursor2.pos()
                if  self.on:
                    say("Widget near Mouse pos",p.x(),p.y())
                    self.a.hide()
                    self.a.move(p.x()+30,p.y()+30)
                    self.a.setText("\n-- I'm here:"+str(p.x())+"|"+str(p.y())+" --\n")
                    self.a.show()

and

Code: Select all

                        if r in "abcde123456789": # add some text to the label
                            self.a.setText(self.a.text() + r)
                        if r =='.': # reset the content
                            self.a.setText("--")

User avatar
Kunda1
Posts: 8386
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature: pivy-trackers + editable context menus = smoother workflow?

Postby Kunda1 » Sat Mar 07, 2020 6:30 am

@Joel_graff, can you use that? :point_up_2:
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features