From: vsv Date: Mon, 20 Oct 2014 13:30:47 +0000 (+0400) Subject: Issue #178: Impossible to select two sketcher objects under SALOME is fixed X-Git-Tag: V_0.5~91 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6758cb69bd578b33cd4d0286a671c8f8109a0a1d;p=modules%2Fshaper.git Issue #178: Impossible to select two sketcher objects under SALOME is fixed --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index a44256ea7..ff1e43a7d 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -197,7 +197,7 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation) aDisplayer->activate(aFeature, aModes); } } - } else { + }// else { // Activate results of current feature for selection //FeaturePtr aFeature = theOperation->feature(); //XGUI_Displayer* aDisplayer = aXWshp->displayer(); @@ -205,13 +205,8 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation) //std::list::const_iterator aIt; //for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) { // aDisplayer->activate(*aIt); - //} - - - - } - // Clear selection done during operation - aDisplayer->clearSelected(); + //} + //} } void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked) diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index 1e0932280..4ad8a63cd 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -73,20 +73,21 @@ void PartSet_OperationFeatureEdit::mousePressed(QMouseEvent* theEvent, Handle(V3 if (commit()) { emit featureConstructed(feature(), FM_Deactivation); - bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier); - if (aHasShift && !theHighlighted.empty()) { - QList aSelected; - std::list::const_iterator aIt; - for (aIt = theSelected.cbegin(); aIt != theSelected.cend(); ++aIt) - aSelected.append((*aIt).object()); + //bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier); + //if (aHasShift && !theHighlighted.empty()) { + // QList aSelected; + // std::list::const_iterator aIt; + // for (aIt = theSelected.cbegin(); aIt != theSelected.cend(); ++aIt) + // aSelected.append((*aIt).object()); /*for (aIt = theHighlighted.cbegin(); aIt != theHighlighted.cend(); ++aIt) { if (!aSelected.contains((*aIt).object())) aSelected.append((*aIt).object()); }*/ //aSelected.push_back(feature()); //aSelected.push_back(theHighlighted.front().object()); - emit setSelection(aSelected); - } else if (aFeature) { + //emit setSelection(aSelected); + //} else + if (aFeature) { restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature); } } diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index dbe635b33..8e0f38400 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -258,8 +258,10 @@ void XGUI_Displayer::setSelected(const QList& theResults, const bool void XGUI_Displayer::clearSelected() { Handle(AIS_InteractiveContext) aContext = AISContext(); - if (aContext) + if (aContext) { + aContext->UnhilightCurrents(false); aContext->ClearSelected(); + } } void XGUI_Displayer::eraseAll(const bool isUpdateViewer) diff --git a/src/XGUI/XGUI_Viewer.cpp b/src/XGUI/XGUI_Viewer.cpp index a2864475b..3a8149615 100644 --- a/src/XGUI/XGUI_Viewer.cpp +++ b/src/XGUI/XGUI_Viewer.cpp @@ -551,10 +551,10 @@ void XGUI_Viewer::onMouseReleased(XGUI_ViewWindow* theWindow, QMouseEvent* theEv if (myStartPnt == myEndPnt) { // the MoveTo is necessary for the second click in the same point. Otherwise the selection is lost. - Handle(V3d_View) aView3d = theWindow->viewPort()->getView(); - if (!aView3d.IsNull()) { - myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d); - } + //Handle(V3d_View) aView3d = theWindow->viewPort()->getView(); + //if (!aView3d.IsNull()) { + // myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d); + //} if (aHasShift && myMultiSelectionEnabled) myAISContext->ShiftSelect(); else