Element widget for Sketcher WB

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Element widget for Sketcher WB

Post by bejant »

jmaustpc wrote:Today Bejant and I found your tool a great help
Yes, and I think this will be a huge help for everyone!

It reminded me, why is the symbol for a point shown as X? Is this one of the icons that will be changed or could the X have another meaning of which I'm unaware?
Image
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Element widget for Sketcher WB

Post by wmayer »

It reminded me, why is the symbol for a point shown as X? Is this one of the icons that will be changed or could the X have another meaning of which I'm unaware?
Look what you have set as "Type": Edge That's why points are not allowed to be selected in the elements view. When pressing "z" several times until the type changes to Starting point you can select it and the icon changes, too.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Element widget for Sketcher WB

Post by abdullah »

It reminded me, why is the symbol for a point shown as X? Is this one of the icons that will be changed or could the X have another meaning of which I'm unaware?
In tomorrow's version try to uncheck the "auto-switch to edge", the droplist should enable and you can play with selecting the type from the droplist. The function of that checkbox is that when you change the object hovered with the mouse, the type automatically changes to edge. Without it, you can actually select starting point or endpoint and identify by hovering the mouse the starting/end point of any element hovered..

I am still thinking about that checkbox, and probably it would make sense to put an option in the sketcher preferences, so that each user can decide if he wants it by default enabled or disabled... let me know what you think...
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Element widget for Sketcher WB

Post by wmayer »

I am still thinking about that checkbox, and probably it would make sense to put an option in the sketcher preferences, so that each user can decide if he wants it by default enabled or disabled... let me know what you think...
Instead of having this somewhere in the preferences dialog you can implement this directly in the elements widget. On creation time of the element widgets you can read a boolean value from the parameters and on destruction time write the current status back. So, when using the elements widget the next time it shows the previously set status.

Code: Select all

TaskSketcherElements::TaskSketcherElements()
{
...
    ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/Elements");
    ui->autoSwitchBox->setChecked(hGrp->GetBool("Auto-switch to edge", true));
}

TaskSketcherElements::~TaskSketcherElements()
{
    ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/Elements");
    hGrp->SetBool("Auto-switch to edge", ui->autoSwitchBox->isChecked());
}
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Element widget for Sketcher WB

Post by abdullah »

Werner, you are just great! That is wonderful solution (that no chance I could have think of, I did not know that it was possible to store application info of a widget like that)!!

I am going to implement it in a new branch. Check it. And it will go in the next pull request, cos it is just great!
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Element widget for Sketcher WB

Post by abdullah »

It is implemented in branch: sketcher_element_widget_improvements1 and pull request has been filed.
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Re: [Merged]Pull request of Element Widget in Sketcher

Post by nahshon »

Moderator edit: this post has been move from elsewhere, to this topic

Hello,
@Abdullah,

Related to TaskSketcherElements:

Please fix spelling of "Symetric" => "Symmetric".

Also, there is a problem with selection.
For point elements it's only relevant to select the first vertex! I suggest to ignore "Auto switch to edge".
For other elements do not allow selecting a vertex that is not relevant for the element type. (disable in them the pull-down menu?)

Thanks,
-- Itai
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [Merged]Pull request of Element Widget in Sketcher

Post by abdullah »

Moderator edit: this post has been move from elsewhere, to this topic

Ok nahshon. Thanks for reporting this!! I will definitely look into it.

Could any moderator please move this two last posts to this thread: viewtopic.php?f=10&t=6861&p=58985&hilit=widget#p58985 to continue the discussion there. I prefer to keep all the problems with the Element Widget either there or in a new thread (preferably there).

Thanks!
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Element widget for Sketcher WB

Post by abdullah »

Please fix spelling of "Symetric" => "Symmetric".
Ok! done! (in my branch...)

I am not sure that I follow you...
For point elements it's only relevant to select the first vertex! I suggest to ignore "Auto switch to edge".
Yes, for points it only makes sense to select the first vertex. I agree. The "Type" applies to all elements in the list. I can not ignore the type just for some elements, or have some elements in type "Edge" and others in type "First Point". The type applying to all of them, can be changed by pressing "z".

Auto-switch to edge just forces to go to edge on hovering a new element, the only thing I could imagine is that, if "Auto switch to edge" is selected, and the element being entered is a point, going to First Point instead of to edge (Point is the only geometry supported that does not have an edge, at least from the user point of view). Do you mean that?
For other elements do not allow selecting a vertex that is not relevant for the element type. (disable in them the pull-down menu?)
This is never allow (due the socalled fast-forward functionality). if I press "z" in a circle it jumps from edge to center point (does not allow to select first point).

If you refer to the specific case of having Auto-switch to edge disabled and using the droplist to select the element. This is a user choice, I can not do anything sensible to prevent it (if I would change his selection because it is invalid, the user will still get frustrated with the software because it fails to do what he demanded).

Let me know what you think. You can put an example for an specific case if you want to... ;)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Element widget for Sketcher WB

Post by abdullah »

Ok, I considered what I think you are asking. So I implemented in the branch below:
- When in auto-switch to edge mode, actually auto-switch to edge for everything except for a point geometry.
If you enter a point geometry, you auto-switch to First Point, allowing to directly operate on the point.
- Typo correction.

Please, give it a try and let me know if you like the feature, if it works as you expected or if you think of any further improvement...

To https://github.com/abdullahtahiriyo/Fre ... master.git
* [new branch] sketcher_element_widget_fixes -> sketcher_element_widget_fixes
Post Reply