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 #include "vvToolManager.h"
19 #include "vvToolCreatorBase.h"
20 #include "vvMainWindowBase.h"
22 //------------------------------------------------------------------------------
23 /// Unique static instance
24 vvToolManager* vvToolManager::mSingleton=0;
25 //------------------------------------------------------------------------------
28 //------------------------------------------------------------------------------
29 vvToolManager * vvToolManager::GetInstance() {
30 if (mSingleton == 0) {
31 mSingleton = new vvToolManager;
35 //------------------------------------------------------------------------------
38 //------------------------------------------------------------------------------
39 void vvToolManager::AddTool(vvToolCreatorBase * v) {
40 std::cout << "Adding the tool <" << v->mToolName.toStdString() << ">." << std::endl;
41 GetInstance()->mListOfTools.push_back(v);
43 //------------------------------------------------------------------------------
46 //------------------------------------------------------------------------------
47 void vvToolManager::InsertToolsInMenu(vvMainWindowBase * m) {
48 for(unsigned int i=0; i<GetInstance()->mListOfTools.size(); i++) {
49 GetInstance()->mListOfTools[i]->InsertToolInMenu(m);
52 //------------------------------------------------------------------------------