NVIDIA Iray API Home  Up
 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, 2016 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 #include <mi/neuraylib/version.h>
13 
14 namespace mi {
15 
16 namespace neuraylib {
17 
22 class IAttribute_container;
23 
42  SLOT_FORCE_32_BIT = 0xffffffffU
43 };
44 
45 mi_static_assert( sizeof( Material_slot) == sizeof( Uint32));
46 
71 class IMdl_compiled_material : public
72  mi::base::Interface_declare<0xb6d884c1,0x1db5,0x49f9,0x88,0x1c,0xd2,0x79,0x96,0x96,0xd3,0xf4,
73  neuraylib::IScene_element>
74 {
75 public:
77 
78 
85  virtual const IData* get_field( const char* name) const = 0;
86 
100  template<class T>
101  const T* get_field( const char* name) const
102  {
103  const IData* ptr_idata = get_field( name);
104  if ( !ptr_idata)
105  return 0;
106  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
107  ptr_idata->release();
108  return ptr_T;
109  }
110 
114  virtual Uint32 get_temporary_count() const = 0;
115 
120  virtual const IData* get_temporary( Uint32 index) const = 0;
121 
133  template<class T>
134  const T* get_temporary( Uint32 index) const
135  {
136  const IData* ptr_idata = get_temporary( index);
137  if ( !ptr_idata)
138  return 0;
139  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
140  ptr_idata->release();
141  return ptr_T;
142  }
143 
145  virtual Float32 get_mdl_meters_per_scene_unit() const = 0;
146 
149  virtual bool depends_on_state_transform() const = 0;
150 
152  virtual bool depends_on_state_object_id() const = 0;
153 
155 
157 
161  virtual Uint32 get_parameter_count() const = 0;
162 
168  virtual const char* get_parameter_name( Uint32 index) const = 0;
169 
176  virtual const IData* get_argument( Uint32 index) const = 0;
177 
189  template<class T>
190  const T* get_argument( Uint32 index) const
191  {
192  const IData* ptr_idata = get_argument( index);
193  if ( !ptr_idata)
194  return 0;
195  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
196  ptr_idata->release();
197  return ptr_T;
198  }
199 
206  virtual base::Uuid get_hash() const = 0;
207 
214  virtual base::Uuid get_slot_hash( Material_slot slot) const = 0;
215 
217 };
218  // end group mi_neuray_materials
220 
221 } // namespace neuraylib
222 
223 #ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
224 using neuraylib::IAttribute_container;
225 using neuraylib::IMdl_compiled_material;
226 using neuraylib::IScene_element;
231 using neuraylib::SLOT_FORCE_32_BIT;
235 using neuraylib::SLOT_IOR;
243 #endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
244 
245 } // namespace mi
246 
247 #endif // MI_NEURAYLIB_IMDL_COMPILED_MATERIAL_H