From 70acee100dbe604b672773557b2df598a6dbcd5c Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 6 Nov 2014 22:40:50 +0300 Subject: [PATCH] refs #240 - Selection of dimension for edit the active widget is a selection control. The operation should not be committed on the mouse release. Only if it is a last selected widget. The disappearance of the property panel is corrected for the perpendicular constraint edition. The case is call edit on a perpendicular constraint, select any line, it is applied as a first parameter, but the property panel is hidden. --- src/PartSet/PartSet_OperationFeatureBase.cpp | 3 ++- src/PartSet/PartSet_OperationFeatureEdit.cpp | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_OperationFeatureBase.cpp b/src/PartSet/PartSet_OperationFeatureBase.cpp index 458410aba..551fbfe8d 100644 --- a/src/PartSet/PartSet_OperationFeatureBase.cpp +++ b/src/PartSet/PartSet_OperationFeatureBase.cpp @@ -101,7 +101,8 @@ void PartSet_OperationFeatureBase::mouseReleased(QMouseEvent* theEvent, ModuleBa flushUpdated(); myPropertyPanel->activateNextWidget(); } - commit(); + if (!myPropertyPanel->activeWidget()) + commit(); } /*bool PartSet_OperationFeatureBase::setWidgetValue(ObjectPtr theFeature, double theX, double theY) diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index c91e91b85..c546e3114 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -136,7 +136,10 @@ void PartSet_OperationFeatureEdit::mousePressed(QMouseEvent* theEvent, ModuleBas if(aActiveWgt && aActiveWgt->isViewerSelector()) { // Almost do nothing, all stuff in on PartSet_OperationFeatureBase::mouseReleased PartSet_OperationFeatureBase::mousePressed(theEvent, theViewer, theSelection); - return; + // the current point should be cleared because it is saved from the previous move and + // should be reinitialized after the start moving. It is important for example for the lenght + // constraint where the first widget is a viewer selector. + myCurPoint.clear(); } else { // commit always until the selection restore is realized (for feature and local selection) @@ -363,6 +366,19 @@ void PartSet_OperationFeatureEdit::mouseReleased( commit(); emitFeaturesDeactivation(); } + else { + /// TODO: OCC bug: 25034 - the highlighted list should be filled not only for AIS_Shape + /// but for other IO, for example constraint dimensions. + /// It is empty and we have to use the process mouse release to start edition operation + /// for these objects + /*QList aSelected = theSelection->getSelected(); + if (aSelected.size() == 1) { + ObjectPtr anObject = aSelected.first().object(); + if (anObject && ModelAPI_Feature::feature(anObject) != feature()) { + restartOperation(PartSet_OperationFeatureEdit::Type(), anObject); + } + }*/ + } } } -- 2.39.2