RAMSES Documentation  27.0.130
Information for RAMSES users and developers
RamsesClient.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2014 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_RAMSESCLIENT_H
10 #define RAMSES_RAMSESCLIENT_H
11 
15 
23 namespace ramses
24 {
25  class Scene;
26  class IClientEventHandler;
27 
34  {
35  public:
44  Scene* createScene(sceneId_t sceneId, const SceneConfig& sceneConfig = SceneConfig(), const char* name = nullptr);
45 
59  Scene* loadSceneFromFile(const char* fileName, bool localOnly = false);
60 
82  Scene* loadSceneFromMemory(std::unique_ptr<unsigned char[], void(*)(const unsigned char*)> data, size_t size, bool localOnly = false);
83 
107  Scene* loadSceneFromFileDescriptor(int fd, size_t offset, size_t length, bool localOnly = false);
108 
134  Scene* loadSceneFromFileDescriptor(sceneId_t sceneId, int fd, size_t offset, size_t length, bool localOnly = false);
135 
154  status_t loadSceneFromFileAsync(const char* fileName, bool localOnly = false);
155 
164 
171  const Scene* findSceneByName(const char* name) const;
172 
176  Scene* findSceneByName(const char* name);
177 
184  const Scene* getScene(sceneId_t sceneId) const;
185 
190 
205 
209  class RamsesClientImpl& impl;
210 
214  explicit RamsesClient(RamsesClientImpl&);
215 
219  RamsesClient() = delete;
220 
225  RamsesClient(const RamsesClient& other) = delete;
226 
232  RamsesClient& operator=(const RamsesClient& other) = delete;
233 
234  private:
238  friend class ClientFactory;
239 
243  virtual ~RamsesClient();
244  };
245 }
246 
247 #endif
#define RAMSES_API
Definition: APIExport.h:35
Provides an interface for handling the result of client events. Implementation of this interface must...
Definition: IClientEventHandler.h:27
Entry point of RAMSES client API.
Definition: RamsesClient.h:34
RamsesClient & operator=(const RamsesClient &other)=delete
Deleted copy assignment.
status_t destroy(Scene &scene)
Destroys the given Scene. The reference of Scene is invalid after this call.
RamsesClient(const RamsesClient &other)=delete
Deleted copy constructor.
Scene * findSceneByName(const char *name)
Find a scene from the client by name.
class RamsesClientImpl & impl
Definition: RamsesClient.h:209
status_t dispatchEvents(IClientEventHandler &clientEventHandler)
Some methods on the client provide asynchronous results. These can be synchronously received by calli...
RamsesClient(RamsesClientImpl &)
Constructor of RamsesClient.
Scene * loadSceneFromFile(const char *fileName, bool localOnly=false)
Loads scene contents and resources from a file.
const Scene * findSceneByName(const char *name) const
Find a scene from the client by name.
Scene * loadSceneFromFileDescriptor(int fd, size_t offset, size_t length, bool localOnly=false)
Loads scene contents and resources from an open file descriptor.
Scene * createScene(sceneId_t sceneId, const SceneConfig &sceneConfig=SceneConfig(), const char *name=nullptr)
Create a new empty Scene.
status_t loadSceneFromFileAsync(const char *fileName, bool localOnly=false)
Loads scene contents and resources asynchronously from a file. The file format has to match current R...
const Scene * getScene(sceneId_t sceneId) const
Get a scene from the client by scene id.
RamsesClient()=delete
Deleted default constructor.
Scene * loadSceneFromFileDescriptor(sceneId_t sceneId, int fd, size_t offset, size_t length, bool localOnly=false)
Loads scene contents and resources from an open file descriptor. This overload overrides the sceneId ...
Scene * getScene(sceneId_t sceneId)
Get a scene from the client by scene id.
Scene * loadSceneFromMemory(std::unique_ptr< unsigned char[], void(*)(const unsigned char *)> data, size_t size, bool localOnly=false)
Loads scene contents and resources from a memory buffer.
The RamsesObject is a base class for all client API objects owned by the framework.
Definition: RamsesObject.h:21
The SceneConfig holds a set of parameters to be used when creating a scene.
Definition: SceneConfig.h:22
The Scene holds a scene graph. It is the essential class for distributing content to the ramses syste...
Definition: Scene.h:83
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
uint32_t status_t
Status is a handle to the result of an API call.
Definition: RamsesFrameworkTypes.h:26