Merged [PR #3963] Sketcher: Changes to drawing of constraint icons.

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
wmayer
Founder
Posts: 18819
Joined: Thu Feb 19, 2009 10:32 am

Re: Merged [PR #3963] Sketcher: Changes to drawing of constraint icons.

Post by wmayer »

The SoImage class inherits from SoShape and re-implements the virtual method rayPick.
https://grey.colorado.edu/coin3d/classS ... ea24bb6dba
So, changing the pick radius should also affect the image selection.
Perhaps this solves an issue, of which I'm not sure if it exists on MacOS only - or while working on it you may have look?: When two constraints are placed at he "same" position, none of them is selectable with the mouse.
I attach such a file, I cannot select point-on-object nor the orthogonal constraint.
I am able to select them but doing this is in the 3D view is very tricky. You have to hover over the icon to see it highlighted in a certain mouse position and then it's selectable.

The easier way is to simply select them on the left side in the Constraints panel.
Also, when constraint icons are merged into a single icon, Coin is only responsible for selecting the merged icon, it can't select individual constraints
With your T-sketch I wasn't able to select the perpendicular constraint icon on top of the point-on-curve constraint (on a weird mouse position). But I was able to select the latter and also the perpendicular icon on top of the vertical constraint icon could be selected which automatically selects its sibling.

And as said above all three icons can be easily selected inside the Constraints panel.
Bei3lay
Posts: 34
Joined: Wed Aug 28, 2019 6:48 am

Re: Merged [PR #3963] Sketcher: Changes to drawing of constraint icons.

Post by Bei3lay »

wmayer wrote: Thu Oct 15, 2020 5:19 pm The SoImage class inherits from SoShape and re-implements the virtual method rayPick.
https://grey.colorado.edu/coin3d/classS ... ea24bb6dba
So, changing the pick radius should also affect the image selection.
I basically just started working with Coin, and I know very little about it. My assumption that there is no pick radius with images is based on the information from The Inventor Mentor book http://www-evasion.imag.fr/Membres/Fran ... #id5477068.
To make it easier to pick lines and points, the ray can be augmented to be a cone (for a perspective camera; see Figure 9-6) or a cylinder (for an orthographic camera). Use the setRadius() method to control the size of this cone or cylinder where it intersects the near plane of the camera. (The default radius is 5 pixels.) Things that are picked must fall within this cone (or cylinder), as follows:
* For points and lines, if any part of the shape falls within this cone, it is picked. (A sphere drawn with LINES draw-style is still picked as a solid sphere.)
* For all other shapes, the ray itself must intersect the shape for it to be picked.
But there is no mention of SoImage anywhere in the book. Maybe it was added later to the Open Inventor API, in which case it is possible that its selection is done differently then described.
wmayer
Founder
Posts: 18819
Joined: Thu Feb 19, 2009 10:32 am

Re: Merged [PR #3963] Sketcher: Changes to drawing of constraint icons.

Post by wmayer »

According to the code it indeed doesn't use the radius for the image picking:
https://github.com/coin3d/coin/blob/mas ... e.cpp#L530
https://github.com/coin3d/coin/blob/mas ... n.cpp#L603
Post Reply