Page MenuHomePhabricator

mitk::Geometry3D redundant function parameters
Closed, ResolvedPublic

Description

The methods

mitk::Geometry3D::IndexToWorld( const mitk::Point3D&, const& mitk::Vector3D, mitk::Vector3D&)

mitk::Geometry3D::WorldToIndex

mitk::Geometry3D::BackTransform

require except of the two (essential) references to a Vector3D also a mitk::Point3D, which is not used in the function body. Does a reason exist for having the Point3D as parameter in the function?

Event Timeline

Basti, could you check that? Or Andreas?

There are some classes which use this methods. Of course they also set the "unused" point parameter. (E.g. mitkImageMapperGL2D line 444)

I just saw that the methods mitk::Geometry3D::WorldToIndex and mitk::Geometry3D::IndexToWorld which take a point and two vectors as parameters are already declared deprecated.

But there are no other methods which transfom vectors. I would propose to just write new mitk::Geometry3D::WorldToIndex and mitk::Geometry3D::IndexToWorld for vectors. This methods can also be called by the deprecated ones.

I wrote new methods (named equally) which don't have the Point3D as parameter. These new methods are now called in the old deprecated ones.

If the old deprecated ones will be called, a MITK_INFO will be printed.

The Geometry3DTest was enhanced for testing transformation with vectors.

There exists also a "\deprecated" tag in doxygen, http://www.stack.nl/~dimitri/doxygen/commands.html#cmddeprecated , maybe that could be used as well.

[d2b233]: Merge branch 'bug-4455-Geometry3D-redundant-function-parameters'

Merged commits:

2011-03-29 09:33:53 Andreas Fetzer [50008d]
Wrote new methods without the redundant parameter Point3D. I also started writing
additional test for the transformation of vectors.