MDL SDK API nvidia_logo_transpbg.gif Up
itype.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_ITYPE_H
8#define MI_NEURAYLIB_ITYPE_H
9
11
12namespace mi {
13
14class IString;
15
16namespace neuraylib {
17
44class IAnnotation_block;
45
47class IStruct_category : public
48 mi::base::Interface_declare<0xdc79e614,0xad7e,0x4e4d,0xa9,0xc1,0x25,0x91,0xba,0x84,0x44,0x2d>
49{
50public:
53 CID_USER = -1,
55 CID_FORCE_32_BIT = 0x7fffffff // Undocumented, for alignment only.
56 };
57
59 virtual const char* get_symbol() const = 0;
60
62 virtual Predefined_id get_predefined_id() const = 0;
63
68 virtual const IAnnotation_block* get_annotations() const = 0;
69};
70
72
78 mi::base::Interface_declare<0x509417fe,0xaf4d,0x439e,0xa5,0xa2,0x09,0x56,0x2a,0x6c,0x04,0x2a>
79{
80public:
82 virtual Size get_size() const = 0;
83
85 virtual Size get_index( const char* name) const = 0;
86
88 virtual const char* get_name( Size index) const = 0;
89
91 virtual const IStruct_category* get_struct_category( Size index) const = 0;
92
94 template <class T>
95 const T* get_struct_category( Size index) const
96 {
97 const IStruct_category* ptr_struct_category = get_struct_category( index);
98 if( !ptr_struct_category)
99 return 0;
100 const T* ptr_T = static_cast<const T*>(
101 ptr_struct_category->get_interface( typename T::IID()));
102 ptr_struct_category->release();
103 return ptr_T;
104 }
105
107 virtual const IStruct_category* get_struct_category( const char* name) const = 0;
108
110 template <class T>
111 const T* get_struct_category( const char* name) const
112 {
113 const IStruct_category* ptr_struct_category = get_struct_category( name);
114 if( !ptr_struct_category)
115 return 0;
116 const T* ptr_T = static_cast<const T*>(
117 ptr_struct_category->get_interface( typename T::IID()));
118 ptr_struct_category->release();
119 return ptr_T;
120 }
121
128 virtual Sint32 set_struct_category( Size index, const IStruct_category* struct_category) = 0;
129
137 const char* name, const IStruct_category* struct_category) = 0;
138
146 const char* name, const IStruct_category* struct_category) = 0;
147};
148
152class IType : public
153 mi::base::Interface_declare<0x242af675,0xeaa2,0x48b7,0x81,0x63,0xba,0x06,0xa5,0xfb,0x68,0xf0>
154{
155public:
157 enum Kind {
196 // Undocumented, for alignment only.
197 TK_FORCE_32_BIT = 0xffffffffU
198 };
199
201 enum Modifier {
205 MK_FORCE_32_BIT // Undocumented, for alignment only.
206 };
207
209 virtual Kind get_kind() const = 0;
210
218 virtual Uint32 get_all_type_modifiers() const = 0;
219
225 virtual const IType* skip_all_type_aliases() const = 0;
226
228 virtual bool is_declarative() const = 0;
229};
230
231mi_static_assert( sizeof( IType::Kind) == sizeof( Uint32));
232mi_static_assert( sizeof( IType::Modifier) == sizeof( Uint32));
233
238class IType_alias : public
239 mi::base::Interface_declare<0x69d8c70a,0xdfda,0x4e8e,0xaa,0x09,0x12,0x1f,0xa9,0x78,0xc6,0x6a,
240 neuraylib::IType>
241{
242public:
244 static const Kind s_kind = TK_ALIAS;
245
247 virtual const IType* get_aliased_type() const = 0;
248
250 virtual Uint32 get_type_modifiers() const = 0;
251
253 virtual const char* get_symbol() const = 0;
254};
255
257class IType_atomic : public
258 mi::base::Interface_declare<0x9d5f9116,0x3896,0x45c8,0xb4,0x5a,0x8b,0x03,0x84,0x49,0x0a,0x77,
259 neuraylib::IType>
260{
261};
262
264class IType_bool : public
265 mi::base::Interface_declare<0x831d8a38,0x26d3,0x4fd2,0xa7,0xf7,0x15,0xc2,0xa5,0x20,0x76,0x6c,
266 neuraylib::IType_atomic>
267{
268public:
270 static const Kind s_kind = TK_BOOL;
271};
272
274class IType_int : public
275 mi::base::Interface_declare<0xbbad021c,0xbfe5,0x45de,0xaf,0x66,0xfd,0xe8,0x45,0xbe,0x48,0x49,
276 neuraylib::IType_atomic>
277{
278public:
280 static const Kind s_kind = TK_INT;
281};
282
284class IType_enum : public
285 mi::base::Interface_declare<0x0e5b167c,0x9c3e,0x48bf,0xb5,0xfd,0x37,0x96,0xaa,0x47,0xaf,0xd1,
286 neuraylib::IType_atomic>
287{
288public:
291 EID_USER = -1,
294 EID_FORCE_32_BIT = 0x7fffffff // Undocumented, for alignment only.
295 };
296
298 static const Kind s_kind = TK_ENUM;
299
301 virtual const char* get_symbol() const = 0;
302
304 virtual Size get_size() const = 0;
305
311 virtual const char* get_value_name( Size index) const = 0;
312
320 virtual Sint32 get_value_code( Size index, Sint32* errors = nullptr) const = 0;
321
326 virtual Size find_value( const char* name) const = 0;
327
332 virtual Size find_value( Sint32 code) const = 0;
333
335 virtual Predefined_id get_predefined_id() const = 0;
336
341 virtual const IAnnotation_block* get_annotations() const = 0;
342
348 virtual const IAnnotation_block* get_value_annotations( Size index) const = 0;
349};
350
352
354class IType_float : public
355 mi::base::Interface_declare<0x613711b3,0x41f2,0x44a9,0xbb,0x78,0x43,0xe2,0x41,0x64,0xb3,0xda,
356 neuraylib::IType_atomic>
357{
358public:
360 static const Kind s_kind = TK_FLOAT;
361};
362
364class IType_double : public
365 mi::base::Interface_declare<0xc381508b,0x7945,0x4c70,0x8a,0x20,0x57,0xd5,0x2b,0x36,0x35,0x40,
366 neuraylib::IType_atomic>
367{
368public:
370 static const Kind s_kind = TK_DOUBLE;
371};
372
374class IType_string : public
375 mi::base::Interface_declare<0x4b4629bc,0xa2ce,0x4008,0xba,0x76,0xf6,0x4d,0x60,0x76,0x0a,0x85,
376 neuraylib::IType_atomic>
377{
378public:
380 static const Kind s_kind = TK_STRING;
381};
382
384class IType_compound : public
385 mi::base::Interface_declare<0xc9ca497f,0xc38b,0x411f,0xa8,0x16,0xa7,0xd8,0x23,0x28,0xa5,0x40,
386 neuraylib::IType>
387{
388public:
390 virtual const IType* get_component_type( Size index) const = 0;
391
393 virtual Size get_size() const = 0;
394};
395
400class IType_vector : public
401 mi::base::Interface_declare<0x412a8a91,0x9062,0x46fd,0xaa,0xcf,0x46,0xbd,0xb3,0xde,0x5b,0x9c,
402 neuraylib::IType_compound>
403{
404public:
406 static const Kind s_kind = TK_VECTOR;
407
414 virtual const IType_atomic* get_element_type() const = 0;
415};
416
428class IType_matrix : public
429 mi::base::Interface_declare<0x6b76570e,0x51b2,0x4e9b,0x9f,0xe7,0xda,0x03,0x1c,0x37,0xbc,0x75,
430 neuraylib::IType_compound>
431{
432public:
434 static const Kind s_kind = TK_MATRIX;
435
437 virtual const IType_vector* get_element_type() const = 0;
438};
439
443class IType_color : public
444 mi::base::Interface_declare<0xedb16770,0xdf70,0x4def,0x83,0xa5,0xc4,0x4f,0xcd,0x09,0x47,0x0f,
445 neuraylib::IType_compound>
446{
447public:
449 static const Kind s_kind = TK_COLOR;
450};
451
453class IType_array : public
454 mi::base::Interface_declare<0x21ab6abe,0x0e26,0x40da,0xa1,0x98,0x42,0xc0,0x89,0x71,0x5d,0x2a,
455 neuraylib::IType_compound>
456{
457public:
459 static const Kind s_kind = TK_ARRAY;
460
462 virtual const IType* get_element_type() const = 0;
463
465 virtual bool is_immediate_sized() const = 0;
466
468 virtual Size get_size() const = 0;
469
472 virtual const char* get_deferred_size() const = 0;
473};
474
476class IType_struct : public
477 mi::base::Interface_declare<0x19566cb2,0x0b5d,0x41ca,0xa0,0x31,0x96,0xe2,0x9a,0xd4,0xc3,0x1a,
478 neuraylib::IType_compound>
479{
480public:
483 SID_USER = -1,
489 SID_FORCE_32_BIT = 0x7fffffff // Undocumented, for alignment only.
490 };
491
493 static const Kind s_kind = TK_STRUCT;
494
496 virtual const char* get_symbol() const = 0;
497
502 virtual const IType* get_field_type( Size index) const = 0;
503
508 virtual const char* get_field_name( Size index) const = 0;
509
514 virtual Size find_field( const char* name) const = 0;
515
517 virtual Predefined_id get_predefined_id() const = 0;
518
523 virtual const IAnnotation_block* get_annotations() const = 0;
524
530 virtual const IAnnotation_block* get_field_annotations( Size index) const = 0;
531
533 virtual const IStruct_category* get_struct_category() const = 0;
534};
535
537
539class IType_reference : public
540 mi::base::Interface_declare<0x3e12cdec,0xdaba,0x460c,0x9e,0x8a,0x21,0x4c,0x43,0x9a,0x1a,0x90,
541 neuraylib::IType>
542{
543};
544
546class IType_resource : public
547 mi::base::Interface_declare<0x142f5bea,0x139e,0x42e4,0xb1,0x1c,0xb3,0x4d,0xd8,0xe3,0xd9,0x8d,
548 neuraylib::IType_reference>
549{
550};
551
553class IType_texture : public
554 mi::base::Interface_declare<0x2f11253f,0xb8ac,0x4b7d,0x8d,0xd6,0x43,0x66,0xf5,0x97,0xd0,0x93,
555 neuraylib::IType_resource>
556{
557public:
559 static const Kind s_kind = TK_TEXTURE;
560
562 enum Shape {
563 TS_2D = 0,
564 TS_3D = 1,
567 TS_BSDF_DATA = 4,
569 TS_FORCE_32_BIT = 0xffffffffU // Undocumented, for alignment only.
570 };
571
573 virtual Shape get_shape() const = 0;
574};
575
576mi_static_assert( sizeof( IType_texture::Shape) == sizeof( Uint32));
577
580 mi::base::Interface_declare<0x11b80cd8,0x14aa,0x4dfa,0x8b,0xf6,0x0e,0x56,0x0f,0x10,0x9c,0x37,
581 neuraylib::IType_resource>
582{
583public:
586};
587
590 mi::base::Interface_declare<0xf061d204,0xc649,0x4a6b,0xb6,0x2d,0x67,0xe6,0x47,0x53,0xa9,0xda,
591 neuraylib::IType_resource>
592{
593public:
596};
597
599class IType_df : public
600 mi::base::Interface_declare<0xf4bcba08,0x7777,0x4662,0x8e,0x29,0x67,0xe1,0x52,0xac,0x05,0x3e,
601 neuraylib::IType_reference>
602{
603};
604
606class IType_bsdf : public
607 mi::base::Interface_declare<0x6542a02c,0xe1d2,0x485d,0x9a,0x51,0x7b,0xed,0xff,0x7f,0x24,0x7b,
608 neuraylib::IType_df>
609{
610public:
612 static const Kind s_kind = TK_BSDF;
613};
614
616class IType_hair_bsdf : public
617 mi::base::Interface_declare<0x8eac6c90,0x2b8f,0x4650,0x8b,0x93,0x88,0xe0,0x42,0xff,0x19,0x9c,
618 neuraylib::IType_df>
619{
620public:
622 static const Kind s_kind = TK_HAIR_BSDF;
623};
624
626class IType_edf : public
627 mi::base::Interface_declare<0x3e3ce697,0xa2a7,0x43ef,0xa2,0xec,0x52,0x5a,0x4c,0x27,0x8f,0xeb,
628 neuraylib::IType_df>
629{
630public:
632 static const Kind s_kind = TK_EDF;
633};
634
636class IType_vdf : public
637 mi::base::Interface_declare<0x44782b21,0x9e60,0x40b2,0xba,0xae,0x41,0x74,0xc9,0x98,0xe1,0x86,
638 neuraylib::IType_df>
639{
640public:
642 static const Kind s_kind = TK_VDF;
643};
644
648class IType_list : public
649 mi::base::Interface_declare<0x68a97390,0x22ea,0x4f03,0xa5,0xb5,0x5c,0x18,0x32,0x38,0x28,0x91>
650{
651public:
653 virtual Size get_size() const = 0;
654
656 virtual Size get_index( const char* name) const = 0;
657
659 virtual const char* get_name( Size index) const = 0;
660
662 virtual const IType* get_type( Size index) const = 0;
663
665 template <class T>
666 const T* get_type( Size index) const
667 {
668 const IType* ptr_type = get_type( index);
669 if( !ptr_type)
670 return 0;
671 const T* ptr_T = static_cast<const T*>( ptr_type->get_interface( typename T::IID()));
672 ptr_type->release();
673 return ptr_T;
674 }
675
677 virtual const IType* get_type( const char* name) const = 0;
678
680 template <class T>
681 const T* get_type( const char* name) const
682 {
683 const IType* ptr_type = get_type( name);
684 if( !ptr_type)
685 return 0;
686 const T* ptr_T = static_cast<const T*>( ptr_type->get_interface( typename T::IID()));
687 ptr_type->release();
688 return ptr_T;
689 }
690
697 virtual Sint32 set_type( Size index, const IType* type) = 0;
698
705 virtual Sint32 set_type( const char* name, const IType* type) = 0;
706
713 virtual Sint32 add_type( const char* name, const IType* type) = 0;
714};
715
721class IType_factory : public
722 mi::base::Interface_declare<0x353803c0,0x74a6,0x48ac,0xab,0xa1,0xe4,0x25,0x42,0x1d,0xa1,0xbc>
723{
724public:
726
727
729 virtual const IStruct_category* create_struct_category( const char* symbol) const = 0;
730
733
737
744 const IStruct_category_list* struct_category_list) const = 0;
745
753 virtual Sint32 compare( const IStruct_category* lhs, const IStruct_category* rhs) const = 0;
754
771 const IStruct_category_list* lhs, const IStruct_category_list* rhs) const = 0;
772
778 virtual const IString* dump( const IStruct_category* struct_category, Size depth = 0) const = 0;
779
789 virtual const IString* dump( const IStruct_category_list* list, Size depth = 0) const = 0;
790
792
794
796 virtual const IType_alias* create_alias(
797 const IType* type, Uint32 modifiers, const char* symbol) const = 0;
798
800 virtual const IType_bool* create_bool() const = 0;
801
803 virtual const IType_int* create_int() const = 0;
804
806 virtual const IType_enum* create_enum( const char* symbol) const = 0;
807
809 virtual const IType_float* create_float() const = 0;
810
812 virtual const IType_double* create_double() const = 0;
813
815 virtual const IType_string* create_string() const = 0;
816
825 const IType_atomic* element_type, Size size) const = 0;
826
834 const IType_vector* column_type, Size columns) const = 0;
835
837 virtual const IType_color* create_color() const = 0;
838
841 const IType* element_type, Size size) const = 0;
842
852 const IType* element_type, const char* size) const = 0;
853
855 virtual const IType_struct* create_struct( const char* symbol) const = 0;
856
858 virtual const IType_texture* create_texture( IType_texture::Shape shape) const = 0;
859
861 virtual const IType_light_profile* create_light_profile() const = 0;
862
865
867 virtual const IType_bsdf* create_bsdf() const = 0;
868
870 virtual const IType_hair_bsdf* create_hair_bsdf() const = 0;
871
873 virtual const IType_edf* create_edf() const = 0;
874
876 virtual const IType_vdf* create_vdf() const = 0;
877
879 virtual IType_list* create_type_list() const = 0;
880
883
886
894 virtual const IType* create_from_mdl_type_name( const char* name) const = 0;
895
903 template <class T>
904 const T* create_from_mdl_type_name( const char* name) const
905 {
906 const IType* ptr_type = create_from_mdl_type_name( name);
907 if( !ptr_type)
908 return 0;
909 const T* ptr_T = static_cast<const T*>( ptr_type->get_interface( typename T::IID()));
910 ptr_type->release();
911 return ptr_T;
912 }
913
915
917
922 virtual IType_list* clone( const IType_list* type_list) const = 0;
923
925
927
952 virtual Sint32 compare( const IType* lhs, const IType* rhs) const = 0;
953
967 virtual Sint32 compare( const IType_list* lhs, const IType_list* rhs) const = 0;
968
992 virtual Sint32 is_compatible( const IType* lhs, const IType* rhs) const = 0;
993
1007 virtual Sint32 from_same_struct_category( const IType* lhs, const IType* rhs) const = 0;
1008
1010
1011
1013
1023 virtual const IString* dump( const IType* type, Size depth = 0) const = 0;
1024
1034 virtual const IString* dump( const IType_list* list, Size depth = 0) const = 0;
1035
1037
1039
1047 virtual const IString* get_mdl_module_name( const IType* type) const = 0;
1048
1063 virtual const IString* get_mdl_type_name( const IType* type) const = 0;
1064
1066};
1067 // end group mi_neuray_mdl_types
1069
1070} // namespace neuraylib
1071
1072} // namespace mi
1073
1074#endif // MI_NEURAYLIB_ITYPE_H
A simple string class.
Definition: istring.h:22
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
An annotation block is an array of annotations.
Definition: iexpression.h:580
An ordered collection of struct categories identified by name or index.
Definition: itype.h:79
virtual const IStruct_category * get_struct_category(const char *name) const =0
Returns the struct category for name, or nullptr if there is no such struct category.
virtual Sint32 set_struct_category(const char *name, const IStruct_category *struct_category)=0
Sets a struct category identified by name.
virtual const IStruct_category * get_struct_category(Size index) const =0
Returns the struct category for index, or nullptr if there is no such struct category.
virtual Sint32 set_struct_category(Size index, const IStruct_category *struct_category)=0
Sets a struct category at a given index.
const T * get_struct_category(Size index) const
Returns the struct category for index, or nullptr if there is no such struct category.
Definition: itype.h:95
const T * get_struct_category(const char *name) const
Returns the struct category for name, or nullptr if there is no such struct category.
Definition: itype.h:111
virtual const char * get_name(Size index) const =0
Returns the name for the given index, or nullptr if there is no such struct category.
virtual Size get_size() const =0
Returns the number of elements.
virtual Sint32 add_struct_category(const char *name, const IStruct_category *struct_category)=0
Adds a struct category at the end of the list.
virtual Size get_index(const char *name) const =0
Returns the index for the given name, or -1 if there is no such struct category.
Represents the optional struct category for struct types.
Definition: itype.h:49
virtual Predefined_id get_predefined_id() const =0
If this struct category is a predefined one, return its ID, else CID_USER.
Predefined_id
Identifiers of struct categories.
Definition: itype.h:52
@ CID_USER
A user-defined struct category.
Definition: itype.h:53
@ CID_MATERIAL_CATEGORY
The "::material_category" struct category.
Definition: itype.h:54
virtual const char * get_symbol() const =0
Returns the qualified name of this struct category.
virtual const IAnnotation_block * get_annotations() const =0
Returns the annotations of the struct category type.
The type of kind alias.
Definition: itype.h:241
virtual const IType * get_aliased_type() const =0
Returns the type aliased by this type.
virtual const char * get_symbol() const =0
Returns the qualified name of the type, or nullptr if no such name exists.
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:244
virtual Uint32 get_type_modifiers() const =0
Returns the modifiers of this type.
The type of kind array.
Definition: itype.h:456
virtual bool is_immediate_sized() const =0
Indicates whether the array is immediate-sized or deferred-sized.
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:459
virtual const char * get_deferred_size() const =0
Returns the abstract size of the array in case of deferred-sized arrays, and nullptr otherwise.
virtual const IType * get_element_type() const =0
Returns the type of the array elements.
virtual Size get_size() const =0
Returns the size of the array in case of immediate-sized arrays, and -1 otherwise.
An atomic type.
Definition: itype.h:260
The type of kind bool.
Definition: itype.h:267
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:270
The type of kind bsdf_measurement.
Definition: itype.h:592
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:595
The type of kind bsdf.
Definition: itype.h:609
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:612
The type of kind color.
Definition: itype.h:446
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:449
A compound type.
Definition: itype.h:387
virtual Size get_size() const =0
Returns the number of components.
virtual const IType * get_component_type(Size index) const =0
Returns the component type at index.
The type of distribution functions.
Definition: itype.h:602
The type of kind double.
Definition: itype.h:367
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:370
The type of kind edf.
Definition: itype.h:629
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:632
A type of kind enum.
Definition: itype.h:287
virtual const IAnnotation_block * get_annotations() const =0
Returns the annotations of the enum type.
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:298
virtual const IAnnotation_block * get_value_annotations(Size index) const =0
Returns the annotations of a value.
virtual const char * get_symbol() const =0
Returns the qualified name of this enum type.
virtual Size find_value(Sint32 code) const =0
Returns the index of a value in linear time.
virtual Predefined_id get_predefined_id() const =0
If this enum is a predefined one, return its ID, else EID_USER.
Predefined_id
IDs to distinguish predefined enum types.
Definition: itype.h:290
@ EID_USER
A user-defined enum type.
Definition: itype.h:291
@ EID_TEX_GAMMA_MODE
The "::tex::gamma_mode" enum type.
Definition: itype.h:292
@ EID_INTENSITY_MODE
The "::intensity_mode" enum type.
Definition: itype.h:293
virtual const char * get_value_name(Size index) const =0
Returns the name of a value.
virtual Sint32 get_value_code(Size index, Sint32 *errors=nullptr) const =0
Returns the code of a value.
virtual Size get_size() const =0
Returns the number of values.
virtual Size find_value(const char *name) const =0
Returns the index of a value in linear time.
The interface for creating types.
Definition: itype.h:723
virtual const IString * get_mdl_type_name(const IType *type) const =0
Returns the MDL type name of a type.
virtual Sint32 compare(const IStruct_category_list *lhs, const IStruct_category_list *rhs) const =0
Compares two instances of mi::neuraylib::IStruct_category_list.
virtual const IString * dump(const IStruct_category *struct_category, Size depth=0) const =0
Returns a textual representation of a struct category.
virtual const IType_alias * create_alias(const IType *type, Uint32 modifiers, const char *symbol) const =0
Creates a new instance of the type alias.
virtual IType_list * create_type_list() const =0
Creates a new type list.
virtual const IType_vector * create_vector(const IType_atomic *element_type, Size size) const =0
Creates a new instance of a vector type.
virtual const IType_enum * get_predefined_enum(IType_enum::Predefined_id id) const =0
Returns a registered enum type, or nullptr if id is unknown.
virtual const IType_matrix * create_matrix(const IType_vector *column_type, Size columns) const =0
Creates a new instance of a matrix type.
virtual const IType_hair_bsdf * create_hair_bsdf() const =0
Creates a new instance of the type hair_bsdf.
virtual const IStruct_category * create_struct_category(const char *symbol) const =0
Returns a registered struct category, or nullptr if symbol is invalid or unknown.
const T * create_from_mdl_type_name(const char *name) const
Creates a type based on its MDL type name.
Definition: itype.h:904
virtual const IStruct_category * get_predefined_struct_category(IStruct_category::Predefined_id id) const =0
Returns a registered struct category, or nullptr if id is unknown.
virtual const IType_enum * create_enum(const char *symbol) const =0
Returns a registered enum type, or nullptr if symbol is invalid or unknown.
virtual const IType_int * create_int() const =0
Creates a new instance of the type int.
virtual const IType_edf * create_edf() const =0
Creates a new instance of the type edf.
virtual const IType_bsdf * create_bsdf() const =0
Creates a new instance of the type bsdf.
virtual const IType_bool * create_bool() const =0
Creates a new instance of the type boolean.
virtual Sint32 compare(const IStruct_category *lhs, const IStruct_category *rhs) const =0
Compares two instances of mi::neuraylib::IStruct_category.
virtual const IType_string * create_string() const =0
Creates a new instance of the string type.
virtual const IType_light_profile * create_light_profile() const =0
Creates a new instance of the type light_profile.
virtual const IType_float * create_float() const =0
Creates a new instance of the float type.
virtual const IType_struct * get_predefined_struct(IType_struct::Predefined_id id) const =0
Returns a registered struct type, or nullptr if id is unknown.
virtual const IType_struct * create_struct(const char *symbol) const =0
Returns a registered struct type, or nullptr if symbol is invalid or unknown.
virtual IType_list * clone(const IType_list *type_list) const =0
Clones the given type list.
virtual Sint32 is_compatible(const IType *lhs, const IType *rhs) const =0
Checks whether two types are (cast-)compatible, i.e.
virtual Sint32 compare(const IType *lhs, const IType *rhs) const =0
Compares two instances of mi::neuraylib::IType.
virtual const IType_texture * create_texture(IType_texture::Shape shape) const =0
Creates a new instance of the type texture.
virtual const IType_array * create_deferred_sized_array(const IType *element_type, const char *size) const =0
Creates a new instance of a deferred-sized array type.
virtual const IType_double * create_double() const =0
Creates a new instance of the double type.
virtual const IType * create_from_mdl_type_name(const char *name) const =0
Creates a type based on its MDL type name.
virtual const IString * dump(const IType_list *list, Size depth=0) const =0
Returns a textual representation of a type list.
virtual Sint32 from_same_struct_category(const IType *lhs, const IType *rhs) const =0
Checks whether two types are from the same struct category, i.e., lhs can be decl-cast to rhs.
virtual const IString * get_mdl_module_name(const IType *type) const =0
Returns the MDL module name of the module which defines type.
virtual const IType_color * create_color() const =0
Creates a new instance of the type color.
virtual const IString * dump(const IStruct_category_list *list, Size depth=0) const =0
Returns a textual representation of a struct category list.
virtual const IString * dump(const IType *type, Size depth=0) const =0
Returns a textual representation of a type.
virtual const IType_bsdf_measurement * create_bsdf_measurement() const =0
Creates a new instance of the type bsdf_measurement.
virtual const IType_vdf * create_vdf() const =0
Creates a new instance of the type vdf.
virtual const IType_array * create_immediate_sized_array(const IType *element_type, Size size) const =0
Creates a new instance of an immediate-sized array type.
virtual IStruct_category_list * create_struct_category_list() const =0
Creates a new struct category list.
virtual Sint32 compare(const IType_list *lhs, const IType_list *rhs) const =0
Compares two instances of mi::neuraylib::IType_list.
virtual IStruct_category_list * clone(const IStruct_category_list *struct_category_list) const =0
Clones the given struct category list.
The type of kind float.
Definition: itype.h:357
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:360
The type of kind bsdf.
Definition: itype.h:619
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:622
The type of kind int.
Definition: itype.h:277
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:280
The type of kind light_profile.
Definition: itype.h:582
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:585
An ordered collection of types identified by name or index.
Definition: itype.h:650
virtual const IType * get_type(Size index) const =0
Returns the type for index, or nullptr if there is no such type.
virtual const char * get_name(Size index) const =0
Returns the name for the given index, or nullptr if there is no such type.
virtual Sint32 set_type(Size index, const IType *type)=0
Sets a type at a given index.
const T * get_type(const char *name) const
Returns the type for name, or nullptr if there is no such type.
Definition: itype.h:681
virtual const IType * get_type(const char *name) const =0
Returns the type for name, or nullptr if there is no such type.
virtual Sint32 add_type(const char *name, const IType *type)=0
Adds a type at the end of the list.
virtual Sint32 set_type(const char *name, const IType *type)=0
Sets a type identified by name.
virtual Size get_size() const =0
Returns the number of elements.
const T * get_type(Size index) const
Returns the type for index, or nullptr if there is no such type.
Definition: itype.h:666
virtual Size get_index(const char *name) const =0
Returns the index for the given name, or -1 if there is no such type.
The type of kind matrix.
Definition: itype.h:431
virtual const IType_vector * get_element_type() const =0
Returns the type of the matrix elements, i.e., the type of a column vector.
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:434
The reference types.
Definition: itype.h:542
A string valued resource type.
Definition: itype.h:549
The type of kind string.
Definition: itype.h:377
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:380
The type of kind struct.
Definition: itype.h:479
virtual const IType * get_field_type(Size index) const =0
Returns a field type.
Predefined_id
IDs to distinguish predefined struct types.
Definition: itype.h:482
@ SID_MATERIAL_SURFACE
The "::material_surface" struct type.
Definition: itype.h:485
@ SID_MATERIAL_GEOMETRY
The "::material_geometry" struct type.
Definition: itype.h:487
@ SID_MATERIAL_VOLUME
The "::material_volume" struct type.
Definition: itype.h:486
@ SID_USER
A user-defined struct type.
Definition: itype.h:483
@ SID_MATERIAL
The "::material" struct type.
Definition: itype.h:488
@ SID_MATERIAL_EMISSION
The "::material_emission" struct type.
Definition: itype.h:484
virtual const IStruct_category * get_struct_category() const =0
Returns the corresponding struct category (or nullptr if there is none).
virtual const char * get_symbol() const =0
Returns the qualified name of the struct type.
virtual Size find_field(const char *name) const =0
Returns the index of a field in linear time.
virtual const IAnnotation_block * get_field_annotations(Size index) const =0
Returns the annotations of a field.
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:493
virtual const IAnnotation_block * get_annotations() const =0
Returns the annotations of the struct type.
virtual Predefined_id get_predefined_id() const =0
If this struct is a predefined one, return its ID, else SID_USER.
virtual const char * get_field_name(Size index) const =0
Returns a field name.
The type of kind texture.
Definition: itype.h:556
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:559
Shape
The possible texture shapes.
Definition: itype.h:562
@ TS_CUBE
Cube map texture.
Definition: itype.h:565
@ TS_PTEX
PTEX texture.
Definition: itype.h:566
@ TS_3D
Three-dimensional texture.
Definition: itype.h:564
@ TS_BSDF_DATA
Three-dimensional texture representing a BSDF data table.
Definition: itype.h:567
@ TS_2D
Two-dimensional texture.
Definition: itype.h:563
virtual Shape get_shape() const =0
Returns the texture type.
The type of kind vdf.
Definition: itype.h:639
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:642
The type of kind vector.
Definition: itype.h:403
static const Kind s_kind
The kind of this subclass.
Definition: itype.h:406
virtual const IType_atomic * get_element_type() const =0
Returns the type of the vector elements.
The interface to MDL types.
Definition: itype.h:154
Kind
The possible kinds of types.
Definition: itype.h:157
@ TK_TEXTURE
A texture type. See mi::neuraylib::IType_texture.
Definition: itype.h:183
@ TK_MATRIX
A matrix type. See mi::neuraylib::IType_matrix.
Definition: itype.h:175
@ TK_BOOL
The boolean type. See mi::neuraylib::IType_bool.
Definition: itype.h:161
@ TK_COLOR
The color type. See mi::neuraylib::IType_color.
Definition: itype.h:177
@ TK_HAIR_BSDF
The hair_bsdf type. See mi::neuraylib::IType_hair_bsdf.
Definition: itype.h:191
@ TK_ALIAS
An alias for another type, aka typedef. See mi::neuraylib::IType_alias.
Definition: itype.h:159
@ TK_VDF
The vdf type. See mi::neuraylib::IType_vdf.
Definition: itype.h:195
@ TK_VECTOR
A vector type. See mi::neuraylib::IType_vector.
Definition: itype.h:173
@ TK_BSDF_MEASUREMENT
The bsdf_measurement type. See mi::neuraylib::IType_bsdf_measurement.
Definition: itype.h:187
@ TK_ARRAY
An array type. See mi::neuraylib::IType_array.
Definition: itype.h:179
@ TK_STRING
The string type. See mi::neuraylib::IType_string.
Definition: itype.h:171
@ TK_STRUCT
A struct type. See mi::neuraylib::IType_struct.
Definition: itype.h:181
@ TK_INT
The integer type. See mi::neuraylib::IType_int.
Definition: itype.h:163
@ TK_LIGHT_PROFILE
The light_profile type. See mi::neuraylib::IType_light_profile.
Definition: itype.h:185
@ TK_BSDF
The bsdf type. See mi::neuraylib::IType_bsdf.
Definition: itype.h:189
@ TK_EDF
The edf type. See mi::neuraylib::IType_edf.
Definition: itype.h:193
@ TK_ENUM
An enum type. See mi::neuraylib::IType_enum.
Definition: itype.h:165
@ TK_DOUBLE
The double type. See mi::neuraylib::IType_double.
Definition: itype.h:169
@ TK_FLOAT
The float type. See mi::neuraylib::IType_float.
Definition: itype.h:167
virtual const IType * skip_all_type_aliases() const =0
Returns the base type.
virtual Uint32 get_all_type_modifiers() const =0
Returns all type modifiers of a type.
Modifier
The possible kinds of type modifiers.
Definition: itype.h:201
@ MK_UNIFORM
A uniform type.
Definition: itype.h:203
@ MK_NONE
No type modifier (mutable, auto-typed).
Definition: itype.h:202
@ MK_VARYING
A varying type.
Definition: itype.h:204
virtual bool is_declarative() const =0
Indicates whether this type is declarative or not.
virtual Kind get_kind() const =0
Returns the kind of type.
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:58
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const =0
Decrements the reference count.
int Sint32
32-bit signed integer.
Definition: types.h:46
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5