NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imdl_compiled_material.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_COMPILED_MATERIAL_H
9 #define MI_NEURAYLIB_IMDL_COMPILED_MATERIAL_H
10 
12 
13 namespace mi {
14 
19 class IAttribute_container;
20 
39  SLOT_FORCE_32_BIT = 0xffffffffU
40 };
41 
42 mi_static_assert( sizeof( Material_slot) == sizeof( Uint32));
43 
68 class IMdl_compiled_material : public
69  mi::base::Interface_declare<0xb6d884c1,0x1db5,0x49f9,0x88,0x1c,0xd2,0x79,0x96,0x96,0xd3,0xf4,
70  IScene_element>
71 {
72 public:
74 
75 
83  virtual const IData* get_field( const char* name) const = 0;
84 
99  template<class T>
100  const T* get_field( const char* name) const
101  {
102  const IData* ptr_idata = get_field( name);
103  if ( !ptr_idata)
104  return 0;
105  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
106  ptr_idata->release();
107  return ptr_T;
108  }
109 
113  virtual Uint32 get_temporary_count() const = 0;
114 
119  virtual const IData* get_temporary( Uint32 index) const = 0;
120 
132  template<class T>
133  const T* get_temporary( Uint32 index) const
134  {
135  const IData* ptr_idata = get_temporary( index);
136  if ( !ptr_idata)
137  return 0;
138  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
139  ptr_idata->release();
140  return ptr_T;
141  }
142 
144 
146 
150  virtual Uint32 get_parameter_count() const = 0;
151 
157  virtual const char* get_parameter_name( Uint32 index) const = 0;
158 
165  virtual const IData* get_argument( Uint32 index) const = 0;
166 
178  template<class T>
179  const T* get_argument( Uint32 index) const
180  {
181  const IData* ptr_idata = get_argument( index);
182  if ( !ptr_idata)
183  return 0;
184  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
185  ptr_idata->release();
186  return ptr_T;
187  }
188 
195  virtual base::Uuid get_hash() const = 0;
196 
203  virtual base::Uuid get_slot_hash( Material_slot slot) const = 0;
204 
206 };
207  // end group mi_neuray_materials
209 
210 } // namespace mi
211 
212 #endif // MI_NEURAYLIB_IMDL_COMPILED_MATERIAL_H