MDL SDK API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
icompiled_material.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2022 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_ICOMPILED_MATERIAL_H
8 #define MI_NEURAYLIB_ICOMPILED_MATERIAL_H
9 
12 #include <mi/neuraylib/version.h>
13 
14 namespace mi {
15 
16 namespace neuraylib {
17 
18 class IMdl_execution_context;
19 
24 enum Material_slot {
47  SLOT_FORCE_32_BIT = 0xffffffffU
48 };
49 
50 mi_static_assert( sizeof( Material_slot) == sizeof( mi::Uint32));
51 
60  OPACITY_FORCE_32_BIT = 0xffffffffU
61 };
62 
63 mi_static_assert( sizeof( Material_opacity) == sizeof( mi::Uint32));
64 
91 class ICompiled_material : public
92  mi::base::Interface_declare<0x3115ab0f,0x7a91,0x4651,0xa5,0x9a,0xfd,0xb0,0x23,0x16,0xb4,0xb7,
93  neuraylib::IScene_element>
94 {
95 public:
97 
98 
100  virtual const IExpression_direct_call* get_body() const = 0;
101 
103  virtual Size get_temporary_count() const = 0;
104 
110  virtual const IExpression* get_temporary( Size index) const = 0;
111 
124  template<class T>
125  const T* get_temporary( Size index) const
126  {
127  const IExpression* ptr_iexpression = get_temporary( index);
128  if ( !ptr_iexpression)
129  return 0;
130  const T* ptr_T = static_cast<const T*>( ptr_iexpression->get_interface( typename T::IID()));
131  ptr_iexpression->release();
132  return ptr_T;
133  }
134 
136  virtual Float32 get_mdl_meters_per_scene_unit() const = 0;
137 
139  virtual Float32 get_mdl_wavelength_min() const = 0;
140 
142  virtual Float32 get_mdl_wavelength_max() const = 0;
143 
146  virtual bool depends_on_state_transform() const = 0;
147 
149  virtual bool depends_on_state_object_id() const = 0;
150 
152  virtual bool depends_on_global_distribution() const = 0;
153 
155  virtual bool depends_on_uniform_scene_data() const = 0;
156 
158  virtual Size get_referenced_scene_data_count() const = 0;
159 
163  virtual const char* get_referenced_scene_data_name( Size index) const = 0;
164 
166 
168 
170  virtual Size get_parameter_count() const = 0;
171 
177  virtual const char* get_parameter_name( Size index) const = 0;
178 
183  virtual const IValue* get_argument( Size index) const = 0;
184 
196  template<class T>
197  const T* get_argument( Size index) const
198  {
199  const IValue* ptr_ivalue = get_argument( index);
200  if ( !ptr_ivalue)
201  return 0;
202  const T* ptr_T = static_cast<const T*>( ptr_ivalue->get_interface( typename T::IID()));
203  ptr_ivalue->release();
204  return ptr_T;
205  }
206 
226  virtual base::Uuid get_hash() const = 0;
227 
247  virtual base::Uuid get_slot_hash( Material_slot slot) const = 0;
248 
255  virtual const IExpression* lookup_sub_expression( const char* path) const = 0;
256 
257 
290  const char* material_instance_name,
291  Size parameter_index,
292  Sint32* errors = 0) const = 0;
293 
299  virtual Material_opacity get_opacity() const = 0;
300 
304  virtual Material_opacity get_surface_opacity() const = 0;
305 
312  virtual bool get_cutout_opacity( Float32* cutout_opacity) const = 0;
313 
321  virtual bool is_valid( IMdl_execution_context* context) const = 0;
322 
324 };
325  // end group mi_neuray_mdl_elements
327 
328 } // namespace neuraylib
329 
330 } // namespace mi
331 
332 #endif // MI_NEURAYLIB_ICOMPILED_MATERIAL_H