From: nds Date: Mon, 29 Jun 2015 12:23:30 +0000 (+0300) Subject: Issue #604 Creation of an unexpected line in the Sketcher X-Git-Tag: V_1.3.0~165 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=398ac0c828b87c1e883ef41c33569bc3018c26cb;p=modules%2Fshaper.git Issue #604 Creation of an unexpected line in the Sketcher Regression: Apply is always disable during mirror operation when the cursor is over property panel. Using myIsResetCurrentValue instead of myIsPropertyPanelValueChanged. --- diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 25db60f12..067dc093a 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -150,7 +150,7 @@ void getAttributesOrResults(const Handle(SelectMgr_EntityOwner)& theOwner, PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule) : QObject(theModule), myModule(theModule), myIsDragging(false), myDragDone(false), - myIsPropertyPanelValueChanged(false), myIsMouseOverWindow(false), + myIsResetCurrentValue(false), myIsMouseOverWindow(false), myIsMouseOverViewProcessed(true), myPreviousUpdateViewerEnabled(true), myIsPopupMenuActive(false), myIsConstraintsShown(true) { @@ -189,7 +189,7 @@ void PartSet_SketcherMgr::onEnterViewPort() // the mouse move and use the cursor position to update own values. If the presentaion is // redisplayed before this update, the feature presentation jumps from reset value to current. myIsMouseOverWindow = true; - myIsPropertyPanelValueChanged = false; + myIsResetCurrentValue = false; operationMgr()->onValidateOperation(); #ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS qDebug(QString("onEnterViewPort: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str()); @@ -219,7 +219,6 @@ void PartSet_SketcherMgr::onLeaveViewPort() { myIsMouseOverViewProcessed = false; myIsMouseOverWindow = false; - myIsPropertyPanelValueChanged = false; operationMgr()->onValidateOperation(); #ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS qDebug(QString("onLeaveViewPort: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str()); @@ -246,13 +245,12 @@ void PartSet_SketcherMgr::onLeaveViewPort() ModuleBase_Operation* aOperation = getCurrentOperation(); ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel(); ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget(); - if (aActiveWgt) { - aActiveWgt->reset(); + if (aActiveWgt && aActiveWgt->reset()) { + myIsResetCurrentValue = true; } aDisplayer->enableUpdateViewer(isEnableUpdateViewer); // hides the presentation of the current operation feature - //myIsPropertyPanelValueChanged = false; // the feature is to be erased here, but it is correct to call canDisplayObject because // there can be additional check (e.g. editor widget in distance constraint) FeaturePtr aFeature = getCurrentOperation()->feature(); @@ -296,7 +294,7 @@ void PartSet_SketcherMgr::onValuesChangedInPropertyPanel() return; // visualize the current operation feature - myIsPropertyPanelValueChanged = true; + myIsResetCurrentValue = false; operationMgr()->onValidateOperation(); ModuleBase_Operation* aOperation = getCurrentOperation(); // the feature is to be erased here, but it is correct to call canDisplayObject because @@ -825,7 +823,7 @@ void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation) void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOp) { connectToPropertyPanel(false); - myIsPropertyPanelValueChanged = false; + myIsResetCurrentValue = false; myIsMouseOverViewProcessed = true; operationMgr()->onValidateOperation(); } @@ -856,7 +854,7 @@ bool PartSet_SketcherMgr::canCommitOperation() const { bool aCanCommit = true; - if (isNestedCreateOperation(getCurrentOperation()) && !canDisplayCurrentCreatedFeature()) + if (isNestedCreateOperation(getCurrentOperation()) && myIsResetCurrentValue) aCanCommit = false; return aCanCommit; @@ -935,7 +933,7 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const bool PartSet_SketcherMgr::canDisplayCurrentCreatedFeature() const { - return myIsPropertyPanelValueChanged || myIsMouseOverWindow; + return myIsMouseOverWindow || !myIsResetCurrentValue; #ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS qDebug(QString("canDisplayCurrentCreatedFeature: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str()); #endif @@ -1211,8 +1209,8 @@ void PartSet_SketcherMgr::onShowConstraintsToggle(bool theOn) QString PartSet_SketcherMgr::mouseOverWindowFlagsInfo() const { - return QString("myIsPropertyPanelValueChanged = %1, myIsMouseOverWindow = %2") - .arg(myIsPropertyPanelValueChanged).arg(myIsMouseOverWindow); + return QString("myIsResetCurrentValue = %1, myIsMouseOverWindow = %2") + .arg(myIsResetCurrentValue).arg(myIsMouseOverWindow); } XGUI_OperationMgr* PartSet_SketcherMgr::operationMgr() const diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 677c4a163..fea62f8e8 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -268,7 +268,7 @@ private: void visualizeFeature(ModuleBase_Operation* theOperation, const bool isToDisplay, const bool isFlushRedisplay = true); private: - /// Gives a debug information about internal flags myIsMouseOverWindow and myIsPropertyPanelValueChanged + /// Gives a debug information about internal flags myIsMouseOverWindow and myIsResetCurrentValue /// \return a string value QString mouseOverWindowFlagsInfo() const; @@ -280,7 +280,7 @@ private: bool myPreviousSelectionEnabled; // the previous selection enabled state in the viewer bool myIsDragging; bool myDragDone; - bool myIsPropertyPanelValueChanged; /// the state that value in the property panel is changed + bool myIsResetCurrentValue; /// the state that value in the property panel is reset bool myIsMouseOverWindow; /// the state that the mouse over the view bool myIsMouseOverViewProcessed; /// the state whether the over view state is processed by mouseMove method bool myIsPopupMenuActive; /// the state of the popup menu is shown