Better selection system for constraints in Sketcher

A subforum for research and development of the user interface of FreeCAD

Moderator: agryson

jnxd
Posts: 115
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Wed Jan 25, 2017 4:19 am

NormandC wrote:I just noticed it as well. Sorry but for me it severely reduces this mode's usefulness. I hope it was unintended and that you'll be able to fix it.


Unintentional, yes, but I really have to figure out a lot of things before I can implement this at all! My initial thought process did not have box selection at all and now I have to somehow shoehorn it in.
jnxd
Posts: 115
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Wed Jan 25, 2017 4:58 pm

So some bad news about the implementation of box select while in constraint creation mode. Using the mode requires setting of "DrawSketchHandler" objects in the ViewProvider to handle the mousepress, keypress etc events. Unfortunately there's an enum in ViewProviderSketch that can either be set to accept DrawSketchHandler, or can be set to make the box/rubberband selections, implying that as it stands, either the constraint creation mode can be active or the box selection mode!

I'll try to bypass this by implementing box selection myself, but just wanted to know if it'd be a better idea to move the handler enum value to a bool and allow coexistence of DrawSketchHandler and rubberband select, or will doing so open a can of worms for the other places DrawSketchHandler is used.
User avatar
NormandC
Posts: 12077
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Better selection system for constraints in Sketcher

Postby NormandC » Thu Jan 26, 2017 2:47 am

That's OK, no pressure! We can still use box selection with the original selection mode.

As for your technical questions, sorry I can't help, end user only here...
DeepSOIC
Posts: 4504
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Better selection system for constraints in Sketcher

Postby DeepSOIC » Thu Jan 26, 2017 10:42 pm

I want old behavior back. Most of the time, I apply my constraints in more-or-less random order. I apply a coincident constraint, with preselection or not, and now I have to additionally press esc before doing anything else (which is an extra "click", and I often forget about it).

I want the constraint not to remain in continue mode if I applied it with pre-selection. Please! :roll: That doesn't hurt the continue mode.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9680 (Git)
Build type: Release
Branch: master
Hash: 370d4f582b8aa86b47f8155aa93e91b3bdee8746
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
jnxd
Posts: 115
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Fri Jan 27, 2017 4:37 am

DeepSOIC wrote:I want old behavior back. Most of the time, I apply my constraints in more-or-less random order. I apply a coincident constraint, with preselection or not, and now I have to additionally press esc before doing anything else (which is an extra "click", and I often forget about it).


I figured it'd be an issue with people so some recent commits in my branch have changed the functionality accordingly. Didn't issue a PR since things are a bit incomplete right now. Sorry for the inconvenience.
DeepSOIC
Posts: 4504
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Better selection system for constraints in Sketcher

Postby DeepSOIC » Fri Jan 27, 2017 9:03 am

jnxd wrote:so some recent commits in my branch have changed the functionality accordingly.
Good news, thanks!
to-the-nth
Posts: 11
Joined: Sun Oct 05, 2014 6:53 am

Re: Better selection system for constraints in Sketcher

Postby to-the-nth » Sun Jan 29, 2017 5:47 pm

jndx - thanks for reverting!

Revert Still hasn't made it into the latest build: :cry:

For me, another part of the use model is to only connect points that are relatively close together to give the constraint solver a good starting point. If the points start to become too distant, the solver becomes more creative and converges on undesired and unexpected solutions. (At least Ctrl^z works most of the time.) So often I do a pre-move on points to get them close before applying a window selected coincident constraint. Sometimes I capture 4 o5 5 points in a window at once.

Now this may start to break things, but it would be interesting to do a window capture and have coincident constraint operate on only on points with in the argument list, and ignore other entities. Specifically, if an entire circle and its center are selected, just ignore the circle since it doesn't have a point and only process the center point. Sometimes I'll have many concentric circles; some of which are tiny; and it would be nice to just grab the whole lot without have to select individual centers.



OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9826 (Git)
Build type: Release
Branch: master
Hash: 33a3c5fcf09bb0f0bf43857024a8994e6c41e43d
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
to-the-nth
Posts: 11
Joined: Sun Oct 05, 2014 6:53 am

Re: Better selection system for constraints in Sketcher

Postby to-the-nth » Sun Jan 29, 2017 7:12 pm

Hi jndx.

I am reverting to build 9564. The latest build 9826 has sticky modes on vert/horz in constraints as well. This just doesn't work for me.

I really think there needs to be a option in preferences to enable this sticky mode stuff. Probably default is disabled for compatibility, and until what ever the sticky mode stuff ends up being gets worked out. I for one think the existing interface is just fine without sticky stuff.

Looking forward to reverting trunk back to the old behavior. Thanks.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9564 (Git)
Build type: Release
Branch: master
Hash: 40aafe745230afd27bbbbd87f5c3247708211e02
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
to-the-nth
Posts: 11
Joined: Sun Oct 05, 2014 6:53 am

Re: Better selection system for constraints in Sketcher

Postby to-the-nth » Sun Jan 29, 2017 7:38 pm

Another thought is to create a sticky version of each of the constraint commands and map them into a shifted hot key.

So lower case h,v,c for non-sticky and H,V,C for sticky?

*Sometimes* when applying H and V constraints, it would be nice to have them be sticky - like constraining a new polyline. The Shift keypress modifier is not that much extra overhead because you'd be saving many future keystrokes.

Also clicking on white space doesn't seem to exit the sticky command.

It would be nice to clean up other key mappings. I don't use Shift+O (Fix Point to an Object) because I'd have to take my hand off the mouse to hit the shift key, but use the Icon instead. There's probably a keymap table somewhere, (I don't know if "o" is mapped to anything), but it would be nice if the default was just "o".
jnxd
Posts: 115
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Mon Jan 30, 2017 4:47 am

Hi to-the-nth,

It's jnxd, BTW.

Can you compile and test my stuff on the constraintselect branch? I have made it such that if a selection is already made before the command is called, it just does its job and goes away without sticking.

By window selected constraint, do you mean box/rubberband selection, where you press the LMB and drag the mouse along the scene without releasing it? In that case let me see what I can do. There is already a request for rubberband selection, but there are technical difficulties to sort out before I can implement it. I'm not really sure how useful it'll be for every constraint, though. For coincident and fixed, the use is very much justified. But for parallel, H/V, there is no way to select only alternative edges to let it all make sense.

I haven't yet figured out how to put up preferences, but I guess it's best to implement it ASAP or there will be a lot more complaints.

There seems to be a method to make polylines such that every new segment is perpendicular to the previous one, toggled using a much unintuitive and unadvertized "m" shortcut. Perhaps there should be a separate icon for such a polyline.

Left click in the "sticky" mode removes older selections. Right click exits.

IMHO, shifted hot keys will create quite some confusion, especially since shifted keys are already used so widely. Let's put this up to the rest of the community to judge before taking any action?