X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetSelector.h;h=9756b3633e13c78af6f2b7ef4f7ee224e85f632e;hb=eef14b29d313b9dd16453d12f20aa02383ee139c;hp=99af3ad74a5ccbc06ad14dc4e623734e4b322005;hpb=78246681ed6d62bdad42d0677e1aae3a0af8af47;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.h b/src/ModuleBase/ModuleBase_WidgetSelector.h index 99af3ad74..9756b3633 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetSelector.h @@ -13,6 +13,7 @@ #include "ModuleBase_Definitions.h" #include +#include #include class Config_WidgetAPI; @@ -42,31 +43,28 @@ Q_OBJECT /// Defines if it is supposed that the widget should interact with the viewer. virtual bool isViewerSelector() { return true; } + /// Activate or deactivate selection and selection filters + /// \return true if the selection filter of the widget is activated in viewer context + virtual bool activateSelectionAndFilters(bool toActivate); + /// Checks the widget validity. By default, it returns true. - /// \param theValue a selected presentation in the view + /// \param thePrs a selected presentation in the view /// \return a boolean value virtual bool isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs); /// Fills the attribute with the value of the selected owner - /// \param theOwner a selected owner + /// \param thePrs a selected owner virtual bool setSelectionCustom(const ModuleBase_ViewerPrs& thePrs); /// The methiod called when widget is deactivated virtual void deactivate(); -protected: - /// Activate or deactivate selection - void activateSelection(bool toActivate); - private slots: /// Slot which is called on selection event void onSelectionChanged(); protected: - /// Set an empty value to attribute - virtual void clearAttribute() = 0; - - // Update focus after the attribute value change + /// Update focus after the attribute value change virtual void updateFocus() = 0; /// Return the attribute values wrapped in a list of viewer presentations @@ -88,7 +86,7 @@ protected: /// \return true if it is succeed virtual void setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape) = 0; - /// The methiod called when widget is activated + /// The methiod called when widget is activated virtual void activateCustom(); /// Returns true if selected shape corresponds to requested shape types. @@ -108,6 +106,11 @@ protected: GeomShapePtr& theShape); //----------- Class members ------------- + /// Returns a name in the next form: attribute_feature_name/attribute_id + /// \param theAttribute a model attribute + /// \return string value + static std::string generateName(const AttributePtr& theAttribite, + ModuleBase_IWorkshop* theWorkshop); }; #endif