]> Creatis software - crea.git/blob - src/creaVtk.h
#3180 crea Feature New Normal Future - Set wx-config for wxWidgets 2.8
[crea.git] / src / creaVtk.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Santé)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
10 #  This software is governed by the CeCILL-B license under French law and 
11 #  abiding by the rules of distribution of free software. You can  use, 
12 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
13 #  license as circulated by CEA, CNRS and INRIA at the following URL 
14 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
15 #  or in the file LICENSE.txt.
16 #
17 #  As a counterpart to the access to the source code and  rights to copy,
18 #  modify and redistribute granted by the license, users are provided only
19 #  with a limited warranty  and the software's author,  the holder of the
20 #  economic rights,  and the successive licensors  have only  limited
21 #  liability. 
22 #
23 #  The fact that you are presently reading this means that you have had
24 #  knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ 
26 */                                                                         
27
28
29 #ifndef __creaVtk_h_INCLUDED__
30 #define __creaVtk_h_INCLUDED__
31
32 #ifdef USE_VTK
33
34 #include "creaSystem.h"
35 #include <vtkImageData.h>
36
37 namespace crea
38 {
39   template <class T>
40
41   CREA_EXPORT vtkImageData* NewVtkImageDataFromRaw( T* data,
42                                                     int nx, 
43                                                     int ny,
44                                                     int nz,
45                                                     bool do_not_desalloc = true);
46   /*
47     // Already provided by vtkTypeTraits<T>::VTKTypeID()
48   template <class T>
49   int GetVtkType(T&) { return VTK_VOID; }
50
51 #define SPECIALIZE_GETVTKIDTYPE(T,R) \
52   template <> int GetVtkType<T>(T&) { return R; }  
53
54   SPECIALIZE_GETVTKIDTYPE(char,VTK_CHAR)
55   SPECIALIZE_GETVTKIDTYPE(signed char,VTK_SIGNED_CHAR)
56   SPECIALIZE_GETVTKIDTYPE(unsigned char,VTK_UNSIGNED_CHAR)
57   SPECIALIZE_GETVTKIDTYPE(short,VTK_SHORT)
58   SPECIALIZE_GETVTKIDTYPE(unsigned short,VTK_UNSIGNED_SHORT)
59   SPECIALIZE_GETVTKIDTYPE(int,VTK_INT)
60   SPECIALIZE_GETVTKIDTYPE(unsigned int,VTK_UNSIGNED_INT)
61   SPECIALIZE_GETVTKIDTYPE(long,VTK_LONG)
62   SPECIALIZE_GETVTKIDTYPE(unsigned long,VTK_UNSIGNED_LONG)
63   SPECIALIZE_GETVTKIDTYPE(float,VTK_FLOAT)
64   SPECIALIZE_GETVTKIDTYPE(double,VTK_DOUBLE)
65
66 #undef SPECIALIZE_GETVTKIDTYPE
67   */
68 }
69
70 #include "creaVtk.txx"
71
72
73 #endif // USE_VTK
74 #endif // __creaVtk_h_INCLUDED__