1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
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
25 #include "vvSlicerManager.h"
26 #include "vvMainWindowBase.h"
30 class QXmlStreamReader;
32 //------------------------------------------------------------------------------
33 class vvToolCreatorBase: public QObject {
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; }
47 std::vector<vvToolBaseBase*> & GetListOfTool() { return mListOfTool; }
50 QString mToolMenuName;
51 QString mToolIconFilename;
57 std::vector<QAction*> mListOfActions;
58 #if __cplusplus > 199711L
59 std::shared_ptr<QXmlStreamReader> m_XmlReader;
61 std::auto_ptr<QXmlStreamReader> m_XmlReader;
67 virtual void MenuToolSlot();
70 vvMainWindowBase * mMainWindow;
71 std::vector<vvToolBaseBase*> mListOfTool;
73 std::string m_MenuName;
75 //------------------------------------------------------------------------------
77 #include "vvToolCreatorBase.txx"