Salome HOME
untabify
[modules/visu.git] / src / CONVERTOR / VISU_VTKTypeList.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_VTKTypeList.hxx
24 //  Author : Oleg UVAROV
25 //  Module : VISU
26 //
27 #ifndef VISU_VTKTypeList_HeaderFile
28 #define VISU_VTKTypeList_HeaderFile
29
30 #include "VISU_TypeList.hxx"
31
32 #include <vtkCharArray.h>
33 #include <vtkUnsignedCharArray.h>
34 #include <vtkShortArray.h>
35 #include <vtkUnsignedShortArray.h>
36 #include <vtkIntArray.h>
37 #include <vtkUnsignedIntArray.h>
38 #include <vtkLongArray.h>
39 #include <vtkUnsignedLongArray.h> 
40 #include <vtkFloatArray.h> 
41 #include <vtkDoubleArray.h> 
42
43
44 //----------------------------------------------------------------------------
45 namespace VISU
46 {
47   //----------------------------------------------------------------------------
48   namespace TL
49   {
50     //----------------------------------------------------------------------------
51     typedef TSequence< char, 
52                        unsigned char, 
53                        short, 
54                        unsigned short, 
55                        int, 
56                        unsigned int, 
57                        long, 
58                        unsigned long, 
59                        float, 
60                        double >::TResult TVTKBasicTypeList;
61
62
63     //----------------------------------------------------------------------------
64     typedef TSequence< vtkCharArray, 
65                        vtkUnsignedCharArray, 
66                        vtkShortArray, 
67                        vtkUnsignedShortArray, 
68                        vtkIntArray, 
69                        vtkUnsignedIntArray, 
70                        vtkLongArray, 
71                        vtkUnsignedLongArray, 
72                        vtkFloatArray, 
73                        vtkDoubleArray >::TResult TVTKArrayTypeList;
74
75
76     //----------------------------------------------------------------------------
77     typedef TSequence< TInt2Type< VTK_CHAR >, 
78                        TInt2Type< VTK_UNSIGNED_CHAR >, 
79                        TInt2Type< VTK_SHORT >, 
80                        TInt2Type< VTK_UNSIGNED_SHORT >, 
81                        TInt2Type< VTK_INT >, 
82                        TInt2Type< VTK_UNSIGNED_INT >, 
83                        TInt2Type< VTK_LONG >, 
84                        TInt2Type< VTK_UNSIGNED_LONG >, 
85                        TInt2Type< VTK_FLOAT >, 
86                        TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
87     
88     
89     //----------------------------------------------------------------------------
90     template< unsigned int type_enum >
91     struct TEnum2VTKBasicType
92     {
93       typedef typename TTypeAt< TVTKBasicTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult;
94     };
95
96     
97     //----------------------------------------------------------------------------
98     template< unsigned int type_enum >
99     struct TEnum2VTKArrayType
100     {
101       typedef typename TTypeAt< TVTKArrayTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult;
102     };
103     
104
105     //----------------------------------------------------------------------------
106     template< class T >
107     struct TVTKBasicType2Enum
108     {
109       typedef typename TTypeAt< TVTKBasicEnumList, TIndexOf< TVTKBasicTypeList, T >::value >::TResult TResult;
110     };
111     
112
113     //----------------------------------------------------------------------------
114   }
115
116
117   //----------------------------------------------------------------------------
118 }
119
120 #endif