#include <renderfarm.h>
Classes | |
struct | ExtRenderingServerInfo |
Public Member Functions | |
RenderFarm () | |
~RenderFarm () | |
bool | connect (const string &serverName) |
Connects to a new rendering server. | |
void | disconnectAll () |
void | disconnect (const string &serverName) |
void | send (const std::string &command) |
void | send (const std::string &command, const std::string &name, const ParamSet ¶ms) |
void | send (const std::string &command, const std::string &name) |
void | send (const std::string &command, float x, float y) |
void | send (const std::string &command, float x, float y, float z) |
void | send (const std::string &command, float a, float x, float y, float z) |
void | send (const std::string &command, float ex, float ey, float ez, float lx, float ly, float lz, float ux, float uy, float uz) |
void | send (const std::string &command, float tr[16]) |
void | send (const std::string &command, const string &name, const string &type, const string &texname, const ParamSet ¶ms) |
void | send (const std::string &command, const std::string &name, float a, float b, const std::string &transform) |
Sends immediately all commands in the buffer to the servers. | |
void | flush () |
int | getServerCount () |
int | getServersStatus (RenderingServerInfo *info, int maxInfoCount) |
void | startFilmUpdater (Scene *scene) |
void | stopFilmUpdater () |
Gets the films from the network, and merge them to the film given in parameter. | |
void | updateFilm (Scene *scene) |
Public Attributes | |
int | serverUpdateInterval |
Private Member Functions | |
void | disconnect (const ExtRenderingServerInfo &serverInfo) |
void | sendFile (std::string file) |
Static Private Member Functions | |
static void | decodeServerName (const string &serverName, string &name, string &port) |
Private Attributes | |
boost::mutex | serverListMutex |
std::vector < ExtRenderingServerInfo > | serverInfoList |
std::stringstream | netBuffer |
FilmUpdaterThread * | filmUpdateThread |
Definition at line 67 of file renderfarm.h.
lux::RenderFarm::RenderFarm | ( | ) | [inline] |
Definition at line 69 of file renderfarm.h.
lux::RenderFarm::~RenderFarm | ( | ) | [inline] |
Definition at line 70 of file renderfarm.h.
References filmUpdateThread.
bool RenderFarm::connect | ( | const string & | serverName | ) |
Connects to a new rendering server.
Definition at line 108 of file renderfarm.cpp.
References decodeServerName(), flush(), LUX_ERROR, LUX_INFO, LUX_NOERROR, LUX_SYSTEM, luxError, netBuffer, serverInfoList, and serverListMutex.
Referenced by lux::Context::addServer().
void RenderFarm::decodeServerName | ( | const string & | serverName, | |
string & | name, | |||
string & | port | |||
) | [static, private] |
Definition at line 94 of file renderfarm.cpp.
Referenced by connect(), and disconnect().
void RenderFarm::disconnect | ( | const ExtRenderingServerInfo & | serverInfo | ) | [private] |
Definition at line 203 of file renderfarm.cpp.
References LUX_ERROR, LUX_INFO, LUX_NOERROR, LUX_SYSTEM, luxError, lux::RenderFarm::ExtRenderingServerInfo::name, lux::RenderFarm::ExtRenderingServerInfo::port, and lux::RenderFarm::ExtRenderingServerInfo::sid.
void RenderFarm::disconnect | ( | const string & | serverName | ) |
Definition at line 188 of file renderfarm.cpp.
References decodeServerName(), serverInfoList, and serverListMutex.
Referenced by disconnectAll(), and lux::Context::removeServer().
void RenderFarm::disconnectAll | ( | ) |
Definition at line 180 of file renderfarm.cpp.
References disconnect(), serverInfoList, and serverListMutex.
Referenced by lux::Context::exit(), and lux::Context::worldEnd().
void RenderFarm::flush | ( | ) |
Definition at line 219 of file renderfarm.cpp.
References LUX_DEBUG, LUX_ERROR, LUX_INFO, LUX_NOERROR, LUX_SYSTEM, luxError, netBuffer, serverInfoList, and serverListMutex.
Referenced by connect(), and lux::Context::worldEnd().
int lux::RenderFarm::getServerCount | ( | ) | [inline] |
Definition at line 94 of file renderfarm.h.
References serverInfoList.
Referenced by lux::Context::getServerCount(), and lux::Context::worldEnd().
int RenderFarm::getServersStatus | ( | RenderingServerInfo * | info, | |
int | maxInfoCount | |||
) |
Definition at line 499 of file renderfarm.cpp.
References RenderingServerInfo::name, RenderingServerInfo::numberOfSamplesReceived, RenderingServerInfo::port, RenderingServerInfo::secsSinceLastContact, RenderingServerInfo::serverIndex, serverInfoList, and RenderingServerInfo::sid.
Referenced by lux::Context::getRenderingServersStatus().
void RenderFarm::send | ( | const std::string & | command, | |
const std::string & | name, | |||
float | a, | |||
float | b, | |||
const std::string & | transform | |||
) |
Sends immediately all commands in the buffer to the servers.
Definition at line 491 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
void RenderFarm::send | ( | const std::string & | command, | |
const string & | name, | |||
const string & | type, | |||
const string & | texname, | |||
const ParamSet & | params | |||
) |
Definition at line 473 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, netBuffer, and sendFile().
void RenderFarm::send | ( | const std::string & | command, | |
float | tr[16] | |||
) |
Definition at line 462 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
void RenderFarm::send | ( | const std::string & | command, | |
float | ex, | |||
float | ey, | |||
float | ez, | |||
float | lx, | |||
float | ly, | |||
float | lz, | |||
float | ux, | |||
float | uy, | |||
float | uz | |||
) |
Definition at line 453 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
void RenderFarm::send | ( | const std::string & | command, | |
float | a, | |||
float | x, | |||
float | y, | |||
float | z | |||
) |
Definition at line 444 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
void RenderFarm::send | ( | const std::string & | command, | |
float | x, | |||
float | y, | |||
float | z | |||
) |
Definition at line 436 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
void lux::RenderFarm::send | ( | const std::string & | command, | |
float | x, | |||
float | y | |||
) |
void RenderFarm::send | ( | const std::string & | command, | |
const std::string & | name | |||
) |
Definition at line 420 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
void RenderFarm::send | ( | const std::string & | command, | |
const std::string & | name, | |||
const ParamSet & | params | |||
) |
Definition at line 396 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, netBuffer, and sendFile().
void RenderFarm::send | ( | const std::string & | command | ) |
Definition at line 348 of file renderfarm.cpp.
References netBuffer.
Referenced by lux::Context::accelerator(), lux::Context::areaLightSource(), lux::Context::attributeBegin(), lux::Context::attributeEnd(), lux::Context::camera(), lux::Context::cleanup(), lux::Context::concatTransform(), lux::Context::coordinateSystem(), lux::Context::coordSysTransform(), lux::Context::film(), lux::Context::identity(), lux::Context::lightGroup(), lux::Context::lightSource(), lux::Context::lookAt(), lux::Context::makenamedmaterial(), lux::Context::material(), lux::Context::motionInstance(), lux::Context::namedmaterial(), lux::Context::objectBegin(), lux::Context::objectEnd(), lux::Context::objectInstance(), lux::Context::pixelFilter(), lux::Context::portalShape(), lux::Context::reverseOrientation(), lux::Context::rotate(), lux::Context::sampler(), lux::Context::scale(), lux::Context::setEpsilon(), lux::Context::shape(), lux::Context::surfaceIntegrator(), lux::Context::texture(), lux::Context::transform(), lux::Context::transformBegin(), lux::Context::transformEnd(), lux::Context::translate(), lux::Context::volume(), lux::Context::volumeIntegrator(), lux::Context::worldBegin(), and lux::Context::worldEnd().
void RenderFarm::sendFile | ( | std::string | file | ) | [private] |
Definition at line 352 of file renderfarm.cpp.
References LUX_ERROR, LUX_SYSTEM, luxError, and netBuffer.
Referenced by send().
void RenderFarm::startFilmUpdater | ( | Scene * | scene | ) |
Definition at line 71 of file renderfarm.cpp.
References filmUpdateThread, LUX_ERROR, LUX_ILLSTATE, luxError, lux::FilmUpdaterThread::thread, and lux::FilmUpdaterThread::updateFilm().
Referenced by lux::Context::addServer(), and lux::Context::worldEnd().
void RenderFarm::stopFilmUpdater | ( | ) |
Gets the films from the network, and merge them to the film given in parameter.
Definition at line 81 of file renderfarm.cpp.
References filmUpdateThread, and lux::FilmUpdaterThread::interrupt().
Referenced by lux::Context::exit(), lux::Context::removeServer(), and lux::Context::worldEnd().
void RenderFarm::updateFilm | ( | Scene * | scene | ) |
Definition at line 257 of file renderfarm.cpp.
References lux::Scene::camera, lux::Camera::film, LUX_ERROR, LUX_INFO, LUX_NOERROR, LUX_SYSTEM, luxError, cimg_library::cimg::option(), serverInfoList, serverListMutex, and lux::Film::UpdateFilm().
Referenced by lux::Context::exit(), lux::FilmUpdaterThread::updateFilm(), lux::Context::updateFilmFromNetwork(), and lux::Context::worldEnd().
Definition at line 136 of file renderfarm.h.
Referenced by startFilmUpdater(), stopFilmUpdater(), and ~RenderFarm().
std::stringstream lux::RenderFarm::netBuffer [private] |
Definition at line 133 of file renderfarm.h.
Referenced by connect(), flush(), send(), and sendFile().
std::vector<ExtRenderingServerInfo> lux::RenderFarm::serverInfoList [private] |
Definition at line 131 of file renderfarm.h.
Referenced by connect(), disconnect(), disconnectAll(), flush(), getServerCount(), getServersStatus(), and updateFilm().
boost::mutex lux::RenderFarm::serverListMutex [private] |
Definition at line 130 of file renderfarm.h.
Referenced by connect(), disconnect(), disconnectAll(), flush(), and updateFilm().
Definition at line 105 of file renderfarm.h.
Referenced by lux::Context::getNetworkServerUpdateInterval(), lux::Context::setNetworkServerUpdateInterval(), and lux::FilmUpdaterThread::updateFilm().