Face boundary aspect with v7.4.0

Hello,

    With versions prior to v7.4.0 face boundary aspects used to be black. From v7.4.0 by default it's white(or light gray) and I can't change the color.

    I tried to call :

aisObject->Attributes()->FaceBoundaryAspect()->SetColor(Quantity_NOC_BLACK);

    without success, "aisObject" being of type Handle_XCAFPrs_AISObject

    How this face boundary color can be changed ?

 

Kirill Gavrilov's picture

XCAFPrs_AISObject inherits AIS_ColoredShape, which defines a map of sub-shape attributes, so that overriding a global Prs3d_Drawer attributes is not enough for changing attributes of sub-shapes (result will depend on calls order).
In addition, AIS_ColoredShape contains a code optimizing attributes allocations (they are shared by smart pointer):

AIS_ColoredShape::AIS_ColoredShape (const TopoDS_Shape& theShape) : AIS_Shape (theShape)
{
  // disable dedicated line aspects
  myDrawer->SetFaceBoundaryAspect  (myDrawer->LineAspect());

This means that face boundary and line aspects are shared by default.
To overcome this limitation, you should either sub-class the object and override the logic (or setup external aspects reasonably) or consider patching OCCT to improve general logic (by yourself or by contacting Open Cascade support).