From f95abbeffa7768cb82cdb27a218ec1c8b8fde3bf Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 4 Apr 2017 16:47:47 +0300 Subject: [PATCH] #2084 invalid sketch after trim: control of reentrant trim is filled only by message of trim feature --- src/PartSet/PartSet_SketcherReentrantMgr.cpp | 32 +++++++------------ src/PartSet/PartSet_SketcherReentrantMgr.h | 4 --- .../PartSet_WidgetFeaturePointSelector.cpp | 5 +-- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.cpp b/src/PartSet/PartSet_SketcherReentrantMgr.cpp index 41ff19045..23e759020 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReentrantMgr.cpp @@ -117,13 +117,13 @@ void PartSet_SketcherReentrantMgr::operationStarted(ModuleBase_Operation* theOpe if (!isActiveMgr()) return; - if (myPreviousFeature.get() && myRestartingMode == RM_LastFeatureUsed) { - ModuleBase_OperationFeature* aCurrentOperation = dynamic_cast( - myWorkshop->currentOperation()); - CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch(); - if (myPreviousFeature.get() && myPreviousFeature->data()->isValid()) // it is not removed - copyReetntrantAttributes(myPreviousFeature, aCurrentOperation->feature(), aSketch); - } + //if (myPreviousFeature.get() && myRestartingMode == RM_LastFeatureUsed) { + //ModuleBase_OperationFeature* aCurrentOperation = dynamic_cast( + // myWorkshop->currentOperation()); + //CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch(); + //if (myPreviousFeature.get() && myPreviousFeature->data()->isValid()) // it is not removed + //copyReetntrantAttributes(myPreviousFeature, aCurrentOperation->feature(), aSketch); + //} resetFlags(); } @@ -262,7 +262,7 @@ bool PartSet_SketcherReentrantMgr::processMouseReleased(ModuleBase_IViewWindow* && !aSelectedPrs->object()->data()->isValid()) { // the selected object was removed diring restart, e.g. presentable macro feature // there are created objects to replace the object depending on created feature kind - aSelectedPrs = generatePreSelection(); + aSelectedPrs = std::shared_ptr(); } aMouseProcessor->setPreSelection(aSelectedPrs, theWindow, theEvent); //aPoint2DWdg->mouseReleased(theWindow, theEvent); @@ -547,7 +547,7 @@ void PartSet_SketcherReentrantMgr::restartOperation() if (myInternalFeature.get()) copyReetntrantAttributes(myInternalFeature, aFOperation->feature(), - module()->sketchMgr()->activeSketch()); + module()->sketchMgr()->activeSketch()); myNoMoreWidgetsAttribute = ""; myIsFlagsBlocked = true; @@ -730,13 +730,13 @@ bool PartSet_SketcherReentrantMgr::copyReetntrantAttributes(const FeaturePtr& th theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); aNRefSelectedAttr->setValue(aRefSelectedAttr->value());*/ - /*std::shared_ptr aRefPreviewAttr = + std::shared_ptr aRefPreviewAttr = std::dynamic_pointer_cast( theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); std::shared_ptr aNRefPreviewAttr = std::dynamic_pointer_cast( theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); - aNRefPreviewAttr->setValue(aRefPreviewAttr->value());*/ + aNRefPreviewAttr->setValue(aRefPreviewAttr->value()); /*std::shared_ptr aPointSelectedAttr = std::dynamic_pointer_cast( @@ -746,14 +746,13 @@ bool PartSet_SketcherReentrantMgr::copyReetntrantAttributes(const FeaturePtr& th theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT())); aNPointSelectedAttr->setValue(aPointSelectedAttr->x(), aPointSelectedAttr->y()); */ - /*std::shared_ptr aPointPreviewAttr = + std::shared_ptr aPointPreviewAttr = std::dynamic_pointer_cast( theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); std::shared_ptr aNPointPreviewAttr = std::dynamic_pointer_cast( theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); aNPointPreviewAttr->setValue(aPointPreviewAttr->x(), aPointPreviewAttr->y()); - */ //aChanged = true; } return aChanged; @@ -776,13 +775,6 @@ bool PartSet_SketcherReentrantMgr::isTangentArc(ModuleBase_Operation* theOperati return aTangentArc; } -std::shared_ptr PartSet_SketcherReentrantMgr::generatePreSelection() -{ - std::shared_ptr aPrs; - - return aPrs; -} - void PartSet_SketcherReentrantMgr::updateAcceptAllAction() { CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch(); diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.h b/src/PartSet/PartSet_SketcherReentrantMgr.h index 3fc5c2246..0b6686983 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.h +++ b/src/PartSet/PartSet_SketcherReentrantMgr.h @@ -186,10 +186,6 @@ private: bool isTangentArc(ModuleBase_Operation* theOperation, const std::shared_ptr& /*theSketch*/) const; - /// Creates selection instance by the current feature and created by restart objects - /// \returns viewer selection presentation - std::shared_ptr generatePreSelection(); - /// Accept All action is enabled if an internal edit is started. /// It updates the state of the button void updateAcceptAllAction(); diff --git a/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp b/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp index 0fecb7ed7..663bc658b 100644 --- a/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp +++ b/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp @@ -213,6 +213,7 @@ void PartSet_WidgetFeaturePointSelector::setPreSelection( ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) { - if (fillFeature(thePreSelected, theWnd, theEvent)) - mouseReleased(theWnd, theEvent); + // the method is empty because firstly by starging of the feature there is no selection of + // sub-segments in the viewer, secondly preselection of restart operation is processed by + // special reentrant message sent by the feature } -- 2.39.2