X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSetPlugin%2FPartSetPlugin_Duplicate.h;h=d72fc67d31fb3d1180626a778c87569382f3404a;hb=44b3aa1055279520a1b3d7a6a77f90bf8db5d087;hp=9bab4d63e4e117e89f5ffd0d01b14e489f4ca4ff;hpb=6d67df3511c8cc3518911419aea31c15bafd2a8d;p=modules%2Fshaper.git diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.h b/src/PartSetPlugin/PartSetPlugin_Duplicate.h index 9bab4d63e..d72fc67d3 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.h +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.h @@ -1,27 +1,75 @@ -// File: PartSetPlugin_Duplicate.h -// Created: 20 May 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2020 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 +// -#ifndef PartSetPlugin_Duplicate_HeaderFile -#define PartSetPlugin_Duplicate_HeaderFile +#ifndef PartSetPlugin_Duplicate_H_ +#define PartSetPlugin_Duplicate_H_ -#include "PartSetPlugin_Part.h" - -/// the reference to copy: reference to the attribute -const std::string PART_DUPLICATE_ATTR_REF = "Origin"; +#include "PartSetPlugin.h" +#include /**\class PartSetPlugin_Duplicate - * \ingroup DataModel + * \ingroup Plugins * \brief Duplicates the active part (not root). Creates a new "part" feature. */ -class PartSetPlugin_Duplicate: public PartSetPlugin_Part +class PartSetPlugin_Duplicate : public ModelAPI_Feature { -public: - /// Makes a new part, copy of active - PartSetPlugin_Duplicate(); + public: + + /// Duplicate kind + inline static const std::string& ID() + { + static const std::string MY_REMOVE_KIND("Duplicate"); + return MY_REMOVE_KIND; + } +//LCOV_EXCL_START + /// Returns the kind of a feature + PARTSETPLUGIN_EXPORT virtual const std::string& getKind() + { + static std::string MY_KIND = PartSetPlugin_Duplicate::ID(); + return MY_KIND; + } +//LCOV_EXCL_STOP + + /// Returns to which group in the document must be added feature + PARTSETPLUGIN_EXPORT virtual const std::string& getGroup() + { + static std::string MY_GROUP = "Parts"; + return MY_GROUP; + } /// Request for initialization of data model of the feature: adding all attributes - PARTSETPLUGIN_EXPORT virtual void initAttributes(); + PARTSETPLUGIN_EXPORT virtual void initAttributes() {} + + /// Not normal feature that stored in the tree + PARTSETPLUGIN_EXPORT virtual bool isAction() + { + return true; + } + + /// Performs the "duplicate" + PARTSETPLUGIN_EXPORT virtual void execute(); + + /// Use plugin manager for features creation + PartSetPlugin_Duplicate() + { + } + }; #endif