Cortex  10.0.0-a4
MArrayTraits.h
1 //
3 // Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // * Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // * Neither the name of Image Engine Design nor the names of any
17 // other contributors to this software may be used to endorse or
18 // promote products derived from this software without specific prior
19 // written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
34 
35 #ifndef IE_MAYACORE_MARRAYTRAITS_H
36 #define IE_MAYACORE_MARRAYTRAITS_H
37 
38 #include "maya/MUintArray.h"
39 #include "maya/MUint64Array.h"
40 #include "maya/MStringArray.h"
41 #include "maya/MTimeArray.h"
42 #include "maya/MPlugArray.h"
43 #include "maya/MObjectArray.h"
44 #include "maya/MIntArray.h"
45 #include "maya/MFloatArray.h"
46 #include "maya/MDoubleArray.h"
47 #include "maya/MDagPathArray.h"
48 #include "maya/MColorArray.h"
49 #include "maya/MVectorArray.h"
50 #include "maya/MFloatVectorArray.h"
51 #include "maya/MPointArray.h"
52 #include "maya/MFloatPointArray.h"
53 #include "maya/MFnUInt64ArrayData.h"
54 #include "maya/MFnStringArrayData.h"
55 #include "maya/MFnIntArrayData.h"
56 #include "maya/MFnDoubleArrayData.h"
57 #include "maya/MFnVectorArrayData.h"
58 #include "maya/MFnPointArrayData.h"
59 
60 namespace IECoreMaya
61 {
62 
66 template<class T>
68 {
70  typedef void ValueType;
74  typedef void DataFn;
78  static MFn::Type dataType()
79  {
80  return MFn::kInvalid;
81  };
82 };
83 
84 template<>
85 struct MArrayTraits<MUintArray>
86 {
87  typedef unsigned int ValueType;
88  typedef void DataFn;
89  static MFn::Type dataType()
90  {
91  return MFn::kInvalid;
92  };
93 };
94 
95 template<>
96 struct MArrayTraits<MUint64Array>
97 {
98  typedef MUint64 ValueType;
99  typedef MFnUInt64ArrayData DataFn;
100  static MFn::Type dataType()
101  {
102  return MFn::kUInt64ArrayData;
103  };
104 };
105 
106 template<>
107 struct MArrayTraits<MStringArray>
108 {
109  typedef MString ValueType;
110  typedef MFnStringArrayData DataFn;
111  static MFn::Type dataType()
112  {
113  return MFn::kStringArrayData;
114  };
115 };
116 
117 template<>
118 struct MArrayTraits<MTimeArray>
119 {
120  typedef MTime ValueType;
121  typedef void DataFn;
122  static MFn::Type dataType()
123  {
124  return MFn::kInvalid;
125  };
126 };
127 
128 template<>
129 struct MArrayTraits<MPlugArray>
130 {
131  typedef MPlug ValueType;
132  typedef void DataFn;
133  static MFn::Type dataType()
134  {
135  return MFn::kInvalid;
136  };
137 };
138 
139 template<>
140 struct MArrayTraits<MObjectArray>
141 {
142  typedef MObject ValueType;
143  typedef void DataFn;
144  static MFn::Type dataType()
145  {
146  return MFn::kInvalid;
147  };
148 };
149 
150 template<>
151 struct MArrayTraits<MIntArray>
152 {
153  typedef int ValueType;
154  typedef MFnIntArrayData DataFn;
155  static MFn::Type dataType()
156  {
157  return MFn::kIntArrayData;
158  };
159 };
160 
161 template<>
162 struct MArrayTraits<MFloatArray>
163 {
164  typedef float ValueType;
165  typedef void DataFn;
166  static MFn::Type dataType()
167  {
168  return MFn::kInvalid;
169  };
170 };
171 
172 template<>
173 struct MArrayTraits<MDoubleArray>
174 {
175  typedef double ValueType;
176  typedef MFnDoubleArrayData DataFn;
177  static MFn::Type dataType()
178  {
179  return MFn::kDoubleArrayData;
180  };
181 };
182 
183 template<>
184 struct MArrayTraits<MDagPathArray>
185 {
186  typedef MDagPath ValueType;
187  typedef void DataFn;
188  static MFn::Type dataType()
189  {
190  return MFn::kInvalid;
191  };
192 };
193 
194 template<>
195 struct MArrayTraits<MColorArray>
196 {
197  typedef MColor ValueType;
198  typedef void DataFn;
199  static MFn::Type dataType()
200  {
201  return MFn::kInvalid;
202  };
203 };
204 
205 template<>
206 struct MArrayTraits<MVectorArray>
207 {
208  typedef MVector ValueType;
209  typedef MFnVectorArrayData DataFn;
210  static MFn::Type dataType()
211  {
212  return MFn::kVectorArrayData;
213  };
214 };
215 
216 template<>
217 struct MArrayTraits<MFloatVectorArray>
218 {
219  typedef MFloatVector ValueType;
220  typedef void DataFn;
221  static MFn::Type dataType()
222  {
223  return MFn::kInvalid;
224  };
225 };
226 
227 template<>
228 struct MArrayTraits<MPointArray>
229 {
230  typedef MPoint ValueType;
231  typedef MFnPointArrayData DataFn;
232  static MFn::Type dataType()
233  {
234  return MFn::kPointArrayData;
235  };
236 };
237 
238 template<>
239 struct MArrayTraits<MFloatPointArray>
240 {
241  typedef MFloatPoint ValueType;
242  typedef void DataFn;
243  static MFn::Type dataType()
244  {
245  return MFn::kInvalid;
246  };
247 };
248 
249 } // namespace IECoreMaya
250 
251 #endif // IE_MAYACORE_MARRAYTRAITS_H
static MFn::Type dataType()
Definition: MArrayTraits.h:78
void DataFn
Definition: MArrayTraits.h:74
Definition: MArrayTraits.h:67
The IECoreMaya namespace holds all the functionality of libIECoreMaya.
Definition: BoolParameterHandler.h:44
void ValueType
The type held in the array.
Definition: MArrayTraits.h:70