How to prohibit Ais_Shape from being selected

I use AIS_Shape to display temporary geometries and prohibit these temporary geometries from being selected, but they are always selected now. How can geometry not be selected? Thanks a lot!

Kirill Gavrilov's picture

You may try the following options:

  • Specify -1 as selection mode while displaying the shape.

    Handle(AIS_Shape) thePrs;
    Handle(AIS_InteractiveContext) theCtx;
    theCtx->Display (thePrs, AIS_Shaded, -1, false);
     

  • Deactivate selection autoactivation in Interactive Context before displaying presentations.

    Handle(AIS_InteractiveContext) theCtx;
    theCtx->SetAutoActivateSelection (false);
     

  • Deactivate shape after it being displayed.

    Handle(AIS_Shape) thePrs;
    Handle(AIS_InteractiveContext) theCtx;
    theCtx->Display (thePrs, false);
    theCtx->Deactivate (thePrs);

David Gao's picture

Thank you, Mr. Gavrilov. It has worked.