From: nds Date: Tue, 3 Nov 2015 05:49:59 +0000 (+0300) Subject: Merge branch 'Dev_1.5.0' into BR_REENTRANCE_OPERATION X-Git-Tag: V_2.0.0_alfa1~6^2~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f34fba2433c87ccdf824df0dc8c34099054b1715;p=modules%2Fshaper.git Merge branch 'Dev_1.5.0' into BR_REENTRANCE_OPERATION Conflicts: src/XGUI/XGUI_PropertyPanel.cpp --- f34fba2433c87ccdf824df0dc8c34099054b1715 diff --cc src/ModuleBase/ModuleBase_IModule.h index 7ed9c8f6a,f4d547d43..41dbd6844 mode 100644,100755..100755 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h diff --cc src/ModuleBase/ModuleBase_WidgetSelector.cpp index d4ed903ec,130079870..6e1f94349 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@@ -165,8 -166,9 +165,9 @@@ bool ModuleBase_WidgetSelector::setSele //******************************************************************** void ModuleBase_WidgetSelector::deactivate() { + ModuleBase_ModelWidget::deactivate(); disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); - activateSelection(false); - activateFilters(false); + activateSelectionAndFilters(false); + ModuleBase_ModelWidget::deactivate(); } diff --cc src/PartSet/CMakeLists.txt index 35275b60f,45ab6dc01..86ba3a3a7 --- a/src/PartSet/CMakeLists.txt +++ b/src/PartSet/CMakeLists.txt @@@ -23,10 -23,8 +23,9 @@@ SET(PROJECT_HEADER PartSet_WidgetShapeSelector.h PartSet_WidgetFileSelector.h PartSet_Filters.h - PartSet_LockApplyMgr.h PartSet_FilterInfinite.h PartSet_SketcherMgr.h + PartSet_SketcherReetntrantMgr.h PartSet_MenuMgr.h PartSet_WidgetSketchCreator.h PartSet_IconFactory.h @@@ -49,10 -47,8 +48,9 @@@ SET(PROJECT_SOURCE PartSet_WidgetShapeSelector.cpp PartSet_WidgetFileSelector.cpp PartSet_Filters.cpp - PartSet_LockApplyMgr.cpp PartSet_FilterInfinite.cpp PartSet_SketcherMgr.cpp + PartSet_SketcherReetntrantMgr.cpp PartSet_MenuMgr.cpp PartSet_WidgetSketchCreator.cpp PartSet_IconFactory.cpp diff --cc src/PartSet/PartSet_Module.cpp index fbde087ad,4dba40553..5861932e7 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@@ -249,28 -257,44 +254,28 @@@ void PartSet_Module::operationCommitted mySketchMgr->commitNestedSketch(theOperation); } - ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); - if (!aFOperation || aFOperation->isEditOperation()) - return; - // the selection is cleared after commit the create operation - // in order to do not use the same selected objects in the restarted operation - // for common behaviour, the selection is cleared even if the operation is not restarted - XGUI_ModuleConnector* aConnector = dynamic_cast(workshop()); - XGUI_Workshop* aWorkshop = aConnector->workshop(); - aWorkshop->selector()->clearSelection(); - /// Restart sketcher operations automatically - FeaturePtr aFeature = aFOperation->feature(); - std::shared_ptr aSPFeature = - std::dynamic_pointer_cast(aFeature); - if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed || - myRestartingMode == RM_EmptyFeatureUsed)) { - myLastOperationId = aFOperation->id(); - myLastFeature = myRestartingMode == RM_LastFeatureUsed ? aFOperation->feature() : FeaturePtr(); - if (!sketchMgr()->sketchSolverError()) - launchOperation(myLastOperationId); + if (!mySketchReentrantMgr->operationCommitted(theOperation)) { + // the selection is cleared after commit the create operation + // in order to do not use the same selected objects in the restarted operation + // for common behaviour, the selection is cleared even if the operation is not restarted + XGUI_ModuleConnector* aConnector = dynamic_cast(workshop()); + XGUI_Workshop* aWorkshop = aConnector->workshop(); + aWorkshop->selector()->clearSelection(); } - breakOperationSequence(); -} - -void PartSet_Module::breakOperationSequence() -{ - myLastOperationId = ""; - myLastFeature = FeaturePtr(); - myRestartingMode = RM_None; } - void PartSet_Module::onOperationAborted(ModuleBase_Operation* theOperation) + void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation) { - breakOperationSequence(); + /// Restart sketcher operations automatically + mySketchReentrantMgr->operationAborted(theOperation); } - void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation) + void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation) { + /// Restart sketcher operations automatically + mySketchReentrantMgr->operationStarted(theOperation); + if (PartSet_SketcherMgr::isSketchOperation(theOperation)) { mySketchMgr->startSketch(theOperation); } diff --cc src/PartSet/PartSet_Module.h index bc97ed5cc,f879712a5..a120f3be6 mode 100644,100755..100755 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@@ -211,7 -203,15 +211,11 @@@ public /// Returns list of granted operation indices virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const; + /// Validates the current operation and send the state change to sketch manager + /// \thePrevState the previous widget value state + virtual void widgetStateChanged(int thePreviousState); + public slots: - /// SLOT, that is called by no more widget signal emitted by property panel - /// Set a specific flag to restart the sketcher operation - void onNoMoreWidgets(); - /// Redefines the parent method in order to customize the next case: /// If the sketch nested operation is active and the presentation is not visualized in the viewer, /// the operation should be always aborted. @@@ -257,10 -261,22 +261,17 @@@ protected /// Register properties of this module virtual void registerProperties(); + /// Connects or disconnects to the value changed signal of the property panel widgets + /// \param theWidget a property contol widget + /// \param isToConnect a boolean value whether connect or disconnect + virtual void connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect); + private slots: - /// Processing of vertex selected - void onVertexSelected(); - void onTreeViewDoubleClick(const QModelIndex&); + void onActiveDocPopup(const QPoint&); + private: - /// Breaks sequense of automatically resterted operations - void breakOperationSequence(); //! Delete features virtual bool deleteObjects(); diff --cc src/PartSet/PartSet_SketcherMgr.cpp index 028ebd650,97a5ce43c..4f89da66c mode 100644,100755..100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp diff --cc src/PartSet/PartSet_WidgetPoint2d.cpp index cbd3c9734,66a67efc4..020a9be68 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@@ -281,22 -248,11 +267,21 @@@ void PartSet_WidgetPoint2D::activateCus aModes << TopAbs_VERTEX; aModes << TopAbs_EDGE; myWorkshop->activateSubShapesSelection(aModes); - - myLockApplyMgr->activate(); } +bool PartSet_WidgetPoint2D::canBeActivatedByMove() +{ + bool aCanBeActivated = false; + if (feature()->getKind() == SketchPlugin_Line::ID() && + attributeID() == SketchPlugin_Line::START_ID()) + aCanBeActivated = true; + + return aCanBeActivated; +} + void PartSet_WidgetPoint2D::deactivate() { + ModuleBase_ModelWidget::deactivate(); ModuleBase_IViewer* aViewer = myWorkshop->viewer(); disconnect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)), this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*))); diff --cc src/PartSet/PartSet_WidgetPoint2d.h index 4481eb60d,d5f87eca0..aac5640c0 mode 100644,100755..100755 --- a/src/PartSet/PartSet_WidgetPoint2d.h +++ b/src/PartSet/PartSet_WidgetPoint2d.h diff --cc src/XGUI/XGUI_PropertyPanel.cpp index 73cdab5a2,f447f24a2..197f79442 mode 100644,100755..100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@@ -195,11 -248,9 +248,11 @@@ bool XGUI_PropertyPanel::setActiveWidge { // Avoid activation of already actve widget. It could happen on focusIn event many times if (theWidget == myActiveWidget) { - return; + return false; } + std::string aPreviosAttributeID; if(myActiveWidget) { + aPreviosAttributeID = myActiveWidget->attributeID(); myActiveWidget->deactivate(); myActiveWidget->setHighlighted(false); } diff --cc src/XGUI/XGUI_Workshop.cpp index 71af25fb3,52212d11b..d534f9d5d mode 100644,100755..100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp