X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModelHighAPI%2FModelHighAPI_Interface.h;h=47a1027892686bf6e8479483b3a3aabed11abea4;hb=aa941d4038c5880146ea98adc84e5d02fc729c49;hp=4dd2bca21a0d140e2ddd1e931c1391800986038a;hpb=307719ccd8caf86108a00bc73b53dd896b92a50b;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.h b/src/ModelHighAPI/ModelHighAPI_Interface.h index 4dd2bca21..47a102789 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.h +++ b/src/ModelHighAPI/ModelHighAPI_Interface.h @@ -1,8 +1,21 @@ -// Name : ModelHighAPI_Interface.h -// Purpose: +// Copyright (C) 2014-2021 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// History: -// 17/05/16 - Sergey POKHODENKO - Creation of the file #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ #define SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ @@ -39,22 +52,35 @@ public: MODELHIGHAPI_EXPORT std::shared_ptr feature() const; + /// If feature is composite return intefrace for sub-feature by zero-based index, + /// or empty pointer if feature not composite or does not have sub-feature with such index. + MODELHIGHAPI_EXPORT + std::shared_ptr subFeature(const int theIndex) const; + /// Shortcut for feature()->getKind() MODELHIGHAPI_EXPORT const std::string& getKind() const; /// Shortcut for feature()->execute() + /// \param isForce start execution of feature instead of sending events MODELHIGHAPI_EXPORT - void execute(); + void execute(bool isForce = false); /// Shortcut for feature()->data()->setName() MODELHIGHAPI_EXPORT - void setName(const std::string& theName); + void setName(const std::wstring& theName); + + /// Shortcut for feature()->data()->name() + MODELHIGHAPI_EXPORT + std::wstring name() const; + + /// Return firts object of the feature + MODELHIGHAPI_EXPORT + virtual ModelHighAPI_Selection result() const; - // TODO(spo): rename to selectAll() /// Return all objects of the feature MODELHIGHAPI_EXPORT - virtual std::list result() const; + virtual std::list results() const; /// Return default result. Default implementation feature()->lastResult() MODELHIGHAPI_EXPORT @@ -70,10 +96,10 @@ public: /// Dump wrapped feature MODELHIGHAPI_EXPORT - virtual void dump(ModelHighAPI_Dumper& theDumper) const {} + virtual void dump(ModelHighAPI_Dumper& /*theDumper*/) const {} protected: - std::shared_ptr myFeature; + std::shared_ptr myFeature; ///< feature of this interface std::map myAttrGetter; ///< names of attributes and their getters };