NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IRemote_client Class Referenceabstract

The client of the Iray Bridge. More...

Inheritance diagram for mi::neuraylib::IRemote_client:
Inheritance graph
[legend]

Public Member Functions

virtual Sint32  push_scene_changes (neuraylib::ITransaction *transaction, const char *scene_name, IRemote_ready_callback *ready_callback, IProgress_callback *progress_callback)=0
  Updates the scene in the remote server db to match the local scene. More...
 
virtual Sint32  create_remote_snapshot (neuraylib::ITransaction *transaction, const char *scene_name, const char *filename, IRemote_ready_callback *ready_callback, IProgress_callback *progress_callback)=0
  Pushes any local scene changes to the remote server and saves a cb snapshot of the scene in that state on the remote server. More...
 
virtual Sint32  create_incremental_remote_snapshot (neuraylib::ITransaction *transaction, const char *scene_name, const char *filename, IRemote_ready_callback *ready_callback, IProgress_callback *progress_callback)=0
  Pushes any local scene changes to the remote server and saves a cb snapshot containing only changes done since the last call to create_remote_snapshot() or to this method. More...
 
virtual bool  cancel (Sint32 async_token)=0
  Cancels an asynchronous operation such as create_remote_snapshot. More...
 
virtual Sint32  measure_bandwidth (bool upload, Uint32 amount, Uint32 count, IProgress_callback *progress_callback)=0
  Performs a bandwidth and round trip test. More...
 
virtual bool  remove_scene (const char *scene_name)=0
  Whenever a scene is pushed to the server any local changes will be replicated in the server side db. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x0fe7edf6, 0x47eb, 0x4a51, 0xa7, 0x59, 0x19, 0x1c, 0x11, 0x01, 0x26, 0xd9 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x0fe7edf6, 0x47eb, 0x4a51, 0xa7, 0x59, 0x19, 0x1c, 0x11, 0x01, 0x26, 0xd9 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

The client of the Iray Bridge.

Member Function Documentation

virtual bool mi::neuraylib::IRemote_client::cancel ( Sint32  async_token)
pure virtual

Cancels an asynchronous operation such as create_remote_snapshot.

Note that this method initiates canceling of the operation and then returns immediately. Any registered callbacks will be called when canceling is completed. Also note that the operation might finish normally even after this method has been called successfully.

Parameters
async_token A token returned from one of the methods starting an asynchronous operation, such as create_remote_snapshot.
Returns
True if the operation was still active, false otherwise.
virtual Sint32 mi::neuraylib::IRemote_client::create_incremental_remote_snapshot ( neuraylib::ITransaction transaction,
const char *  scene_name,
const char *  filename,
IRemote_ready_callback ready_callback,
IProgress_callback progress_callback 
)
pure virtual

Pushes any local scene changes to the remote server and saves a cb snapshot containing only changes done since the last call to create_remote_snapshot() or to this method.

Incremental cb files can be imported to apply only the incremental changes to an already loaded scene.

The cb file format is a lightweight scene format that can be used by the cb_importer plugin to import the scene in that state at a later time. The cb file format is essentially just a list of element names and hashes of the data, and the actual data is loaded from the remote server disk cache. The cb snapshot will be saved in the server-side folder specified by calling mi::neuraylib::IRemote_configuration::set_scene_export_path(). Relative paths are allowed, so specifying a snapshot file name as "my_folder/my_snapshot.cb" will save the cb file to the "my_folder" folder under the specified output directory.

If there is no existing connection to the configured remote server, this method will automatically attempt to establish it.

The following is required to import a cb file:

  • The cb_importer plugin must be loaded.
  • The path to the disk cache must be configured by calling mi::neuraylib::IRemote_configuration::set_remote_disk_cache_path().
  • The configured disk cache must contain data for all hashes referenced by the cb file. Saving the snapshot with this method ensures that all hashes are saved to the disk cache configured on the remote server.
  • The saved snapshot file must have the suffix ".cb".

Progress areas: "remote_push_state". Sent when the state of the push operation changes.

  • value 1: Detecting changes to upload. Data will be uploaded in this state as well, but it is not yet known how much data needs to be uploaded.
  • value 2: Uploading.
  • value 3: Saving remote snapshot on server.
  • value 4: Finished updating scene on remote server.
  • value 5: Client canceled the scene update.
  • value 6: Some error prevented the scene update from finishing.

IRemote_ready_callback error codes:

  • 0: Success.
  • -1: The operation was canceled.
  • <-1: An unspecified error prevented the operation from completing.

IRemote_ready_callback str value: On success str contains the snapshot file name. If no file name was provided in the call, this will be a unique name generated by the server.

Parameters
transaction The transaction to use. Must be kept open until the asynchronous operation has completed.
scene_name The name of the scene to update.
filename The name of the cb snapshot file. May only contain characters valid for files on the server-side file system. Can be a relative path, for example: "user1/session1/my_snapshot.cb". Can be NULL or an empty string in which case the server will generate a unique name for the cb snapshot.
ready_callback Called when this asynchronous operation is finished.
progress_callback The progress callback interface.
Returns
  • >=0: The asynchronous operation started OK. The returned value
  • is a token that identifies the asynchronous operation.
  • -1: Invalid argument(s).
  • -2: Connection error.
  • <-2: Unspecified error.
virtual Sint32 mi::neuraylib::IRemote_client::create_remote_snapshot ( neuraylib::ITransaction transaction,
const char *  scene_name,
const char *  filename,
IRemote_ready_callback ready_callback,
IProgress_callback progress_callback 
)
pure virtual

Pushes any local scene changes to the remote server and saves a cb snapshot of the scene in that state on the remote server.

The cb file format is a lightweight scene format that can be used by the cb_importer plugin to import the scene in that state at a later time. The cb file format is essentially just a list of element names and hashes of the data, and the actual data is loaded from the remote server disk cache. The cb snapshot will be saved in the server-side folder specified by calling mi::neuraylib::IRemote_configuration::set_scene_export_path(). Relative paths are allowed, so specifying a snapshot file name as "my_folder/my_snapshot.cb" will save the cb file to the "my_folder" folder under the specified output directory.

If there is no existing connection to the configured remote server, this method will automatically attempt to establish it.

The following is required to import a cb file:

  • The cb_importer plugin must be loaded.
  • The path to the disk cache must be configured by calling mi::neuraylib::IRemote_configuration::set_remote_disk_cache_path().
  • The configured disk cache must contain data for all hashes referenced by the cb file. Saving the snapshot with this method ensures that all hashes are saved to the disk cache configured on the remote server.
  • The saved snapshot file must have the suffix ".cb".

Progress areas: "remote_push_state". Sent when the state of the push operation changes.

  • value 1: Detecting changes to upload. Data will be uploaded in this state as well, but it is not yet known how much data needs to be uploaded.
  • value 2: Uploading.
  • value 3: Saving remote snapshot on server.
  • value 4: Finished updating scene on remote server.
  • value 5: Client canceled the scene update.
  • value 6: Some error prevented the scene update from finishing.

IRemote_ready_callback error codes:

  • 0: Success.
  • -1: The operation was canceled.
  • <-1: An unspecified error prevented the operation from completing.

IRemote_ready_callback str value: On success str contains the snapshot file name. If no file name was provided in the call, this will be a unique name generated by the server.

Parameters
transaction The transaction to use. Must be kept open until the asynchronous operation has completed.
scene_name The name of the scene to update.
filename The name of the cb snapshot file. May only contain characters valid for files on the server-side file system. Can be a relative path, for example: "user1/session1/my_snapshot.cb". Can be NULL or an empty string in which case the server will generate a unique name for the cb snapshot.
ready_callback Called when this asynchronous operation is finished.
progress_callback The progress callback interface.
Returns
  • >=0: The asynchronous operation started OK. The returned value
  • is a token that identifies the asynchronous operation.
  • -1: Invalid argument(s).
  • -2: Connection error.
  • <-2: Unspecified error.
virtual Sint32 mi::neuraylib::IRemote_client::measure_bandwidth ( bool  upload,
Uint32  amount,
Uint32  count,
IProgress_callback progress_callback 
)
pure virtual

Performs a bandwidth and round trip test.

This methods sends uncompressed random data to or from the server to measure the available bandwidth without rendering and database overhead.

The callback is called with area = "test_status" and value = 100 when the test is finished.

Parameters
upload The direction of the bandwidth test (upload or download).
amount Size of data to send.
count How many times to send the data.
progress_callback The callback used to report the progress and the result.
Returns
  • >=0: Success.
  • -1: Invalid arguments, e.g., amount is smaller than the size of the protocol header.
  • -2: Connection error.
  • <-2: Unspecified error.
virtual Sint32 mi::neuraylib::IRemote_client::push_scene_changes ( neuraylib::ITransaction transaction,
const char *  scene_name,
IRemote_ready_callback ready_callback,
IProgress_callback progress_callback 
)
pure virtual

Updates the scene in the remote server db to match the local scene.

The supplied ready callback will be called when the operation finishes and the supplied progress callback will be called with progress updates. If one is using the cloud_render plugin this is done automatically when calling render().

This method will also attempt to establish a connection to the configured remote server if the connection is not already established. The address is configured through the mi::neuraylib::IRemote_configuration interface.

Progress areas: "remote_push_state". Sent when the state of the push operation changes.

  • value 1: Detecting changes to upload. Data will be uploaded in this state as well, but it is not yet known how much data needs to be uploaded.
  • value 2: Uploading.
  • value 3: Performing operation (not applicable here).
  • value 4: Finished updating scene on remote server.
  • value 5: Client canceled the scene update.
  • value 6: Some error prevented the scene update from finishing.

IReady_callback result values:

  • 0 Success.
  • <0 The operation failed.
Parameters
transaction The transaction to use. Must be kept open until the asynchronous operation has completed.
scene_name The name of the scene to update.
ready_callback Called when this asynchronous operation is finished.
progress_callback The progress callback interface.
Returns
  • >=0: The asynchronous operation started OK. The returned value
  • is a token that identifies the asynchronous operation.
  • -1: Invalid argument(s).
  • -2: Connection error.
  • <-2: Unspecified error.
virtual bool mi::neuraylib::IRemote_client::remove_scene ( const char *  scene_name)
pure virtual

Whenever a scene is pushed to the server any local changes will be replicated in the server side db.

Call this method when the replicated server side data is no longer needed to purge all book-keeping and also the server side data. Note that the data will be removed from the server as soon as possible, but if the data is in use it might take a while before it is gone.