Ocean
|
This class implements the experiences interaction library object. More...
Data Structures | |
class | Instance |
Internal helper class holding the instance of this library. More... | |
Public Types | |
typedef std::unique_ptr< Experience > | UniqueExperience |
Definition of a unique pointer to an Experience object. More... | |
typedef std::function< UniqueExperience()> | CreateExperienceFunction |
Definition of a callback function allowing to create a new experience. More... | |
Public Types inherited from Ocean::Interaction::Library | |
typedef std::map< std::string, std::string > | FileExtensions |
Definition of a map mapping file extensions to file type descriptions. More... | |
Static Public Member Functions | |
static void | registerLibrary () |
Creates this library and registers it at the global interaction manager. More... | |
static bool | unregisterLibrary () |
Unregisters this library at the global interaction manager. More... | |
static bool | registerNewExperience (std::string experienceName, CreateExperienceFunction createExperienceFunction) |
Registers a new experience without actually creating the experience. More... | |
Protected Types | |
typedef std::unordered_map< std::string, UniqueExperience > | NameToExperienceMap |
Definition of a vector holding experiences. More... | |
typedef std::unordered_map< std::string, CreateExperienceFunction > | NameToFunctionMap |
Definition of an unordered map mapping experience names to experience create functions. More... | |
Protected Member Functions | |
ExperiencesLibrary () | |
Creates a new experiences library object. More... | |
~ExperiencesLibrary () override | |
Destructs a experiences library object. More... | |
bool | load (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename) override |
Loads a new interaction file. More... | |
bool | unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename) override |
Unloads one specific loaded interaction files. More... | |
void | unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp) override |
Unloads all loaded scripts. More... | |
void | preFileLoad (const UserInterface &userInterface, const std::string &filename) override |
Pre file load interaction function. More... | |
void | postFileLoad (const UserInterface &userInterface, const std::string &filename, const bool succeeded) override |
Post file load interaction function. More... | |
Timestamp | preUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) override |
Pre update interaction function. More... | |
void | postUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) override |
Post update interaction function. More... | |
void | onMousePress (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &button, const Vector2 &screenPosition, const Line3 &ray, const Rendering::ObjectId pickedObject, const Vector3 &pickedPosition, const Timestamp timestamp) override |
Mouse press event function. More... | |
void | onMouseMove (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &button, const Vector2 &screenPosition, const Line3 &ray, const Rendering::ObjectId pickedObject, const Vector3 &pickedPosition, const Timestamp timestamp) override |
Mouse move event function. More... | |
void | onMouseRelease (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &button, const Vector2 &screenPosition, const Line3 &ray, const Rendering::ObjectId pickedObject, const Vector3 &pickedPosition, const Timestamp timestamp) override |
Mouse release event function. More... | |
void | onKeyPress (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) override |
Key press function. More... | |
void | onKeyRelease (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) override |
Key release function. More... | |
void | release () override |
Releases this library. More... | |
Protected Member Functions inherited from Ocean::Interaction::Library | |
Library (const std::string &name) | |
Creates a new library object. More... | |
virtual | ~Library () |
Destructs a library object. 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... | |
Library (const Library &library)=delete | |
Disabled copy constructor. More... | |
Library & | operator= (const Library &library)=delete |
Disabled copy operator. More... | |
Protected Attributes | |
NameToFunctionMap | nameToFunctionMap_ |
The map mapping names of experiences to create functions. More... | |
NameToExperienceMap | nameToExperienceMap_ |
The map mapping names of experiences to actual instances of experiences. More... | |
Lock | lock_ |
The library's lock. More... | |
Protected Attributes inherited from Ocean::Interaction::Library | |
std::string | libraryName |
Library name. More... | |
FileExtensions | libraryFileExtensions |
Map holding accepted file extensions supported by this library. More... | |
Additional Inherited Members | |
Public Member Functions inherited from Ocean::Interaction::Library | |
const std::string & | name () const |
Returns the name of this library. More... | |
virtual bool | isFileExtensionSupported (const std::string &extension) const |
Returns whether a specified file extension is supported by this interaction plugin. More... | |
Static Protected Member Functions inherited from Ocean::Interaction::Library | |
static bool | registerFactory (Library &library) |
Registers a library at the manager. More... | |
static bool | unregisterLibrary (const std::string &library) |
Unregisters a library at the manager. More... | |
This class implements the experiences interaction library object.
typedef std::function<UniqueExperience()> Ocean::Interaction::Experiences::ExperiencesLibrary::CreateExperienceFunction |
Definition of a callback function allowing to create a new experience.
|
protected |
Definition of a vector holding experiences.
|
protected |
Definition of an unordered map mapping experience names to experience create functions.
typedef std::unique_ptr<Experience> Ocean::Interaction::Experiences::ExperiencesLibrary::UniqueExperience |
Definition of a unique pointer to an Experience object.
|
protected |
Creates a new experiences library object.
|
overrideprotected |
Destructs a experiences library object.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Key release function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Mouse move event function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Mouse press event function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Mouse release event function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Post file load interaction function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Post update interaction function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Pre file load interaction function.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
Pre update interaction function.
Reimplemented from Ocean::Interaction::Library.
|
static |
Creates this library and registers it at the global interaction manager.
Do not register this library if using it as plugin, because it's done by the plugin itself.
However, if you are not using the plugin mechanism you have to initialize this library once at program initialization.
If the library is not used anymore unregister it using the unregister function.
Beware: This registration must not be done more than once!
|
static |
Registers a new experience without actually creating the experience.
experienceName | The name of the experience to register, must be valid |
createExperienceFunction | The create function of the new experience, must be valid |
|
overrideprotectedvirtual |
Releases this library.
Reimplemented from Ocean::Interaction::Library.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Unloads one specific loaded interaction files.
Implements Ocean::Interaction::Library.
|
static |
Unregisters this library at the global interaction manager.
Do not unregister this library if using it as plugin, because it's done by the plugin itself when the plugin is unloaded.
Beware: This registration must not be done more than once and must not be done without previous registration!
|
protected |
The library's lock.
|
protected |
The map mapping names of experiences to actual instances of experiences.
|
protected |
The map mapping names of experiences to create functions.