Draft workbench working plane

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft workbench working plane

Post by yorik »

cline wrote:By the way, I need to figure out how to hook up a callback that detects the escape key so SelectPlane can be aborted if desired. Yorik - I think you have already done this. Let me know if you recall how.
Actually it all happens in the draftGui toolbar. At the begining of the file you'll see a special QLineEdit widget which emits a special signal in case Escape is pressed. That signal is bound to a function that calls the "finish" function of the active tool. Since all Draft command use at least one lineEdit widget, it was simple. Maybe the plane select tool can display something during selection, so we can use the same method...
cline
Posts: 56
Joined: Tue Dec 29, 2009 11:43 pm

Re: Draft workbench working plane

Post by cline »

Thanks, I added a new input box, but used the draftGui tools so escape is forwarded to SelectPlane's action method. The code to handle escape turned out two be two lines: one that tests if arg is an escape keypress, anfd the other to call finish. The change is checked in.
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft workbench working plane

Post by yorik »

Okay your new UI works fine!
What would you think, besides the XY, XZ and YZ buttons, to have a "View" that would pick a plane passing through (0,0) and perpendicular to the camera axis? I think that way we can forget completely about the old behaviour, and I can also remove the Z-lock button which is becoming useless...
I find that way cool when you can actually obtain simplification. Well done!

About the Escape thing, it seems to me it doesn't work perfectly, probably because the inputbox needs to be focused to emit the signal... Of course in this tool it doesn't make sense to refocus it constantly... There must be a workaround somewhere, though. I wonder if it still would emit signals if it was hidden...
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft workbench working plane

Post by yorik »

yorikvanhavre wrote:What would you think, besides the XY, XZ and YZ buttons, to have a "View" that would pick a plane passing through (0,0) and perpendicular to the camera axis?
I just implemented it actually, if it's ok for you.
I'm thinking the lock-Z button still has its utility, when you work only in 2D in XY plane, and enter coordinates with the keyboard, it goes faster (you don't need to enter the Z coordinate). That could be automatic too, but it might be convenient to keep it that way, I don't know...
cline
Posts: 56
Joined: Tue Dec 29, 2009 11:43 pm

Re: Draft workbench working plane

Post by cline »

yorikvanhavre wrote: I just implemented it actually, if it's ok for you.
You beat me to checkin. I also added a "None" button that removes the working plane which enables the old behavior, but it is not working properly at the moment. I should have a new version to check in this morning.

Ken
cline
Posts: 56
Joined: Tue Dec 29, 2009 11:43 pm

Re: Draft workbench working plane

Post by cline »

OK, the "none" button has been checked in. It takes some care to get this right in the face of changing views, and it needs more testing.

The only real bug I am aware of has to do with the offset button, whose value is sometimes ignored. For the moment, you have to hit return while using it, which is far from intuitive.

Yorik - sorry if I changed the geometry or labels of pushbuttons. This is not intentional, but I got confused by our overlapping edits. Feel free to adjust the look as you see fit.

Ken
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft workbench working plane

Post by yorik »

This is great, I'm getting a big fan of that WorkingPlane.
I made an entry on the wiki, change it if you see mistakes...
I'm thinking to another cool use we might do of that tool: in the context menu. You select a face, then, right click -> set as working plane...
Post Reply