From 29cfe0a9ce36e9d1b5ec2fb0c8c4f395cab02a1a Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 23 Dec 2015 11:44:43 +0300 Subject: [PATCH] issue #1152 arc validation problem 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 | 14 +++++++++++--- src/XGUI/XGUI_ViewerProxy.cpp | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 5af914ad3..e8555daed 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -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); } diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index d0b6779e8..6233d28ff 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -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 } -- 2.39.2