]> Creatis software - clitk.git/blob - vv/vvToolBase.h
Debug RTStruct conversion with empty struc
[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://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
19 #ifndef VVTOOLBASE_H
20 #define VVTOOLBASE_H
21
22 #include "vvToolBaseBase.h"
23 #include "vvToolCreator.h"
24 #include <QIcon>
25
26 //------------------------------------------------------------------------------
27 template<class ToolType>
28 class vvToolBase : public vvToolBaseBase {
29 public:
30   vvToolBase(vvMainWindowBase * m);
31   virtual ~vvToolBase() {};
32   
33   static void Initialize();  // can't be virtual, must be overwritten
34
35   static void SetToolName(QString n) { vvToolCreator<ToolType>::GetInstance()->mToolName = n; }
36   static void SetToolMenuName(QString n) { vvToolCreator<ToolType>::GetInstance()->mToolMenuName = n; }
37   static void SetToolIconFilename(QString n) { vvToolCreator<ToolType>::GetInstance()->mToolIconFilename = n; }
38   static void SetToolTip(QString n) { vvToolCreator<ToolType>::GetInstance()->mToolTip = n; }
39   static void SetToolExperimental(bool exp) { vvToolCreator<ToolType>::GetInstance()->mExperimental = exp; }
40   static void SetToolInMenu(std::string menu) { vvToolCreator<ToolType>::GetInstance()->SetMenuName(menu); }
41
42   static QIcon GetToolIcon() { return QIcon(vvToolCreator<ToolType>::GetInstance()->mToolIconFilename); }
43   static QString & GetToolName() { return vvToolCreator<ToolType>::GetInstance()->mToolName; }
44
45   vvSlicerManager * AddImage(vvImage::Pointer image,std::string filename) {
46     return CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); 
47   }
48
49   void setSender(QObject *s) { mSender = s; }
50
51  protected:
52   QObject * mSender;
53 };
54 //------------------------------------------------------------------------------
55
56 #include "vvToolBase.txx"
57
58 #endif
59