X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFiltersPlugin%2FFiltersPlugin_Selection.h;h=b60f4c85f325cc4b79e5d258bb77036dba44649a;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=2da80a2dc1e67bbed5f3a4959d4e3fb8b5a1c946;hpb=33d191c57ab22ff6e84ea27e69537670d242d336;p=modules%2Fshaper.git diff --git a/src/FiltersPlugin/FiltersPlugin_Selection.h b/src/FiltersPlugin/FiltersPlugin_Selection.h index 2da80a2dc..b60f4c85f 100644 --- a/src/FiltersPlugin/FiltersPlugin_Selection.h +++ b/src/FiltersPlugin/FiltersPlugin_Selection.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -21,15 +21,14 @@ #define FILTERSPLUGIN_SELECTION_H_ #include "FiltersPlugin.h" -#include -#include +#include /**\class FiltersPlugin_Selection * \ingroup DataModel * \brief An interface for working with filters in the feature. A filters feature must inherit it * in order to allow management of filters in the feature data structure. */ -class FiltersPlugin_Selection : public ModelAPI_Feature, public ModelAPI_FiltersFeature +class FiltersPlugin_Selection : public ModelAPI_FiltersFeature { public: /// Extrusion kind @@ -51,31 +50,45 @@ public: /// Computes a selection? FILTERS_EXPORT virtual void execute() {} - /// Initially there are no filters selected, so, no attributes - virtual void initAttributes() {} - /// Feature is created in the plugin manager FiltersPlugin_Selection() {} + /// This method initializes all filters on open of document + FILTERS_EXPORT virtual void initAttributes() override; + // methods related to the filters management /// Adds a filter to the feature. Also initializes arguments of this filter. - FILTERS_EXPORT virtual void addFilter(const std::string theFilterID); + /// Returns the real identifier of the filter. + FILTERS_EXPORT virtual std::string addFilter(const std::string theFilterID) override; /// Removes an existing filter from the feature. - FILTERS_EXPORT virtual void removeFilter(const std::string theFilterID); + FILTERS_EXPORT virtual void removeFilter(const std::string theFilterID) override; /// Returns the list of existing filters in the feature. - FILTERS_EXPORT virtual std::list filters() const; + FILTERS_EXPORT virtual std::list filters() const override; /// Stores the reversed flag for the filter. - FILTERS_EXPORT virtual void setReversed(const std::string theFilterID, const bool theReversed); + FILTERS_EXPORT virtual void setReversed + (const std::string theFilterID, const bool theReversed) override; /// Returns the reversed flag value for the filter. - FILTERS_EXPORT virtual bool isReversed(const std::string theFilterID); + FILTERS_EXPORT virtual bool isReversed(const std::string theFilterID) override; /// Returns the ordered list of attributes related to the filter. - FILTERS_EXPORT virtual std::list filterArgs(const std::string theFilterID) const; + FILTERS_EXPORT virtual std::list + filterArgs(const std::string theFilterID) const override; + + /// Sets the attribute (not-persistent field) that contains this filters feature. + /// The filter feature may make synchronization by this method call. + FILTERS_EXPORT virtual void setAttribute(const AttributePtr& theAttr) override; + + /// Returns the attribute (not-persistent field) that contains this filters feature. + FILTERS_EXPORT virtual const AttributePtr& baseAttribute() const override; + +protected: + + AttributePtr myBase; ///< the attribute related to this filter }; #endif