1、选中导入模型的面主要在XXXView.cpp的消息中定义鼠标事件
2、需要对导入的模型的显示方式进行稍微的更改
//在导入模型时显示的状态有所更改
//其中 1 代表 不是线框模式
//其中 3 代表 TopAbs_Solid
anAIScontext->Display(ais,1,3,Standard_True,Standard_True,AIS_DS_Displayed);
3、首先需要实现鼠标移动到模型的显示
//OnMouseMove中的部分代码
//获取上下文的对象
Handle(AIS_InteractiveContext) ais = GetDocument()->GetIC();
//使得对象在移动的时候,选中
ais->MoveTo(point.x,point.y,myView,Standard_True);
//选中后的显示状态的更改
Handle(Prs3d_Drawer) t_hilight_style = ais->HighlightStyle();
t_hilight_style->SetMethod(Aspect_TOHM_COLOR); // 颜色显示方式
t_hilight_style->SetColor(Quantity_NOC_LIGHTYELLOW); // 设置高亮颜色
t_hilight_style->SetDisplayMode(1); // 整体高亮
t_hilight_style->SetTransparency(0.2f); // 设置透明度
ais->SetSelectionStyle(t_hilight_style);
4、其次去定义鼠标左键按下的事件,可以实现选中的停留
//OnLButtonDown中的部分代码
Handle(AIS_InteractiveContext) ais = GetDocument()->GetIC();
ais->Select(Standard_True);//实现单选的功能