[Insight-developers] RE: [Insight-users] TODO for AffineTransform::Rotate3D()

Lorensen, William E (Research) lorensen at crd.ge.com
Wed, 28 Jan 2004 15:12:34 -0500


Actually, I agree with 3). 



-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Wednesday, January 28, 2004 2:40 PM
To: Luis Ibanez
Cc: Lorensen, William E (Research); Insight Developers
Subject: Re: [Insight-users] TODO for AffineTransform::Rotate3D()


On Wed, 28 Jan 2004, Luis Ibanez wrote:

> The concept checking for dimension seems to be ok when we only use C++,
> since the methods are only compiled when used, but... wouldn't it
> generate problems for wrapping ? We are instantiating this transform for
> both 2D and 3D and the wrapping layer instantiates all the methods.

They are only compiled when used if we are not doing explicit
instantiation.  An explicit instantiation will compile all methods.
Since I'm looking into using explicit instantiation for common types to
reduce space and time requirements, this is not just a problem for
wrapping.

There are a few ways to solve this problem:

1.) Use partial specialization to leave these method definitions empty
when not instantiating the proper dimension.  This would probably be the
correct solution if we could use it.

2.) Define full specializations of the method for all the wrapped types to
leave the definition empty for the improper dimensions.  This requires
maintenance.

3.) Remove the methods altogether and require the general Rotate method to
be used.  I vote for this approach.

-Brad