Iray SDK API nvidia_logo_transpbg.gif Up
mi::bridge::IIray_bridge_snapshot_context Class Referenceabstract

Context for creating Iray Bridge snapshots. More...

#include <iiray_bridge_client.h>

Inheritance diagram for mi::bridge::IIray_bridge_snapshot_context:

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 IDataget_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...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_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 IInterfaceget_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

- Public Types inherited from mi::base::Interface_declare< 0xe624c597, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xe624c597, ... >
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 Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

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.

See also
mi::bridge::IIray_bridge_client::create_snapshot_context()

Member Function Documentation

 cancel_snapshot()

virtual Sint32 mi::bridge::IIray_bridge_snapshot_context::cancel_snapshot ( )
pure virtual

Cancels the snapshot currently being created by this snapshot context.

Note
This method returns immediately and the snapshot will be canceled as quickly as possible, at which time the provided callback will be invoked with an error code. Note that the snapshot might still be created after successfully calling cancel if it was to late to cancel it.
Returns
  • 0: Success.
  • -2: Network error.
  • -3: Failed to abort the snapshot.
  • <= -4: Unspecified error.

 create_snapshot()

virtual Sint32 mi::bridge::IIray_bridge_snapshot_context::create_snapshot ( neuraylib::ITransaction transaction,
const char *  file_name,
IIray_bridge_snapshot_callback callback,
bool  incremental = false 
)
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.

Parameters
transactionThe 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_nameThe 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 NULL) 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.
callbackThe callback that will be called on progress and when the snapshot has been successfully saved, or if there was an error.
incrementalIf 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.
Returns
  • 0: Success.
  • -1: Invalid arguments.
  • -2: Network error.
  • -3: A snapshot is currently already being created.
  • -4: The scene element could not be accessed.
  • <= -5: Unspecified error.

 get_option() [1/2]

template<class T>
const T * mi::bridge::IIray_bridge_snapshot_context::get_option ( const char *  name) const
inline

Returns the value of a snapshot context option.

See also
set_option(), get_option_name()

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.

Template Parameters
TThe interface type of the render-context option.
Parameters
nameThe name of the option.
Returns
The value of the option, or NULL in case of failure, e.g., if there is no such option.

 get_option() [2/2]

virtual const IData * mi::bridge::IIray_bridge_snapshot_context::get_option ( const char *  name) const
pure virtual

Returns the value of a snapshot context option.

See also
set_option(), get_option_name()
Parameters
nameThe name of the option.
Returns
The value of the option, or NULL in case of failure, e.g., if there is no such option.

 get_option_name()

virtual const char * mi::bridge::IIray_bridge_snapshot_context::get_option_name ( Size  index) const
pure virtual

Returns the name of a render context option.

See also
get_options_length(), get_option_type(), get_option(), set_option()
Parameters
indexThe index of the render context option in question.
Returns
The name of the specified render context option, or NULL if index is out of bounds.

 get_option_type()

virtual const char * mi::bridge::IIray_bridge_snapshot_context::get_option_type ( Size  index) const
pure virtual

Returns the type of a render context option.

See also
get_options_length(), get_option_name(), get_option(), set_option()
Parameters
indexThe index of the render context option in question.
Returns
The type of the specified render context option, or NULL if index is out of bounds.

 get_options_length()

virtual Size mi::bridge::IIray_bridge_snapshot_context::get_options_length ( ) const
pure virtual

Returns the number of render context options.

See also
get_option_name()

 set_option()

virtual Sint32 mi::bridge::IIray_bridge_snapshot_context::set_option ( const char *  name,
const IData value 
)
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.

See also
get_option(), get_option_name(), get_option_type()
Parameters
nameThe name of the option to be set.
valueThe value of the option to be set.
Returns
  • 0: Success.
  • -1: name is invalid.
  • -2: value is invalid.
  • -3: The option can not be set at this point in time.