|
Ocean
|
This class implements the base class for all interaction libraries. More...
#include <Library.h>
Public Types | |
| using | FileExtensions = std::map< std::string, std::string > |
| Definition of a map mapping file extensions to file type descriptions. | |
Public Member Functions | |
| const std::string & | name () const |
| Returns the name of this library. | |
| virtual bool | isFileExtensionSupported (const std::string &extension) const |
| Returns whether a specified file extension is supported by this interaction plugin. | |
| virtual bool | load (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename)=0 |
| Loads a new interaction file. | |
| virtual bool | unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename)=0 |
| Unloads one specific loaded interaction files. | |
| virtual void | unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp)=0 |
| Unloads all loaded scripts. | |
| virtual void | preFileLoad (const UserInterface &userInterface, const std::string &filename) |
| Pre file load interaction function. | |
| virtual void | postFileLoad (const UserInterface &userInterface, const std::string &filename, const bool succeeded) |
| Post file load interaction function. | |
| virtual Timestamp | preUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) |
| Pre update interaction function. | |
| virtual void | postUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) |
| Post update interaction function. | |
| virtual 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) |
| Mouse press event function. | |
| virtual 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) |
| Mouse move event function. | |
| virtual 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) |
| Mouse release event function. | |
| virtual void | onKeyPress (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) |
| Key press function. | |
| virtual void | onKeyRelease (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) |
| Key release function. | |
| virtual void | release () |
| Releases this library. | |
Protected Member Functions | |
| Library (const std::string &name) | |
| Creates a new library object. | |
| virtual | ~Library () |
| Destructs a library object. | |
| FileExtensions | registeredFileExtensions () const |
| Returns all registered file extensions. | |
| void | registerFileExtension (const std::string &extension, const std::string &description) |
| Registers an additional file extension. | |
| Library (const Library &library)=delete | |
| Disabled copy constructor. | |
| Library & | operator= (const Library &library)=delete |
| Disabled copy operator. | |
Static Protected Member Functions | |
| static bool | registerFactory (Library &library) |
| Registers a library at the manager. | |
| static bool | unregisterLibrary (const std::string &library) |
| Unregisters a library at the manager. | |
Protected Attributes | |
| std::string | libraryName |
| Library name. | |
| FileExtensions | libraryFileExtensions |
| Map holding accepted file extensions supported by this library. | |
Friends | |
| class | Manager |
This class implements the base class for all interaction libraries.
| using Ocean::Interaction::Library::FileExtensions = std::map<std::string, std::string> |
Definition of a map mapping file extensions to file type descriptions.
|
protected |
Creates a new library object.
| name | The name of the library |
|
protectedvirtual |
Destructs a library object.
|
protecteddelete |
Disabled copy constructor.
| library | Object which would be copied |
|
virtual |
Returns whether a specified file extension is supported by this interaction plugin.
| extension | File extension to check |
|
pure virtual |
Loads a new interaction file.
| userInterface | The application's UI elements |
| engine | Current engine |
| timestamp | Recent timestmap |
| filename | Name of the interaction file to load |
Implemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
inline |
Returns the name of this library.
|
virtual |
Key press function.
| userInterface | The application's UI elements |
| engine | Rendering engine currently used |
| key | Key which has been pressed |
| timestamp | Event timestamp |
Reimplemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Key release function.
| userInterface | The application's UI elements |
| engine | Rendering engine currently used |
| key | Key which has been pressed |
| timestamp | Event timestamp |
Reimplemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Mouse move event function.
| userInterface | The application's UI elements |
| engine | Rendering engine currently used |
| button | Pressed mouse button |
| screenPosition | 2D screen position of the mouse cursor |
| ray | 3D picking ray |
| pickedObject | Name of the possible picked object |
| pickedPosition | Possible intersection point between mouse-pick-ray and 3D object |
| timestamp | Event timestamp |
Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Mouse press event function.
| userInterface | The application's UI elements |
| engine | Rendering engine currently used |
| button | Pressed mouse button |
| screenPosition | 2D screen position of the mouse cursor |
| ray | 3D picking ray |
| pickedObject | Name of the possible picked object |
| pickedPosition | Possible intersection point between mouse-pick-ray and 3D object |
| timestamp | Event timestamp |
Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Mouse release event function.
| userInterface | The application's UI elements |
| engine | Rendering engine currently used |
| button | Released mouse button |
| screenPosition | 2D screen position of the mouse cursor |
| ray | 3D picking ray |
| pickedObject | Name of the possible picked object |
| pickedPosition | Possible intersection point between mouse-pick-ray and 3D object |
| timestamp | Event timestamp |
Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
Disabled copy operator.
| library | Object which would be copied |
|
virtual |
Post file load interaction function.
| userInterface | The application's UI elements |
| filename | Filename of the loaded filename |
| succeeded | State determining whether the file has been loaded successfully |
Reimplemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Post update interaction function.
| userInterface | The application's UI elements |
| engine | Engine which has been updated, must be valid |
| view | The view which will be used to render, must be valid |
| timestamp | Recent update timestamp |
Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Pre file load interaction function.
| userInterface | The application's UI elements |
| filename | Filename of the file to be loaded |
Reimplemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
virtual |
Pre update interaction function.
This function is invoked before each update process, the application interaction module has the possibility to return a different preferred update timestamp.
| userInterface | The application's UI elements |
| engine | Engine to be updated, must be valid |
| view | The view which will be used to render, must be valid |
| timestamp | Recent update timestmap |
Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
inlineprotected |
Returns all registered file extensions.
|
staticprotected |
Registers a library at the manager.
Each library should be registered at most once.
| library | Library to register |
|
protected |
Registers an additional file extension.
| extension | New file extension to register |
| description | Description of the file type |
|
virtual |
Releases this library.
Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary.
|
pure virtual |
Unloads all loaded scripts.
| userInterface | The application's UI elements |
| engine | Current engine |
| timestamp | Recent timestmap |
Implemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
pure virtual |
Unloads one specific loaded interaction files.
| userInterface | The application's UI elements |
| engine | Current engine |
| timestamp | Recent timestmap |
| filename | Filename of the interaction to be unloaded |
Implemented in Ocean::Interaction::Empty::EPYLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::JavaScript::JSLibrary.
|
staticprotected |
Unregisters a library at the manager.
| library | Name of the library to unregister |
|
protected |
Map holding accepted file extensions supported by this library.
|
protected |
Library name.