]> Creatis software - clitk.git/blob - vv/vvToolManager.cxx
- add "convert to" in context menu
[clitk.git] / vv / vvToolManager.cxx
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
19 #include "vvToolManager.h"
20 #include "vvToolCreatorBase.h"
21 #include "vvMainWindowBase.h"
22
23 //------------------------------------------------------------------------------
24 /// Unique static instance 
25 vvToolManager* vvToolManager::mSingleton=0; 
26 //------------------------------------------------------------------------------
27
28
29 //------------------------------------------------------------------------------
30 vvToolManager * vvToolManager::GetInstance() {
31   if (mSingleton == 0) {
32     mSingleton = new vvToolManager;
33   }
34   return mSingleton;
35 }
36 //------------------------------------------------------------------------------
37
38
39 //------------------------------------------------------------------------------
40 void vvToolManager::AddTool(vvToolCreatorBase * v)  {
41   std::cout << "Adding the tool <" << v->mToolName.toStdString() << ">." << std::endl;
42   GetInstance()->mListOfTools.push_back(v);
43 }  
44 //------------------------------------------------------------------------------
45
46
47 //------------------------------------------------------------------------------
48 void vvToolManager::InsertToolsInMenu(vvMainWindowBase * m) {
49   for(unsigned int i=0; i<GetInstance()->mListOfTools.size(); i++) {
50     GetInstance()->mListOfTools[i]->InsertToolInMenu(m);
51   }
52 }
53 //------------------------------------------------------------------------------
54