]> Creatis software - clitk.git/blob - vv/vvToolBase.h
added the new headers
[clitk.git] / vv / vvToolBase.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 VVTOOLBASE_H
19 #define VVTOOLBASE_H
20 #include "vvToolBaseBase.h"
21 #include "vvToolCreator.h"
22
23 //------------------------------------------------------------------------------
24 template<class ToolType>
25 class vvToolBase : public vvToolBaseBase {
26 public:
27   vvToolBase(vvMainWindowBase * m);
28   static void Initialize();  // can't be virtual, must be overwritten
29
30   static void SetToolName(QString n) { vvToolCreator<ToolType>::mSingleton->mToolName = n; }
31   static void SetToolMenuName(QString n) { vvToolCreator<ToolType>::mSingleton->mToolMenuName = n; }
32   static void SetToolIconFilename(QString n) { vvToolCreator<ToolType>::mSingleton->mToolIconFilename = n; }
33   static void SetToolTip(QString n) { vvToolCreator<ToolType>::mSingleton->mToolTip = n; }
34   static void SetToolExperimental(bool exp) { vvToolCreator<ToolType>::mSingleton->mExperimental = exp; }
35
36   void AddImage(vvImage::Pointer image,std::string filename) {
37     CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); 
38   }
39
40 };
41 //------------------------------------------------------------------------------
42
43 #include "vvToolBase.txx"
44
45 #endif
46