How to disable wire drawing in Web Assembly?

Hello, Now I'm trying to add a fully transparency object. I made a Prs3d_Drawer to disable all drawing features. But there remain wires (or face boundary?) like the screen shot. How can I disable all wire drawing of an object? Please help me !

P.S. SetTransparency(1.0) is not working for me. It shows wires when mouse hovering.

Here is my code :

    Handle(AIS_Shape) aisShape = new AIS_Shape(BRepPrimAPI_MakeSphere(gp::Origin(), 10).Shape());

    Handle(Prs3d_Drawer) drawer = new Prs3d_Drawer();
    drawer->SetFaceBoundaryDraw(Standard_False);
    drawer->SetFreeBoundaryDraw(Standard_False);

    aisShape->SetAutoHilight(false);
    aisShape->SetAttributes(drawer);
    aisShape->SetHilightAttributes(drawer);
    aisShape->SetDynamicHilightAttributes(drawer);

    context->SetLocalAttributes(aisShape, drawer, true);

    context->Display(aisShape, true);
Attachments: 
Kirill Gavrilov's picture

Now I'm trying to add a fully transparency object.

What is the purpose for adding invisible object to the viewer? Just don't display it....

David Coverdale's picture

Haha Sorry. My explanation was not enough.

My purpose is to make a Picking Area. with the AIS_Shape.
It should be hidden and should be pickable.

There are so many Aspects in OCCT, but it seems to be a bit hard to find the exact aspect for that wire.

David Coverdale's picture

It's resolved!

    aisShape->SetTransparency(1.0);
    aisShape->SetHilightAttributes(aisShape->Attributes());
    aisShape->SetDynamicHilightAttributes(aisShape->Attributes());

There is no more wires!

Kirill Gavrilov's picture

I guess your screenshot is not when displaying the sphere, but when highlighting it. AIS_Shape uses AIS_Wireframe presentation mode for highlighting by default, so you may ask aisShape->SetHilightMode(AIS_Shaded) to use the same presentation for highlighting.

Transparent presentation is still displayed in the viewer, though you wouldn't see it. So for most optimal performance it would be better using Aspect_IS_EMPTY aspect to suppress rendering or subclass AIS_Shape and override AIS_Shape::Compute() to draw nothing with a dummy primitive array defining bounding box of a shape. But I guess this is not important in your case.

David Coverdale's picture

Aspect_IS_EMPTY is what I want!! Really appreciate you :)