#include <RemoteViz/Rendering/RenderArea.h>
Public Member Functions | |
const std::string & | getId () const |
Connection * | getConnection (const std::string &id) const |
Connection * | getConnection (unsigned int index) const |
unsigned int | getNumConnections () const |
SoSceneManager * | getSceneManager () const |
SoTouchManager * | getTouchManager () const |
SoGLContext * | getGLContext () const |
bool | sendMessage (const std::string &message, Connection **excludedConnections=NULL, unsigned int num=0) const |
unsigned int | getWidth () const |
unsigned int | getHeight () const |
void | resize (unsigned int width, unsigned int height) |
void | closeConnectionsAndDispose () |
void | addListener (std::shared_ptr< RenderAreaListener > listener) |
void | removeListener (std::shared_ptr< RenderAreaListener > listener) |
void | removeAllListeners () |
unsigned int | getNumListeners () const |
const std::string & | getGpu () const |
Defines the rendering area.
The implementation of the class RenderAreaListener allows managing the renderArea events.
When using ServiceSettings::INVENTOR_SERVICE or ServiceSettings::INVENTOR_APPLICATION service mode, this class provides access to the scene manager and the touch manager to modify the rendering.
void RemoteViz::Rendering::RenderArea::addListener | ( | std::shared_ptr< RenderAreaListener > | listener | ) |
Adds a RenderAreaListener to manage the renderArea.
listener | : object that listens to the renderArea events |
void RemoteViz::Rendering::RenderArea::closeConnectionsAndDispose | ( | ) |
Closes all connections of the renderArea and disposes it.
If connections are still open, this method will close them and dispose the renderArea. While executing this method, the callback ServiceListener::onDisposedRenderArea will be triggered and a DISPOSED disconnect message will be sent to all clients of the renderArea. The callback RenderAreaListener::onClosedConnection will not be triggered after closing connections.
Connection* RemoteViz::Rendering::RenderArea::getConnection | ( | unsigned int | index | ) | const |
Gets a Connection to the renderArea.
index | : index identifying the Connection |
Connection* RemoteViz::Rendering::RenderArea::getConnection | ( | const std::string & | id | ) | const |
Gets a Connection to the renderArea.
id | : ID identifying the Connection |
SoGLContext* RemoteViz::Rendering::RenderArea::getGLContext | ( | ) | const |
Gets the OpenGL context of the renderArea.
In the ServiceSettings::INDEPENDENT_SERVICE mode, this method returns null.
const std::string& RemoteViz::Rendering::RenderArea::getGpu | ( | ) | const |
Gets the Graphics Processing Unit (GPU) used to compute the render.
GPU can be defined in ServiceListener::onPendingCreateRenderArea.
unsigned int RemoteViz::Rendering::RenderArea::getHeight | ( | ) | const |
Gets the renderArea height.
const std::string& RemoteViz::Rendering::RenderArea::getId | ( | ) | const |
Gets the renderArea id.
unsigned int RemoteViz::Rendering::RenderArea::getNumConnections | ( | ) | const |
Gets the connections number of the renderArea.
unsigned int RemoteViz::Rendering::RenderArea::getNumListeners | ( | ) | const |
Gets the number of RenderAreaListener.
SoSceneManager* RemoteViz::Rendering::RenderArea::getSceneManager | ( | ) | const |
Gets the Scene manager of the renderArea.
In the ServiceSettings::INDEPENDENT_SERVICE mode, this method returns null.
SoTouchManager* RemoteViz::Rendering::RenderArea::getTouchManager | ( | ) | const |
Gets the Touch Manager of the renderArea.
In the ServiceSettings::INDEPENDENT_SERVICE mode, this method returns null.
unsigned int RemoteViz::Rendering::RenderArea::getWidth | ( | ) | const |
Gets the renderArea width.
void RemoteViz::Rendering::RenderArea::removeAllListeners | ( | ) |
Removes all RenderAreaListeners.
void RemoteViz::Rendering::RenderArea::removeListener | ( | std::shared_ptr< RenderAreaListener > | listener | ) |
Removes a RenderAreaListener.
listener | : object that listens to the renderArea events |
void RemoteViz::Rendering::RenderArea::resize | ( | unsigned int | width, | |
unsigned int | height | |||
) |
Resizes the renderArea at a specific size.
After resizing, a notification will be sent to all the renderArea clients. The minimum size is (128, 128) and the maximum size is (3840, 2160). If the size is inferior or superior to the limit, it will be adjusted automatically.
width | : new width of the renderArea | |
height | : new height of the renderArea |
bool RemoteViz::Rendering::RenderArea::sendMessage | ( | const std::string & | message, | |
Connection ** | excludedConnections = NULL , |
|||
unsigned int | num = 0 | |||
) | const |
Sends a text message to the renderArea connections.
message | : the message to be sent to all connections of the renderArea | |
excludedConnections | : an excluded connections array | |
num | : number of excluded connections |