Transparency of AIS_Trihedron object

Hello everyone,

I use OpenCascade 7.6 for my c# project and I don't know why can't change the transparency of AIS_Trihedron object.

I've tried both methods and nothing's changed. So is there any other opinion to do that?

_gnomon->SetTransparency(_transparency);
_context->SetTransparency(_gnomon, _transparency, false);
gkv311 n's picture

AIS_Trihedron doesn't implement properties like SetTransparency() and SetColor() of base interface of interactive object. Instead, you may configure aspects manually - try digging into properties of Prs3d_DatumAspect:

Handle(AIS_InteractiveContext) theCtx = ...;
Handle(AIS_Trihedron) theTrih = ...;
Handle(Prs3d_Drawer) aDrawer = theTrih->Attributes();
if (!aDrawer->HasOwnDatumAspect())
{
  aDrawer->SetDatumAspects(new Prs3d_DatumAspect());
}
aDrawer->DatumAspect()->ShadingAdpect(Prs3d_DatumParts_XAxis)->SetColor(Quantity_NOC_RED);
aDrawer->DatumAspect()->ShadingAdpect(Prs3d_DatumParts_XAxis)->SetTransparency(0.5);

theCtx->Redisplay(aTrih, true);