X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_ImportResult.h;h=b33007be38e80c12d9d3383ba3293cfadcab1236;hb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;hp=4b5df61303c238425dd1c4a711644786f33595b2;hpb=bb4ab20a1f03f936d4d8511eb9e9733ee965bb72;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_ImportResult.h b/src/FeaturesPlugin/FeaturesPlugin_ImportResult.h index 4b5df6130..b33007be3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_ImportResult.h +++ b/src/FeaturesPlugin/FeaturesPlugin_ImportResult.h @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2019 CEA/DEN, EDF R&D +// Copyright (C) 2017-2022 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 @@ -22,7 +22,7 @@ #include "FeaturesPlugin.h" -#include +#include #include /// \class FeaturesPlugin_ImportResult @@ -30,7 +30,7 @@ /// \brief The Import Result feature allows the user to import one or several results /// from another Part. -class FeaturesPlugin_ImportResult : public ModelAPI_Feature +class FeaturesPlugin_ImportResult : public ModelAPI_CompositeFeature { public: /// Feature kind. @@ -39,6 +39,12 @@ public: static const std::string MY_ID("ImportResult"); return MY_ID; } + /// All features (list of references) + inline static const std::string& FEATURES_ID() + { + static const std::string MY_FEATURES_ID("Features"); + return MY_FEATURES_ID; + } /// \return the kind of a feature. FEATURESPLUGIN_EXPORT virtual const std::string& getKind() @@ -60,6 +66,26 @@ public: /// Request for initialization of data model of the feature: adding all attributes. FEATURESPLUGIN_EXPORT virtual void initAttributes(); + /// Appends a feature + FEATURESPLUGIN_EXPORT virtual std::shared_ptr addFeature(std::string theID); + + /// \return the number of sub-elements. + FEATURESPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const; + + /// \return the sub-feature by zero-base index. + FEATURESPLUGIN_EXPORT virtual + std::shared_ptr subFeature(const int theIndex, bool forTree = false); + + /// \return the sub-feature unique identifier in this composite feature by zero-base index. + FEATURESPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const; + + /// \return true if feature or result belong to this composite feature as subs. + FEATURESPLUGIN_EXPORT virtual bool isSub(ObjectPtr theObject) const; + + /// This method to inform that sub-feature is removed and must be removed from the internal data + /// structures of the owner (the remove from the document will be done outside just after). + FEATURESPLUGIN_EXPORT virtual void removeFeature(std::shared_ptr theFeature); + /// Use plugin manager for features creation. FeaturesPlugin_ImportResult() {} };