I am loading xml files to be displayed in the screen. The xml defines shapes and colors, so for creating the object, I am using a TopoDS_Compound and an AIS_ColoredShape so each part of the shape can be displayed in a different color. Also, I'm trying to use OCAF for displaying a complex structure and to provide Undo/Redo operations.
The problem I'm facing is the following one:
When creating the object, adding to OCAF and then displaying the tree, it is working fine. Then, If I undo the operation, the object dissapear as it is expected. But finally, when I apply a redo operation, the object is displayed in black. It seems it is missing the colors of the sub_shapes
Also, I have implemented a hide selected/show hidden object operation. If I hide the object it disappears properly, but when I try to show it again (recovering it from a dictionary of <string, AIS_ColoredShapes>) it always is displayed in a unique color, missing the sub_shapes colors information
As I said, the AIS_ColoredShape is already created but the color is missed. Is there something to be done when re-displaying an AIS_ColoredShape that I am missing or has anyone faced a similar problem??
I am using c# .Net 8 and the Open Cascade c# wrapper
This is the code where I recover the info from the dictionary and the OCAF label:
AIS_ColoredShape aisC;
_coloredAisByEntry.TryGetValue(entry, out aisC);
if (aisC != null && !aisC.IsNull())
{
int mode; _ocaf.TryGetDisplayMode(label, out mode);
_ctx.SetDisplayMode(aisC, mode, true);
if (!_ctx.IsDisplayed(aisC))
_ctx.Display(aisC, true);
_ctx.Update(aisC, false);
}
Where _ctx is the AIS_InteractiveContext.
Thank you very much in advance