Context for creating Iray Bridge snapshots. More...
#include <iiray_bridge_client.h>
Public Member Functions | |
virtual Sint32 | create_snapshot (neuraylib::ITransaction *transaction, const char *file_name, IIray_bridge_snapshot_callback *callback, bool incremental=false)=0 |
Creates a scene snapshot on the Iray Bridge server. More... | |
virtual Sint32 | cancel_snapshot ()=0 |
Cancels the snapshot currently being created by this snapshot context. More... | |
virtual Sint32 | set_option (const char *name, const IData *value)=0 |
Sets the value of a snapshot context option. More... | |
virtual const IData * | get_option (const char *name) const =0 |
Returns the value of a snapshot context option. More... | |
template<class T> | |
const T * | get_option (const char *name) const |
Returns the value of a snapshot 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 | |
![]() | |
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... | |
![]() | |
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... | |
Context for creating Iray Bridge snapshots.
A snapshot context is very similar to a render context, but instead of rendering it allows to create scene snapshots on the server. Instances of this class are meant to be used together with Bridge render contexts to save snapshots to take advantage of Bridge features such as incremental changes.
This context will, just as the Bridge renderer contexts, use the Iray Bridge server URL and security token as set on the API component mi::bridge::IIray_bridge_client, and will also detect changes to the application URL which will trigger an automatic reconnect to the new Iray Bridge server.
|
pure virtual |
Cancels the snapshot currently being created by this snapshot context.
|
pure virtual |
Creates a scene snapshot on the Iray Bridge server.
Optionally the created snapshot is incremental which means that only the changes since the last call to create_snapshot() on this context are saved.
Only one snapshot can be created at a time. Calling this method while another snapshot is being created will fail.
transaction | The transaction to use when creating the snapshot. Any data that is not up to date on the server will be sent automatically. The transaction needs to be from the same scope as the transaction used to create the context. |
file_name | The name of the file to save the snapshot to. The location of the file is configured on the server. If called with an empty string (or nullptr ) the server will generate a unique name for the snapshot. This name will be provided in the callback to the provided mi::bridge::IIray_bridge_snapshot_callback instance. |
callback | The callback that will be called on progress and when the snapshot has been successfully saved, or if there was an error. |
incremental | If true , then only the changes since the last call to create_snapshot() will be saved. If this is the first call for this context then a full snapshot will be saved even if set to true . Fully restoring an incremental snapshot requires loading the full snapshot first and then any subsequent incremental snapshots in the order they were created. |
|
inline |
Returns the value of a snapshot 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 snapshot 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 |
Sets the value of a snapshot context option.
Supported options are "bridge_address" and "bridge_security_token", both of type IString, which override the default settings for the bridge server and security token to use when saving snapshots.
name | The name of the option to be set. |
value | The value of the option to be set. |
name
is invalid.value
is invalid.