neuray API Programmer's Manual

ifunction_call.h File Reference

Description

Scene element Function_call.

Code Example

ifunction_call.h

‎/***************************************************************************************************
 * Copyright 2023 NVIDIA Corporation. All rights reserved.
 **************************************************************************************************/

#ifndef MI_NEURAYLIB_IFUNCTION_CALL_H
#define MI_NEURAYLIB_IFUNCTION_CALL_H

#include <cstring>

#include <mi/neuraylib/iexpression.h>
#include <mi/neuraylib/imdl_factory.h>
#include <mi/neuraylib/iscene_element.h>

namespace mi {

namespace neuraylib {

class IMdl_execution_context;

enum Mdl_repair_options{
    MDL_REPAIR_DEFAULT           = 0,           
    MDL_REMOVE_INVALID_ARGUMENTS = 1, 
    MDL_REPAIR_INVALID_ARGUMENTS = 2, 
    MDL_REPAIR_OPTIONS_FORCE_32_BIT = 0xffffffffU // Undocumented, for alignment only
};

mi_static_assert( sizeof( Mdl_repair_options) == sizeof( Uint32));

class IFunction_call : public
    mi::base::Interface_declare<0x67b29f5f,0xdbc1,0x4300,0x94,0x53,0x3e,0x2d,0x28,0x29,0xc1,0xe9,
                                neuraylib::IScene_element>
{
public:
    virtual const char* get_function_definition() const = 0;

    virtual const char* get_mdl_function_definition() const = 0;

    virtual bool is_material() const = 0;

    inline bool is_array_constructor() const
    { return strcmp( get_mdl_function_definition(), "T[](...)") == 0; }

    virtual const IType* get_return_type() const = 0;

    virtual Size 
               get_parameter_count() const = 0;

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

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

    virtual const IType_list* get_parameter_types() const = 0;

    virtual const IExpression_list* get_arguments() const = 0;

    virtual Sint32 
               set_arguments( const IExpression_list* arguments) = 0;

    virtual Sint32 
               set_argument( Size index, const IExpression* argument) = 0;

    virtual Sint32 
               set_argument( const char* name, const IExpression* argument) = 0;

    virtual Sint32 
               reset_argument( Size index) = 0;

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

    virtual bool is_default() const = 0;

    virtual bool is_valid( IMdl_execution_context* context) const = 0;

    virtual Sint32 
               repair( Uint32 flags, IMdl_execution_context* context) = 0;
};
 // end group mi_neuray_mdl_elements

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_IFUNCTION_CALL

Namespaces

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

Classes

class 
This interface represents a function call. More...

Enumerations

enum  {MDL_REPAIR_DEFAULT = 0, MDL_REMOVE_INVALID_ARGUMENTS = 1, MDL_REPAIR_INVALID_ARGUMENTS = 2, MDL_REPAIR_OPTIONS_FORCE_32_BIT = 0xffffffffU }
Options for repairing function calls. More...