NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
type_traits.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2014 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
6 //*****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_TYPE_TRAITS_H
9 #define MI_NEURAYLIB_TYPE_TRAITS_H
10 
12 #include <mi/neuraylib/idata.h>
13 
14 namespace mi {
15 
20 class IData;
21 class IBoolean;
22 class ISint8;
23 class ISint16;
24 class ISint32;
25 class ISint64;
26 class IUint8;
27 class IUint16;
28 class IUint32;
29 class IUint64;
30 class IFloat32;
31 class IFloat64;
32 class ISize;
33 class IDifference;
34 class IString;
35 class IUuid;
36 class IVoid;
37 class IRef;
38 class IParameter;
39 class ITemporary;
40 class IBoolean_2;
41 class IBoolean_3;
42 class IBoolean_4;
43 class ISint32_2;
44 class ISint32_3;
45 class ISint32_4;
46 class IUint32_2;
47 class IUint32_3;
48 class IUint32_4;
49 class IFloat32_2;
50 class IFloat32_3;
51 class IFloat32_4;
52 class IFloat64_2;
53 class IFloat64_3;
54 class IFloat64_4;
55 class IBoolean_2_2;
56 class IBoolean_2_3;
57 class IBoolean_2_4;
58 class IBoolean_3_2;
59 class IBoolean_3_3;
60 class IBoolean_3_4;
61 class IBoolean_4_2;
62 class IBoolean_4_3;
63 class IBoolean_4_4;
64 class ISint32_2_2;
65 class ISint32_2_3;
66 class ISint32_2_4;
67 class ISint32_3_2;
68 class ISint32_3_3;
69 class ISint32_3_4;
70 class ISint32_4_2;
71 class ISint32_4_3;
72 class ISint32_4_4;
73 class IUint32_2_2;
74 class IUint32_2_3;
75 class IUint32_2_4;
76 class IUint32_3_2;
77 class IUint32_3_3;
78 class IUint32_3_4;
79 class IUint32_4_2;
80 class IUint32_4_3;
81 class IUint32_4_4;
82 class IFloat32_2_2;
83 class IFloat32_2_3;
84 class IFloat32_2_4;
85 class IFloat32_3_2;
86 class IFloat32_3_3;
87 class IFloat32_3_4;
88 class IFloat32_4_2;
89 class IFloat32_4_3;
90 class IFloat32_4_4;
91 class IFloat64_2_2;
92 class IFloat64_2_3;
93 class IFloat64_2_4;
94 class IFloat64_3_2;
95 class IFloat64_3_3;
96 class IFloat64_3_4;
97 class IFloat64_4_2;
98 class IFloat64_4_3;
99 class IFloat64_4_4;
100 class IColor;
101 class IColor3;
102 class ISpectrum;
103 class IBbox3;
104 
105 template<typename I> struct Type_traits {};
106 
107 template<> struct Type_traits<mi::IBoolean>
108 { static const char* get_type_name() { return "Boolean"; } };
109 
110 template<> struct Type_traits<mi::ISint8>
111 { static const char* get_type_name() { return "Sint8"; } };
112 
113 template<> struct Type_traits<mi::ISint16>
114 { static const char* get_type_name() { return "Sint16"; } };
115 
116 template<> struct Type_traits<mi::ISint32>
117 { static const char* get_type_name() { return "Sint32"; } };
118 
119 template<> struct Type_traits<mi::ISint64>
120 { static const char* get_type_name() { return "Sint64"; } };
121 
122 template<> struct Type_traits<mi::IUint8>
123 { static const char* get_type_name() { return "Uint8"; } };
124 
125 template<> struct Type_traits<mi::IUint16>
126 { static const char* get_type_name() { return "Uint16"; } };
127 
128 template<> struct Type_traits<mi::IUint32>
129 { static const char* get_type_name() { return "Uint32"; } };
130 
131 template<> struct Type_traits<mi::IUint64>
132 { static const char* get_type_name() { return "Uint64"; } };
133 
134 template<> struct Type_traits<mi::IFloat32>
135 { static const char* get_type_name() { return "Float32"; } };
136 
137 template<> struct Type_traits<mi::IFloat64>
138 { static const char* get_type_name() { return "Float64"; } };
139 
140 template<> struct Type_traits<mi::ISize>
141 { static const char* get_type_name() { return "Size"; } };
142 
143 template<> struct Type_traits<mi::IDifference>
144 { static const char* get_type_name() { return "Difference"; } };
145 
146 template<> struct Type_traits<mi::IString>
147 { static const char* get_type_name() { return "String"; } };
148 
149 template<> struct Type_traits<mi::IUuid>
150 { static const char* get_type_name() { return "Uuid"; } };
151 
152 template<> struct Type_traits<mi::IVoid>
153 { static const char* get_type_name() { return "Void"; } };
154 
155 template<> struct Type_traits<mi::IRef>
156 { static const char* get_type_name() { return "Ref"; } };
157 
158 template<> struct Type_traits<mi::IParameter>
159 { static const char* get_type_name() { return "Parameter"; } };
160 
161 template<> struct Type_traits<mi::ITemporary>
162 { static const char* get_type_name() { return "Temporary"; } };
163 
164 template<> struct Type_traits<mi::IBoolean_2>
165 { static const char* get_type_name() { return "Boolean<2>"; } };
166 
167 template<> struct Type_traits<mi::IBoolean_3>
168 { static const char* get_type_name() { return "Boolean<3>"; } };
169 
170 template<> struct Type_traits<mi::IBoolean_4>
171 { static const char* get_type_name() { return "Boolean<4>"; } };
172 
173 template<> struct Type_traits<mi::ISint32_2>
174 { static const char* get_type_name() { return "Sint32<2>"; } };
175 
176 template<> struct Type_traits<mi::ISint32_3>
177 { static const char* get_type_name() { return "Sint32<3>"; } };
178 
179 template<> struct Type_traits<mi::ISint32_4>
180 { static const char* get_type_name() { return "Sint32<4>"; } };
181 
182 template<> struct Type_traits<mi::IUint32_2>
183 { static const char* get_type_name() { return "Uint32<2>"; } };
184 
185 template<> struct Type_traits<mi::IUint32_3>
186 { static const char* get_type_name() { return "Uint32<3>"; } };
187 
188 template<> struct Type_traits<mi::IUint32_4>
189 { static const char* get_type_name() { return "Uint32<4>"; } };
190 
191 template<> struct Type_traits<mi::IFloat32_2>
192 { static const char* get_type_name() { return "Float32<2>"; } };
193 
194 template<> struct Type_traits<mi::IFloat32_3>
195 { static const char* get_type_name() { return "Float32<3>"; } };
196 
197 template<> struct Type_traits<mi::IFloat32_4>
198 { static const char* get_type_name() { return "Float32<4>"; } };
199 
200 template<> struct Type_traits<mi::IFloat64_2>
201 { static const char* get_type_name() { return "Float64<2>"; } };
202 
203 template<> struct Type_traits<mi::IFloat64_3>
204 { static const char* get_type_name() { return "Float64<3>"; } };
205 
206 template<> struct Type_traits<mi::IFloat64_4>
207 { static const char* get_type_name() { return "Float64<4>"; } };
208 
209 template<> struct Type_traits<mi::IBoolean_2_2>
210 { static const char* get_type_name() { return "Boolean<2,2>"; } };
211 
212 template<> struct Type_traits<mi::IBoolean_2_3>
213 { static const char* get_type_name() { return "Boolean<2,3>"; } };
214 
215 template<> struct Type_traits<mi::IBoolean_2_4>
216 { static const char* get_type_name() { return "Boolean<2,4>"; } };
217 
218 template<> struct Type_traits<mi::IBoolean_3_2>
219 { static const char* get_type_name() { return "Boolean<3,2>"; } };
220 
221 template<> struct Type_traits<mi::IBoolean_3_3>
222 { static const char* get_type_name() { return "Boolean<3,3>"; } };
223 
224 template<> struct Type_traits<mi::IBoolean_3_4>
225 { static const char* get_type_name() { return "Boolean<3,4>"; } };
226 
227 template<> struct Type_traits<mi::IBoolean_4_2>
228 { static const char* get_type_name() { return "Boolean<4,2>"; } };
229 
230 template<> struct Type_traits<mi::IBoolean_4_3>
231 { static const char* get_type_name() { return "Boolean<4,3>"; } };
232 
233 template<> struct Type_traits<mi::IBoolean_4_4>
234 { static const char* get_type_name() { return "Boolean<4,4>"; } };
235 
236 template<> struct Type_traits<mi::ISint32_2_2>
237 { static const char* get_type_name() { return "Sint32<2,2>"; } };
238 
239 template<> struct Type_traits<mi::ISint32_2_3>
240 { static const char* get_type_name() { return "Sint32<2,3>"; } };
241 
242 template<> struct Type_traits<mi::ISint32_2_4>
243 { static const char* get_type_name() { return "Sint32<2,4>"; } };
244 
245 template<> struct Type_traits<mi::ISint32_3_2>
246 { static const char* get_type_name() { return "Sint32<3,2>"; } };
247 
248 template<> struct Type_traits<mi::ISint32_3_3>
249 { static const char* get_type_name() { return "Sint32<3,3>"; } };
250 
251 template<> struct Type_traits<mi::ISint32_3_4>
252 { static const char* get_type_name() { return "Sint32<3,4>"; } };
253 
254 template<> struct Type_traits<mi::ISint32_4_2>
255 { static const char* get_type_name() { return "Sint32<4,2>"; } };
256 
257 template<> struct Type_traits<mi::ISint32_4_3>
258 { static const char* get_type_name() { return "Sint32<4,3>"; } };
259 
260 template<> struct Type_traits<mi::ISint32_4_4>
261 { static const char* get_type_name() { return "Sint32<4,4>"; } };
262 
263 template<> struct Type_traits<mi::IUint32_2_2>
264 { static const char* get_type_name() { return "Uint32<2,2>"; } };
265 
266 template<> struct Type_traits<mi::IUint32_2_3>
267 { static const char* get_type_name() { return "Uint32<2,3>"; } };
268 
269 template<> struct Type_traits<mi::IUint32_2_4>
270 { static const char* get_type_name() { return "Uint32<2,4>"; } };
271 
272 template<> struct Type_traits<mi::IUint32_3_2>
273 { static const char* get_type_name() { return "Uint32<3,2>"; } };
274 
275 template<> struct Type_traits<mi::IUint32_3_3>
276 { static const char* get_type_name() { return "Uint32<3,3>"; } };
277 
278 template<> struct Type_traits<mi::IUint32_3_4>
279 { static const char* get_type_name() { return "Uint32<3,4>"; } };
280 
281 template<> struct Type_traits<mi::IUint32_4_2>
282 { static const char* get_type_name() { return "Uint32<4,2>"; } };
283 
284 template<> struct Type_traits<mi::IUint32_4_3>
285 { static const char* get_type_name() { return "Uint32<4,3>"; } };
286 
287 template<> struct Type_traits<mi::IUint32_4_4>
288 { static const char* get_type_name() { return "Uint32<4,4>"; } };
289 
290 template<> struct Type_traits<mi::IFloat32_2_2>
291 { static const char* get_type_name() { return "Float32<2,2>"; } };
292 
293 template<> struct Type_traits<mi::IFloat32_2_3>
294 { static const char* get_type_name() { return "Float32<2,3>"; } };
295 
296 template<> struct Type_traits<mi::IFloat32_2_4>
297 { static const char* get_type_name() { return "Float32<2,4>"; } };
298 
299 template<> struct Type_traits<mi::IFloat32_3_2>
300 { static const char* get_type_name() { return "Float32<3,2>"; } };
301 
302 template<> struct Type_traits<mi::IFloat32_3_3>
303 { static const char* get_type_name() { return "Float32<3,3>"; } };
304 
305 template<> struct Type_traits<mi::IFloat32_3_4>
306 { static const char* get_type_name() { return "Float32<3,4>"; } };
307 
308 template<> struct Type_traits<mi::IFloat32_4_2>
309 { static const char* get_type_name() { return "Float32<4,2>"; } };
310 
311 template<> struct Type_traits<mi::IFloat32_4_3>
312 { static const char* get_type_name() { return "Float32<4,3>"; } };
313 
314 template<> struct Type_traits<mi::IFloat32_4_4>
315 { static const char* get_type_name() { return "Float32<4,4>"; } };
316 
317 template<> struct Type_traits<mi::IFloat64_2_2>
318 { static const char* get_type_name() { return "Float64<2,2>"; } };
319 
320 template<> struct Type_traits<mi::IFloat64_2_3>
321 { static const char* get_type_name() { return "Float64<2,3>"; } };
322 
323 template<> struct Type_traits<mi::IFloat64_2_4>
324 { static const char* get_type_name() { return "Float64<2,4>"; } };
325 
326 template<> struct Type_traits<mi::IFloat64_3_2>
327 { static const char* get_type_name() { return "Float64<3,2>"; } };
328 
329 template<> struct Type_traits<mi::IFloat64_3_3>
330 { static const char* get_type_name() { return "Float64<3,3>"; } };
331 
332 template<> struct Type_traits<mi::IFloat64_3_4>
333 { static const char* get_type_name() { return "Float64<3,4>"; } };
334 
335 template<> struct Type_traits<mi::IFloat64_4_2>
336 { static const char* get_type_name() { return "Float64<4,2>"; } };
337 
338 template<> struct Type_traits<mi::IFloat64_4_3>
339 { static const char* get_type_name() { return "Float64<4,3>"; } };
340 
341 template<> struct Type_traits<mi::IFloat64_4_4>
342 { static const char* get_type_name() { return "Float64<4,4>"; } };
343 
344 template<> struct Type_traits<mi::IColor>
345 { static const char* get_type_name() { return "Color"; } };
346 
347 template<> struct Type_traits<mi::IColor3>
348 { static const char* get_type_name() { return "Color3"; } };
349 
350 template<> struct Type_traits<mi::ISpectrum>
351 { static const char* get_type_name() { return "Spectrum"; } };
352 
353 template<> struct Type_traits<mi::IBbox3>
354 { static const char* get_type_name() { return "Bbox3"; } };
355 
356 template<typename I, Size DIM> struct Vector_type_traits {};
357 
358 template<> struct Vector_type_traits<bool, 2>
359 { typedef mi::IBoolean_2 Interface_type; };
360 
361 template<> struct Vector_type_traits<bool, 3>
362 { typedef mi::IBoolean_3 Interface_type; };
363 
364 template<> struct Vector_type_traits<bool, 4>
365 { typedef mi::IBoolean_4 Interface_type; };
366 
367 template<> struct Vector_type_traits<mi::Sint32, 2>
368 { typedef mi::ISint32_2 Interface_type; };
369 
370 template<> struct Vector_type_traits<mi::Sint32, 3>
371 { typedef mi::ISint32_3 Interface_type; };
372 
373 template<> struct Vector_type_traits<mi::Sint32, 4>
374 { typedef mi::ISint32_4 Interface_type; };
375 
376 template<> struct Vector_type_traits<mi::Float32, 2>
377 { typedef mi::IFloat32_2 Interface_type; };
378 
379 template<> struct Vector_type_traits<mi::Float32, 3>
380 { typedef mi::IFloat32_3 Interface_type; };
381 
382 template<> struct Vector_type_traits<mi::Float32, 4>
383 { typedef mi::IFloat32_4 Interface_type; };
384 
385 template<> struct Vector_type_traits<mi::Float64, 2>
386 { typedef mi::IFloat64_2 Interface_type; };
387 
388 template<> struct Vector_type_traits<mi::Float64, 3>
389 { typedef mi::IFloat64_3 Interface_type; };
390 
391 template<> struct Vector_type_traits<mi::Float64, 4>
392 { typedef mi::IFloat64_4 Interface_type; };
393 
394 template<typename I, Size ROW, Size COL> struct Matrix_type_traits {};
395 
396 template<> struct Matrix_type_traits<bool, 2, 2>
397 { typedef mi::IBoolean_2_2 Interface_type; };
398 
399 template<> struct Matrix_type_traits<bool, 2, 3>
400 { typedef mi::IBoolean_2_3 Interface_type; };
401 
402 template<> struct Matrix_type_traits<bool, 2, 4>
403 { typedef mi::IBoolean_2_4 Interface_type; };
404 
405 template<> struct Matrix_type_traits<bool, 3, 2>
406 { typedef mi::IBoolean_3_2 Interface_type; };
407 
408 template<> struct Matrix_type_traits<bool, 3, 3>
409 { typedef mi::IBoolean_3_3 Interface_type; };
410 
411 template<> struct Matrix_type_traits<bool, 3, 4>
412 { typedef mi::IBoolean_3_4 Interface_type; };
413 
414 template<> struct Matrix_type_traits<bool, 4, 2>
415 { typedef mi::IBoolean_4_2 Interface_type; };
416 
417 template<> struct Matrix_type_traits<bool, 4, 3>
418 { typedef mi::IBoolean_4_3 Interface_type; };
419 
420 template<> struct Matrix_type_traits<bool, 4, 4>
421 { typedef mi::IBoolean_4_4 Interface_type; };
422 
423 template<> struct Matrix_type_traits<mi::Sint32, 2, 2>
424 { typedef mi::ISint32_2_2 Interface_type; };
425 
426 template<> struct Matrix_type_traits<mi::Sint32, 2, 3>
427 { typedef mi::ISint32_2_3 Interface_type; };
428 
429 template<> struct Matrix_type_traits<mi::Sint32, 2, 4>
430 { typedef mi::ISint32_2_4 Interface_type; };
431 
432 template<> struct Matrix_type_traits<mi::Sint32, 3, 2>
433 { typedef mi::ISint32_3_2 Interface_type; };
434 
435 template<> struct Matrix_type_traits<mi::Sint32, 3, 3>
436 { typedef mi::ISint32_3_3 Interface_type; };
437 
438 template<> struct Matrix_type_traits<mi::Sint32, 3, 4>
439 { typedef mi::ISint32_3_4 Interface_type; };
440 
441 template<> struct Matrix_type_traits<mi::Sint32, 4, 2>
442 { typedef mi::ISint32_4_2 Interface_type; };
443 
444 template<> struct Matrix_type_traits<mi::Sint32, 4, 3>
445 { typedef mi::ISint32_4_3 Interface_type; };
446 
447 template<> struct Matrix_type_traits<mi::Sint32, 4, 4>
448 { typedef mi::ISint32_4_4 Interface_type; };
449 
450 template<> struct Matrix_type_traits<mi::Float32, 2, 2>
451 { typedef mi::IFloat32_2_2 Interface_type; };
452 
453 template<> struct Matrix_type_traits<mi::Float32, 2, 3>
454 { typedef mi::IFloat32_2_3 Interface_type; };
455 
456 template<> struct Matrix_type_traits<mi::Float32, 2, 4>
457 { typedef mi::IFloat32_2_4 Interface_type; };
458 
459 template<> struct Matrix_type_traits<mi::Float32, 3, 2>
460 { typedef mi::IFloat32_3_2 Interface_type; };
461 
462 template<> struct Matrix_type_traits<mi::Float32, 3, 3>
463 { typedef mi::IFloat32_3_3 Interface_type; };
464 
465 template<> struct Matrix_type_traits<mi::Float32, 3, 4>
466 { typedef mi::IFloat32_3_4 Interface_type; };
467 
468 template<> struct Matrix_type_traits<mi::Float32, 4, 2>
469 { typedef mi::IFloat32_4_2 Interface_type; };
470 
471 template<> struct Matrix_type_traits<mi::Float32, 4, 3>
472 { typedef mi::IFloat32_4_3 Interface_type; };
473 
474 template<> struct Matrix_type_traits<mi::Float32, 4, 4>
475 { typedef mi::IFloat32_4_4 Interface_type; };
476 
477 template<> struct Matrix_type_traits<mi::Float64, 2, 2>
478 { typedef mi::IFloat64_2_2 Interface_type; };
479 
480 template<> struct Matrix_type_traits<mi::Float64, 2, 3>
481 { typedef mi::IFloat64_2_3 Interface_type; };
482 
483 template<> struct Matrix_type_traits<mi::Float64, 2, 4>
484 { typedef mi::IFloat64_2_4 Interface_type; };
485 
486 template<> struct Matrix_type_traits<mi::Float64, 3, 2>
487 { typedef mi::IFloat64_3_2 Interface_type; };
488 
489 template<> struct Matrix_type_traits<mi::Float64, 3, 3>
490 { typedef mi::IFloat64_3_3 Interface_type; };
491 
492 template<> struct Matrix_type_traits<mi::Float64, 3, 4>
493 { typedef mi::IFloat64_3_4 Interface_type; };
494 
495 template<> struct Matrix_type_traits<mi::Float64, 4, 2>
496 { typedef mi::IFloat64_4_2 Interface_type; };
497 
498 template<> struct Matrix_type_traits<mi::Float64, 4, 3>
499 { typedef mi::IFloat64_4_3 Interface_type; };
500 
501 template<> struct Matrix_type_traits<mi::Float64, 4, 4>
502 { typedef mi::IFloat64_4_4 Interface_type; };
503  // end group mi_neuray_types
505 
506 } // namespace mi
507 
508 #endif // MI_NEURAYLIB_TYPE_TRAITS_H