]> Creatis software - crea.git/blob - src/creaVtk.h
69435b627f525b8350d68c2041099b8b9e5c380b
[crea.git] / src / creaVtk.h
1 #ifndef __creaVtk_h_INCLUDED__
2 #define __creaVtk_h_INCLUDED__
3
4 #ifdef USE_VTK
5
6 #include "creaSystem.h"
7 #include <vtkImageData.h>
8
9 namespace crea
10 {
11   template <class T>
12
13   CREA_EXPORT vtkImageData* NewVtkImageDataFromRaw( T* data,
14                                                     int nx, 
15                                                     int ny,
16                                                     int nz,
17                                                     bool do_not_desalloc = true);
18   /*
19     // Already provided by vtkTypeTraits<T>::VTKTypeID()
20   template <class T>
21   int GetVtkType(T&) { return VTK_VOID; }
22
23 #define SPECIALIZE_GETVTKIDTYPE(T,R) \
24   template <> int GetVtkType<T>(T&) { return R; }  
25
26   SPECIALIZE_GETVTKIDTYPE(char,VTK_CHAR)
27   SPECIALIZE_GETVTKIDTYPE(signed char,VTK_SIGNED_CHAR)
28   SPECIALIZE_GETVTKIDTYPE(unsigned char,VTK_UNSIGNED_CHAR)
29   SPECIALIZE_GETVTKIDTYPE(short,VTK_SHORT)
30   SPECIALIZE_GETVTKIDTYPE(unsigned short,VTK_UNSIGNED_SHORT)
31   SPECIALIZE_GETVTKIDTYPE(int,VTK_INT)
32   SPECIALIZE_GETVTKIDTYPE(unsigned int,VTK_UNSIGNED_INT)
33   SPECIALIZE_GETVTKIDTYPE(long,VTK_LONG)
34   SPECIALIZE_GETVTKIDTYPE(unsigned long,VTK_UNSIGNED_LONG)
35   SPECIALIZE_GETVTKIDTYPE(float,VTK_FLOAT)
36   SPECIALIZE_GETVTKIDTYPE(double,VTK_DOUBLE)
37
38 #undef SPECIALIZE_GETVTKIDTYPE
39   */
40 }
41
42 #include "creaVtk.txx"
43
44
45 #endif // USE_VTK
46 #endif // __creaVtk_h_INCLUDED__