I need to make faces of a shape have different attributes (color, transparency, ...). I achieved this by creating a custom Interactive Object class that inherits from AIS_Shape. In the Compute method I explore the shape and assign every face a different drawer before adding it. It was either that or displaying all its faces as different Interactive Objects.
I added an extra display mode to my custom Interactive Object that uses the same attributes, except for the transparency value (which is higher, making it translucent).
I open a local context and use it to select faces. What I want to achieve is that the whole object use the new display mode (AIS_InteractiveContext::SetDisplayMode doesn't seem to work in Local Context), but, when the mouse is on top of a face, the face is drawn opaque instead of having its wire drawn in another color and thicker line (default behavior). In other words: I want the hilighted face to be opaque while the other faces are translucent.
Recomputing the presentation works, but it's too slow. Adding a new AIS_Shape with the hilighted face as shape works too, but it's also too slow. SetHilightMode doesn't seem to do what I want.
Is there any mechanism I could use here to speed up the process?
I also take the opportunity to ask: what's the best way to change the Display Mode in Local Context?