]> Creatis software - clitk.git/blob - vv/vvToolCreatorBase.h
Merge branch 'master' of /home/romulo/creatis/clitk3-git-shared/clitk3
[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://www.centreleonberard.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
21 //qt
22 #include <QObject>
23
24 // vv
25 #include "vvSlicerManager.h"
26 #include "vvMainWindowBase.h"
27
28 class QAction;
29 class vvToolBaseBase;
30
31 //------------------------------------------------------------------------------
32 class vvToolCreatorBase: public QObject {
33   Q_OBJECT
34   public:
35
36   vvToolCreatorBase(QString name);
37   virtual ~vvToolCreatorBase() {;}  
38   virtual void InsertToolInMenu(vvMainWindowBase * m);
39   virtual void InsertToolInContextMenu();
40   template<class ToolType> void CreateTool();
41   virtual void MenuSpecificToolSlot() = 0;
42   vvMainWindowBase * GetMainWindow() const { return mMainWindow; }
43   void addMenuToContextMenu(QMenu * m);
44   void SetMenuName(std::string m) { m_MenuName = m; }
45
46   QString mToolName;
47   QString mToolMenuName;
48   QString mToolIconFilename;
49   QString mToolTip;
50   QAction * mAction;
51   bool mExperimental;
52   bool mUseContextMenu;
53   QMenu * mToolMenu;
54   std::vector<QAction*> mListOfActions;
55
56 public slots:
57   virtual void MenuToolSlot();
58
59 protected:
60   vvMainWindowBase * mMainWindow;
61   std::vector<vvToolBaseBase*> mListOfTool;
62   QObject * mSender;
63   std::string m_MenuName;
64 };
65 //------------------------------------------------------------------------------
66
67 #include "vvToolCreatorBase.txx"
68
69 #endif
70