Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 30 Dec 2014 11:43:53 +0000 (14:43 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 30 Dec 2014 11:43:53 +0000 (14:43 +0300)
1  2 
src/XGUI/XGUI_Displayer.cpp

index 37dab67a4cf827bc490d6286f81458d49c6ecbc7,45980ee6270402dec376e5fe227ce6858cb46017..a8f9dcad990baa4b7a0fe56252615dd0231c3458
@@@ -208,6 -208,23 +208,23 @@@ void XGUI_Displayer::redisplay(ObjectPt
      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();
@@@ -299,7 -316,7 +316,7 @@@ void XGUI_Displayer::activateObjects(co
    //myUseExternalObjects = true;
  
    AIS_ListOfInteractive aPrsList;
 -  displayedObjects(aContext, aPrsList);
 +  ::displayedObjects(aContext, aPrsList);
  
    Handle(AIS_Trihedron) aTrihedron;
    AIS_ListIteratorOfListOfInteractive aLIt(aPrsList);
@@@ -339,7 -356,7 +356,7 @@@ void XGUI_Displayer::deactivateObjects(
  
    //aContext->NotUseDisplayedObjects();
    AIS_ListOfInteractive aPrsList;
 -  displayedObjects(aContext, aPrsList);
 +  ::displayedObjects(aContext, aPrsList);
  
    AIS_ListIteratorOfListOfInteractive aLIt;
    //Handle(AIS_Trihedron) aTrihedron;