Salome HOME
issue #1152 arc validation problem
authornds <nds@opencascade.com>
Wed, 23 Dec 2015 08:44:43 +0000 (11:44 +0300)
committernds <nds@opencascade.com>
Wed, 23 Dec 2015 08:45:32 +0000 (11:45 +0300)
in additional, it is corrected that the external object is immediately visualized in the viewer after the end point click.

src/PartSet/PartSet_WidgetPoint2d.cpp
src/XGUI/XGUI_ViewerProxy.cpp

index 5af914ad35e967b8fe2b14a4d347cfcff11a2c62..e8555daed568bdede8f07571dcff437dc0255852 100644 (file)
@@ -383,11 +383,17 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous
         else {
           if (getPoint2d(aView, aShape, aX, aY))
             setPoint(aX, aY);
+          else
+            setValueState(Stored); // in case of edge selection, Apply state should also be updated
           bool anOrphanPoint = aShape.ShapeType() == TopAbs_VERTEX ||
                                isOrphanPoint(aSelectedFeature, mySketch, aX, aY);
           setConstraintWith(aObject);
-          if (!anOrphanPoint)
+          // fignal updated should be flushed in order to visualize possible created external objects
+          // e.g. selection of trihedron axis when input end arc point
+          updateObject(feature());
+          if (!anOrphanPoint && !anExternal)
             emit vertexSelected();
+
           emit focusOutWidget(this);
         }
       }
@@ -409,8 +415,10 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous
           PartSet_Tools::setConstraints(mySketch, feature(), attributeID(), aX, aY);
         }
         else if (aShape.ShapeType() == TopAbs_EDGE) {
-          if (MyFeaturesForCoincedence.contains(myFeature->getKind().c_str()))
+          if (MyFeaturesForCoincedence.contains(myFeature->getKind().c_str())) {
             setConstraintWith(aObject);
+            setValueState(Stored); // in case of edge selection, Apply state should also be updated
+          }
         }
         // it is important to perform updateObject() in order to the current value is 
         // processed by Sketch Solver. Test case: line is created from a previous point
@@ -419,7 +427,7 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous
         // points of the line becomes less than the tolerance. Validator of the line returns
         // false, the line will be aborted, but sketch stays valid.
         updateObject(feature());
-        if (!anOrphanPoint)
+        if (!anOrphanPoint && !anExternal)
           emit vertexSelected();
         emit focusOutWidget(this);
       }
index d0b6779e83112c582d5ffbe7b00b57a3303c2e2b..6233d28ff80940973c70c6920d1df3752944f42e 100644 (file)
@@ -29,7 +29,7 @@ void XGUI_ViewerProxy::connectViewProxy()
          SIGNAL(trihedronVisibilityChanged(bool)));
 #else
   connect(myWorkshop->mainWindow()->viewer(), SIGNAL(trihedronVisibilityChanged(bool)),
-         SLOT(trihedronVisibilityChanged(bool)));
+         SIGNAL(trihedronVisibilityChanged(bool)));
 #endif
 }