posts - 537, comments - 590, trackbacks - 0, articles - 0

OpenCASCADE Customize Highlighting

Posted on 2020-02-29 15:01 eryar 阅读(8440) 评论(0)  编辑 收藏 引用 所属分类: 2.OpenCASCADE

OpenCASCADE Customize Highlighting


The traditional way of highlighting selected entity owners adopted by Open CASCADE Technology assumes that each entity owner highlights itself on its own. This approach has two drawbacks:

l  each entity owner has to maintain its own Prs3d_Presentation object, that results in a considerable memory overhead;

l  drawing selected owners one by one is not efficient from the visualization point of view.



Therefore, to overcome these limitations, OCCT has an alternative way to implement the highlighting of a selected presentation. Using this approach, the interactive object itself will be responsible for the highlighting, not the entity owner.



On the basis of SelectMgr_EntityOwner::IsAutoHilight() return value, AIS_InteractiveContext object either uses the traditional way of highlighting (in case if IsAutoHilight() returns TRUE) or groups such owners according to their selectable objects and finally calls SelectMgr_SelectableObject::HilightSelected() or SelectMgr_SelectableObject::ClearSelected(), passing a group of owners as an argument.

Hence, an application can derive its own interactive object and redefine virtual methods HilightSelected(), ClearSelected() and HilightOwnerWithColor() from SelectMgr_SelectableObject. SelectMgr_SelectableObject::GetHilightPresentation and SelectMgr_SelectableObject::GetSelectPresentation methods can be used to optimize filling of selection and highlight presentations according to the user's needs. The AIS_InteractiveContext::HighlightSelected() method can be used for efficient redrawing of the selection presentation for a given interactive object from an application code.


l  HilightSelected():交互对象选中时的高亮显示效果;

l  ClearSelected():清除对象选中时的高亮效果;

l  HilightOwnerWithColor():鼠标移动到交互对象上时的高亮效果;





Shing Liu(

【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理