This interface is used for doing actual rendering and picking. More...
#include <irender_context.h>
Public Types | |
enum | Cancel_mode { CANCEL_AND_CONTINUE = 0 , CANCEL_AND_RESTART = 1 , CANCEL_FORCE_32_BIT = 0xffffffffU } |
Different modes of canceling a rendering operation. More... | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | IID = Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> |
Declares the interface ID (IID) of this interface. More... | |
Public Member Functions | |
virtual Sint32 | render (ITransaction *transaction, IRender_target_base *render_target_base, IProgress_callback *progress_callback)=0 |
Renders the associated scene with the associated render mode. More... | |
virtual Sint32 | render_async (ITransaction *transaction, IRender_target_base *render_target_base, IReady_callback *ready_callback, IProgress_callback *progress_callback)=0 |
Renders the associated scene with the associated render mode. More... | |
virtual void | cancel_render (Cancel_mode mode=CANCEL_AND_CONTINUE)=0 |
Allows to cancel rendering currently done using this render context. More... | |
virtual IPick_array * | pick (ITransaction *transaction, const Float32_2_struct &point, Uint32 max_pick_levels=1)=0 |
Picks what is behind a point in the scene. More... | |
virtual IPick_array * | pick (ITransaction *transaction, const Float32_2_struct ¢er, const Float32_2_struct &size, Uint32 max_pick_levels=1)=0 |
Picks what is behind a rectangle in the scene. More... | |
virtual IRender_counters * | get_render_counters ()=0 |
Returns the render counters for this render context. More... | |
virtual Sint32 | set_option (const char *name, const IData *value)=0 |
Sets the value of a render context option. More... | |
virtual const IData * | get_option (const char *name) const =0 |
Returns the value of a render context option. More... | |
template<class T> | |
const T * | get_option (const char *name) const |
Returns the value of a render context option. More... | |
virtual Size | get_options_length () const =0 |
Returns the number of render context options. More... | |
virtual const char * | get_option_name (Size index) const =0 |
Returns the name of a render context option. More... | |
virtual const char * | get_option_type (Size index) const =0 |
Returns the type of a render context option. More... | |
![]() | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
This interface is used for doing actual rendering and picking.
It can be obtained from mi::neuraylib::IScene::create_render_context().
Different modes of canceling a rendering operation.
The canceling mode is a hint to the render mode what is probably going to happen next. It allows the render mode to select the best way of canceling the rendering operation. The canceling mode does not affect the correctness of the converged result of the next rendering operation (but it might affect the time needed to achieve it and/or the quality of intermediate results).
|
pure virtual |
Allows to cancel rendering currently done using this render context.
It is not guaranteed how much time it takes until the rendering is actually finished. Note, that this function can be called by a different thread than the one currently doing the rendering.
|
inline |
Returns the value of a render context option.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the render-context option. |
name | The name of the option. |
nullptr
in case of failure, e.g., if there is no such option.
|
pure virtual |
Returns the value of a render context option.
name | The name of the option. |
nullptr
in case of failure, e.g., if there is no such option.
|
pure virtual |
Returns the name of a render context option.
index | The index of the render context option in question. |
nullptr
if index
is out of bounds.
|
pure virtual |
Returns the type of a render context option.
index | The index of the render context option in question. |
nullptr
if index
is out of bounds.
|
pure virtual |
Returns the number of render context options.
|
pure virtual |
Returns the render counters for this render context.
nullptr
if this render mode does not support render counters.
|
pure virtual |
Picks what is behind a rectangle in the scene.
Casts a ray into the scene for each raster pixel coordinate in the given rectangle. Returns an array that contains information about any objects hit by the rays. If multiple rays hit the same object, only one mi::neuraylib::IPick_result is added to the result array. The implementation defines which of the rays determines the corresponding world position.
Rays are cast at the crossings of an integer grid around center
through those pixels which are addressed by a rectangle of the given size
, centered around center
, and rounded to the nearest coordinate.
A call to this function with a size of (1,1) is equivalent to a call to the overload.
The max_pick_levels
parameter controls the number of rays that may be cast, per ray, during the picking operation. A level of 1 will only trace primary rays. Any other value will continue tracing rays through the scene until nothing was hit or the maximum depth is exhausted, with a value of 0 indicating unconstrained depth.
transaction | The transaction used to access the database. |
center | The 2D center of the picked region in screenspace. |
size | The rectangular size of the picked region in screenspace. |
max_pick_levels | The maximum ray depth for picking. |
nullptr
on error.
|
pure virtual |
Picks what is behind a point in the scene.
Casts a single ray into the scene at raster pixel coordinate point
, with (0,0) in the bottom left corner. Returns an array that contains information about any objects hit by the ray.
See the overload for details on the max_pick_levels
parameter.
transaction | The transaction used to access the database. |
point | The picked 2D point in screenspace. |
max_pick_levels | The maximum ray depth for picking. |
nullptr
on error.
|
pure virtual |
Renders the associated scene with the associated render mode.
The result is written to the given render target.
This method is synchronous, it returns after a certain amount of work has been done. See render_async() for an asynchronous variant of this method.
transaction | The transaction used to access the database. |
render_target_base | The rendered image is written into this render target before the method returns. It is guaranteed that the render target will only be modified during the runtime of this call, even if background rendering happens. |
progress_callback | This callback is called when progress in rendering occurs (might be nullptr ). |
nullptr
).
|
pure virtual |
Renders the associated scene with the associated render mode.
The result is written to the given render target.
The method returns immediately while the rendering is in progress. See render() for a synchronous variant of this method.
transaction | The transaction used to access the database. The transaction needs to be kept open until the ready callback was called. |
render_target_base | The rendered image is written into this render target. It is guaranteed that the render target will only be modified between this call and the invocation of the ready callback (see below), even if background rendering happens. |
ready_callback | This callback is called when rendering is finished. The result parameter of the callback matches the return values of the render() method. |
progress_callback | This callback is called when progress in rendering occurs (might be nullptr ). |
nullptr
).
|
pure virtual |
Sets the value of a render context option.
There are three different types of options:
This method deals with the second of the three types. Currently, there are no options common for all render modes. See the documentation of the render mode in question for render mode-specific options.
name | The name of the option to be set. |
value | The value of the option to be set. |
name
is invalid.value
is invalid.