Cannot change Vertex Color

If an AIS_Shape is made using a 3d Primitive and using TopoDS_Shape, an attempt to the color changes are properly reflected in both wireframe and shading modes. If an Edge or Wire is used to make the AIS_Ahspe, the color change is only applicable in its wireframe mode and if it is created with a Vertex, the color does not change at all.

Another thing is that the color after selection is made is always gray. There are methods to change the hilight color but not the selected color.

Any one came across or dealt with these issues in his/her experience?

Paul Jimenez's picture

Dealing with colors in AIS is something a bit difficult to get right. To do that, you have to specify the colors in the drawer, but there are drawers and colors for many different things. Sometimes it's more like trial and error.

For example, check methods like this in AIS_Drawer/Prs3d_Drawer:

SetUnFreeBoundaryAspect, SetFreeBoundaryAspect, SetShadingAspect, ...

Basically, check everything that says "Aspect" somewhere in its name and play with it.

I haven't tried it myself, but the method to change the color of the selection seems to be AIS_InteractiveContext::SelectionColor(const Quantity_NameOfColor aCol).

Sharjith Naramparambath's picture

The method is pretty confusing and I had assumed it to be the one that gets the color. General OCC way is to have a SetSelectionColor to set and SelectionColor to get.

It worked, thanks!