opencascade

OpenCascade: highlightion and selection styles don't work properly for edges/wires and points


OpenCascade: highlightion and selection styles don't work properly for edges/wires and points, they are highlighted/selected by default color (Quantity_NOC_BLUE/Quantity_NOC_GRAY) For faces and solids everything works correctly. What advise to do? Thanks in advance.

I use this code.

Handle(Prs3d_Drawer) highlightStyle = new Prs3d_Drawer();
HighlightStyle->SetColor(Quantity_NOC_YELLOW);
m_Context->SetSelectionStyle(highlightStyle);
m_Context->SetHighlightStyle(highlightStyle);

Solution

  • I don't know if this is the case here, but if you're trying to highlight subshapes..

    SetSelectionStyle(highlightStyle) is a shortcut for calling SetHighlightStyle(Prs3d_TypeOfHighlight_Selected, highlightStyle)

    SetHighlightStyle(highlightStyle) is shortcut for calling SetHighlightStyle(Prs3d_TypeOfHighlight_Dynamic, highlightStyle).

    As per the docs @ https://dev.opencascade.org/doc/refman/html/_prs3d___type_of_highlight_8hxx.html

    we have 4 interesting values:

    Therefore if you're trying to change the appearance of subshapes in objects, you need to call

    Handle(Prs3d_Drawer) highlightStyle = new Prs3d_Drawer();
    HighlightStyle->SetColor(Quantity_NOC_YELLOW);
    m_Context->SetHighlightStyle(Prs3d_TypeOfHighlight_LocalSelected, highlightStyle);
    m_Context->SetHighlightStyle(Prs3d_TypeOfHighlight_LocalDynamic, highlightStyle);