Salome HOME
2D PointLocator remapping now works properly on non-convex polygons.
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingTraits.hxx
1 // Copyright (C) 2016-2020  CEA/DEN, EDF R&D
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, or (at your option) any later version.
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 // Author : Anthony Geay (EDF R&D)
20
21 #pragma once
22
23 #include "MEDCoupling.hxx"
24 #include "MCType.hxx"
25 #include <vector>
26
27 namespace MEDCoupling
28 {
29   template<class T>
30   struct MEDCOUPLING_EXPORT Traits
31   {
32     using EltType = T;
33   };
34
35   class DataArrayInt32;
36   class DataArrayFloat;
37   class DataArrayDouble;
38   class DataArrayChar;
39   class DataArrayByte;
40   class DataArrayInt64;
41   class MEDCouplingFieldDouble;
42   class MEDCouplingFieldFloat;
43   class MEDCouplingFieldInt32;
44   class MEDCouplingFieldInt64;
45   class DataArrayInt32Tuple;
46   class DataArrayInt64Tuple;
47   class DataArrayFloatTuple;
48   class DataArrayDoubleTuple;
49   class DataArrayByteTuple;
50   class DataArrayInt32Iterator;
51   class DataArrayInt64Iterator;
52   class DataArrayByteIterator;
53   
54   template<>
55   struct MEDCOUPLING_EXPORT Traits<double>
56   {
57     static const char ArrayTypeName[];
58     static const char FieldTypeName[];
59     static const char NPYStr[];
60     static const char ReprStr[];
61     using ArrayType = DataArrayDouble;
62     using ArrayTypeCh = DataArrayDouble;
63     using FieldType = MEDCouplingFieldDouble;
64     using ArrayTuple = DataArrayDoubleTuple;
65   };
66
67   template<>
68   struct MEDCOUPLING_EXPORT Traits<float>
69   {
70     static const char ArrayTypeName[];
71     static const char FieldTypeName[];
72     static const char NPYStr[];
73     static const char ReprStr[];
74     using ArrayType = DataArrayFloat;
75     using ArrayTypeCh = DataArrayFloat;
76     using FieldType = MEDCouplingFieldFloat;
77     using ArrayTuple = DataArrayFloatTuple;
78   };
79   
80   template<>
81   struct MEDCOUPLING_EXPORT Traits<Int32>
82   {
83     static const char ArrayTypeName[];
84     static const char FieldTypeName[];
85     static const char NPYStr[];
86     static const char ReprStr[];
87     static const char VTKReprStr[];
88     using ArrayType = DataArrayInt32;
89     using ArrayTypeCh = DataArrayInt32;
90     using FieldType = MEDCouplingFieldInt32;
91     using ArrayTuple = DataArrayInt32Tuple;
92     using IteratorType = DataArrayInt32Iterator;
93   };
94
95   template<>
96   struct MEDCOUPLING_EXPORT Traits<Int64>
97   {
98     static const char ArrayTypeName[];
99     static const char FieldTypeName[];
100     static const char NPYStr[];
101     static const char ReprStr[];
102     static const char VTKReprStr[];
103     using ArrayType = DataArrayInt64;
104     using ArrayTypeCh = DataArrayInt64;
105     using FieldType = MEDCouplingFieldInt64;
106     using ArrayTuple = DataArrayInt64Tuple;
107     using IteratorType = DataArrayInt64Iterator;
108   };
109
110   template<>
111   struct MEDCOUPLING_EXPORT Traits<char>
112   {
113     static const char ArrayTypeName[];
114     using ArrayTypeCh = DataArrayByte;
115     using ArrayType = DataArrayChar;
116     using ArrayTuple = DataArrayByteTuple;
117     using IteratorType = DataArrayByteIterator;
118   };
119 }