X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_CompositeFeature.h;h=1011b350b9272fe6fb185582fa7af3e32a48de25;hb=7b4be16ca6e44bd9fc8aaca8cda03646801adcd4;hp=3498b8fb1c0d714c2cde47218c9bcf12e915ca0e;hpb=f1cd93fd02a54259f72e3191d037323a496b2bef;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_CompositeFeature.h b/src/ModelAPI/ModelAPI_CompositeFeature.h index 3498b8fb1..1011b350b 100644 --- a/src/ModelAPI/ModelAPI_CompositeFeature.h +++ b/src/ModelAPI/ModelAPI_CompositeFeature.h @@ -1,37 +1,66 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// Copyright (C) 2014-2017 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 +// -// File: ModelAPI_CompositeFeature.hxx -// Created: 20 Oct 2014 -// Author: Mikhail PONIKAROV - -#ifndef ModelAPI_CompositeFeature_H_ -#define ModelAPI_CompositeFeature_H_ +#ifndef MODELAPI_COMPOSITEFEATURE_H_ +#define MODELAPI_COMPOSITEFEATURE_H_ +#include "ModelAPI.h" #include "ModelAPI_Feature.h" /**\class ModelAPI_CompositeFeature * \ingroup DataModel * \brief Feature that consists of other features: like sketcher - * with edges inside. It just allows t oadd a feature to this feature only + * with edges inside. It just allows to add a feature to this feature only * instead of adding in both document and this feature. */ class ModelAPI_CompositeFeature : public ModelAPI_Feature { public: + MODELAPI_EXPORT virtual ~ModelAPI_CompositeFeature(); + /// Adds feature to the sketch and to its document virtual std::shared_ptr addFeature(std::string theID) = 0; /// Returns the number of sub-elements - virtual int numberOfSubs() const = 0; + virtual int numberOfSubs(bool forTree = false) const = 0; /// Returns the sub-feature by zero-base index - virtual std::shared_ptr subFeature(const int theIndex) const = 0; + virtual std::shared_ptr subFeature(const int theIndex, + bool forTree = false) = 0; /// Returns the sub-feature unique identifier in this composite feature by zero-base index virtual int subFeatureId(const int theIndex) const = 0; - /// Returns true if feature or reuslt belong to this composite feature as subs + /// Returns true if feature or result belong to this composite feature as subs virtual bool isSub(ObjectPtr theObject) const = 0; + + /// 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) + virtual void removeFeature(std::shared_ptr theFeature) = 0; + + /// Exchanges IDs of two given features: needed for more correct naming in some cases (issue 769) + MODELAPI_EXPORT virtual void exchangeIDs(std::shared_ptr theFeature1, + std::shared_ptr theFeature2); + + /// in addition removes all subs + MODELAPI_EXPORT virtual void erase(); }; //! Pointer on the composite feature object