I want to prevent AIS_Trihedron from being deleted.

  1. I hope AIS_Trihedron is not deleted.

  2. I hope the AIS_Trihedron is fixed.

The current code is as follows.

Handle(Geom_Axis2Placement) axis = new Geom_Axis2Placement(gp::Origin(), gp::DZ(), gp::DX());
        Handle(AIS_Trihedron) aisTrihedron = new AIS_Trihedron(axis);
        aisTrihedron->SetDatumDisplayMode(Prs3d_DM_WireFrame);
        aisTrihedron->SetDrawArrows(true);

        aisTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(2.5);
        aisTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(2.5);
        aisTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(2.5);
        aisTrihedron->SetDatumPartColor(Prs3d_DP_XAxis, Quantity_NOC_RED2);
        aisTrihedron->SetDatumPartColor(Prs3d_DP_YAxis, Quantity_NOC_GREEN2);
        aisTrihedron->SetDatumPartColor(Prs3d_DP_ZAxis, Quantity_NOC_BLUE2);
        aisTrihedron->SetLabel(Prs3d_DP_XAxis, "X");
        aisTrihedron->SetLabel(Prs3d_DP_YAxis, "Y");
        aisTrihedron->SetLabel(Prs3d_DP_ZAxis, "Z");

        aisTrihedron->SetTransformPersistence(
            new Graphic3d_TransformPers(Graphic3d_TMF_ZoomPers, axis->Ax2().Location()));
        aisTrihedron->Attributes()->SetZLayer(Graphic3d_ZLayerId_Topmost);


        aisTrihedron->SetInfiniteState(true);
        myAISContext()->Display(aisTrihedron, false);
        myAISContext()->SetSelectionModeActive(aisTrihedron, AIS_TrihedronSelectionMode_MainPlanes, false, AIS_SelectionModesConcurrency_GlobalOrLocal);


john ko's picture

fixed -> Handle(Graphic3d_TransformPers) trsf = new Graphic3d_TransformPers(Graphic3d_TMF_TriedronPers,Aspect_TOTP_LEFT_LOWER,Graphic3d_Vec2i(35, 35));