From: nds Date: Tue, 20 Jan 2015 14:54:42 +0000 (+0300) Subject: Issue #351 constraint is not applied on preselected segments X-Git-Tag: V_1.0.0~22^2~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d9f1514edde38ead795c3f657fa522e9184e619c;p=modules%2Fshaper.git Issue #351 constraint is not applied on preselected segments The reason: lost selection of the circle center. The decision: do not perform redisplay the AIS presentation in the AIS_InteractiveContext(displayer) if the shapes are equal. Here the GeomAPI realisation is necessary. The TopoDS_Shape realisation of the isEqual method is not enough because different TShapes instances are created and isEqual returns false. A correction in the widget shape selector to avoid the distance presentation update by set an object(before set an attribute). In the previous version, the distance was jumped by selecting two points on lines. The reason is the distance calculation between point-object by setObject and after that point-point by setAttr --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp index f57605c8c..096dc4a96 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,7 @@ std::shared_ptr GeomAlgoAPI_PointBuilder::point( const gp_Pnt& aPnt = thePoint->impl(); BRepBuilderAPI_MakeVertex aMaker(aPnt); TopoDS_Vertex aVertex = aMaker.Vertex(); - std::shared_ptr aRes(new GeomAPI_Shape); + std::shared_ptr aRes(new GeomAPI_Vertex); aRes->setImpl(new TopoDS_Shape(aVertex)); return aRes; } diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index bd9a98be5..c8b8112fe 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -40,11 +40,10 @@ bool PartSet_WidgetShapeSelector::storeValue() const if (aRefAttr) { TopoDS_Shape aShape = myShape->impl(); AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(mySelectedObject, aShape, mySketch); - if (mySelectedObject) - aRefAttr->setObject(mySelectedObject); if (aPntAttr) aRefAttr->setAttr(aPntAttr); - + else if (mySelectedObject) + aRefAttr->setObject(mySelectedObject); updateObject(myFeature); return true; }