}
}
}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+vvToolCreatorBase * vvToolManager::GetToolCreatorFromName(QString toolTypeName)
+{
+ std::vector<vvToolCreatorBase *> & v = vvToolManager::GetInstance()->GetListOfTools();
+ int index=-1;
+ for(uint i=0; i<v.size(); i++) {
+ // DD(v[i]->mToolName.toStdString());
+ if (v[i]->mToolName == toolTypeName) {
+ index = i;
+ }
+ }
+ if (index == -1) {
+ std::cerr << "Error, ToolCreator named '" << toolTypeName.toStdString()
+ << "' does not exist. Abort." << std::endl;
+ return NULL;
+ }
+ return v[index];
+}
+//------------------------------------------------------------------------------
+
+
class vvToolCreatorBase;
class vvMainWindowBase;
+class QString;
+class vvToolBaseBase;
//------------------------------------------------------------------------------
// Manage a list of ToolCreator. Each tool will be automagically
/// Called in MainWindow, make the tools enabled/disabled
static void EnableToolsInMenu(vvMainWindowBase * m, bool enable);
+ std::vector<vvToolCreatorBase *> & GetListOfTools() { return mListOfTools; }
+
+ vvToolCreatorBase * GetToolCreatorFromName(QString toolTypeName);
+
protected:
/// Singleton object pointer