VRay SDK for C++
Loading...
Searching...
No Matches
VRay::VRayServer Class Reference

Public Member Functions

 VRayServer (const ServerOptions &serverOptions)
 
int addHosts (const char *hosts)
 
std::string exportSceneBuffer (int flags) const
 
ExternalStringexportSceneBufferFast (size_t &length, int flags) const
 
char * getActiveHosts (int *size) const
 
char * getAllHosts (int *size) const
 
char * getInactiveHosts (int *size) const
 
LicenseError getLicenseError () const
 
 operator bool () const
 
int removeHosts (const char *hosts)
 
int resetHosts (const char *hosts)
 
int run ()
 Starts V-Ray Server. Blocking call.
 
template<class T , void(T::*)(VRayServer &, const char *msg, double, void *) TMethod>
void setOnConnect (T &object, const void *userData=NULL)
 
void setOnConnect (void(*callback)(VRayServer &, const char *msg, double instant, void *), const void *userData=NULL)
 
template<class T , void(T::*)(VRayServer &, const char *msg, double, void *) TMethod>
void setOnDisconnect (T &object, const void *userData=NULL)
 
void setOnDisconnect (void(*callback)(VRayServer &, const char *msg, double instant, void *), const void *userData=NULL)
 
template<class T , void(T::*)(VRayServer &, const char *msg, MessageLevel level, double, void *) TMethod>
void setOnLogMessage (T &object, MessageLevel minLevel=MessageInfo, const void *userData=NULL)
 
void setOnLogMessage (void(*callback)(VRayServer &, const char *msg, MessageLevel level, double instant, void *), MessageLevel minLevel=MessageInfo, const void *userData=NULL)
 
template<class T , void(T::*)(VRayServer &, const char *msg, int elementNumber, int elementsCount, double instant, void *userData) TMethod>
void setOnProgress (T &object, const void *userData=NULL)
 
void setOnProgress (void(*callback)(VRayServer &, const char *msg, int elementNumber, int elementsCount, double instant, void *), const void *userData=NULL)
 
template<class T , void(T::*)(VRayServer &, int, uint64_t, uint64_t, const char *name, double instant, void *userData) TMethod>
void setOnSceneUpdate (T &object, const void *userData=NULL)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void setOnSceneUpdate (void(*callback)(VRayServer &vray, int action, uint64_t changeIndex, uint64_t pluginId, const char *name, double instant, void *), const void *userData=NULL)
 
template<class T , void(T::*)(VRayServer &, double, void *) TMethod>
void setOnServerClose (T &object, const void *userData=NULL)
 
void setOnServerClose (void(*callback)(VRayServer &, double instant, void *), const void *userData=NULL)
 
template<class T , void(T::*)(VRayServer &, double, void *) TMethod>
void setOnServerStart (T &object, const void *userData=NULL)
 
void setOnServerStart (void(*callback)(VRayServer &, double instant, void *), const void *userData=NULL)
 
int start ()
 Starts V-Ray Server in a separate thread. Non-blocking call.
 
void stop ()
 Terminates the server started by 'start' in a separate thread.
 

Member Function Documentation

◆ exportSceneBuffer()

std::string VRay::VRayServer::exportSceneBuffer ( int  flags) const
inline

Exports the current scene contents and return the generated vrscene stream as a string. The exporter serializes all plugins in text format.

Parameters
flagsCustom export options (see ExportSceneFlags enum)
Returns
the vrscene stream as a string.

◆ exportSceneBufferFast()

ExternalString * VRay::VRayServer::exportSceneBufferFast ( size_t &  length,
int  flags 
) const
inline

Exports the current scene contents and return the generated vrscene stream as a sequence of chars. The exporter serializes all plugins in text format.

Parameters
flagsCustom export options (see ExportSceneFlags enum)
Returns
the vrscene string stream.

◆ operator bool()

VRay::VRayServer::operator bool ( ) const
inline

If exceptions are not enabled use this function to test whether you have a valid server

Returns
true - server instance is valid, false - server instance is invalid

◆ setOnSceneUpdate()

void VRay::VRayServer::setOnSceneUpdate ( void(*)(VRayServer &vray, int action, uint64_t changeIndex, uint64_t pluginId, const char *name, double instant, void *)  callback,
const void *  userData = NULL 
)
inline

Set callback function for the event when the current scene is updated Callback arguments: vray - The VRayServer which produced the event. action - an action code representing the update event being processed. changeIndex - A linearly growing index reflecting the number of changes applied to the scene or 0 if not applicable. pluginId - the plugin instance id being affected by the change or 0 if not applicable. name - Depending on the action code, hold either the name of the plugin or the parameter being updated, or nullptr if not applicable. instant - Relative time of the event in seconds since V-Ray initialization.


The documentation for this class was generated from the following file: