From 020a349bff56877b2efd356264758a578748d008 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 27 Apr 2017 16:24:03 +0300 Subject: [PATCH] Debug of the external circle center selection. --- src/Model/Model_AttributeSelection.cpp | 4 +++- src/PartSet/PartSet_WidgetSketchLabel.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 1ed05a9a7..0ffaf4fea 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -167,6 +167,7 @@ void Model_AttributeSelection::setValueCenter( TDataStd_UAttribute::Set(aSelLab, kELLIPSE_CENTER2); break; } + owner()->data()->sendAttributeUpdated(this); } } @@ -278,6 +279,7 @@ std::shared_ptr Model_AttributeSelection::value() TopoDS_Shape aSelShape = aSelection->Get(); aResult = std::shared_ptr(new GeomAPI_Shape); aResult->setImpl(new TopoDS_Shape(aSelShape)); + return centerByEdge(aResult, aType); } else { // for simple construction element: just shape of this construction element std::shared_ptr aConstr = std::dynamic_pointer_cast(context()); @@ -291,7 +293,7 @@ std::shared_ptr Model_AttributeSelection::value() } } } - return aResult; + return aResult; // empty case } bool Model_AttributeSelection::isInvalid() diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index b3a05a35c..83f48e1f5 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -577,7 +577,7 @@ std::shared_ptr std::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); // X axis is preferable to be dirX on the sketch const double tol = Precision::Confusion(); - bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol; + bool isX = fabs(fabs(anA) - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol; std::shared_ptr aTempDir( isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0)); std::shared_ptr aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir))); -- 2.39.2