Request for comments - constraint highlighting

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.
nahshon
Posts: 184
Joined: Wed Jul 24, 2013 8:06 pm

Request for comments - constraint highlighting

Post by nahshon » Mon Sep 09, 2013 7:19 am

https://github.com/itain/FreeCAD/tree/h ... onstraints
Branch: hilight_constraints

Asking for both technical and usability comments.

Changed files:
src/Mod/Sketcher/Gui/TaskSketcherConstrains.h
src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp

Items in the sketcher constraint list are marked, based on selected geometric object in the sketch.

If a single item is selected mark all the constraints that are directly referencing this item.
If two or more items are selected, mark those constraints that directly reference at least two selected items (select two items to see how they are related!).

This version ignores main axes, external edges and the root point when they are selected. Should be easy to add them.

I'm managing own selection lists. This is done also in ViewProviderSketch.cpp (and possibly other places). I do not know if there is a way (and is it at all advisable) to share objects between TaskSketcherConstrains and ViewProviderSketch.

Thanks!
-- Itai

nahshon
Posts: 184
Joined: Wed Jul 24, 2013 8:06 pm

Re: Request for comments - constraint highlighting

Post by nahshon » Sun Sep 22, 2013 11:38 am

Almost two weeks and 0 responses! What am I doing wrong?

Since my previous post I have added support for main axes, external edges root point, and also merged in the master branch several times.
I find this new feature useful.

Usage (set the filter to All to see the full list of constraints):
Select a single sketch object (line, arc, circle) to see the constraints that are related to that object.
Select a single vertex (line-end, point, etc) to see the constraints that are related to that vertex.
Select multiple items to see the constraints that are related to two or more items in the selected group.

To find the constraint that affects two connected line ends, it is easiest to use the box-selection tool on the area that contains the connected vertices.

xat80
Posts: 12
Joined: Sat Jul 06, 2013 12:28 pm

Re: Request for comments - constraint highlighting

Post by xat80 » Sun Sep 22, 2013 3:17 pm

Hi, I am not a freecad maintainer so you might want to catch one on IRC to get a review if none responds here.

I did not try your code yet but from reading the diff, if I understand well, this works by modifying the behavior of the "All" filter by automatically highlight the constrains related to the selection. I find this a bit strange; my advise, for what it's worth, would be to add a filter "Follow Selection". I also have the sensation that it would simplify the code.

xat80
Posts: 12
Joined: Sat Jul 06, 2013 12:28 pm

Re: Request for comments - constraint highlighting

Post by xat80 » Sun Sep 22, 2013 3:21 pm

Sorry for the double post but i forgot to mention: If you want your code to be reviewed for trunk integration, you might want to post in the "Pull Request" section of the forum.

User avatar
yorik
Site Admin
Posts: 11371
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Request for comments - constraint highlighting

Post by yorik » Sun Sep 22, 2013 4:16 pm

Hi,
Sorry nobody replied, but it's very easy to miss posts with phpbb forums (in fact I hadn't seen it)... You might try to send a private message to one of the sketcher developers like logari81. As xat80 said, there is a special section for that in this forum too, and there is also a "pull request" feature on the bug tracker, which I suggest you to use, so you don't risk to see your request lost in the void. I won't guarantee you that it will be accepted, though. As a general rule, you're always advised to discuss your ideas first, to see what others think of it, before implementing them...

logari81
Posts: 654
Joined: Mon Jun 14, 2010 6:00 pm

Re: Request for comments - constraint highlighting

Post by logari81 » Sun Sep 22, 2013 4:16 pm

nahshon wrote:Almost two weeks and 0 responses! What am I doing wrong?
show screenshots or screencasts!

Btw. why should constraints be selected when you select edges? This complicates things with selection. I would just add a point "Info" to the right-click pop-up menu or something like this, but I wouldn't mess with users selection.

User avatar
yorik
Site Admin
Posts: 11371
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Request for comments - constraint highlighting

Post by yorik » Sun Sep 22, 2013 4:17 pm

Actually I'll move this post to the "pull requests" section...

nahshon
Posts: 184
Joined: Wed Jul 24, 2013 8:06 pm

Re: Request for comments - constraint highlighting

Post by nahshon » Tue Sep 24, 2013 7:30 pm

Update:
Pass lists of conflicting / redundant constraints into TaskSketcherConstrains. These are colored red in the constraint list.

Always translate Resolved / Unresolved messages.
Paint the Unresolved messages red.

Todo: TaskSketcherMessage must compose the messages rather than accept strings via the slot functions.

nahshon
Posts: 184
Joined: Wed Jul 24, 2013 8:06 pm

Re: Request for comments - constraint highlighting

Post by nahshon » Tue Sep 24, 2013 8:05 pm

For those who replied earlier, After Yorik moved the thread I could not reply for some time. Then My computer was broken for more than a day (a new display adapter fixed it).

@yorikvanhavre: Thanks!

@xat80: I do not change the filter. Only add colors to already filtered items in the constraint list.

@logari81: I do not select constraints (I know its a bad idea. Been there in my very early trials).
Here's a screenshot after my latest changes. It shows only colors in the constraints list. There are also small changes to the sketcher messages area.

Image

-- Itai

PS, How do I cause the image to be seen with the correct size?

nahshon
Posts: 184
Joined: Wed Jul 24, 2013 8:06 pm

Re: Request for comments - constraint highlighting

Post by nahshon » Thu Sep 26, 2013 1:12 pm

Update: new merge from master and apply fix suggested here.

Post Reply