Fri, 05/27/2022 - 10:13
Forums:
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:
Fri, 05/27/2022 - 12:12
What is the purpose for adding invisible object to the viewer? Just don't display it....
Fri, 05/27/2022 - 12:20
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.
Fri, 05/27/2022 - 12:34
It's resolved!
There is no more wires!
Fri, 05/27/2022 - 13:01
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.
Fri, 05/27/2022 - 13:14
Aspect_IS_EMPTY is what I want!! Really appreciate you :)