]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fill circle start point by click in the viewer when the opeation is restarted.
authornds <nds@opencascade.com>
Wed, 28 Oct 2015 11:25:19 +0000 (14:25 +0300)
committernds <nds@opencascade.com>
Wed, 28 Oct 2015 11:25:19 +0000 (14:25 +0300)
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherReetntrantMgr.cpp
src/PartSet/PartSet_SketcherReetntrantMgr.h
src/PartSet/PartSet_WidgetPoint2d.h

index 572bea5a273b211b2a77a10013b311474ba6a9a3..62a37589cb8fbbbb7ffc5c4ed255e00c12a12955 100644 (file)
@@ -337,7 +337,7 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE
   if (!(theEvent->buttons() & Qt::LeftButton))
     return;
 
-  if (myModule->sketchReentranceMgr()->processMousePressed())
+  if (myModule->sketchReentranceMgr()->processMousePressed(theWnd, theEvent))
     return;
 
   // Clear dragging mode
@@ -438,7 +438,7 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE
 
 void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
 {
-  if (myModule->sketchReentranceMgr()->processMouseReleased())
+  if (myModule->sketchReentranceMgr()->processMouseReleased(theWnd, theEvent))
     return;
 
   ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
@@ -476,7 +476,7 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse
 
 void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
 {
-  if (myModule->sketchReentranceMgr()->processMouseMoved())
+  if (myModule->sketchReentranceMgr()->processMouseMoved(theWnd, theEvent))
     return;
 
   if (isNestedCreateOperation(getCurrentOperation()) && !myIsMouseOverViewProcessed) {
index a243e762f79bfa0cdf73035d0c0639c60edfbf0a..96050b8781136b0a8118daa7f8f72d00116d1961 100755 (executable)
@@ -141,7 +141,8 @@ void PartSet_SketcherReetntrantMgr::operationAborted(ModuleBase_Operation* theOp
   breakOperationSequence();
 }
 
-bool PartSet_SketcherReetntrantMgr::processMouseMoved()
+bool PartSet_SketcherReetntrantMgr::processMouseMoved(ModuleBase_IViewWindow*/* theWnd*/,
+                                                      QMouseEvent*/* theEvent*/)
 {
   bool aProcessed = false;
   if (!isActiveMgr())
@@ -159,12 +160,14 @@ bool PartSet_SketcherReetntrantMgr::processMouseMoved()
   return aProcessed;
 }
 
-bool PartSet_SketcherReetntrantMgr::processMousePressed()
+bool PartSet_SketcherReetntrantMgr::processMousePressed(ModuleBase_IViewWindow*/* theWnd*/,
+                                                        QMouseEvent*/* theEvent*/)
 {
   return isActiveMgr() && myIsInternalEditOperation;
 }
 
-bool PartSet_SketcherReetntrantMgr::processMouseReleased()
+bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow* theWnd,
+                                                         QMouseEvent* theEvent)
 {
   bool aProcessed = false;
   if (!isActiveMgr())
@@ -175,7 +178,14 @@ bool PartSet_SketcherReetntrantMgr::processMouseReleased()
     //if (operationMgr()->isApplyEnabled())
     anOperation->commit();
     aProcessed = true;
+
+    // fill the widget by the mouse event point
+    PartSet_WidgetPoint2D* aPoint2DWdg = dynamic_cast<PartSet_WidgetPoint2D*>(module()->activeWidget());
+    if (aPoint2DWdg) {
+      aPoint2DWdg->onMouseRelease(theWnd, theEvent);
+    }
   }
+
   return aProcessed;
 }
 
index e08054fa3ab275cc259766af2401c7a9cf33871b..0c232eef02d8c1ca9ba01781d4a94bfac7c33e66 100755 (executable)
@@ -14,6 +14,9 @@
 class ModuleBase_IWorkshop;
 class ModuleBase_Operation;
 class ModuleBase_ModelWidget;
+class ModuleBase_IViewWindow;
+
+class QMouseEvent;
 
 class XGUI_Workshop;
 class PartSet_Module;
@@ -63,17 +66,17 @@ public:
   /// It happens if the current operation is an internal edit operation and the first
   /// control can be filled by the mouse move event. The operation is committed.
   /// \return true if operation is committed.
-  bool processMouseMoved();
+  bool processMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
   /// Return true if the manager processes the mouse press event
   /// \return true if the current operation is an internal edit operation.
-  bool processMousePressed();
+  bool processMousePressed(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
   /// Return true if the manager processes the mouse enter event
   /// It happens if the current operation is an internal edit operation.
   /// The operation is committed.
   /// \return true if operation is committed.
-  bool processMouseReleased();
+  bool processMouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
   /// Activates the operation widgets relatively the internal reentrant flags
   void propertyPanelDefined(ModuleBase_Operation* theOperation);
index 216d058f4abe0fbce6a67f0f69608e044d71a29f..4481eb60db68fcff1e596c65503e710e9b63dbdb 100644 (file)
@@ -101,7 +101,6 @@ public slots:
   /// \param theEvent a mouse event
   void onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
-protected slots:
   /// Process mouse release event
   /// \param theWnd a view window
   /// \param theEvent a mouse event