|
Ocean
|
This class is the base class for all scene description libraries. More...
#include <Library.h>
Public Types | |
| typedef std::map< std::string, std::string > | FileExtensions |
| Definition of a map mapping file extensions to file type descriptions. | |
Public Member Functions | |
| SceneRef | load (const std::string &filename, const std::string &fileExtension, const Rendering::EngineRef &engine, const Timestamp ×tamp, const DescriptionType descriptionType, float *progress=nullptr, bool *cancel=nullptr) |
| Loads a new scene by a given filename. | |
| const std::string & | name () const |
| Returns the name of the library. | |
| DescriptionType | descriptionType () const |
| Returns the description type supported by the library. | |
| virtual NodeRef | node (const std::string &name) const |
| Returns the node reference of the first available scene description node with a specified name. | |
| virtual NodeRefs | nodes (const std::string &name) const |
| Returns all node references of all available scene description nodes with a specified name. | |
| NodeRefManager & | nodeManager () const |
| Returns the node reference manager of this library. | |
| virtual void | release () |
| Releases the library. | |
Protected Member Functions | |
| Library (const Library &library)=delete | |
| Disabled copy constructor. | |
| Library (const std::string &name, const DescriptionType descriptionType, const unsigned int priority) | |
| Creates a new library object. | |
| virtual | ~Library () |
| Destructs a library object. | |
| unsigned int | priority () const |
| Returns the priority of this library. | |
| FileExtensions | registeredFileExtensions () const |
| Returns all registered file extensions. | |
| void | registerFileExtension (const std::string &extension, const std::string &description) |
| Registers an additional file extension. | |
| virtual SceneRef | loadPermanent (const std::string &filename, const std::string &fileExtension, const Rendering::EngineRef &engine, const Timestamp ×tamp, float *progress, bool *cancel) |
| Loads a new scene by a given filename and returns a scene hierarchy which can be used permanently. | |
| virtual SceneRef | loadTransient (const std::string &filename, const std::string &fileExtension, float *progress, bool *cancel) |
| Loads a new scene by a given filename and returns a transient scene hierarchy which can be converted to a rendering scene graph afterwards. | |
| Library & | operator= (const Library &library)=delete |
| Disabled copy operator. | |
Static Protected Member Functions | |
| static bool | unregisterLibrary (const std::string &library) |
| Unregisters a library at the manager. | |
Private Attributes | |
| std::string | name_ |
| The name of the library. | |
| unsigned int | priority_ = 0u |
| The priority of this library, the higher the value, the higher the priority. | |
| FileExtensions | fileExtensions_ |
| Map holding accepted file extensions supported by this library. | |
| DescriptionType | descriptionType_ |
| Supported scene description type. | |
| NodeRefManager | nodeRefManager_ |
| Node reference manager for this library only. | |
Friends | |
| class | Manager |
| class | ObjectRef< Library > |
This class is the base class for all scene description libraries.
| typedef std::map<std::string, std::string> Ocean::SceneDescription::Library::FileExtensions |
Definition of a map mapping file extensions to file type descriptions.
|
protecteddelete |
Disabled copy constructor.
| library | Object which would be copied |
|
protected |
Creates a new library object.
| name | The name of the library |
| descriptionType | Supported scene description type |
| priority | The priority of this library, the higher the value, the higher the priority, with range [0, infinity) |
|
protectedvirtual |
Destructs a library object.
|
inline |
Returns the description type supported by the library.
| SceneRef Ocean::SceneDescription::Library::load | ( | const std::string & | filename, |
| const std::string & | fileExtension, | ||
| const Rendering::EngineRef & | engine, | ||
| const Timestamp & | timestamp, | ||
| const DescriptionType | descriptionType, | ||
| float * | progress = nullptr, |
||
| bool * | cancel = nullptr |
||
| ) |
Loads a new scene by a given filename.
| filename | Entire filename of the scene to load |
| fileExtension | File extention of the scene to load |
| engine | Rendering engine to be connected with the scene description, must be defined for permanent scene description objects only |
| timestamp | The current timestamp, must be valid |
| descriptionType | Scene description type |
| progress | Progress state receiving recurrently information about the load state with range [0, 1] |
| cancel | Cancel state allows the cancelation of a load process while loading process hasn't finished, if the cancel state is used the load process stops if the value is set to True |
|
protectedvirtual |
Loads a new scene by a given filename and returns a scene hierarchy which can be used permanently.
| filename | Entire filename of the scene to load |
| fileExtension | File extention of the scene to load |
| engine | Rendering engine to be connected with the scene description |
| timestamp | The current timestamp, must be valid |
| progress | Progress state receiving recurrently information about the load state with range [0, 1] |
| cancel | Cancel state allows the cancelation of a load process while loading process hasn't finished, if the cancel state is used the load process stops if the value is set to True |
Reimplemented in Ocean::SceneDescription::SDX::X3D::X3DLibrary.
|
protectedvirtual |
Loads a new scene by a given filename and returns a transient scene hierarchy which can be converted to a rendering scene graph afterwards.
| filename | Entire filename of the scene to load |
| fileExtension | File extention of the scene to load |
| progress | Progress state receiving recurrently information about the load state with range [0, 1] |
| cancel | Cancel state allows the cancelation of a load process while loading process hasn't finished, if the cancel state is used the load process stops if the value is set to True |
Reimplemented in Ocean::SceneDescription::SDL::Assimp::AssimpLibrary, and Ocean::SceneDescription::SDL::OBJ::OBJLibrary.
|
inline |
Returns the name of the library.
|
virtual |
Returns the node reference of the first available scene description node with a specified name.
| name | The name of the node to return |
|
inline |
Returns the node reference manager of this library.
|
virtual |
Returns all node references of all available scene description nodes with a specified name.
| name | The name of the nodes to return |
Disabled copy operator.
| library | Object which would be copied |
|
inlineprotected |
Returns the priority of this library.
In case two libraries support the same scene description format, the library with higher priority will be used first to load the scene.
|
inlineprotected |
Returns all registered file extensions.
|
protected |
Registers an additional file extension.
| extension | New file extension to register |
| description | Description of the file type |
|
virtual |
Releases the library.
|
staticprotected |
Unregisters a library at the manager.
| library | Name of the library to unregister |
|
private |
Supported scene description type.
|
private |
Map holding accepted file extensions supported by this library.
|
private |
The name of the library.
|
mutableprivate |
Node reference manager for this library only.
|
private |
The priority of this library, the higher the value, the higher the priority.