From: nds Date: Thu, 6 Nov 2014 19:40:50 +0000 (+0300) Subject: refs #240 - Selection of dimension for edit X-Git-Tag: V_0.5~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=70acee100dbe604b672773557b2df598a6dbcd5c;p=modules%2Fshaper.git 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. --- 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); + } + }*/ + } } }