display: how to hide a solid within an AISColored shape made of a composite solid

Hello forum,
I would like to hide a solid within an AIS_ColoredShape build with a TopoDS_CompSolid.
After the solid subshape has made hidden, I would like to make it unselectable.

As explained in this old post:

https://dev.opencascade.org/content/display-how-hide-face-within-aiscolo...

, and in the OpenCascade documentation, it is possible to hide a face of an AIS_ColoredShape
acting on an AIS_ColoredDrawer; the face made hidden is made unselectable by calling
AIS_ColoredShape::Redisplay, which recomputes (also) the selection presentation.

I followed this strategy on the solid subshape of the composite solid:
1) set the custom drawer of the solid hidden
2) call redisplay

When moving the mouse the hidden solid is highlighted and the hidden solid
can be selected.
Any idea?
Giovanni

gkv311 n's picture

This is just a bug in AIS_ColoredShape, which doesn't distingush the same Face shared between hidden and visible Solids (because when both are visible - it is impossible to distinguish them).

So, the solution is either to fix bug in OCCT or to avoid displaying such Solids (by creating temporary copies, for instance).

Giovanni Bettega's picture

yes probably the modification should be done in the recursive AIS_ColoredShape::computeSubshapeSelection(...)
by overriding thhe protected computeSelection and defining a new computeSubshapeSelection_1.
I'll try ciao grazie Giovanni