Program: vv
Module: $RCSfile: vvToolManager.h,v $
Language: C++
- Date: $Date: 2010/01/29 13:54:37 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/02/24 11:42:42 $
+ Version: $Revision: 1.3 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
#ifndef VVTOOLMANAGER_H
#define VVTOOLMANAGER_H
-#include "vvToolCreatorBase.h"
#include "clitkCommon.h"
class vvToolCreatorBase;
-class vvMainWindow;
+class vvMainWindowBase;
//------------------------------------------------------------------------------
// Manage a list of ToolCreator. Each tool will be automagically
// MainWindow will call the 'Initialize' to insert the tool in the
// menu bar.
class vvToolManager {
+
public:
- // Functions
+
+ /// Get or build unique instance with this method
static vvToolManager * GetInstance();
+
+ /// Add a tool creator in the list (called before main, via static member initialization)
static void AddTool(vvToolCreatorBase * v);
- static void Initialize(vvMainWindow * m);
- static void UpdateEnabledTool();
- // Variables
- static std::vector<vvToolCreatorBase *> mListOfTools;
+
+ /// Called in MainWindow, insert all tools into the menu
+ static void InsertToolsInMenu(vvMainWindowBase * m);
+
+protected:
+
+ /// Singleton object pointer
static vvToolManager * mSingleton;
-};
-//------------------------------------------------------------------------------
+ /// list of all tool creators
+ std::vector<vvToolCreatorBase *> mListOfTools;
+};
//------------------------------------------------------------------------------
-// Static instances initialization (to put in main)
-#define TOOL_MANAGER_INITIALIZATION \
- vvToolManager* vvToolManager::mSingleton=0; \
- std::vector<vvToolCreatorBase *> vvToolManager::mListOfTools;
-//------------------------------------------------------------------------------
-
#endif