Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
Service.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20
21#pragma once
22
23#include <Inventor/sys/port.h>
25
26#include <string>
27#include <memory>
28
36namespace RemoteViz
37{
38 namespace Rendering
39 {
40
41 class RenderArea;
42
43 class ServiceImpl;
44
45 class Client;
46
47 class ServiceSettings;
48
49 class ServiceListener;
50
51 class RenderAreaHardware;
86 {
87
89 friend class RenderAreaImpl;
90 friend class ConnectionImpl;
91 friend class ClientImpl;
92 friend class RenderAreaDeleter;
93 friend class MonitoringImpl;
94 friend class ServiceDeleter;
97 public:
98
105 static Service* instance();
110 void dispatch() const;
121 bool open(std::shared_ptr<const ServiceSettings> settings);
128 bool close();
134 bool isRunning() const;
149 void createRenderArea(const std::string& id, unsigned int width, unsigned int height, std::shared_ptr<const RenderAreaHardware> renderAreaHardware);
157 std::shared_ptr<RenderArea> getRenderArea(const std::string& id) const;
165 std::shared_ptr<RenderArea> getRenderArea(unsigned int index) const;
171 unsigned int getNumRenderAreas() const;
177 std::shared_ptr<const ServiceSettings> getSettings() const;
183 void addListener(std::shared_ptr<ServiceListener> listener);
189 void removeListener(std::shared_ptr<ServiceListener> listener);
199 unsigned int getNumListeners() const;
207 std::shared_ptr<Client> getClient(const std::string& id) const;
215 std::shared_ptr<Client> getClient(unsigned int index) const;
221 unsigned int getNumClients() const;
222
223 private:
225 std::shared_ptr<ServiceImpl> getImpl() const;
228 private:
230 std::shared_ptr<ServiceImpl> pImpl;
231
233 Service();
234
236 Service(const Service&) = delete;
237 Service& operator= (const Service&) = delete;
238
239 };
240 }
241}
valueRef operator=(valueRef newValue)
Sets this field to newValue.
Definition SoSubField.h:242
<a href="IconLegend.html"><img src="extRV.gif" alt="RemoteViz" border="0"></a>
Definition Service.h:86
void addListener(std::shared_ptr< ServiceListener > listener)
Adds a ServiceListener.
void createRenderArea(const std::string &id, unsigned int width, unsigned int height, std::shared_ptr< const RenderAreaHardware > renderAreaHardware)
Forces the creation of a renderArea.
bool close()
Closes the rendering service.
std::shared_ptr< RenderArea > getRenderArea(const std::string &id) const
Gets a RenderArea from id.
void removeListener(std::shared_ptr< ServiceListener > listener)
Removes a ServiceListener.
void removeAllListeners()
Removes all ServiceListeners.
std::shared_ptr< Client > getClient(unsigned int index) const
Gets a Client from index.
unsigned int getNumListeners() const
Gets the number of ServiceListener.
bool open(std::shared_ptr< const ServiceSettings > settings)
Opens the rendering service.
unsigned int getNumClients() const
Gets the number of clients.
std::shared_ptr< Client > getClient(const std::string &id) const
Gets a Client from id.
void dispatch() const
This method has to be used with the ServiceSettings::INVENTOR_SERVICE and ServiceSettings::INDEPENDEN...
std::shared_ptr< RenderArea > getRenderArea(unsigned int index) const
Gets a RenderArea from index.
bool isRunning() const
This method is used to know if the rendering service is running.
static Service * instance()
Renderering service instance (Singleton)
unsigned int getNumRenderAreas() const
Gets the number of renderAreas.
std::shared_ptr< const ServiceSettings > getSettings() const
Gets the settings of the service.
Class to render an OpenInventor scene in a Qt OpenGL window.
Definition RenderArea.h:46
#define RENDERSERVICE_API
Definition port.h:378