Hi Miklos and Matt,

thank you for reporting that. This was indeed not intended :)
I will take care of this. Actually we will rename the new function just as Matt 
suggested.
It will be fixed in the release.

Best
Andreas

On Sep 30, 2013, at 6:27 PM, Miklos Espak 
<esp...@gmail.com<mailto:esp...@gmail.com>> wrote:

The workaround was to replace this:


      mitk::SliceNavigationController::ViewDirection viewDirection = 
sliceNavigationController->GetViewDirection();

with

      mitk::SliceNavigationController::ViewDirection viewDirection = 
const_cast<const 
mitk::SliceNavigationController*>(sliceNavigationController)->GetViewDirection();


That is, the getter generated by the macro is a const function that returns an 
enum, and the other one is a non-const function that returns const char*. 
Although C++ allows function overloading with different return types if only 
the "const-ness" differs (e.g. for returning const and non-const iterators), I 
think the current case is a misuse. ;-)


Miklos


On 30 September 2013 17:02, Miklos Espak 
<esp...@gmail.com<mailto:esp...@gmail.com>> wrote:
Also, there is a typo in line 157:

    case 3:
        viewDirectionString = "Orginal";


On 30 September 2013 16:53, Clarkson, Matt 
<m.clark...@ucl.ac.uk<mailto:m.clark...@ucl.ac.uk>> wrote:
Hi there,

mitk::SliceNavigationController now has

itkGetEnumMacro(ViewDirection, ViewDirection);
and
const char* GetViewDirection();

which in our code, such as:
mitk::SliceNavigationController::ViewDirection viewDirection = 
sliceNavigationController->GetViewDirection();

results in:
error: cannot convert ‘const char*’ to 
‘mitk::SliceNavigationController::ViewDirection’ in initialization

I notice that GetViewDirection is not used that often.

pwd
/Users/mattclarkson/build/MITK
Legolas:MITK mattclarkson$ grep -rl GetViewDirection *
Core/Code/Controllers/mitkSliceNavigationController.cpp
Core/Code/Controllers/mitkSliceNavigationController.h
Modules/InputDevices/WiiMote/mitkWiiMoteVtkCameraController.cpp
Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.cpp

and in all cases, its used as an enum? However, I can't see why code in 
QmitkSlicesInterpolator.cpp works, calling GetViewDirection and assigning it to 
an Enum, but in our code it does not work.

But it also strikes me that mitk::SliceNavigationController should not have the 
same method name with two different return types.

Any suggestions on how to fix this? I would rename the one that returns a const 
char* to GetViewDirectionAsString or similar.

Thanks

Matt


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/mitk-users



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to