Zeke Xiao

Zeke Xiao

github

OpenCASCADE display objects are set to not selectable.

Original selection mode code:

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;
}

For example: AIS_Shape::SelectionMode(TopAbs_EDGE) selection mode is set to edges.

When calling AIS_InteractiveContext::Display, setting -1 will make the object unselectable.

myContext->Display(theObjects,
                    AIS_Shaded,
                    selectable ? AIS_Shape::SelectionMode(TopAbs_EDGE) : -1,
                    Standard_True);
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.