/// \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;
NCollection_List<TopoDS_Shape> aShapes;
std::list<ObjectPtr> 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);
return isModified;
}
+bool PartSet_WidgetPoint2D::useSelectedShapes() const
+{
+ return true;
+}
+
bool PartSet_WidgetPoint2D::isOrphanPoint(const FeaturePtr& theFeature,
const CompositeFeaturePtr& theSketch,
double theX, double theY)
/// 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();