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://oncora1.lyon.fnclcc.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 VVTOOLCREATOR_H
19 #define VVTOOLCREATOR_H
21 #include "vvToolCreatorBase.h"
23 //------------------------------------------------------------------------------
24 template<class ToolType>
25 class vvToolCreator: public vvToolCreatorBase {
27 vvToolCreator(QString name):vvToolCreatorBase(name) {;}
28 virtual void InsertToolInMenu(vvMainWindowBase * m);
29 virtual void MenuSpecificToolSlot() { CreateTool<ToolType>(); }
30 static vvToolCreator<ToolType> * mSingleton;
32 //------------------------------------------------------------------------------
35 //------------------------------------------------------------------------------
36 #define CREATOR(CLASSNAME) vvToolCreator<CLASSNAME>::mSingleton
37 //------------------------------------------------------------------------------
40 //------------------------------------------------------------------------------
41 #define ADD_TOOL(NAME) \
43 vvToolCreator<NAME> * vvToolCreator<NAME>::mSingleton = \
44 new vvToolCreator<NAME>(#NAME);
45 //------------------------------------------------------------------------------
47 #include "vvToolCreator.txx"