Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Edit improvements

Post by vocx »

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.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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).
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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 ;)
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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.
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

I made some progress with context menu in Draft Edit:
edit context menu.gif
edit context menu.gif (79.39 KiB) Viewed 1633 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
follow my experiments on BIM modelling for architecture design
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Post by Moult »

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
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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?
follow my experiments on BIM modelling for architecture design
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Post by Moult »

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
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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 1514 times
follow my experiments on BIM modelling for architecture design
Post Reply