[Resolved] PR #4942 new option to show/hide sketcher constraints

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Locked
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

Do as Gene says and it should work. Select "All", check the checkbox, select "Geometric" in the filter. Datums should be gone.

I might need to add an update on activation of the checkbox to track filter. This might be an improvement of those that testing provides.

I do not know why "track filter selection" is unclear. It makes the visibility track the selection of the filter.

Alternatively, you might select "All" in the filter and hit the button "Show All". Then select Datum. Then, hit the button "Hide All".

Let me know if you do not manage to make it work.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by uwestoehr »

GeneFC wrote: Wed Sep 22, 2021 11:59 pm As I said yesterday, the track filter selection works perfectly. Your screencast shows you are not using it.
...
If you click only "All" as your screencast shows then it will appear that nothing happens.
But as you can see in my screencast, I selected "Datums" but then the Track option has no effect, nothing changes visibly.

I think it is still unclear what I need:
- I am discussing the sketch with colleagues, so I start with the normal sketch view (everything is shown)
A. now I want to hide only the dimensions, everything else should still be shown
B. later I want to show the hidden dimensions again, so to get the initial sketch view back

As user I look for something labeled "Hide". It is not clear to me why I need to "track" something. So the wording is not self-explanatory.

However, so what do I do to achieve step A. of my goals?:
1. I select in the combobox "Datums" (since I want to do something with all datums)
2. I use the Track option
-> nothing happens
3. I uncheck the Track option
-> nothing happens
4. I select "All" in the combobox (to go back to the initial view)
5. I check the Track option
6. I select in the combobox "Datums"
-> now the option does something, but everything is hidden, only the datums are visible. But I need the opposite, everything should be shown, the datums should be hidden.

Maybe I am too untalented. What do I have to do to achieve my goal?
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: PR #4942 new option to show/hide sketcher constraints

Post by GeneFC »

uwestoehr wrote: Thu Sep 23, 2021 4:59 pm A. now I want to hide only the dimensions, everything else should still be shown
Ok, I do not see a way to do that.

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

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

uwestoehr wrote: Thu Sep 23, 2021 4:59 pm
GeneFC wrote: Wed Sep 22, 2021 11:59 pm As I said yesterday, the track filter selection works perfectly. Your screencast shows you are not using it.
...
If you click only "All" as your screencast shows then it will appear that nothing happens.
But as you can see in my screencast, I selected "Datums" but then the Track option has no effect, nothing changes visibly.

I think it is still unclear what I need:
- I am discussing the sketch with colleagues, so I start with the normal sketch view (everything is shown)
A. now I want to hide only the dimensions, everything else should still be shown
B. later I want to show the hidden dimensions again, so to get the initial sketch view back

As user I look for something labeled "Hide". It is not clear to me why I need to "track" something. So the wording is not self-explanatory.

However, so what do I do to achieve step A. of my goals?:
1. I select in the combobox "Datums" (since I want to do something with all datums)
2. I use the Track option
-> nothing happens
3. I uncheck the Track option
-> nothing happens
4. I select "All" in the combobox (to go back to the initial view)
5. I check the Track option
6. I select in the combobox "Datums"
-> now the option does something, but everything is hidden, only the datums are visible. But I need the opposite, everything should be shown, the datums should be hidden.

Maybe I am too untalented. What do I have to do to achieve my goal?
You are very talented. No doubt there. You discovered a bug with the tracking filter checkbox. I will fix that later.

Alternative one, with auto-tracking (lowest amount of clicks, it is missing an initial refresh on clicking the button, I will add it later today):
Peek 24-09-2021 07-11.gif
Peek 24-09-2021 07-11.gif (172.99 KiB) Viewed 2563 times
Geometric = All - Datum

Alternative two, with the hide/show buttons (hide everything with filter in All, show everything with filter in Geometric):
Peek 24-09-2021 07-13.gif
Peek 24-09-2021 07-13.gif (173.62 KiB) Viewed 2563 times
Alternative three, with hide/show (show everything in all, hide all in datum):
Peek 24-09-2021 07-17.gif
Peek 24-09-2021 07-17.gif (141.85 KiB) Viewed 2563 times
Let me know if this helps.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

I have just committed to master the fix so that the view is updated on checking the "track filter selection" checkbox.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by uwestoehr »

GeneFC wrote: Thu Sep 23, 2021 5:42 pm Ok, I do not see a way to do that.
OK, abdullah, can you please have a look at my initial comment to see what I only need:

- selecting an annotation type in the combobox
- an action what should be done with the selected type (hidden or shown) that is performed immediately.

Nothing else, no tracking or fancy stuff, just to hide the annotation element type I selected and a way to re-show it afterwards (toggle hide/show). So that one can discuss sketches live with colleagues and to keep the overview or focus on certain points by hiding stuff that is not necessary for the current discussion state.

Please same the action UI element (can be an option or button "hide/show" that it is self-explanatory, that this option will hide something.

Edit:
I put my PR into master to test it again and from the UI point of view, this was already what is necessary:
- the option to hide/show the filtered element was in the View tab since it is a view action
- one could filter a desired annotation type and then hide/show it

Now I cannot hide a desired annotation type. I have anew Automation tab which is not self-explanatory since nothing should be automated. Then thee is a tracking option that is also not self-explanatory. One can also not toggle the view of the selected annotation type. So none of the features of my PR are in. :cry:
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

uwestoehr wrote: Fri Sep 24, 2021 4:34 pm OK, abdullah, can you please have a look at my initial comment to see what I only need:

- selecting an annotation type in the combobox
- an action what should be done with the selected type (hidden or shown) that is performed immediately.

Nothing else, no tracking or fancy stuff, just to hide the annotation element type I selected and a way to re-show it afterwards (toggle hide/show). So that one can discuss sketches live with colleagues and to keep the overview or focus on certain points by hiding stuff that is not necessary for the current discussion state.

Please same the action UI element (can be an option or button "hide/show" that it is self-explanatory, that this option will hide something.
I think we are misunderstanding each other.

I do not really understand which functionality was in the original PR that is not in master now. I am going to explain what I see. Maybe you can tell me what I am not seeing.

I have compiled your branch again. Aside from the problems with the checkbox controlling the checkbox, the checkbox has been substituted with two buttons (Hide All / Show All).

This is your branch:
Peek 24-09-2021 23-33.gif
Peek 24-09-2021 23-33.gif (114.56 KiB) Viewed 2339 times
You click the checkbox "checked"/"unchecked".

Please compare this with the animated gif of the "Alternative 3" in my previous post. There you push the button "Hide All" to hide all the listed constraints, you push the button "Show All" to show all the listed constraints.

If you see a difference in functionality, please try to explain what exactly the difference is. Maybe I am just to tired and I do not see something obvious.
uwestoehr wrote: Fri Sep 24, 2021 4:34 pm Edit:
I put my PR into master to test it again and from the UI point of view, this was already what is necessary:
- the option to hide/show the filtered element was in the View tab since it is a view action
- one could filter a desired annotation type and then hide/show it
The checkbox was in the constraint widget. The buttons that, as far as I see, match your functionality, are in the constraint widget too.

The buttons seem to work exactly as your checkbox. The only difference being that the checkbox has been converted into two buttons.
uwestoehr wrote: Fri Sep 24, 2021 4:34 pm Now I cannot hide a desired annotation type.
Why can't you? If you want to show/hide the datums (one of your examples) and you are with the filter in "All" with all the constraints shown, you select "Datum" in the filter and hit "Hide All". The Datums are gone. If you hit "Show All", the Datums are back.
uwestoehr wrote: Fri Sep 24, 2021 4:34 pm I have anew Automation tab which is not self-explanatory since nothing should be automated.
It has not been easy to come with short names for the tabs. If you have a better name for that tab, let me know. I can explain why I came to that name. The checkboxes "control" the list (limit the content, per element or the number of elements), thus the name "List" (this do not relate to visibility, but to the actual list). The buttons "Hide All" / "Show All" control the Visibility, View was shorter. The tracking option performs a visibility control automatically based on the filter selection, thus the name "Automation".

Maybe there is some confusion in that several functions have been merged simultaneously. You do not need to use the Automation tab if you do not want this feature. The "Hide All", "Show All" buttons work totally independently from the tracking option.

I thought of putting the buttons together with the tracking option (in the same tab). However, I need the space under the tracking option for layer automation (when geometry layers become a reality) and I did not want to make three rows per tab, as this would make the constraint list shorter.

You may well not feel the need of the tracking functionality. I think the tracking functionality is very nice when you are investigating a sketch and want to focus in different groups of constraints one after the other. This avoids the clicks associated with having to click the "Show All"/"Hide All" button after changing the filter.

I still do not understand how the tracking functionality is not the best match for your use case (as per the first animated gif in my previous post). It basically enables to change the visibility by just selecting the "set" you want to see in the filter. This, in my view, best matches the use case of showing a customer or colleague first the geometric constraints, then the datum constraints, then all of them. But, of course, if you do not like it for whatever reason, just pretend is not there and use the buttons.
uwestoehr wrote: Fri Sep 24, 2021 4:34 pm Then thee is a tracking option that is also not self-explanatory.
I do think it is rather self-explanatory. I am open to alternative names. It is an option where the visibility of the constraints in the 3D view tracks whatever selection you have on the filter. If you change the filter, the visibility of the constraints in the 3D view changes to match the selection of the filter. Ergo the visibility tracks the filter selection. In other words, change the filter and the visibility will change to match your selection.
uwestoehr wrote: Fri Sep 24, 2021 4:34 pm One can also not toggle the view of the selected annotation type.
If by toggling you mean showing/hiding what you have selected on the filter (and you do not want to change the filter itself), then do not use the tracking functionality. Just use the buttons. The tracking option works best by selecting directly on the filter what you want to see (so if you do not want to see the datums, but want to see the rest of the constraints, this is "Geometric", if you want to see the datums only "Datum", if you want to see all "All").

If by toggling you mean getting shown what was hidden, and getting hidden what was shown. This can only be done with the "Switch virtual space" command in the toolbar. This was not part of your PR either.
uwestoehr wrote: Fri Sep 24, 2021 4:34 pm So none of the features of my PR are in. :cry:
I do not understand what is not there, save for the checkbox having morphed into two buttons.

Please read carefully this post and let me know.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by uwestoehr »

abdullah wrote: Fri Sep 24, 2021 10:15 pm I think we are misunderstanding each other.
Indeed. As I wrote I was compiling your branch when you merged to master. So since that time I use FC master. With a fresh recompiled Sketcher WB I see this UI:
FreeCAD_nVhkOTbATm.png
FreeCAD_nVhkOTbATm.png (12.93 KiB) Viewed 2278 times

So I don't see what you posted. Is there a pending PR or branch I need to compile to see the same as you?
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by chennes »

uwestoehr wrote: Sat Sep 25, 2021 2:12 am With a fresh recompiled Sketcher WB I see this UI:
[...]
So I don't see what you posted.
Is that not exactly the UI that Abdullah demonstrates above? I mean, he's got a different theme obviously, but otherwise I see that same interface, and am able to follow along exactly with the demonstrations in this post.

(@abdullah, this is superb, this makes my sketches with tons of constraints so much more usable! Thanks for adding!)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: PR #4942 new option to show/hide sketcher constraints

Post by wsteffe »

I can not directly check the PR because I don't have a master built.
Nevertheless, looking at your screenshots I would way the following

1) In my opinion the buttons "Show All" and "Hide All" should be renamed "Show" and "Hide"
If I have understood well they are not showing/hiding All but just the current filter selection (unless this is All).

2) As uwestoehr, I also do not understand the purpose of the automation button.

[quote=abdullah post_id=535704 time=1632521755 user_id=3232
The tracking option performs a visibility control automatically based on the filter selection, thus the name "Automation".
[/quote]

But what kind of visibility control is "automatically" done with this selection ? Does it hide or does it show ?
I presume that it just let you toggle the visibility state (hides if it is currently shown and shows if it t is currently hidden) with a filter selection. If it works in this way it would be better to name it "switching hide/show".
Locked