neuray API Programmer's Manual

imdl_function_definition.h File Reference

Description

Scene element Mdl_function_definition.

Code Example

imdl_function_definition.h

‎//*****************************************************************************
// Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
//*****************************************************************************
//*****************************************************************************

#ifndef MI_NEURAYLIB_IMDL_FUNCTION_DEFINITION_H
#define MI_NEURAYLIB_IMDL_FUNCTION_DEFINITION_H

#include <mi/neuraylib/iattachable.h>
#include <mi/neuraylib/iscene_element.h>
#include <mi/neuraylib/version.h>

namespace mi {

namespace neuraylib {

class IAttribute_container;
class IMdl_function_call;

class IMdl_function_definition : public
    mi::base::Interface_declare<0x0a8d2440,0x0b1f,0x4424,0x87,0xad,0x50,0xe1,0x20,0x8e,0x62,0x39,
                                neuraylib::IScene_element>
{
public:
    virtual const char* get_module() const = 0;

    virtual const char* get_name() const = 0;

    virtual bool is_exported() const = 0;

    virtual const char* get_return_type() const = 0;

    virtual bool is_return_type_varying() const = 0;

    virtual Uint32 
               get_parameter_count() const = 0;

    virtual const char* get_parameter_name( Uint32 index) const = 0;

    virtual Sint32 
               get_parameter_index( const char* name) const = 0;

    virtual const char* get_parameter_type( Uint32 index) const = 0;

    virtual const char* get_parameter_type( const char* name) const = 0;

    virtual bool is_parameter_type_uniform( Uint32 index) const = 0;

    virtual bool is_parameter_type_uniform( const char* name) const = 0;

    virtual const char* get_argument_type( Uint32 index) const = 0;

    virtual const char* get_argument_type( const char* name) const = 0;

    virtual const IAttachable* get_default( Uint32 index) const = 0;

    template<class T>
    const T* get_default( Uint32 index) const
    {
        const IAttachable* ptr_idata = get_default( index);
        if ( !ptr_idata)
            return 0;
        const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
        ptr_idata->release();
        return ptr_T;
    }

    virtual const IAttachable* get_default( const char* name) const = 0;

    template<class T>
    const T* get_default( const char* name) const
    {
        const IAttachable* ptr_idata = get_default( name);
        if ( !ptr_idata)
            return 0;
        const T* ptr_T = static_cast<const T*>( ptr_idata->get_interface( typename T::IID()));
        ptr_idata->release();
        return ptr_T;
    }

    virtual const IAttribute_container* get_annotations() const = 0;

    virtual const IAttribute_container* get_return_annotations() const = 0;

    virtual const IAttribute_container* get_parameter_annotations( Uint32 index) const = 0;

    virtual const IAttribute_container* get_parameter_annotations( const char* name) const = 0;

    virtual IMdl_function_call* create_function_call(
        const IAttribute_container* arguments, Sint32* errors = 0) const = 0;
};
 // end group mi_neuray_materials

} // namespace neuraylib

#ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
using neuraylib::IAttribute_container;
using neuraylib::IMdl_function_call;
using neuraylib::IMdl_function_definition;
using neuraylib::IScene_element;
#endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION

} // namespace mi

#endif // MI_NEURAYLIB_IMDL_FUNCTION_DEFINITION_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
This interfaces represents a function definition. More...