X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Plugin.h;h=e5d0cc740b2442e20bb39265d3679f77e36380aa;hb=dc6ab7150ec816d25d7be4959407b6622b019e88;hp=2b26663504d1a8668fbcef2cecde7f639205e3ac;hpb=29b4b1b5e692ebc45e8a27703b9307b075d2cff2;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Plugin.h b/src/SketchPlugin/SketchPlugin_Plugin.h index 2b2666350..e5d0cc740 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.h +++ b/src/SketchPlugin/SketchPlugin_Plugin.h @@ -1,23 +1,51 @@ -// File: SketchPlugin_Plugin.hxx -// Created: 31 Mar 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2019 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 SketchPlugin_Plugin_HeaderFile -#define SketchPlugin_Plugin_HeaderFile +#ifndef SKETCHPLUGIN_PLUGIN_H_ +#define SKETCHPLUGIN_PLUGIN_H_ +#include +#include +#include +#include +#include -#include "SketchPlugin.h" -#include "ModelAPI_Plugin.h" - -class SKETCHPLUGIN_EXPORT SketchPlugin_Plugin: public ModelAPI_Plugin +/**\class SketchPlugin_Plugin + * \ingroup Plugins + * \brief Interface common for any plugin: allows to use plugin by the plugins manager. + */ +class SketchPlugin_Plugin : public ModelAPI_Plugin, public Events_Listener { public: /// Creates the feature object of this plugin by the feature string ID - virtual std::shared_ptr createFeature(std::string theFeatureID); + SKETCHPLUGIN_EXPORT virtual FeaturePtr createFeature(std::string theFeatureID); -public: - /// Is needed for python wrapping by swig - SketchPlugin_Plugin(); + /// Constructor that registers features and other plugin elements. + SKETCHPLUGIN_EXPORT SketchPlugin_Plugin(); + + //! Redefinition of Events_Listener method + SKETCHPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr& theMessage); + +protected: + //! Returns the state of the feature in the WorkBench: enabled or disabled for the moment. + std::shared_ptr getFeaturesState( + const std::shared_ptr& theFeature) const; }; #endif