#include <RemoteViz/Rendering/Service.h>
Public Member Functions | |
void | dispatch () const |
bool | open (ServiceSettings *instanceSettings) |
bool | close () |
bool | isRunning () const |
void | createRenderArea (const std::string &id, unsigned int width, unsigned int height, RenderAreaHardware *renderAreaHardware) |
RenderArea * | getRenderArea (const std::string &id) const |
RenderArea * | getRenderArea (unsigned int index) const |
unsigned int | getNumRenderAreas () const |
ServiceSettings * | getSettings () const |
void | addListener (std::shared_ptr< ServiceListener > listener) |
void | removeListener (std::shared_ptr< ServiceListener > listener) |
void | removeAllListeners () |
unsigned int | getNumListeners () const |
Client * | getClient (const std::string &id) const |
Client * | getClient (unsigned int index) const |
unsigned int | getNumClients () const |
Static Public Member Functions | |
static Service * | instance () |
Defines the RemoteViz rendering service. This class uses the singleton pattern restricting its instantiation to a single unique object in the program (see instance). To use RemoteViz, the service has to be opened with the method "Open". The implementation of class ServiceListener enables you to manage the service events.
void RemoteViz::Rendering::Service::addListener | ( | std::shared_ptr< ServiceListener > | listener | ) |
Adds a ServiceListener.
listener | : object that listens to the service events |
bool RemoteViz::Rendering::Service::close | ( | ) |
Closes the rendering service.
If renderAreas still exist, this method will dispose them and close the rendering service.
void RemoteViz::Rendering::Service::createRenderArea | ( | const std::string & | id, | |
unsigned int | width, | |||
unsigned int | height, | |||
RenderAreaHardware * | renderAreaHardware | |||
) |
Creates a renderArea.
This method is optional. The other way to create a renderArea is to return true to the callback ServiceListener::onPendingCreateRenderArea
If the renderArea already exists, the call will be ignored.
id | : ID identifying the RenderArea | |
width | : renderArea width | |
height | : renderArea height | |
renderAreaHardware | : renderArea hardware settings. This object will be copied. |
void RemoteViz::Rendering::Service::dispatch | ( | ) | const |
This method has to be used with the ServiceSettings::INVENTOR_SERVICE and ServiceSettings::INDEPENDENT_SERVICE mode in a loop.
It processes all waiting RemoteViz events.
Client* RemoteViz::Rendering::Service::getClient | ( | unsigned int | index | ) | const |
Gets a Client from index.
Range is [0..getNumClients - 1].
index | : index identifying the client |
Client* RemoteViz::Rendering::Service::getClient | ( | const std::string & | id | ) | const |
Gets a Client from id.
Range is [0..getNumClients - 1].
id | : ID identifying the client |
unsigned int RemoteViz::Rendering::Service::getNumClients | ( | ) | const |
Gets the number of clients.
unsigned int RemoteViz::Rendering::Service::getNumListeners | ( | ) | const |
Gets the number of ServiceListener.
unsigned int RemoteViz::Rendering::Service::getNumRenderAreas | ( | ) | const |
Gets the number of renderAreas.
RenderArea* RemoteViz::Rendering::Service::getRenderArea | ( | unsigned int | index | ) | const |
Gets a RenderArea from index.
Range is [0..getNumRenderAreas - 1].
index | : index identifying the renderArea |
RenderArea* RemoteViz::Rendering::Service::getRenderArea | ( | const std::string & | id | ) | const |
Gets a RenderArea from id.
Range is [0..getNumRenderAreas - 1].
id | : ID identifying the RenderArea |
ServiceSettings* RemoteViz::Rendering::Service::getSettings | ( | ) | const |
Gets the settings of the service.
static Service* RemoteViz::Rendering::Service::instance | ( | ) | [static] |
Renderering service instance (Singleton).
bool RemoteViz::Rendering::Service::isRunning | ( | ) | const |
This method is used to know if the rendering service is running.
bool RemoteViz::Rendering::Service::open | ( | ServiceSettings * | instanceSettings | ) |
Opens the rendering service.
instanceSettings | : the settings of the instance. This object cannot be null and will be copied. |
void RemoteViz::Rendering::Service::removeAllListeners | ( | ) |
Removes all ServiceListeners.
void RemoteViz::Rendering::Service::removeListener | ( | std::shared_ptr< ServiceListener > | listener | ) |
Removes a ServiceListener.
listener | : object that listens to the service events |