]> Creatis software - clitk.git/blob - vv/vvToolCreatorBase.h
- add "convert to" in context menu
[clitk.git] / vv / vvToolCreatorBase.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #ifndef VVTOOLCREATORBASE_H
19 #define VVTOOLCREATORBASE_H
20 #include <QObject>
21 #include "vvSlicerManager.h"
22 #include "vvMainWindowBase.h"
23
24 class QAction;
25 class vvToolBaseBase;
26
27 //------------------------------------------------------------------------------
28 class vvToolCreatorBase: public QObject {
29   Q_OBJECT
30   public:
31
32   vvToolCreatorBase(QString name);
33   virtual ~vvToolCreatorBase() {;}  
34   virtual void InsertToolInMenu(vvMainWindowBase * m);
35   virtual void InsertToolInContextMenu();
36   template<class ToolType> void CreateTool();
37   virtual void MenuSpecificToolSlot() = 0;
38   vvMainWindowBase * GetMainWindow() const { return mMainWindow; }
39   void addMenuToContextMenu(QMenu * m);
40
41   QString mToolName;
42   QString mToolMenuName;
43   QString mToolIconFilename;
44   QString mToolTip;
45   QAction * mAction;
46   bool mExperimental;
47   bool mUseContextMenu;
48   QMenu * mToolMenu;
49   std::vector<QAction*> mListOfActions;
50
51 public slots:
52   virtual void MenuToolSlot();
53
54 protected:
55   vvMainWindowBase * mMainWindow;
56   std::vector<vvToolBaseBase*> mListOfTool;
57   QObject * mSender;
58 };
59 //------------------------------------------------------------------------------
60
61 #include "vvToolCreatorBase.txx"
62
63 #endif
64