X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Displayer.cpp;h=ccad93e0e2325f4d0a776c4c8a9044ebb5b3af85;hb=8d04b5f4360b23cf376beff9c5e7c12d0e6a5f1e;hp=23753cf8ca2811567bb4dc9c5ceece3f3ab4d4af;hpb=c53720ca78f12ec6333ca44c8dc2bb6b7a9a5294;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 23753cf8c..ccad93e0e 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -370,11 +370,16 @@ void XGUI_Displayer::redisplayObjects() // redisplay objects visualized in the viewer static Events_ID EVENT_DISP = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); - QObjectPtrList aDisplayed = myWorkshop->displayer()->displayedObjects(); + QObjectPtrList aDisplayed = displayedObjects(); QObjectPtrList::const_iterator anIt = aDisplayed.begin(), aLast = aDisplayed.end(); for (; anIt != aLast; anIt++) { aECreator->sendUpdated(*anIt, EVENT_DISP); } + XGUI_ViewerProxy* aViewer = myWorkshop->viewer(); + if (aViewer->isColorScaleVisible()) { + aViewer->setupColorScale(); + aViewer->setColorScaleShown(true); + } Events_Loop::loop()->flush(EVENT_DISP); } @@ -613,12 +618,6 @@ bool XGUI_Displayer::enableUpdateViewer(const bool isEnabled) return aWasEnabled; } -//************************************************************** -bool XGUI_Displayer::isUpdateEnabled() const -{ - return myViewerBlockedRecursiveCount == 0; -} - //************************************************************** void XGUI_Displayer::updateViewer() const { @@ -1056,8 +1055,6 @@ void XGUI_Displayer::displayTrihedron(bool theToDisplay) const if (getCallBack()) getCallBack()->Remove(aTrihedron); #endif } - - updateViewer(); } //************************************************************** @@ -1097,17 +1094,21 @@ void XGUI_Displayer::AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) th ::Iterator aShapeIt(theShapesToBeSelected); for (; aShapeIt.More(); aShapeIt.Next()) { const TopoDS_Shape& aParameterShape = aShapeIt.Key(); - // isSame should be used here as it does not check orientation of shapes - // despite on isEqual of shapes or IsBound for shape in QMap. Orientation is - // different for Edges shapes in model shape and owner even if this is the same shape - if (aParameterShape.IsSame(aShape)) { + // In case of compound we cannot rely on simple comparison method. + // If the compound is generated by Group feature then this compound is alwais new. + // So, we have to compare content of these compounds + + // isSame should be used here as it does not check orientation of shapes + // despite on isEqual of shapes or IsBound for shape in QMap. Orientation is + // different for Edges shapes in model shape and owner even if this is the same shape + if (ModuleBase_Tools::isSameShape(aParameterShape, aShape)) { Handle(AIS_InteractiveObject) anOwnerPresentation = - Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable()); + Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable()); NCollection_Map aPresentations = - theShapesToBeSelected.Find(aParameterShape); + theShapesToBeSelected.Find(aParameterShape); if (aPresentations.Contains(anOwnerPresentation)) { theContext->AddOrRemoveSelected(anOwner, Standard_False); - anOwner->SetSelected (Standard_True); + anOwner->SetSelected(Standard_True); // collect selected presentations to do not select them if compsolid is selected if (!aSelectedPresentations.Contains(anOwnerPresentation)) aSelectedPresentations.Add(anOwnerPresentation);