NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imdl_function_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_FUNCTION_DEFINITION_H
9 #define MI_NEURAYLIB_IMDL_FUNCTION_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_function_call;
25 
35 class IMdl_function_definition : public
36  mi::base::Interface_declare<0x0a8d2440,0x0b1f,0x4424,0x87,0xad,0x50,0xe1,0x20,0x8e,0x62,0x39,
37  neuraylib::IScene_element>
38 {
39 public:
45  virtual const char* get_module() const = 0;
46 
54  virtual const char* get_name() const = 0;
55 
57  virtual bool is_exported() const = 0;
58 
62  virtual const char* get_return_type() const = 0;
63 
67  virtual bool is_return_type_varying() const = 0;
68 
72  virtual Uint32 get_parameter_count() const = 0;
73 
78  virtual const char* get_parameter_name( Uint32 index) const = 0;
79 
84  virtual Sint32 get_parameter_index( const char* name) const = 0;
85 
93  virtual const char* get_parameter_type( Uint32 index) const = 0;
94 
99  virtual const char* get_parameter_type( const char* name) const = 0;
100 
106  virtual bool is_parameter_type_uniform( Uint32 index) const = 0;
107 
113  virtual bool is_parameter_type_uniform( const char* name) const = 0;
114 
126  virtual const char* get_argument_type( Uint32 index) const = 0;
127 
136  virtual const char* get_argument_type( const char* name) const = 0;
137 
146  virtual const IAttachable* get_default( Uint32 index) const = 0;
147 
163  template<class T>
164  const T* get_default( Uint32 index) const
165  {
166  const IAttachable* ptr_idata = get_default( index);
167  if ( !ptr_idata)
168  return 0;
169  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
170  ptr_idata->release();
171  return ptr_T;
172  }
173 
179  virtual const IAttachable* get_default( const char* name) const = 0;
180 
193  template<class T>
194  const T* get_default( const char* name) const
195  {
196  const IAttachable* ptr_idata = get_default( name);
197  if ( !ptr_idata)
198  return 0;
199  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
200  ptr_idata->release();
201  return ptr_T;
202  }
203 
207  virtual const IAttribute_container* get_annotations() const = 0;
208 
212  virtual const IAttribute_container* get_return_annotations() const = 0;
213 
221  virtual const IAttribute_container* get_parameter_annotations( Uint32 index) const = 0;
222 
227  virtual const IAttribute_container* get_parameter_annotations( const char* name) const = 0;
228 
255  const IAttribute_container* arguments, Sint32* errors = 0) const = 0;
256 };
257  // end group mi_neuray_materials
259 
260 } // namespace neuraylib
261 
262 #ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
263 using neuraylib::IAttribute_container;
264 using neuraylib::IMdl_function_call;
265 using neuraylib::IMdl_function_definition;
266 using neuraylib::IScene_element;
267 #endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
268 
269 } // namespace mi
270 
271 #endif // MI_NEURAYLIB_IMDL_FUNCTION_DEFINITION_H