[Insight-developers] Better Point Casting

Damion Shelton dmshelto@andrew.cmu.edu
Wed, 20 Feb 2002 16:03:45 -0500


> I would rather not allow casting Points to Vectors because
> that blurrs the distintion between both concepts and removes
> all the interest in having both classes

Hi... I think this has been already addressed by later emails (having 
trouble keeping track), but in addition to assuming that the developer 
knows what's going on, this particular case is/was a problem in some of the 
blox code because there are two interpretations of what a point is:

1) A point in n-d space
2) A vector from the origin n-d space

Depending on the particular operation, it's very helpful to interconvert 
the  two directly. The existing implementation of itk::Point requires 
calling:

VectorType GetVectorFromOrigin (void)

It seems that a well-written cast could accomplish more-or-less the same 
thing without requiring a function call, and without losing clarity.

-Damion-