Handle(AIS_InteractiveContext) aContext = AISContext();
if (aContext.IsNull())
return;
+ // Check that the visualized shape is the same and the redisplay is not necessary
+ // Redisplay of AIS object leads to this object selection compute and the selection
+ // in the browser is lost
+ // become
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+ if (aResult.get() != NULL) {
+ Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(aAISIO);
+ if (!aShapePrs.IsNull()) {
+ std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
+ const TopoDS_Shape& aShape = aShapePrs->Shape();
+ std::shared_ptr<GeomAPI_Shape> anAISShapePtr(new GeomAPI_Shape());
+ anAISShapePtr->setImpl(new TopoDS_Shape(aShape));
+
+ if (aShapePtr->isEqual(anAISShapePtr))
+ return;
+ }
+ }
aContext->Redisplay(aAISIO, false);
if (isUpdateViewer)
updateViewer();