NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imdl_material_instance.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_IMDL_MATERIAL_INSTANCE_H
9 #define MI_NEURAYLIB_IMDL_MATERIAL_INSTANCE_H
10 
13 
14 namespace mi {
15 
20 class IAttribute_container;
21 class IMdl_compiled_material;
22 
30 class IMdl_material_instance : public
31  mi::base::Interface_declare<0xf265a300,0x01d9,0x4b65,0xb9,0x64,0xd4,0x78,0xde,0x7c,0xeb,0xf2,
32  IScene_element>
33 {
34 public:
40  virtual const char* get_material_definition() const = 0;
41 
49  virtual const char* get_name() const = 0;
50 
54  virtual Uint32 get_parameter_count() const = 0;
55 
60  virtual const char* get_parameter_name( Uint32 index) const = 0;
61 
66  virtual Sint32 get_parameter_index( const char* name) const = 0;
67 
75  virtual const char* get_parameter_type( Uint32 index) const = 0;
76 
81  virtual const char* get_parameter_type( const char* name) const = 0;
82 
88  virtual bool is_parameter_type_uniform( Uint32 index) const = 0;
89 
95  virtual bool is_parameter_type_uniform( const char* name) const = 0;
96 
108  virtual const char* get_argument_type( Uint32 index) const = 0;
109 
118  virtual const char* get_argument_type( const char* name) const = 0;
119 
130  virtual const IAttachable* get_argument( Uint32 index) const = 0;
131 
149  template<class T>
150  const T* get_argument( Uint32 index) const
151  {
152  const IAttachable* ptr_idata = get_argument( index);
153  if ( !ptr_idata)
154  return 0;
155  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
156  ptr_idata->release();
157  return ptr_T;
158  }
159 
167  virtual const IAttachable* get_argument( const char* name) const = 0;
168 
183  template<class T>
184  const T* get_argument( const char* name) const
185  {
186  const IAttachable* ptr_idata = get_argument( name);
187  if ( !ptr_idata)
188  return 0;
189  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
190  ptr_idata->release();
191  return ptr_T;
192  }
193 
209  virtual Sint32 set_argument( Uint32 index, const IAttachable* value) = 0;
210 
226  virtual Sint32 set_argument( const char* name, const IAttachable* value) = 0;
227 
231  virtual const IAttribute_container* access_arguments() const = 0;
232 
247  virtual Sint32 set_arguments( const IAttribute_container* arguments) = 0;
248 
255  COMPILATION_OPTIONS_FORCE_32_BIT = 0xffffffffU // Undocumented, for alignment only
256  };
257 
258  mi_static_assert( sizeof( Compilation_options) == sizeof( Uint32));
259 
271  Uint32 flags = 0, Sint32* errors = 0) const = 0;
272 };
273  // end group mi_neuray_materials
275 
276 } // namespace mi
277 
278 #endif // MI_NEURAYLIB_IMDL_MATERIAL_INSTANCE_H