- FeaturePtr aFeature = XGUI_Tools::realFeature(theFeature);
- if (!isVisible(aFeature))
- return false;
-
- boost::shared_ptr<GeomAPI_Shape> aShapePtr = aFeature->data()->shape();
- if (aShapePtr) {
- boost::shared_ptr<GeomAPI_AISObject> aAISObj = getAISObject(aFeature);
- Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj->impl<Handle(AIS_InteractiveObject)>());
- if (!aAISShape.IsNull()) {
- aAISShape->Set(aShapePtr->impl<TopoDS_Shape>());
- AISContext()->Redisplay(aAISShape);
- return true;
+ if (!isVisible(theObject))
+ return;
+
+ ResultPtr aResult = boost::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+ if (aResult) {
+ boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModuleBase_Tools::shape(aResult);
+ if (aShapePtr) {
+ boost::shared_ptr<GeomAPI_AISObject> aAISObj = getAISObject(theObject);
+ Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj->impl<Handle(AIS_InteractiveObject)>());
+ if (!aAISShape.IsNull()) {
+ aAISShape->Set(aShapePtr->impl<TopoDS_Shape>());
+ AISContext()->Redisplay(aAISShape, isUpdateViewer);
+ }
+ }
+ } else {
+ GeomPresentablePtr aPrs = boost::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
+ if (aPrs) {
+ boost::shared_ptr<GeomAPI_AISObject> aAISObj = aPrs->getAISObject(getAISObject(theObject));
+ Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+ AISContext()->Redisplay(aAISIO, isUpdateViewer);