Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imaterial_definition.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2020 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_IMATERIAL_DEFINITION_H
8 #define MI_NEURAYLIB_IMATERIAL_DEFINITION_H
9 
12 
13 namespace mi {
14 
15 namespace neuraylib {
16 
21 class IMaterial_instance;
22 class IMdl_execution_context;
23 
32 class IMaterial_definition : public
33  mi::base::Interface_declare<0x73753e3d,0x62e4,0x41a7,0xa8,0xf5,0x37,0xeb,0xda,0xd9,0x01,0xd9,
34  neuraylib::IScene_element>
35 {
36 public:
40  virtual const char* get_module() const = 0;
41 
48  virtual const char* get_mdl_name() const = 0;
49 
52  virtual const char* get_prototype() const = 0;
53 
55  virtual bool is_exported() const = 0;
56 
58  virtual Size get_parameter_count() const = 0;
59 
64  virtual const char* get_parameter_name( Size index) const = 0;
65 
70  virtual Size get_parameter_index( const char* name) const = 0;
71 
73  virtual const IType_list* get_parameter_types() const = 0;
74 
80  virtual const IExpression_list* get_defaults() const = 0;
81 
88  virtual const IExpression_list* get_enable_if_conditions() const = 0;
89 
96  virtual Size get_enable_if_users( Size index) const = 0;
97 
105  virtual Size get_enable_if_user( Size index, Size u_index) const = 0;
106 
109  virtual const IAnnotation_block* get_annotations() const = 0;
110 
117  virtual const IAnnotation_list* get_parameter_annotations() const = 0;
118 
126  virtual const char* get_thumbnail() const = 0;
127 
138  virtual bool is_valid(IMdl_execution_context* context) const = 0;
139 
173  const IExpression_list* arguments, Sint32* errors = 0) const = 0;
174 
176  virtual const IExpression_direct_call* get_body() const = 0;
177 
179  virtual Size get_temporary_count() const = 0;
180 
186  virtual const IExpression* get_temporary( Size index) const = 0;
187 
198  virtual const char* get_temporary_name( Size index) const = 0;
199 
212  template<class T>
213  const T* get_temporary( Size index) const
214  {
215  const IExpression* ptr_iexpression = get_temporary( index);
216  if ( !ptr_iexpression)
217  return 0;
218  const T* ptr_T = static_cast<const T*>( ptr_iexpression->get_interface( typename T::IID()));
219  ptr_iexpression->release();
220  return ptr_T;
221  }
222 };
223  // end group mi_neuray_mdl_elements
225 
226 } // namespace neuraylib
227 
228 } // namespace mi
229 
230 #endif // MI_NEURAYLIB_IMATERIAL_DEFINITION_H