Ocean
|
This class implements the manager for all interaction libraries / plugins. More...
Public Member Functions | |
bool | load (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename) |
Loads a new interaction file. More... | |
bool | unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename) |
Unloads one specific loaded interaction files. More... | |
void | unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp) |
Unloads all loaded interaction files. More... | |
bool | handlesMouseEvents () const |
Returns whether currently at least one interaction library handles mouse events. More... | |
void | preFileLoad (const UserInterface &userInterface, const std::string &filename) |
Pre file load interaction function. More... | |
void | postFileLoad (const UserInterface &userInterface, const std::string &filename, const bool succeeded) |
Post file load interaction function. More... | |
Timestamp | preUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) |
Pre update interaction function. More... | |
void | postUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp) |
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) |
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) |
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) |
Mouse release event function. More... | |
void | onKeyPress (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) |
Key press function. More... | |
void | onKeyRelease (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp) |
Key release function. More... | |
virtual FileExtensions | supportedExtensions () |
Returns all currently supported file extensions. More... | |
Names | libraries () const |
Returns the names of all currently registered libraries. More... | |
void | release () |
Releases all interaction libraries. More... | |
void | registerMouseEventLibrary (const std::string &name) |
Registers an interaction library handling mouse events. More... | |
bool | unregisterMouseEventLibrary (const std::string &name) |
Unregisters an interaction library handling mouse events. More... | |
Lock & | lock () const |
Retruns the lock object of this engine. More... | |
Public Member Functions inherited from Ocean::IO::FileManager | |
virtual bool | isSupported (const std::string &extension) |
Returns whether a specified file extension is supported. More... | |
Protected Types | |
typedef std::unordered_set< Library * > | LibrarySet |
Definition of a set holding registered interaction libraries. More... | |
typedef std::unordered_set< std::string > | NameSet |
Definition of a set holding names of interaction libraries. More... | |
typedef std::vector< std::string > | Names |
Definition of a vector holding names. More... | |
Protected Member Functions | |
Manager () | |
Creates a new manager. More... | |
virtual | ~Manager () |
Destructs a manager. More... | |
void | registerLibrary (Library &library) |
Registers a new interaction library able to read a specific interaction format. More... | |
bool | unregisterLibrary (const std::string &name) |
Unregisters a library. More... | |
Protected Member Functions inherited from Ocean::IO::FileManager | |
FileManager () | |
Creates a new file manager object. More... | |
virtual | ~FileManager () |
Destructs a file manager object. More... | |
Protected Member Functions inherited from Ocean::Singleton< Manager > | |
Singleton ()=default | |
Default constructor. More... | |
Protected Attributes | |
LibrarySet | librarySet_ |
Set holding all registered interaction libraries. More... | |
NameSet | mouseEventLibraries_ |
Set holding all names of libraries interested in mouse events. More... | |
Lock | lock_ |
Manager lock. More... | |
Friends | |
class | Singleton< Manager > |
class | Library |
Additional Inherited Members | |
Public Types inherited from Ocean::IO::FileManager | |
typedef std::map< std::string, std::string > | FileExtensions |
Definition of a map mapping supported file extensions to file type descriptions. More... | |
Static Public Member Functions inherited from Ocean::Singleton< Manager > | |
static Manager & | get () |
Returns a reference to the unique object. More... | |
This class implements the manager for all interaction libraries / plugins.
|
protected |
Definition of a set holding registered interaction libraries.
|
protected |
Definition of a vector holding names.
|
protected |
Definition of a set holding names of interaction libraries.
|
protected |
Creates a new manager.
|
protectedvirtual |
Destructs a manager.
|
inline |
Returns whether currently at least one interaction library handles mouse events.
Because mouse events can produce high computational overhead this test can safe computational time.
Names Ocean::Interaction::Manager::libraries | ( | ) | const |
Returns the names of all currently registered libraries.
bool Ocean::Interaction::Manager::load | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const Timestamp | timestamp, | ||
const std::string & | filename | ||
) |
Loads a new interaction file.
userInterface | The application's UI elements |
engine | Current engine |
timestamp | Recent timestmap |
filename | Filename of the interaction to load |
|
inline |
Retruns the lock object of this engine.
Beware: Use this lock with caution.
void Ocean::Interaction::Manager::onKeyPress | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const std::string & | key, | ||
const Timestamp | timestamp | ||
) |
void Ocean::Interaction::Manager::onKeyRelease | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const std::string & | key, | ||
const Timestamp | timestamp | ||
) |
void Ocean::Interaction::Manager::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.
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 |
void Ocean::Interaction::Manager::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.
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 |
void Ocean::Interaction::Manager::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.
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 |
void Ocean::Interaction::Manager::postFileLoad | ( | const UserInterface & | userInterface, |
const std::string & | filename, | ||
const bool | succeeded | ||
) |
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 |
void Ocean::Interaction::Manager::postUpdate | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const Rendering::ViewRef & | view, | ||
const Timestamp | timestamp | ||
) |
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 |
void Ocean::Interaction::Manager::preFileLoad | ( | const UserInterface & | userInterface, |
const std::string & | filename | ||
) |
Pre file load interaction function.
userInterface | The application's UI elements |
filename | Filename of the file to be loaded |
Timestamp Ocean::Interaction::Manager::preUpdate | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const Rendering::ViewRef & | view, | ||
const Timestamp | timestamp | ||
) |
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.
If several interaction modules are used and each is changing the timestamp each changed timestamp is given to the next module as preferred timestamp.
Therefore the last registered interaction module has the possiblity to define the used 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 |
|
protected |
Registers a new interaction library able to read a specific interaction format.
library | Library to register |
void Ocean::Interaction::Manager::registerMouseEventLibrary | ( | const std::string & | name | ) |
Registers an interaction library handling mouse events.
name | The name of the library interested in mouse events |
void Ocean::Interaction::Manager::release | ( | ) |
Releases all interaction libraries.
|
virtual |
Returns all currently supported file extensions.
Implements Ocean::IO::FileManager.
void Ocean::Interaction::Manager::unload | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const Timestamp | timestamp | ||
) |
Unloads all loaded interaction files.
userInterface | The application's UI elements |
engine | Current engine |
timestamp | Recent timestmap |
bool Ocean::Interaction::Manager::unload | ( | const UserInterface & | userInterface, |
const Rendering::EngineRef & | engine, | ||
const Timestamp | timestamp, | ||
const std::string & | filename | ||
) |
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 |
|
protected |
Unregisters a library.
name | The name of the library to unregister |
bool Ocean::Interaction::Manager::unregisterMouseEventLibrary | ( | const std::string & | name | ) |
Unregisters an interaction library handling mouse events.
name | The name of the library not interested in mouse events anymore |
|
friend |
|
protected |
Set holding all registered interaction libraries.
|
protected |
Set holding all names of libraries interested in mouse events.
This set is used to decided whether mouse events should be processed for this interaction libraries.