Ocean
|
This class is the base class for all scene description libraries. More...
Public Types | |
typedef std::map< std::string, std::string > | FileExtensions |
Definition of a map mapping file extensions to file type descriptions. More... | |
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. More... | |
const std::string & | name () const |
Returns the name of the library. More... | |
DescriptionType | descriptionType () const |
Returns the description type supported by the library. More... | |
virtual NodeRef | node (const std::string &name) const |
Returns the node reference of the first available scene description node with a specified name. More... | |
virtual NodeRefs | nodes (const std::string &name) const |
Returns all node references of all available scene description nodes with a specified name. More... | |
NodeRefManager & | nodeManager () const |
Returns the node reference manager of this library. More... | |
virtual void | release () |
Releases the library. More... | |
Protected Member Functions | |
Library (const Library &library)=delete | |
Disabled copy constructor. More... | |
Library (const std::string &name, const DescriptionType descriptionType, const unsigned int priority) | |
Creates a new library object. More... | |
virtual | ~Library () |
Destructs a library object. More... | |
unsigned int | priority () const |
Returns the priority of this library. More... | |
FileExtensions | registeredFileExtensions () const |
Returns all registered file extensions. More... | |
void | registerFileExtension (const std::string &extension, const std::string &description) |
Registers an additional file extension. More... | |
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. More... | |
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. More... | |
Library & | operator= (const Library &library)=delete |
Disabled copy operator. More... | |
Static Protected Member Functions | |
static bool | unregisterLibrary (const std::string &library) |
Unregisters a library at the manager. More... | |
Private Attributes | |
std::string | name_ |
The name of the library. More... | |
unsigned int | priority_ = 0u |
The priority of this library, the higher the value, the higher the priority. More... | |
FileExtensions | fileExtensions_ |
Map holding accepted file extensions supported by this library. More... | |
DescriptionType | descriptionType_ |
Supported scene description type. More... | |
NodeRefManager | nodeRefManager_ |
Node reference manager for this library only. More... | |
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::OBJ::OBJLibrary, and Ocean::SceneDescription::SDL::Assimp::AssimpLibrary.
|
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 |
|
friend |
|
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.