From 87d67d34afa176b6f2e1215c3503b5847970bb9a Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 26 Mar 2015 08:03:17 +0300 Subject: [PATCH] Union of validator and filter functionalities. Code improvement, it renames storeAttributeValues to setObject. --- src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp | 8 ++++---- src/ModuleBase/ModuleBase_WidgetShapeSelector.h | 3 ++- src/PartSet/PartSet_WidgetConstraintShapeSelector.cpp | 4 ++-- src/PartSet/PartSet_WidgetConstraintShapeSelector.h | 2 +- src/PartSet/PartSet_WidgetShapeSelector.cpp | 4 ++-- src/PartSet/PartSet_WidgetShapeSelector.h | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index b981a9064..ef46fa062 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -132,8 +132,8 @@ bool ModuleBase_WidgetShapeSelector::storeValueCustom() const } //******************************************************************** -bool ModuleBase_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, - GeomShapePtr theShape) +bool ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theSelectedObject, + GeomShapePtr theShape) { bool isChanged = false; FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theSelectedObject); @@ -392,7 +392,7 @@ void ModuleBase_WidgetShapeSelector::restoreAttributeValue(bool theValid) DataPtr aData = myFeature->data(); AttributePtr anAttribute = myFeature->attribute(attributeID()); - storeAttributeValues(myObject, myShape); + setObject(myObject, myShape); AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID()); if (aRefAttr) { if (!myIsObject) @@ -446,7 +446,7 @@ bool ModuleBase_WidgetShapeSelector::setSelection(const Handle_SelectMgr_EntityO if (!acceptSubShape(aShape)) return false; - storeAttributeValues(aObject, aShape); + setObject(aObject, aShape); return true; } diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h index ea5ef10a7..fe28323b1 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@ -138,7 +138,8 @@ Q_OBJECT /// the specific type and set the given values /// \param theSelectedObject an object /// \param theShape a selected shape, which is used in the selection attribute - virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape); + /// \return true if it is succeed + virtual bool setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape); //----------- Class members ------------- protected: diff --git a/src/PartSet/PartSet_WidgetConstraintShapeSelector.cpp b/src/PartSet/PartSet_WidgetConstraintShapeSelector.cpp index ca6f8837a..5c5700b99 100644 --- a/src/PartSet/PartSet_WidgetConstraintShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetConstraintShapeSelector.cpp @@ -12,7 +12,7 @@ #include #include -bool PartSet_WidgetConstraintShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) +bool PartSet_WidgetConstraintShapeSelector::setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape) { ObjectPtr aSelectedObject = theSelectedObject; @@ -29,5 +29,5 @@ bool PartSet_WidgetConstraintShapeSelector::storeAttributeValues(ObjectPtr theSe return false; } } - return ModuleBase_WidgetShapeSelector::storeAttributeValues(aSelectedObject, theShape); + return ModuleBase_WidgetShapeSelector::setObject(aSelectedObject, theShape); } diff --git a/src/PartSet/PartSet_WidgetConstraintShapeSelector.h b/src/PartSet/PartSet_WidgetConstraintShapeSelector.h index c20eee6f3..9a69e4384 100644 --- a/src/PartSet/PartSet_WidgetConstraintShapeSelector.h +++ b/src/PartSet/PartSet_WidgetConstraintShapeSelector.h @@ -47,7 +47,7 @@ protected: /// the specific type and set the given values /// \param theSelectedObject an object /// \param theShape a selected shape, which is used in the selection attribute - virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape); + virtual bool setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape); //private: /// Pointer to a sketch diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index 6dd500d4a..578e1cdf9 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -18,7 +18,7 @@ #include #include -bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) +bool PartSet_WidgetShapeSelector::setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape) { ObjectPtr aSelectedObject = theSelectedObject; GeomShapePtr aShape = theShape; @@ -73,7 +73,7 @@ bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObje } } } - return ModuleBase_WidgetShapeSelector::storeAttributeValues(aSelectedObject, aShape); + return ModuleBase_WidgetShapeSelector::setObject(aSelectedObject, aShape); } //******************************************************************** diff --git a/src/PartSet/PartSet_WidgetShapeSelector.h b/src/PartSet/PartSet_WidgetShapeSelector.h index c342e0701..b47c59ebf 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.h +++ b/src/PartSet/PartSet_WidgetShapeSelector.h @@ -47,7 +47,7 @@ protected: /// the specific type and set the given values /// \param theSelectedObject an object /// \param theShape a selected shape, which is used in the selection attribute - virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape); + virtual bool setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape); /// Creates a backup of the current values of the attribute /// It should be realized in the specific widget because of different -- 2.39.2