How to select entity owners manually

I have an application where I'm keeping some references to the topological data in the form of TopoDS_Shape objects and using AIS to display this data in the form of AIS_InteractiveObjects. However, I'm having a difficult time trying to figure out how to programmatically select an entity owner that represents the visualization of a TopoDS_Shape

For example, if the current selection mode is set for face selection, I want to select the face by calling entityOwner->SetSelected(Standard_True) (i.e. SelectMgr_EntityOwner::SetSelected). However, this doesn't cause the face to be highlighted in the viewer. How can I select a SelectMgr_EntityOwner from code? Do I need to use something like StdSelect_BRepSelectionTool?


Ajith Subramanian's picture

I believe I have figured out the issue. I have to use AIS_InteractiveContext::SetSelected to select the owners instead of calling SelectMgr_EntityOwner::SetSelected. Calling SetSelected on the entity owner simply sets the IsSelected flag for the owner, but the actual selection and presentation logic is part of the context.