OpenCASCADE 显示对象设置不可选中
阅读原文时间:2023年09月06日阅读:1

原有的选中模式代码:

static Standard_Integer SelectionMode (const TopAbs_ShapeEnum theShapeType)
{
    switch (theShapeType)
    {
    case TopAbs_VERTEX:    return 1;
    case TopAbs_EDGE:      return 2;
    case TopAbs_WIRE:      return 3;
    case TopAbs_FACE:      return 4;
    case TopAbs_SHELL:     return 5;
    case TopAbs_SOLID:     return 6;
    case TopAbs_COMPSOLID: return 7;
    case TopAbs_COMPOUND:  return 8;
    case TopAbs_SHAPE:     return 0;
    }
    return 0;
}

例如: AIS_Shape::SelectionMode(TopAbs_EDGE) 选中模式为边线

调用 AIS_InteractiveContext::Display 时设置 -1 ,则对象无法选中

myContext->Display(theObjects,
                    AIS_Shaded,
                    selectable ? AIS_Shape::SelectionMode(TopAbs_EDGE) : -1,
                    Standard_True);

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章