Cortex  10.0.0-a4
MFnDataTypeTraits.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_MFNDATATYPETRAITS_H
36 #define IE_MAYACORE_MFNDATATYPETRAITS_H
37 
38 #include "maya/MFnData.h"
39 
40 #include "maya/MUintArray.h"
41 #include "maya/MUint64Array.h"
42 #include "maya/MStringArray.h"
43 #include "maya/MTimeArray.h"
44 #include "maya/MPlugArray.h"
45 #include "maya/MObjectArray.h"
46 #include "maya/MIntArray.h"
47 #include "maya/MFloatArray.h"
48 #include "maya/MDoubleArray.h"
49 #include "maya/MDagPathArray.h"
50 #include "maya/MColorArray.h"
51 #include "maya/MVectorArray.h"
52 #include "maya/MFloatVectorArray.h"
53 #include "maya/MPointArray.h"
54 #include "maya/MFloatPointArray.h"
55 #include "maya/MFnUInt64ArrayData.h"
56 #include "maya/MFnStringArrayData.h"
57 #include "maya/MFnIntArrayData.h"
58 #include "maya/MFnDoubleArrayData.h"
59 #include "maya/MFnVectorArrayData.h"
60 #include "maya/MFnPointArrayData.h"
61 
62 namespace IECoreMaya
63 {
64 
68 template<MFnData::Type T>
70 {
72  typedef void ValueType;
73 
75  static MFn::Type dataType()
76  {
77  return MFn::kInvalid;
78  }
79 };
80 
81 template<>
82 struct MFnDataTypeTraits<MFnData::kMatrix>
83 {
84  typedef MMatrix ValueType;
85 
86  static MFn::Type dataType()
87  {
88  return MFn::kMatrixData;
89  }
90 };
91 
92 template<>
93 struct MFnDataTypeTraits<MFnData::kString>
94 {
95  typedef MString ValueType;
96 
97  static MFn::Type dataType()
98  {
99  return MFn::kStringData;
100  }
101 };
102 
103 template<>
104 struct MFnDataTypeTraits<MFnData::kStringArray>
105 {
106  typedef MStringArray ValueType;
107 
108  static MFn::Type dataType()
109  {
110  return MFn::kStringArrayData;
111  }
112 };
113 
114 template<>
115 struct MFnDataTypeTraits<MFnData::kVectorArray>
116 {
117  typedef MVectorArray ValueType;
118 
119  static MFn::Type dataType()
120  {
121  return MFn::kVectorArrayData;
122  }
123 };
124 
125 template<>
126 struct MFnDataTypeTraits<MFnData::kPointArray>
127 {
128  typedef MPointArray ValueType;
129 
130  static MFn::Type dataType()
131  {
132  return MFn::kPointArrayData;
133  }
134 };
135 
136 template<>
137 struct MFnDataTypeTraits<MFnData::kIntArray>
138 {
139  typedef MIntArray ValueType;
140 
141  static MFn::Type dataType()
142  {
143  return MFn::kIntArrayData;
144  }
145 };
146 
147 template<>
148 struct MFnDataTypeTraits<MFnData::kDoubleArray>
149 {
150  typedef MDoubleArray ValueType;
151 
152  static MFn::Type dataType()
153  {
154  return MFn::kDoubleArrayData;
155  }
156 };
157 
158 } // namespace IECoreMaya
159 
160 #endif // IE_MAYACORE_MFNDATATYPETRAITS_H
static MFn::Type dataType()
The Dependecny Graph data type.
Definition: MFnDataTypeTraits.h:75
void ValueType
The Maya value type.
Definition: MFnDataTypeTraits.h:72
The IECoreMaya namespace holds all the functionality of libIECoreMaya.
Definition: BoolParameterHandler.h:44
Definition: MFnDataTypeTraits.h:69