Hello!

I am trying to develop new tools (or customized versions of those 
available in MITK) and got into a problem:

I do not want to register my tool in the usual place in 
CoreObjectFactory's constructor because I do not want to always have to 
recompile the library for each change I do to the code. (Or for each new 
tool I experiment with!).

My first guess was that I could just get the CoreObjectFactory instance 
at any place on my code and then register the tool. From that moment on, 
any ToolManager would include the new tool. I did something like this in 
the SampleApp constructor:

mitk::CoreObjectFactory::Pointer instance = 
mitk::CoreObjectFactory::GetInstance(); 
instance.GetPointer()->RegisterFactory(mitk::RegionGrowingToolFactory::New());

mitk::ToolManager::Pointer m_ToolManager = mitk::ToolManager::New();
const mitk::ToolManager::ToolVectorTypeConst allTools = 
m_ToolManager->GetTools();

  for ( mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = 
allTools.begin();
        iter != allTools.end();
        ++iter )
  {
    const mitk::Tool* tool = *iter;

    std::cout << tool->GetGroup() << " -- " << tool->GetName() << std::endl;

  }

This, I hoped, would result in a new RegionGrowingTool in the Tools 
listing provided by the for cycle, but that did not happen!

Does anyone have a clue to why this does not work or what is the correct 
method to do it? I am probably missing something or understanding the 
all ObjectFactory concept incorrectly.

Thanks in advance!

Samuel



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to