Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ivalue.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2020 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_IVALUE_H
8 #define MI_NEURAYLIB_IVALUE_H
9 
10 #include <mi/base/handle.h>
11 #include <mi/math/color.h>
12 #include <mi/math/matrix.h>
13 #include <mi/math/spectrum.h>
14 #include <mi/math/vector.h>
15 #include <mi/neuraylib/itype.h>
16 
17 namespace mi {
18 
19 namespace neuraylib {
20 
25 class IValue : public
29  mi::base::Interface_declare<0xbf837f4a,0x9034,0x4f32,0xaf,0x5c,0x75,0xb3,0x67,0x64,0x53,0x23>
30 {
31 public:
33  enum Kind {
64  // Undocumented, for alignment only.
65  VK_FORCE_32_BIT = 0xffffffffU
66  };
67 
69  virtual Kind get_kind() const = 0;
70 
72  virtual const IType* get_type() const = 0;
73 
75  template <class T>
76  const T* get_type() const
77  {
78  const IType* ptr_type = get_type();
79  if( !ptr_type)
80  return 0;
81  const T* ptr_T = static_cast<const T*>( ptr_type->get_interface( typename T::IID()));
82  ptr_type->release();
83  return ptr_T;
84  }
85 };
86 
87 mi_static_assert( sizeof( IValue::Kind) == sizeof( Uint32));
88 
90 class IValue_atomic : public
91  mi::base::Interface_declare<0xf2413c80,0x8e71,0x4974,0xaa,0xf2,0x60,0xd5,0xe2,0x94,0x9d,0x3e,
92  neuraylib::IValue>
93 {
94 public:
96  const IType_atomic* get_type() const = 0;
97 };
98 
100 class IValue_bool : public
101  mi::base::Interface_declare<0xaf253a14,0x1f04,0x4b67,0xba,0x70,0x7b,0x01,0x05,0xfb,0xc8,0xf5,
102  neuraylib::IValue_atomic>
103 {
104 public:
106  static const Kind s_kind = VK_BOOL;
107 
109  const IType_bool* get_type() const = 0;
110 
112  virtual bool get_value() const = 0;
113 
115  virtual void set_value( bool value) = 0;
116 };
117 
119 class IValue_int : public
120  mi::base::Interface_declare<0x91e6f145,0x280d,0x4d68,0x95,0x57,0xe1,0xd0,0x9c,0xd2,0x5c,0x74,
121  neuraylib::IValue_atomic>
122 {
123 public:
125  static const Kind s_kind = VK_INT;
126 
128  const IType_int* get_type() const = 0;
129 
131  virtual Sint32 get_value() const = 0;
132 
134  virtual void set_value( Sint32 value) = 0;
135 };
136 
138 class IValue_enum : public
139  mi::base::Interface_declare<0xdc876204,0x8a97,0x40e9,0xb9,0xb6,0xca,0xdc,0xdd,0x60,0x1f,0xbf,
140  neuraylib::IValue_atomic>
141 {
142 public:
144  static const Kind s_kind = VK_ENUM;
145 
147  virtual const IType_enum* get_type() const = 0;
148 
150  virtual Sint32 get_value() const = 0;
151 
153  virtual Size get_index() const = 0;
154 
160  virtual Sint32 set_value( Sint32 value) = 0;
161 
165  virtual Sint32 set_index( Size index) = 0;
166 
168  virtual const char* get_name() const = 0;
169 
173  virtual Sint32 set_name( const char* name) = 0;
174 };
175 
177 class IValue_float : public
178  mi::base::Interface_declare<0x21f07151,0x74b5,0x4296,0x90,0x29,0xc7,0xde,0x49,0x38,0x2a,0xbc,
179  neuraylib::IValue_atomic>
180 {
181 public:
183  static const Kind s_kind = VK_FLOAT;
184 
186  const IType_float* get_type() const = 0;
187 
189  virtual Float32 get_value() const = 0;
190 
192  virtual void set_value( Float32 value) = 0;
193 };
194 
196 class IValue_double : public
197  mi::base::Interface_declare<0xbdc84417,0x3e83,0x4bab,0x90,0xb1,0x9f,0x57,0xed,0x7b,0x15,0x03,
198  neuraylib::IValue_atomic>
199 {
200 public:
202  static const Kind s_kind = VK_DOUBLE;
203 
205  const IType_double* get_type() const = 0;
206 
208  virtual Float64 get_value() const = 0;
209 
211  virtual void set_value( Float64 value) = 0;
212 };
213 
215 class IValue_string : public
216  mi::base::Interface_declare<0x64b28506,0x8675,0x4724,0xa1,0x0d,0xc6,0xf2,0x35,0x46,0x26,0x39,
217  neuraylib::IValue_atomic>
218 {
219 public:
221  static const Kind s_kind = VK_STRING;
222 
224  const IType_string* get_type() const = 0;
225 
227  virtual const char* get_value() const = 0;
228 
230  virtual void set_value( const char* value) = 0;
231 };
232 
235  mi::base::Interface_declare<0x1fe80d3d, 0xe79e, 0x4bdb, 0xb6, 0x30, 0xe3, 0x36, 0x31, 0xa4, 0x1e, 0x39,
236  neuraylib::IValue_string>
237 {
238 public:
241  virtual const char* get_original_value() const = 0;
242 };
243 
245 class IValue_compound : public
246  mi::base::Interface_declare<0xdabc8fe3,0x5c70,0x4ef0,0xa2,0xf7,0x34,0x30,0xb5,0x67,0xdc,0x75,
247  neuraylib::IValue>
248 {
249 public:
251  virtual const IType_compound* get_type() const = 0;
252 
254  virtual Size get_size() const = 0;
255 
257  virtual const IValue* get_value( Size index) const = 0;
258 
260  template <class T>
261  const T* get_value( Size index) const
262  {
263  const IValue* ptr_value = get_value( index);
264  if( !ptr_value)
265  return 0;
266  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
267  ptr_value->release();
268  return ptr_T;
269  }
270 
272  virtual IValue* get_value( Size index) = 0;
273 
275  template <class T>
276  T* get_value( Size index)
277  {
278  IValue* ptr_value = get_value( index);
279  if( !ptr_value)
280  return 0;
281  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
282  ptr_value->release();
283  return ptr_T;
284  }
285 
295  virtual Sint32 set_value( Size index, IValue* value) = 0;
296 };
297 
302 class IValue_vector : public
303  mi::base::Interface_declare<0xf5d09fc3,0xd783,0x4571,0x8d,0x59,0x41,0xb1,0xff,0xd3,0x91,0x49,
304  neuraylib::IValue_compound>
305 {
306 public:
308  static const Kind s_kind = VK_VECTOR;
309 
311  virtual const IType_vector* get_type() const = 0;
312 
314  virtual const IValue_atomic* get_value( Size index) const = 0;
315 
317  template <class T>
318  const T* get_value( Size index) const
319  {
320  const IValue_atomic* ptr_value = get_value( index);
321  if( !ptr_value)
322  return 0;
323  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
324  ptr_value->release();
325  return ptr_T;
326  }
327 
329  virtual IValue_atomic* get_value( Size index) = 0;
330 
332  template <class T>
333  T* get_value( Size index)
334  {
335  IValue_atomic* ptr_value = get_value( index);
336  if( !ptr_value)
337  return 0;
338  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
339  ptr_value->release();
340  return ptr_T;
341  }
342 };
343 
348 class IValue_matrix : public
349  mi::base::Interface_declare<0x9ee95da6,0x2cd6,0x4168,0x89,0xea,0x92,0x10,0x57,0xda,0xe6,0xdc,
350  neuraylib::IValue_compound>
351 {
352 public:
354  static const Kind s_kind = VK_MATRIX;
355 
357  virtual const IType_matrix* get_type() const = 0;
358 
360  virtual const IValue_vector* get_value( Size index) const = 0;
361 
363  virtual IValue_vector* get_value( Size index) = 0;
364 };
365 
367 class IValue_color : public
368  mi::base::Interface_declare<0x3bb9bf46,0x1cbb,0x4460,0xbe,0x27,0x10,0xf5,0x71,0x61,0x96,0xa2,
369  neuraylib::IValue_compound>
370 {
371 public:
373  static const Kind s_kind = VK_COLOR;
374 
376  virtual const IType_color* get_type() const = 0;
377 
379  virtual const IValue_float* get_value( Size index) const = 0;
380 
382  virtual IValue_float* get_value( Size index) = 0;
383 
390  virtual Sint32 set_value( Size index, IValue_float* value) = 0;
391 
393 };
394 
396 class IValue_array : public
397  mi::base::Interface_declare<0xa17c5f57,0xa647,0x41c4,0x86,0x2f,0x4c,0x0d,0xe1,0x30,0x08,0xfc,
398  neuraylib::IValue_compound>
399 {
400 public:
402  static const Kind s_kind = VK_ARRAY;
403 
405  virtual const IType_array* get_type() const = 0;
406 
413  virtual Sint32 set_size( Size size) = 0;
414 };
415 
417 class IValue_struct : public
418  mi::base::Interface_declare<0xcbe089ce,0x4aea,0x474d,0x94,0x5f,0x52,0x13,0xef,0x01,0xce,0x81,
419  neuraylib::IValue_compound>
420 {
421 public:
423  static const Kind s_kind = VK_STRUCT;
424 
426  virtual const IType_struct* get_type() const = 0;
427 
432  virtual const IValue* get_field( const char* name) const = 0;
433 
438  template <class T>
439  const T* get_field( const char* name) const
440  {
441  const IValue* ptr_value = get_field( name);
442  if( !ptr_value)
443  return 0;
444  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
445  ptr_value->release();
446  return ptr_T;
447  }
448 
453  virtual IValue* get_field( const char* name) = 0;
454 
459  template <class T>
460  T* get_field( const char* name)
461  {
462  IValue* ptr_value = get_field( name);
463  if( !ptr_value)
464  return 0;
465  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
466  ptr_value->release();
467  return ptr_T;
468  }
469 
479  virtual Sint32 set_field( const char* name, IValue* value) = 0;
480 };
481 
483 class IValue_resource : public
484  mi::base::Interface_declare<0x479bb10c,0xd444,0x426c,0x83,0xab,0x26,0xdf,0xf6,0x1d,0x6f,0xd7,
485  neuraylib::IValue>
486 {
487 public:
489  virtual const IType_resource* get_type() const = 0;
490 
494  virtual const char* get_value() const = 0;
495 
506  virtual Sint32 set_value( const char* value) = 0;
507 
512  virtual const char* get_file_path() const = 0;
513 };
514 
516 class IValue_texture : public
517  mi::base::Interface_declare<0xf2a03651,0x8883,0x4ba4,0xb9,0xa9,0xe6,0x87,0x34,0x3a,0xb3,0xb8,
518  neuraylib::IValue_resource>
519 {
520 public:
522  static const Kind s_kind = VK_TEXTURE;
523 
525  virtual const IType_texture* get_type() const = 0;
526 
531  virtual Float32 get_gamma() const = 0;
532 };
533 
535 class IValue_light_profile : public
536  mi::base::Interface_declare<0xd7c9ffbd,0xb5e4,0x4bf4,0x90,0xd0,0xe9,0x75,0x4d,0x6d,0x49,0x07,
537  neuraylib::IValue_resource>
538 {
539 public:
541  static const Kind s_kind = VK_LIGHT_PROFILE;
542 
544  virtual const IType_light_profile* get_type() const = 0;
545 };
546 
549  mi::base::Interface_declare<0x31a55244,0x415c,0x4b4d,0xa7,0x86,0x2f,0x21,0x9c,0xb8,0xb9,0xff,
550  neuraylib::IValue_resource>
551 {
552 public:
555 
557  virtual const IType_bsdf_measurement* get_type() const = 0;
558 };
559 
561 class IValue_invalid_df : public
562  mi::base::Interface_declare<0x1588b6fa,0xa143,0x4bac,0xa0,0x32,0x06,0xbd,0x9e,0x7f,0xb6,0xe5,
563  neuraylib::IValue>
564 {
565 public:
567  static const Kind s_kind = VK_INVALID_DF;
568 
570  const IType_reference* get_type() const = 0;
571 };
572 
576 class IValue_list : public
577  mi::base::Interface_declare<0x8027a5e5,0x4e25,0x410c,0xbb,0xce,0x84,0xb4,0x88,0x8b,0x03,0x46>
578 {
579 public:
581  virtual Size get_size() const = 0;
582 
584  virtual Size get_index( const char* name) const = 0;
585 
587  virtual const char* get_name( Size index) const = 0;
588 
590  virtual const IValue* get_value( Size index) const = 0;
591 
593  template <class T>
594  const T* get_value( Size index) const
595  {
596  const IValue* ptr_value = get_value( index);
597  if( !ptr_value)
598  return 0;
599  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
600  ptr_value->release();
601  return ptr_T;
602  }
603 
605  virtual const IValue* get_value( const char* name) const = 0;
606 
608  template <class T>
609  const T* get_value( const char* name) const
610  {
611  const IValue* ptr_value = get_value( name);
612  if( !ptr_value)
613  return 0;
614  const T* ptr_T = static_cast<const T*>( ptr_value->get_interface( typename T::IID()));
615  ptr_value->release();
616  return ptr_T;
617  }
618 
625  virtual Sint32 set_value( Size index, const IValue* value) = 0;
626 
633  virtual Sint32 set_value( const char* name, const IValue* value) = 0;
634 
641  virtual Sint32 add_value( const char* name, const IValue* value) = 0;
642 };
643 
647 class IValue_factory : public
648  mi::base::Interface_declare<0x82595c0d,0x3687,0x4b45,0xa3,0x38,0x42,0x20,0x02,0xea,0x3f,0x9b>
649 {
650 public:
651 
653  virtual IType_factory* get_type_factory() const = 0;
654 
656  virtual IValue_bool* create_bool( bool value = false) const = 0;
657 
659  virtual IValue_int* create_int( Sint32 value = 0) const = 0;
660 
662  virtual IValue_enum* create_enum( const IType_enum* type, Size index = 0) const = 0;
663 
665  virtual IValue_float* create_float( Float32 value = 0.0f) const = 0;
666 
668  virtual IValue_double* create_double( Float64 value = 0.0) const = 0;
669 
673  virtual IValue_string* create_string( const char* value = "") const = 0;
674 
676  virtual IValue_vector* create_vector( const IType_vector* type) const = 0;
677 
679  virtual IValue_matrix* create_matrix( const IType_matrix* type) const = 0;
680 
682  virtual IValue_color* create_color(
683  Float32 red = 0.0f,
684  Float32 green = 0.0f,
685  Float32 blue = 0.0f) const = 0;
686 
688  virtual IValue_array* create_array( const IType_array* type) const = 0;
689 
691  virtual IValue_struct* create_struct( const IType_struct* type) const = 0;
692 
694  virtual IValue_texture* create_texture( const IType_texture* type, const char* value) const = 0;
695 
697  virtual IValue_light_profile* create_light_profile( const char* value) const = 0;
698 
700  virtual IValue_bsdf_measurement* create_bsdf_measurement( const char* value) const = 0;
701 
703  virtual IValue_invalid_df* create_invalid_df( const IType_reference* type) const = 0;
704 
706  virtual IValue* create( const IType* type) const = 0;
707 
709  template <class T>
710  T* create( const IType* type) const
711  {
712  IValue* ptr_value = create( type);
713  if( !ptr_value)
714  return 0;
715  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
716  ptr_value->release();
717  return ptr_T;
718  }
719 
721  virtual IValue_list* create_value_list() const = 0;
722 
726  virtual IValue* clone( const IValue* value) const = 0;
727 
731  template <class T>
732  T* clone( const T* value) const
733  {
734  IValue* ptr_value = clone( static_cast<const IValue*>( value));
735  if( !ptr_value)
736  return 0;
737  T* ptr_T = static_cast<T*>( ptr_value->get_interface( typename T::IID()));
738  ptr_value->release();
739  return ptr_T;
740  }
741 
745  virtual IValue_list* clone( const IValue_list* value_list) const = 0;
746 
767  virtual Sint32 compare( const IValue* lhs, const IValue* rhs) const = 0;
768 
782  virtual Sint32 compare( const IValue_list* lhs, const IValue_list* rhs) const = 0;
783 
794  virtual const IString* dump( const IValue* value, const char* name, Size depth = 0) const = 0;
795 
805  virtual const IString* dump(
806  const IValue_list* list, const char* name, Size depth = 0) const = 0;
807 };
808 
824 template<class T>
826 {
829  if( value_int) {
830  value_int->set_value( v);
831  return 0;
832  }
833 
836  if( value_enum) {
837  if( value_enum->set_value( v) != 0)
838  return -2;
839  return 0;
840  }
841 
842  return -1;
843 }
844 
848 inline mi::Sint32 set_value( mi::neuraylib::IValue* value, const bool& v)
849 {
852  if( value_bool) {
853  value_bool->set_value( v);
854  return 0;
855  }
856 
857  return -1;
858 }
859 
864 {
867  if( value_float) {
868  value_float->set_value( v);
869  return 0;
870  }
871 
874  if( value_double) {
875  value_double->set_value( v);
876  return 0;
877  }
878 
879  return -1;
880 }
881 
886 {
889  if( value_float) {
890  value_float->set_value( static_cast<mi::Float32>( v));
891  return 0;
892  }
893 
896  if( value_double) {
897  value_double->set_value( v);
898  return 0;
899  }
900 
901  return -1;
902 }
903 
908 inline mi::Sint32 set_value( mi::neuraylib::IValue* value, const char* v)
909 {
912  if( value_enum) {
913  if( value_enum->set_name( v) != 0)
914  return -2;
915  return 0;
916  }
917 
920  if( value_string) {
921  value_string->set_value( v);
922  return 0;
923  }
924 
927  if( value_resource) {
928  if( value_resource->set_value( v) != 0)
929  return -2;
930  return 0;
931  }
932 
933  return -1;
934 }
935 
940 template<class T, Size DIM>
942 {
945  if( value_vector) {
946  if( value_vector->get_size() != DIM)
947  return -1;
948  for( Size i = 0; i < DIM; ++i) {
949  mi::base::Handle<mi::neuraylib::IValue> component( value_vector->get_value( i));
950  mi::Sint32 result = set_value( component.get(), v[i]);
951  if( result != 0)
952  return result;
953  }
954  return 0;
955  }
956 
957  return -1;
958 }
959 
969 template<class T, Size ROW, Size COL>
971 {
974  if( value_matrix) {
975  if( value_matrix->get_size() != ROW)
976  return -1;
977  for( Size i = 0; i < ROW; ++i) {
979  if( column->get_size() != COL)
980  return -1;
981  for( Size j = 0; j < COL; ++j) {
982  mi::base::Handle<mi::neuraylib::IValue> element( column->get_value( j));
983  mi::Sint32 result = set_value( element.get(), v[i][j]);
984  if( result != 0)
985  return result;
986  }
987  }
988  return 0;
989  }
990 
991  return -1;
992 }
993 
998 {
1001  if( value_color) {
1003  red ->set_value( v.r);
1005  green->set_value( v.g);
1007  blue ->set_value( v.b);
1008  return 0;
1009  }
1010 
1011  return -1;
1012 }
1013 
1019 {
1022  if( value_color) {
1024  red ->set_value( v[0]);
1026  green->set_value( v[1]);
1028  blue ->set_value( v[2]);
1029  return 0;
1030  }
1031 
1032  return -1;
1033 }
1034 
1045 template<class T>
1047 {
1050  if( value_compound) {
1051  mi::base::Handle<mi::neuraylib::IValue> component( value_compound->get_value( index));
1052  if( !component)
1053  return -3;
1054  return set_value( component.get(), v);
1055  }
1056 
1057  return -1;
1058 }
1059 
1070 template<class T>
1071 mi::Sint32 set_value( mi::neuraylib::IValue* value, const char* name, const T& v)
1072 {
1075  if( value_struct) {
1076  mi::base::Handle<mi::neuraylib::IValue> field( value_struct->get_field( name));
1077  if( !field)
1078  return -3;
1079  return set_value( field.get(), v);
1080  }
1081 
1082  return -1;
1083 }
1084 
1085 // Simplifies reading the value of #mi::neuraylib::IValue into the corresponding classes from the
1099 template<class T>
1101 {
1104  if( value_int) {
1105  v = value_int->get_value();
1106  return 0;
1107  }
1108 
1111  if( value_enum) {
1112  v = value_enum->get_value();
1113  return 0;
1114  }
1115 
1116  return -1;
1117 }
1118 
1122 inline mi::Sint32 get_value( const mi::neuraylib::IValue* value, bool& v)
1123 {
1126  if( value_bool) {
1127  v = value_bool->get_value();
1128  return 0;
1129  }
1130 
1131  return -1;
1132 }
1133 
1138 {
1141  if( value_float) {
1142  v = value_float->get_value();
1143  return 0;
1144  }
1145 
1148  if( value_double) {
1149  v = static_cast<mi::Float32>( value_double->get_value());
1150  return 0;
1151  }
1152 
1153  return -1;
1154 }
1155 
1160 {
1163  if( value_float) {
1164  v = value_float->get_value();
1165  return 0;
1166  }
1167 
1170  if( value_double) {
1171  v = value_double->get_value();
1172  return 0;
1173  }
1174 
1175  return -1;
1176 }
1177 
1182 inline mi::Sint32 get_value( const mi::neuraylib::IValue* value, const char*& v)
1183 {
1186  if( value_enum) {
1187  v = value_enum->get_name();
1188  return 0;
1189  }
1190 
1193  if( value_string) {
1194  v = value_string->get_value();
1195  return 0;
1196  }
1197 
1200  if( value_resource) {
1201  v = value_resource->get_value();
1202  return 0;
1203  }
1204 
1205  return -1;
1206 }
1207 
1212 template <class T, Size DIM>
1214 {
1217  if( value_vector) {
1218  if( value_vector->get_size() != DIM)
1219  return -1;
1220  for( Size i = 0; i < DIM; ++i) {
1221  mi::base::Handle<const mi::neuraylib::IValue> component( value_vector->get_value( i));
1222  mi::Sint32 result = get_value( component.get(), v[i]);
1223  if( result != 0)
1224  return result;
1225  }
1226  return 0;
1227  }
1228 
1229  return -1;
1230 }
1231 
1241 template <class T, Size ROW, Size COL>
1243 {
1246  if( value_matrix) {
1247  if( value_matrix->get_size() != ROW)
1248  return -1;
1249  for( Size i = 0; i < ROW; ++i) {
1251  value_matrix->get_value( i));
1252  if( column->get_size() != COL)
1253  return -1;
1254  for( Size j = 0; j < COL; ++j) {
1255  mi::base::Handle<const mi::neuraylib::IValue> element( column->get_value( j));
1256  mi::Sint32 result = get_value( element.get(), v[i][j]);
1257  if( result != 0)
1258  return result;
1259  }
1260  }
1261  return 0;
1262  }
1263 
1264  return -1;
1265 }
1266 
1271 {
1274  if( value_color) {
1276  v.r = red ->get_value();
1278  v.g = green->get_value();
1280  v.b = blue ->get_value();
1281  v.a = 1.0f;
1282  return 0;
1283  }
1284 
1285  return -1;
1286 }
1287 
1293 {
1296  if( value_color) {
1298  v[0] = red ->get_value();
1300  v[1] = green->get_value();
1302  v[2] = blue ->get_value();
1303  return 0;
1304  }
1305 
1306  return -1;
1307 }
1308 
1319 template<class T>
1321 {
1324  if( value_compound) {
1325  mi::base::Handle<const mi::neuraylib::IValue> component( value_compound->get_value( index));
1326  if( !component)
1327  return -3;
1328  return get_value( component.get(), v);
1329  }
1330 
1331  return -1;
1332 }
1333 
1344 template<class T>
1345 mi::Sint32 get_value( const mi::neuraylib::IValue* value, const char* name, T& v)
1346 {
1349  if( value_struct) {
1350  mi::base::Handle<const mi::neuraylib::IValue> field( value_struct->get_field( name));
1351  if( !field)
1352  return -3;
1353  return get_value( field.get(), v);
1354  }
1355 
1356  return -1;
1357 }
1358  // end group mi_neuray_mdl_types
1360 
1361 } // namespace neuraylib
1362 
1363 } // namespace mi
1364 
1365 #endif // MI_NEURAYLIB_IVALUE_H