]> Creatis software - clitk.git/blob - vv/vvToolCreatorBase.h
Debug RTStruct conversion with empty struc
[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 class QXmlStreamReader;
31
32 //------------------------------------------------------------------------------
33 class vvToolCreatorBase: public QObject {
34   Q_OBJECT
35   public:
36
37   vvToolCreatorBase(QString name);
38   virtual ~vvToolCreatorBase() {}
39   virtual void InsertToolInMenu(vvMainWindowBase * m);
40   virtual void InsertToolInContextMenu();
41   template<class ToolType> void CreateTool();
42   virtual void MenuSpecificToolSlot() = 0;
43   vvMainWindowBase * GetMainWindow() const { return mMainWindow; }
44   void addMenuToContextMenu(QMenu * m);
45   void SetMenuName(std::string m) { m_MenuName = m; }
46
47   std::vector<vvToolBaseBase*> & GetListOfTool() { return mListOfTool; }
48
49   QString mToolName;
50   QString mToolMenuName;
51   QString mToolIconFilename;
52   QString mToolTip;
53   QAction * mAction;
54   bool mExperimental;
55   bool mUseContextMenu;
56   QMenu * mToolMenu;
57   std::vector<QAction*> mListOfActions;
58 #if __cplusplus > 199711L
59   std::shared_ptr<QXmlStreamReader> m_XmlReader;
60 #else
61   std::auto_ptr<QXmlStreamReader> m_XmlReader;
62 #endif
63   bool mReadStateFlag;
64   int mImageIndex;
65
66 public slots:
67   virtual void MenuToolSlot();
68
69 protected:
70   vvMainWindowBase * mMainWindow;
71   std::vector<vvToolBaseBase*> mListOfTool;
72   QObject * mSender;
73   std::string m_MenuName;
74 };
75 //------------------------------------------------------------------------------
76
77 #include "vvToolCreatorBase.txx"
78
79 #endif
80