Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
vocx
Posts: 2323
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Edit improvements

Postby vocx » Thu Oct 17, 2019 8:36 am

carlopav wrote:
Thu Oct 17, 2019 5:50 am
...So I limited it at least until I move editing options from taskpanel to context menu...
But, why? Of course you can work on that, but I think right now just moving the nodes of various objects (without necessarily showing all options in the task panel) would be useful already.
carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Thu Oct 17, 2019 1:50 pm

I think it would seem buggy if taskpanel doesnt correspond to object that user is editing. And also I needed it this way because i was trying to always enable draft edit (so when user select an object editpoints are displayed automagically).
carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Wed Nov 06, 2019 8:42 pm

vocx wrote:
Thu Oct 17, 2019 8:36 am
But, why? Of course you can work on that, but I think right now just moving the nodes of various objects (without necessarily showing all options in the task panel) would be useful already.
Following your suggestion, PR: https://github.com/FreeCAD/FreeCAD/pull/2699 allow the user to choose the maximum number of objects while editing ;)
carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Thu Dec 26, 2019 10:21 pm

In following commit i tried to be as clear as possible:
https://github.com/FreeCAD/FreeCAD/pull/2839

I'll try to be as short as i can here in the post, since i tried to document the code.
The following parts of the code should not probably stay in the main Draft Edit.

PREVIEW: from this line on, could be split into every object code or in a general Draft_EditPreview, or maybe better i could add some specific function in draft Trackers to keep edit slim.

ADDITIONAL TOOLS: From this line on, additional tools like addPoint, delPoint, I hope they can become subcommands, activated by a context menu. At the moment, when "add point button" is checked, user click is forwarded to theese functions.

MAIN EDITING FUNCTIONS: These line on should stay inside the tool, since they identify which function to call to getEditPoints and to update the object.

OBJECT EDITING FUNCTIONS: From this line to the end. This is the code i'd like to split more. Since every object is asked for a list of editpoints, and when a point is moved every object is notified and changed, I think this should go to the object class, not inside a graphical editing tool. Expecially for BezCurve and Circle that contains code that could be used by a wide range of functions.
carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun Dec 29, 2019 10:51 pm

I made some progress with context menu in Draft Edit:
edit context menu.gif
edit context menu.gif (79.39 KiB) Viewed 223 times
Now it should be possible to add custom actions to the nodes, so when multi object editing is enabled, the menu exactly shows what you can do with that node.
As always code was already there, i just had to look better for it :)
At the moment it is triggered by pressing "e" key while editing or with Alt+left click

EDIT: The branch is here https://github.com/carlopav/FreeCAD/tre ... provements
User avatar
Moult
Posts: 231
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Postby Moult » Sun Dec 29, 2019 10:55 pm

This is amazing work, @carlopav! Keep it up!
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Mon Dec 30, 2019 11:23 am

Moult wrote:
Sun Dec 29, 2019 10:55 pm
This is amazing work, @carlopav! Keep it up!
Thanks Moult!
BTW may I ask you if I can use the DE shortcut for draft edit and change to SE or SH for subelement highlight?
User avatar
Moult
Posts: 231
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Postby Moult » Mon Dec 30, 2019 12:00 pm

Absolutely go right ahead! Feel free to rewrite / remove / improve any of the stuff that I wrote too! You're doing a great job!
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Mon Dec 30, 2019 12:55 pm

carlopav
Posts: 418
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sat Jan 04, 2020 6:25 pm

Added context menu support also for Arc editing.
Updated the PR.
Now i suggest to get rid of the old interface, since it's not updated for multi object editing (and I dont have a good idea on how to update it).
The task panel can just show the close button and a small text that suggest you are in editing mode and you can display options pressing E key or with Alt+Left mouse click
Attachments
6cJgaviMm2.gif
6cJgaviMm2.gif (337.68 KiB) Viewed 104 times