NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imdl_function_call.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_FUNCTION_CALL_H
9 #define MI_NEURAYLIB_IMDL_FUNCTION_CALL_H
10 
13 
14 namespace mi {
15 
20 class IAttribute_container;
21 
29 class IMdl_function_call : public
30  mi::base::Interface_declare<0x308bcfb7,0x6abc,0x44cd,0xb2,0xdc,0x0c,0x88,0x44,0x0f,0x9e,0x32,
31  IScene_element>
32 {
33 public:
39  virtual const char* get_function_definition() const = 0;
40 
48  virtual const char* get_name() const = 0;
49 
53  virtual const char* get_return_type() const = 0;
54 
58  virtual bool is_return_type_varying() const = 0;
59 
63  virtual Uint32 get_parameter_count() const = 0;
64 
69  virtual const char* get_parameter_name( Uint32 index) const = 0;
70 
75  virtual Sint32 get_parameter_index( const char* name) const = 0;
76 
84  virtual const char* get_parameter_type( Uint32 index) const = 0;
85 
90  virtual const char* get_parameter_type( const char* name) const = 0;
91 
97  virtual bool is_parameter_type_uniform( Uint32 index) const = 0;
98 
104  virtual bool is_parameter_type_uniform( const char* name) const = 0;
105 
117  virtual const char* get_argument_type( Uint32 index) const = 0;
118 
127  virtual const char* get_argument_type( const char* name) const = 0;
128 
139  virtual const IAttachable* get_argument( Uint32 index) const = 0;
140 
158  template<class T>
159  const T* get_argument( Uint32 index) const
160  {
161  const IAttachable* ptr_idata = get_argument( index);
162  if ( !ptr_idata)
163  return 0;
164  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
165  ptr_idata->release();
166  return ptr_T;
167  }
168 
176  virtual const IAttachable* get_argument( const char* name) const = 0;
177 
192  template<class T>
193  const T* get_argument( const char* name) const
194  {
195  const IAttachable* ptr_idata = get_argument( name);
196  if ( !ptr_idata)
197  return 0;
198  const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
199  ptr_idata->release();
200  return ptr_T;
201  }
202 
218  virtual Sint32 set_argument( Uint32 index, const IAttachable* value) = 0;
219 
235  virtual Sint32 set_argument( const char* name, const IAttachable* value) = 0;
236 
240  virtual const IAttribute_container* access_arguments() const = 0;
241 
256  virtual Sint32 set_arguments( const IAttribute_container* arguments) = 0;
257 };
258  // end group mi_neuray_materials
260 
261 } // namespace mi
262 
263 #endif // MI_NEURAYLIB_IMDL_FUNCTION_CALL