NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imdl_material_definition.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
6 //*****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_IMDL_MATERIAL_DEFINITION_H
9 #define MI_NEURAYLIB_IMDL_MATERIAL_DEFINITION_H
10 
13 #include <mi/neuraylib/version.h>
14 
15 namespace mi {
16 
17 namespace neuraylib {
18 
23 class IAttribute_container;
24 class IMdl_material_instance;
25 
34 class IMdl_material_definition : public
35  mi::base::Interface_declare<0x839307d2,0xadcd,0x4580,0x84,0xfa,0x76,0x87,0x37,0xe6,0xea,0xd0,
36  neuraylib::IScene_element>
37 {
38 public:
44  virtual const char* get_module() const = 0;
45 
53  virtual const char* get_name() const = 0;
54 
56  virtual bool is_exported() const = 0;
57 
61  virtual Uint32 get_parameter_count() const = 0;
62 
67  virtual const char* get_parameter_name( Uint32 index) const = 0;
68 
73  virtual Sint32 get_parameter_index( const char* name) const = 0;
74 
82  virtual const char* get_parameter_type( Uint32 index) const = 0;
83 
88  virtual const char* get_parameter_type( const char* name) const = 0;
89 
95  virtual bool is_parameter_type_uniform( Uint32 index) const = 0;
96 
102  virtual bool is_parameter_type_uniform( const char* name) const = 0;
103 
115  virtual const char* get_argument_type( Uint32 index) const = 0;
116 
125  virtual const char* get_argument_type( const char* name) const = 0;
126 
135  virtual const IAttachable* get_default( Uint32 index) const = 0;
136 
152  template<class T>
153  const T* get_default( Uint32 index) const
154  {
155  const IAttachable* ptr_idata = get_default( index);
156  if ( !ptr_idata)
157  return 0;
158  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
159  ptr_idata->release();
160  return ptr_T;
161  }
162 
168  virtual const IAttachable* get_default( const char* name) const = 0;
169 
182  template<class T>
183  const T* get_default( const char* name) const
184  {
185  const IAttachable* ptr_idata = get_default( name);
186  if ( !ptr_idata)
187  return 0;
188  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
189  ptr_idata->release();
190  return ptr_T;
191  }
192 
196  virtual const IAttribute_container* get_annotations() const = 0;
197 
205  virtual const IAttribute_container* get_parameter_annotations( Uint32 index) const = 0;
206 
211  virtual const IAttribute_container* get_parameter_annotations( const char* name) const = 0;
212 
239  const IAttribute_container* arguments,
240  Sint32* errors = 0) const = 0;
241 
281  virtual Sint32 create_preset(
282  const char* module_name,
283  const char* preset_name,
284  const IAttribute_container* defaults) const = 0;
285 };
286  // end group mi_neuray_materials
288 
289 } // namespace neuraylib
290 
291 #ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
292 using neuraylib::IAttribute_container;
293 using neuraylib::IMdl_material_definition;
294 using neuraylib::IMdl_material_instance;
295 using neuraylib::IScene_element;
296 #endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
297 
298 } // namespace mi
299 
300 #endif // MI_NEURAYLIB_IMDL_MATERIAL_DEFINITION_H