00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <Inventor/sys/port.h>
00024 #include <RemoteViz/Rendering/LibHelper.h>
00025
00026 #include <string>
00027 #include <memory>
00028 #include <vector>
00029
00030 class SoSceneManager;
00031
00032 class SoTouchManager;
00033
00034 class SoGLContext;
00035
00036 namespace RemoteViz
00037 {
00038 namespace Rendering
00039 {
00040
00041 class Connection;
00042
00043 class RenderAreaImpl;
00044
00045 class RenderAreaListener;
00046
00047 class RenderAreaHardware;
00079 class RENDERSERVICE_API RenderArea {
00080
00082 friend class ServiceImpl;
00083 friend class ConnectionImpl;
00086 public:
00087
00104 bool isDisposed() const;
00110 const std::string& getId() const;
00118 std::shared_ptr<Connection> getConnection(const std::string& id) const;
00126 std::shared_ptr<Connection> getConnection(unsigned int index) const;
00132 unsigned int getNumConnections() const;
00141 SoSceneManager* getSceneManager() const;
00150 SoTouchManager* getTouchManager() const;
00159 SoGLContext* getGLContext() const;
00169 bool sendMessage(const std::string& message, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
00179 bool sendMessage(const std::vector<unsigned char>& buffer, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
00185 unsigned int getWidth() const;
00191 unsigned int getHeight() const;
00204 void resize(unsigned int width, unsigned int height);
00215 void closeConnectionsAndDispose();
00221 void addListener(std::shared_ptr<RenderAreaListener> listener);
00227 void removeListener(std::shared_ptr<RenderAreaListener> listener);
00231 void removeAllListeners();
00237 unsigned int getNumListeners() const;
00245 const std::string& getGpu() const;
00246
00247 private:
00249 std::shared_ptr<RenderAreaImpl> getImpl() const;
00252 private:
00254 std::shared_ptr<RenderAreaImpl> pImpl;
00255
00257 RenderArea(const std::string& id, const RenderAreaHardware& renderAreaHardware);
00258
00260 RenderArea(const RenderArea&) = delete;
00261 RenderArea& operator= (const RenderArea&) = delete;
00262
00264 static std::shared_ptr<RenderArea> createInstance(const std::string& id, unsigned int width, unsigned int height, const RenderAreaHardware& renderAreaHardware);
00265 };
00266
00267 }
00268 }
00269
00270