]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#2084 invalid sketch after trim: control of reentrant trim is filled only by message...
authornds <nds@opencascade.com>
Tue, 4 Apr 2017 13:47:47 +0000 (16:47 +0300)
committernds <nds@opencascade.com>
Tue, 4 Apr 2017 13:47:47 +0000 (16:47 +0300)
src/PartSet/PartSet_SketcherReentrantMgr.cpp
src/PartSet/PartSet_SketcherReentrantMgr.h
src/PartSet/PartSet_WidgetFeaturePointSelector.cpp

index 41ff190453e0825bd39902dda425c6d16252b990..23e759020ed5c723cf7f434759177d40bfdd3b8a 100644 (file)
@@ -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<ModuleBase_OperationFeature*>(
-                                                                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<ModuleBase_OperationFeature*>(
+    //                                                            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<ModuleBase_ViewerPrs>();
         }
         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<ModelAPI_AttributeReference> aRefPreviewAttr =
+    std::shared_ptr<ModelAPI_AttributeReference> aRefPreviewAttr =
                       std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
                       theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
     std::shared_ptr<ModelAPI_AttributeReference> aNRefPreviewAttr =
                         std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
                         theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
-    aNRefPreviewAttr->setValue(aRefPreviewAttr->value());*/
+    aNRefPreviewAttr->setValue(aRefPreviewAttr->value());
 
     /*std::shared_ptr<GeomDataAPI_Point2D> aPointSelectedAttr =
                       std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
@@ -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<GeomDataAPI_Point2D> aPointPreviewAttr =
+    std::shared_ptr<GeomDataAPI_Point2D> aPointPreviewAttr =
                       std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
                       theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
     std::shared_ptr<GeomDataAPI_Point2D> aNPointPreviewAttr =
                       std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
                       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<ModuleBase_ViewerPrs> PartSet_SketcherReentrantMgr::generatePreSelection()
-{
-  std::shared_ptr<ModuleBase_ViewerPrs> aPrs;
-
-  return aPrs;
-}
-
 void PartSet_SketcherReentrantMgr::updateAcceptAllAction()
 {
   CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
index 3fc5c22469eb820acbbff38bb63648e2a0060565..0b66869830daed9ef974bbcf55465dcc7afc30ba 100644 (file)
@@ -186,10 +186,6 @@ private:
   bool isTangentArc(ModuleBase_Operation* theOperation,
                     const std::shared_ptr<ModelAPI_CompositeFeature>& /*theSketch*/) const;
 
-  /// Creates selection instance by the current feature and created by restart objects
-  /// \returns viewer selection presentation
-  std::shared_ptr<ModuleBase_ViewerPrs> generatePreSelection();
-
   /// Accept All action is enabled if an internal edit is started.
   /// It updates the state of the button
   void updateAcceptAllAction();
index 0fecb7ed7855e535d11dfc007a7ffe30e5565f84..663bc658b568bdf7813b23abd027ff5f46aebdc6 100644 (file)
@@ -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
 }