From: nds Date: Tue, 1 Mar 2016 13:37:28 +0000 (+0300) Subject: Rectangle feature: coincidence debug: 1. lines should not be updated in execute becau... X-Git-Tag: V_2.2.0~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2214a01e99079a3bfb6d8f15393f0bb870dd0958;p=modules%2Fshaper.git Rectangle feature: coincidence debug: 1. lines should not be updated in execute because it is performed in attributeChanges [wrong case: create rectangle with coincidence to axis, solver move lines, but execute returns them back to rectangle's points]. 2. we need to flush created for coincidence[wrong case: after the first modification only one line is moved to axis, others are not moved] --- diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 03cd49c32..813741c88 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -418,7 +418,7 @@ void PartSet_WidgetPoint2D::setConstraintWith(const ObjectPtr& theObject) ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B())); aRef2->setObject(theObject); - aFeature->execute(); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); } void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) diff --git a/src/PythonAddons/macros/rectangle/feature.py b/src/PythonAddons/macros/rectangle/feature.py index aaa65512a..3679577c8 100644 --- a/src/PythonAddons/macros/rectangle/feature.py +++ b/src/PythonAddons/macros/rectangle/feature.py @@ -106,8 +106,8 @@ class SketchPlugin_Rectangle(model.Feature): aRefAttrB.setAttr(aLine.attribute("StartPoint")) # Flags which show horizontal or vertical constraint is build for correponding line self.__isHV = [False, False, False, False] - # Update coordinates of created lines - self.updateLines() + # Update coordinates of created lines + self.updateLines() # Add horizontal and vertical constraint for the lines which already have result for i in range (0, aNbLines): if self.__isHV[i]: