Ocean
X3DLibrary.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_LIBRARY_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_LIBRARY_H
10 
12 
15 
16 namespace Ocean
17 {
18 
19 namespace SceneDescription
20 {
21 
22 namespace SDX
23 {
24 
25 namespace X3D
26 {
27 
28 /**
29  * This class implements the scene library for all x3d file types.
30  * @ingroup scenedescriptionsdxx3d
31  */
32 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT X3DLibrary : public Library
33 {
35 
36  public:
37 
38  /**
39  * Registers this library at the global scene description manager.
40  * With each register call, the reference counter for a specific library will be incremented.
41  * Each call to registerLibrary() needs to be balanced with a corresponding call of unregisterLibrary() before shutting down.
42  * @return True, if the library has not been registered before
43  * @see Manager, unregisterLibrary()
44  */
45  static bool registerLibrary();
46 
47  /**
48  * Unregisters this library at the global scene description manager.
49  * With each unregister call, the reference counter for a specific library will be decremented and removed from the system if the counter reaches zero.
50  * Each call to registerLibrary() needs to be balanced with a corresponding call of unregisterLibrary() before shutting down.
51  * @return True, if the library was actually removed from the system (as the reference counter reached zero); False, if the library is still used by someone else
52  * @see registerLibrary().
53  */
54  static bool unregisterLibrary();
55 
56  private:
57 
58  /**
59  * Creates a new x3d library.
60  */
62 
63  /**
64  * Destructs a x3d library.
65  */
66  ~X3DLibrary() override;
67 
68  /**
69  * Creates this library and returns it an object reference.
70  * @return The new library object
71  */
72  static LibraryRef create();
73 
74  /**
75  * Loads a new scene by a given filename and returns a scene hierarchy which can be used permanently.
76  * @see Library::loadPermanent().
77  */
78  SceneRef loadPermanent(const std::string& filename, const std::string& fileExtension, const Rendering::EngineRef& engine, const Timestamp& timestamp, float* progress, bool* cancel) override;
79 };
80 
81 }
82 
83 }
84 
85 }
86 
87 }
88 
89 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_X3D_LIBRARY_H
This template class implements a object reference with an internal reference counter.
Definition: base/ObjectRef.h:58
This class is the base class for all scene description libraries.
Definition: scenedescription/Library.h:37
This class implements the manager for all scene descriptions.
Definition: scenedescription/Manager.h:101
This class implements the scene library for all x3d file types.
Definition: X3DLibrary.h:33
static bool registerLibrary()
Registers this library at the global scene description manager.
static bool unregisterLibrary()
Unregisters this library at the global scene description manager.
~X3DLibrary() override
Destructs a x3d library.
X3DLibrary()
Creates a new x3d library.
static LibraryRef create()
Creates this library and returns it an object reference.
SceneRef loadPermanent(const std::string &filename, const std::string &fileExtension, const Rendering::EngineRef &engine, const Timestamp &timestamp, float *progress, bool *cancel) override
Loads a new scene by a given filename and returns a scene hierarchy which can be used permanently.
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition: SmartObjectRef.h:90
This class implements a timestamp.
Definition: Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15