Page MenuHomePhabricator

Tool registration macro hard coded to use mitk namespace
Closed, ResolvedPublic

Description

In mitkToolFactoryMacro.h there is a macro that generates a code that uses the mitk namespace. Therefore, if you want to put your custom tool in your own namespace, the compilation will fail. The simple fix is to remove the 'mitk::' namespace qualifier from the macro. Since the macro is used within a namespace, anyway, this will not case any problem. I rebuilt the current MITK master with this change, successfully.

Pull request follows.

Event Timeline

macros to overcome assumption about tool and tool gui class names

I found a way of resolving this issue in our codebase, without modifying MITK. I created a macro that defines an 'alias' to our class that is in the mitk namespace, and registers that class with the MITK macro. The same had to be done for tool GUI classes, as QmitkToolSelectionBox assumes that the GUI class name has a "Qmitk" prefix and "GUI" suffix added to the tool class name.

I attached my macros just for the record and close this issue as 'resolved'.

[462e8b]: Merge branch 'bug-19601-ToolMacroUsesMITKNamespace'

Merged commits:

2016-04-27 13:02:10 Stefan Kislinskiy [9af474]
Merge remote-tracking branch 'NifTK/bug-19601-tool-macro-uses-mitk-namespace' into bug-19601-ToolMacroUsesMITKNamespace


2016-03-10 13:15:49 Miklos Espak [f81f48]
Remove hard-coded namespace qualifier from tool registration macro

Signed-off-by: Miklos Espak <m.espak@ucl.ac.uk>