[vtk-developers] Sized types: vtkInt32Type et al

David Gobbi dgobbi at atamai.com
Mon May 30 16:22:42 EDT 2005


Brad King wrote:

> David,
>
> I've gotten enough changes committed that you should be able to use it 
> for vtkImageReslice.  Please try it when you can and let me know if it 
> does what you originally did with vtkSizedTypes.h.
>
> Brad King wrote:
>
>> We propose a "vtkTemplateAliasMacro" that can be used in place of 
>> vtkTemplateMacro when such aliasing is safe.
>
>
> I've added a "vtkTemplateAliasMacro.h" header file that defines this 
> macro.  It must be explicitly included to be used.
>
>> A vtkTypeTraits class template with specializations for each native 
>> type will help solve these issues behind the scenes.
>
>
> I've added a "vtkTypeTraits.h" header that defines a vtkTypeTraits 
> template with some useful information about each type.  It must be 
> explicitly included to be used.
>
> The vtkType* typedef-ed names have been added to 
> "vtkSystemIncludes.h".  These type names should be available in any 
> VTK source file.

Thanks, I'll re-institute the vtkImageReslice changes so that it uses 
this stuff.  The type-traits struct is very nice.

I see that in vtkTemplateAliasMacro you kept the ability to turn 
individual types on or off, just like in my original code.
The nested macros are an interesting way to do this... I'd have to say 
that my original, verbose formulation was a bit easier to
read.  I guess that fewer lines of code means less chance of a typo 
creeping in, though.

In vtkImageReslice.cxx I'm going to use this to explicitly turn 
vtkTypeInt64 and vtkTypeUInt64 off, since my code can't
properly handle 64-bit int types yet.

 - David



More information about the vtk-developers mailing list