]> Creatis software - clitk.git/blob - vv/vvToolManager.cxx
removed headers
[clitk.git] / vv / vvToolManager.cxx
1 #include "vvToolManager.h"
2 #include "vvToolCreatorBase.h"
3 #include "vvMainWindowBase.h"
4
5 //------------------------------------------------------------------------------
6 /// Unique static instance 
7 vvToolManager* vvToolManager::mSingleton=0; 
8 //------------------------------------------------------------------------------
9
10
11 //------------------------------------------------------------------------------
12 vvToolManager * vvToolManager::GetInstance() {
13   if (mSingleton == 0) {
14     mSingleton = new vvToolManager;
15   }
16   return mSingleton;
17 }
18 //------------------------------------------------------------------------------
19
20
21 //------------------------------------------------------------------------------
22 void vvToolManager::AddTool(vvToolCreatorBase * v)  {
23   std::cout << "Adding the tool <" << v->mToolName.toStdString() << ">." << std::endl;
24   GetInstance()->mListOfTools.push_back(v);
25 }  
26 //------------------------------------------------------------------------------
27
28
29 //------------------------------------------------------------------------------
30 void vvToolManager::InsertToolsInMenu(vvMainWindowBase * m) {
31   for(unsigned int i=0; i<GetInstance()->mListOfTools.size(); i++) {
32     GetInstance()->mListOfTools[i]->InsertToolInMenu(m);
33   }
34 }
35 //------------------------------------------------------------------------------
36