neuray API Programmer's Manual

irender_context.h File Reference

Description

Context for rendering and picking operations.

Code Example

irender_context.h

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

#ifndef MI_NEURAYLIB_IRENDER_CONTEXT_H
#define MI_NEURAYLIB_IRENDER_CONTEXT_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/idata.h>
#include <mi/neuraylib/typedefs.h>

namespace mi {

namespace neuraylib {

class IPick_array;
class IProgress_callback;
class IReady_callback;
class IRender_counters;
class IRender_target_base;
class ITransaction;



class IRender_context : public
    mi::base::Interface_declare<0xad5ccd43,0x75a1,0x427a,0x83,0x7d,0x95,0xc8,0x70,0x91,0xd4,0xc8>
{
public:
    virtual Sint32 
               render(
        ITransaction* transaction,
        IRender_target_base* render_target_base,
        IProgress_callback* progress_callback) = 0;

    virtual Sint32 
               render_async(
        ITransaction* transaction,
        IRender_target_base* render_target_base,
        IReady_callback* ready_callback,
        IProgress_callback* progress_callback) = 0;

    virtual void cancel_render() = 0;

    virtual IPick_array* pick(
        ITransaction* transaction,
        const Float32_2_struct& point) = 0;

    virtual IPick_array* pick(
        ITransaction* transaction,
        const Float32_2_struct& center,
        const Float32_2_struct& size) = 0;

    virtual IRender_counters* get_render_counters() = 0;

    virtual Sint32 
               set_option( const char* name, const IData* value) = 0;

    virtual const IData* get_option( const char* name) const = 0;

    template<class T>
    const T* get_option( const char* name) const
    {
        const IData* ptr_idata = get_option( 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 Size 
               get_options_length() const = 0;

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

    virtual const char* get_option_type( Size index) const = 0;
};
 // end group mi_neuray_rendering

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_IRENDER_CONTEXT_H

Namespaces

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

Classes

class 
This interface is used for doing actual rendering and picking. More...