neuray API Programmer's Manual

imdl_module_builder.h File Reference

Description

MDL module builder.

Code Example

imdl_module_builder.h

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

#ifndef MI_NEURAYLIB_IMDL_MODULE_BUILDER_H
#define MI_NEURAYLIB_IMDL_MODULE_BUILDER_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/itype.h>
#include <mi/neuraylib/version.h>

namespace mi {

class IArray;

namespace neuraylib {

class IAnnotation_block;
class IAnnotation_list;
class IExpression;
class IExpression_list;
class IMdl_execution_context;




class IMdl_module_builder: public
    base::Interface_declare<0x2357f2f8,0x4428,0x47e5,0xaa,0x92,0x97,0x98,0x25,0x5d,0x26,0x57>
{
public:
    virtual Sint32 
               add_variant(
        const char* name,
        const char* prototype_name,
        const IExpression_list* defaults,
        const IAnnotation_block* annotations,
        const IAnnotation_block* return_annotations,
        bool is_exported,
        bool is_declarative,
        IMdl_execution_context* context) = 0;

#ifdef MI_NEURAYLIB_DEPRECATED_15_0
    inline Sint32 
               add_variant(
        const char* name,
        const char* prototype_name,
        const IExpression_list* defaults,
        const IAnnotation_block* annotations,
        const IAnnotation_block* return_annotations,
        bool is_exported,
        IMdl_execution_context* context)
    {
        return add_variant(
            name,
            prototype_name,
            defaults,
            annotations,
            return_annotations,
            is_exported,
            false,
            context);
    }
#endif // MI_NEURAYLIB_DEPRECATED_15_0

    virtual Sint32 
               add_function(
        const char* name,
        const IExpression* body,
        const IExpression_list* temporaries,
        const IType_list* parameters,
        const IExpression_list* defaults,
        const IAnnotation_list* parameter_annotations,
        const IAnnotation_block* annotations,
        const IAnnotation_block* return_annotations,
        bool is_exported,
        bool is_declarative,
        IType::Modifier frequency_qualifier,
        IMdl_execution_context* context) = 0;

#ifdef MI_NEURAYLIB_DEPRECATED_15_0
    inline Sint32 
               add_function(
        const char* name,
        const IExpression* body,
        const IType_list* parameters,
        const IExpression_list* defaults,
        const IAnnotation_list* parameter_annotations,
        const IAnnotation_block* annotations,
        const IAnnotation_block* return_annotations,
        bool is_exported,
        IType::Modifier frequency_qualifier,
        IMdl_execution_context* context)
    {
        return add_function(
            name, body, 0, parameters, defaults, parameter_annotations, annotations,
            return_annotations, is_exported, false, frequency_qualifier, context);
    }
#endif // MI_NEURAYLIB_DEPRECATED_15_0

    virtual Sint32 
               add_annotation(
        const char* name,
        const IType_list* parameters,
        const IExpression_list* defaults,
        const IAnnotation_list* parameter_annotations,
        const IAnnotation_block* annotations,
        bool is_exported,
        IMdl_execution_context* context) = 0;

    virtual Sint32 
               add_struct_category(
        const char* name,
        const IAnnotation_block* annotations,
        bool is_exported,
        IMdl_execution_context* context) = 0;

    virtual Sint32 
               add_enum_type(
        const char* name,
        const IExpression_list* enumerators,
        const IAnnotation_list* enumerator_annotations,
        const IAnnotation_block* annotations,
        bool is_exported,
        IMdl_execution_context* context) = 0;

    virtual Sint32 
               add_struct_type(
        const char* name,
        const IType_list* fields,
        const IExpression_list* field_defaults,
        const IAnnotation_list* field_annotations,
        const IAnnotation_block* annotations,
        bool is_exported,
        bool is_declarative,
        const IStruct_category* struct_category,
        IMdl_execution_context* context) = 0;

#ifdef MI_NEURAYLIB_DEPRECATED_15_0
    inline Sint32 
               add_struct_type(
        const char* name,
        const IType_list* fields,
        const IExpression_list* field_defaults,
        const IAnnotation_list* field_annotations,
        const IAnnotation_block* annotations,
        bool is_exported,
        IMdl_execution_context* context)
    {
        return add_struct_type(
            name,
            fields,
            field_defaults,
            field_annotations,
            annotations,
            is_exported,
            false,
            0,
            context);
    }
#endif // MI_NEURAYLIB_DEPRECATED_15_0

    virtual Sint32 
               add_constant(
        const char* name,
        const IExpression* expr,
        const IAnnotation_block* annotations,
        bool is_exported,
        IMdl_execution_context* context) = 0;

    virtual Sint32 
               set_module_annotations(
        const IAnnotation_block* annotations, IMdl_execution_context* context) = 0;

    virtual Sint32 
               remove_entity(
        const char* name, Size index, IMdl_execution_context* context) = 0;

    virtual Sint32 
               clear_module( IMdl_execution_context* context) = 0;

    virtual const IArray* analyze_uniform(
        const IExpression* root_expr, bool root_expr_uniform, IMdl_execution_context* context) = 0;
};
 // end group mi_neuray_mdl_misc

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_IMDL_MODULE_BUILDER_H

Namespaces

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

Classes

class 
The module builder allows to create new MDL modules. More...