Color of Compound

Hello everyone,

Firstly I import step file and I read all labels. But when label is solid, I can get the color of label but if label is compound then could not get the color. Why this is not working on compound? For any help I will be appreciated.

TDF_Label referred_label{ label };
Handle_XCAFPrs_AISObject object = new XCAFPrs_AISObject(referred_label);

if (shape().ShapeType() == TopAbs_SOLID) 
{
    Quantity_Color labelColor(0.9725490196, 0.9725490196, 1, Quantity_TOC_RGB);
    colorTool->GetColor(referred_label, XCAFDoc_ColorSurf, labelColor);
    // can get color of label
}
else if (shape().ShapeType() == TopAbs_COMPOUND) 
{
    Quantity_Color labelColor(0.9725490196, 0.9725490196, 1, Quantity_TOC_RGB);
    colorTool->GetColor(referred_label, XCAFDoc_ColorSurf, labelColor);
    // cannot get color of label because this is a compound
}
Dmitrii Pasukhin's picture

There are not connection between type of shape and attributes.

For getting color from the label, the label must have reference to color. https://dev.opencascade.org/doc/overview/html/occt_user_guides__xde.html...

Best regards, Dmitrii.