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

API component that serves as entry point for the client-side Iray Bridge API. More...

#include <iiray_bridge_client.h>

Inheritance diagram for mi::bridge::IIray_bridge_client:

Public Member Functions

virtual Sint32 set_application_url (const char *application_url)=0
 Sets the default WebSocket URL to the server-side Iray Bridge application. More...
 
virtual const char * get_application_url () const =0
 Returns the configured Iray Bridge application URL. More...
 
virtual Sint32 set_security_token (const char *security_token)=0
 Sets the security token to use when connecting the server-side Iray Bridge application. More...
 
virtual const char * get_security_token () const =0
 Returns the configured security token. More...
 
virtual IIray_bridge_snapshot_contextcreate_snapshot_context (neuraylib::ITransaction *transaction, const char *scene_name)=0
 Creates a snapshot context. More...
 
virtual Sint32 set_log_forwarding_level (base::Message_severity level)=0
 Sets the log level of messages that are forwarded from the Iray Bridge server. More...
 
virtual base::Message_severity get_log_forwarding_level () const =0
 Returns the currently set log level for messages forwarded from the Iray Bridge server. More...
 
virtual void set_receiving_logger (base::ILogger *logger)=0
 Sets the receiving logger for log messages forwarded from the Iray Bridge server. More...
 
virtual base::ILoggerget_receiving_logger () const =0
 Returns the receiving logger for log messages forwarded from the Iray Bridge server. More...
 
virtual const char * get_bridge_protocol_version () const =0
 Returns the Iray Bridge protocol version. More...
 
virtual IIray_bridge_sessionget_session (const char *application_url, const char *security_token=0)=0
 Returns a session to the provided Bridge application running on a Bridge server. 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< 0x2e3322ff, ... >
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< 0x2e3322ff, ... >
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

API component that serves as entry point for the client-side Iray Bridge API.

This API component is provided by the iray_bridge_client plugin.

Member Function Documentation

 create_snapshot_context()

virtual IIray_bridge_snapshot_context * mi::bridge::IIray_bridge_client::create_snapshot_context ( neuraylib::ITransaction transaction,
const char *  scene_name 
)
pure virtual

Creates a snapshot context.

Parameters
transactionThe transaction determines the scope of the context. All transactions used with the context need to be from the same scope.
scene_nameThe scene of the context.
Returns
A snapshot context for the given scope and scene, or NULL if creation failed.

 get_application_url()

virtual const char * mi::bridge::IIray_bridge_client::get_application_url ( ) const
pure virtual

Returns the configured Iray Bridge application URL.

 get_bridge_protocol_version()

virtual const char * mi::bridge::IIray_bridge_client::get_bridge_protocol_version ( ) const
pure virtual

Returns the Iray Bridge protocol version.

 get_log_forwarding_level()

virtual base::Message_severity mi::bridge::IIray_bridge_client::get_log_forwarding_level ( ) const
pure virtual

Returns the currently set log level for messages forwarded from the Iray Bridge server.

See also
set_log_forwarding_level
Returns
The current log forwarding level.

 get_receiving_logger()

virtual base::ILogger * mi::bridge::IIray_bridge_client::get_receiving_logger ( ) const
pure virtual

Returns the receiving logger for log messages forwarded from the Iray Bridge server.

Note that if no receiving logger has been set, this method returns NULL and logging is done using the currently general configured logger.

See also
set_receiving_logger()
Returns
The current receiving logger.

 get_security_token()

virtual const char * mi::bridge::IIray_bridge_client::get_security_token ( ) const
pure virtual

Returns the configured security token.

 get_session()

virtual IIray_bridge_session * mi::bridge::IIray_bridge_client::get_session ( const char *  application_url,
const char *  security_token = 0 
)
pure virtual

Returns a session to the provided Bridge application running on a Bridge server.

Bridge supports session sharing, so subsequent calls to this method with the same URL and security token will return an already existing valid session. The session will be considered the same if the URL and security token strings match exactly, otherwise a new session will be created. If a session is closed then calling get_session() with the same URL and security token will create a new session and attempt a new connection to the server.

This call will return a session immediately which will connect to the specified URL automatically in the background. To find out if the session is connected or if the connection fails add a session state callback by calling mi::bridge::IIray_bridge_session::add_session_state_callback(). This callback will be called immediately with the current state, and then when the state changes.

Parameters
application_urlThe WebSocket URL to the server-side Bridge application. If the HTTP server listens on host "somehost" and port 80, and the application path on the server side is set to "/myapp", then the client will connect using the URL "ws://somehost:80/myapp". If the connection is encrypted using the SSL protocol, then the prefix "wss" needs to be used instead of "ws". Note that the port must be specified. The standard port for WebSockets is 80 and 443 for secure WebSockets.
security_tokenAn optional security token that can be inspected by the server-side application to decide whether the session should be accepted or rejected.

 set_application_url()

virtual Sint32 mi::bridge::IIray_bridge_client::set_application_url ( const char *  application_url)
pure virtual

Sets the default WebSocket URL to the server-side Iray Bridge application.

Bridge renderer contexts and snapshot contexts will use this address as a default if the context option "bridge_address" has not already been set. Note that the default will be picked up only once on first render or first snapshot creation, and after this point the context will no longer look at this global setting.

Note that it is recommended to only use the context option "bridge_address" instead of this global default. If the bridge address change then all the open contexts will need to be reconfigured with the new address.

Parameters
application_urlThe WebSocket URL to the server-side Iray Bridge application. If the HTTP server listens on host "somehost" and port 80, and the application path on the server side is set to "/myapp", then the client will connect using the URL "ws://somehost:80/myapp". If the connection is encrypted using the SSL protocol, then the prefix "wss" needs to be used instead of "ws". Note that the port must be specified. The standard port for WebSockets is 80 and 443 for secure WebSockets.
Iray Bridge server instances running on the VCA use SSL, run on port 443, and use the application path "/bridge".
Returns
0 on success, <0 for unspecified error.
See also
mi::bridge::IIray_bridge_server::create_application()

 set_log_forwarding_level()

virtual Sint32 mi::bridge::IIray_bridge_client::set_log_forwarding_level ( base::Message_severity  level)
pure virtual

Sets the log level of messages that are forwarded from the Iray Bridge server.

Note that this does not affect the log level of the server, nor the log level of the client. It only filters the messages forwarded by the server to the client.

See also
get_log_forwarding_level()
Returns
0 on success, <0 for unspecified error.

 set_receiving_logger()

virtual void mi::bridge::IIray_bridge_client::set_receiving_logger ( base::ILogger logger)
pure virtual

Sets the receiving logger for log messages forwarded from the Iray Bridge server.

If the provided logger is NULL then forwarded log entries will be written to the general configured logger as if they were generated locally, but with a prefix identifying the server that they originated from (default behavior).

See also
set_receiving_logger()
Parameters
loggerThe receiving logger. It is valid to pass NULL in which case logging is reset to be done to the general configured logger.

 set_security_token()

virtual Sint32 mi::bridge::IIray_bridge_client::set_security_token ( const char *  security_token)
pure virtual

Sets the security token to use when connecting the server-side Iray Bridge application.

Bridge renderer contexts and snapshot contexts will use this token as a default if the context option "bridge_security_token" has not already been set. Note that the default will be picked up only once on first render or first snapshot creation, and after this point the context will no longer look at this global setting.

Note that it is recommended to only use the context option "bridge_security_token" instead of this global default. If the token change then all the open contexts will need to be reconfigured with the new token.

Parameters
security_tokenThe security token to set.
Returns
0 on success, <0 for unspecified error.