From: nds Date: Fri, 25 Dec 2015 16:10:28 +0000 (+0300) Subject: #1182 point is attched to Sketch Constraint line X-Git-Tag: V_2.1.0~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d4ec34025812615d1aa16679db0c5a151b2a2abe;p=modules%2Fshaper.git #1182 point is attched to Sketch Constraint line --- diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp index e501d9ac4..fa0b72579 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp @@ -24,6 +24,11 @@ PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, { } +bool PartSet_WidgetPoint2DFlyout::useSelectedShapes() const +{ + return false; +} + bool PartSet_WidgetPoint2DFlyout::focusTo() { bool aCanAcceptFocus = true; diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.h b/src/PartSet/PartSet_WidgetPoint2DFlyout.h index 6a76e19bc..637d14f52 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.h +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.h @@ -37,6 +37,10 @@ public: /// \return the state whether the widget can accept the focus virtual bool focusTo(); + /// Returns true if the attribute can be changed using the selected shapes in the viewer + /// and creating a coincidence constraint to them. This control does not use them. + virtual bool useSelectedShapes() const; + private: //! Returns workshop XGUI_Workshop* workshop() const; diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index e8555daed..d34128d16 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -359,8 +359,8 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous NCollection_List aShapes; std::list aObjects; aSelection->selectedShapes(aShapes, aObjects); - // if we have selection - if (aShapes.Extent() > 0) { + // if we have selection and use it + if (aShapes.Extent() > 0 && useSelectedShapes()) { TopoDS_Shape aShape = aShapes.First(); ObjectPtr aObject = aObjects.front(); FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(aObject); @@ -541,6 +541,11 @@ bool PartSet_WidgetPoint2D::processEnter() return isModified; } +bool PartSet_WidgetPoint2D::useSelectedShapes() const +{ + return true; +} + bool PartSet_WidgetPoint2D::isOrphanPoint(const FeaturePtr& theFeature, const CompositeFeaturePtr& theSketch, double theX, double theY) diff --git a/src/PartSet/PartSet_WidgetPoint2d.h b/src/PartSet/PartSet_WidgetPoint2d.h index e32cf72c1..6985ffa4e 100755 --- a/src/PartSet/PartSet_WidgetPoint2d.h +++ b/src/PartSet/PartSet_WidgetPoint2d.h @@ -93,6 +93,10 @@ Q_OBJECT /// Returns true if the event is processed. virtual bool processEnter(); + /// Returns true if the attribute can be changed using the selected shapes in the viewer + /// and creating a coincidence constraint to them. This control use them. + virtual bool useSelectedShapes() const; + signals: /// Signal about selection of an existing vertex from an object void vertexSelected();