X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolManager.h;h=01f1e819f5856f927cf561ee78155f6e58561e27;hb=0a85e47a06c7d046d06a4645b724c4e81b19998d;hp=8d8c1da9a50bf05812044520bf783ee9b5901e08;hpb=6bfb777400c8ef3778564641cb1d27fed28f2db1;p=clitk.git diff --git a/vv/vvToolManager.h b/vv/vvToolManager.h index 8d8c1da..01f1e81 100644 --- a/vv/vvToolManager.h +++ b/vv/vvToolManager.h @@ -3,8 +3,8 @@ Program: vv Module: $RCSfile: vvToolManager.h,v $ Language: C++ - Date: $Date: 2010/02/03 10:54:08 $ - Version: $Revision: 1.2 $ + Date: $Date: 2010/02/24 11:42:42 $ + Version: $Revision: 1.3 $ Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr) Copyright (C) 2008 @@ -28,11 +28,10 @@ #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 @@ -40,15 +39,25 @@ class vvMainWindow; // 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 - std::vector 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 mListOfTools; }; //------------------------------------------------------------------------------