X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetFeatureOrAttribute.h;h=1dfd055ceb48f2b8699942cc7e59ec4f927cd5c9;hb=d058dc531b24c5c548fabfc0dbede4506b4e3076;hp=9de6c149a36fcedffb068fbb14cfc164fe394867;hpb=e4e9446cd26b23a5b5d58a1a6de2f7bd4fa0c865;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h index 9de6c149a..1dfd055ce 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h +++ b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h @@ -19,13 +19,14 @@ class ModelAPI_Attribute; */ class MODULEBASE_EXPORT ModuleBase_WidgetFeatureOrAttribute : public ModuleBase_WidgetFeature { - Q_OBJECT -public: +Q_OBJECT + public: /// Constructor /// \theParent the parent object /// \theParent the parent object /// \theData the widget configuation. The attribute of the model widget is obtained from - ModuleBase_WidgetFeatureOrAttribute(QWidget* theParent, const Config_WidgetAPI* theData, const std::string& theParentId); + ModuleBase_WidgetFeatureOrAttribute(QWidget* theParent, const Config_WidgetAPI* theData, + const std::string& theParentId); /// Destructor virtual ~ModuleBase_WidgetFeatureOrAttribute(); @@ -36,19 +37,26 @@ public: /// Saves the internal parameters to the given feature /// \param theFeature a model feature to be changed - virtual bool storeValue(ObjectPtr theFeature) const; + virtual bool storeValue() const; - virtual bool restoreValue(ObjectPtr theFeature); + virtual bool restoreValue(); + /// Defines if it is supposed that the widget should interact with the viewer. + virtual bool isViewerSelector() { return true; } + + protected: + /// Returns the feature attribute if it can be found by the given value + /// \param theValue the widget value + /// \return an attribute or null + boost::shared_ptr findAttribute(ModuleBase_WidgetValue* theValue); -protected: /// Set the attribute /// \param theAttribute value /// \return the boolean result of the attribute set - bool setAttribute(const boost::shared_ptr& theAttribute, - bool theSendEvent = true); + bool setAttribute(const boost::shared_ptr& theAttribute, bool theSendEvent = + true); -protected: - boost::shared_ptr myAttribute; /// < the attribute + protected: + boost::shared_ptr myAttribute; /// < the attribute }; #endif