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