Ocean
Ocean::Interaction::Library Class Referenceabstract

This class implements the base class for all interaction libraries. More...

Inheritance diagram for Ocean::Interaction::Library:

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

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...
 
virtual bool load (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename)=0
 Loads a new interaction file. More...
 
virtual bool unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp, const std::string &filename)=0
 Unloads one specific loaded interaction files. More...
 
virtual void unload (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Timestamp timestamp)=0
 Unloads all loaded scripts. More...
 
virtual void preFileLoad (const UserInterface &userInterface, const std::string &filename)
 Pre file load interaction function. More...
 
virtual void postFileLoad (const UserInterface &userInterface, const std::string &filename, const bool succeeded)
 Post file load interaction function. More...
 
virtual Timestamp preUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp)
 Pre update interaction function. More...
 
virtual void postUpdate (const UserInterface &userInterface, const Rendering::EngineRef &engine, const Rendering::ViewRef &view, const Timestamp timestamp)
 Post update interaction function. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void onKeyPress (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp)
 Key press function. More...
 
virtual void onKeyRelease (const UserInterface &userInterface, const Rendering::EngineRef &engine, const std::string &key, const Timestamp timestamp)
 Key release function. More...
 
virtual void release ()
 Releases this library. More...
 

Protected Member Functions

 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...
 
Libraryoperator= (const Library &library)=delete
 Disabled copy operator. More...
 

Static Protected Member Functions

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...
 

Protected Attributes

std::string libraryName
 Library name. More...
 
FileExtensions libraryFileExtensions
 Map holding accepted file extensions supported by this library. More...
 

Friends

class Manager
 

Detailed Description

This class implements the base class for all interaction libraries.

Member Typedef Documentation

◆ FileExtensions

typedef std::map<std::string, std::string> Ocean::Interaction::Library::FileExtensions

Definition of a map mapping file extensions to file type descriptions.

Constructor & Destructor Documentation

◆ Library() [1/2]

Ocean::Interaction::Library::Library ( const std::string &  name)
protected

Creates a new library object.

Parameters
nameThe name of the library

◆ ~Library()

virtual Ocean::Interaction::Library::~Library ( )
protectedvirtual

Destructs a library object.

◆ Library() [2/2]

Ocean::Interaction::Library::Library ( const Library library)
protecteddelete

Disabled copy constructor.

Parameters
libraryObject which would be copied

Member Function Documentation

◆ isFileExtensionSupported()

virtual bool Ocean::Interaction::Library::isFileExtensionSupported ( const std::string &  extension) const
virtual

Returns whether a specified file extension is supported by this interaction plugin.

Parameters
extensionFile extension to check
Returns
True, if suo

◆ load()

virtual bool Ocean::Interaction::Library::load ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const Timestamp  timestamp,
const std::string &  filename 
)
pure virtual

Loads a new interaction file.

Parameters
userInterfaceThe application's UI elements
engineCurrent engine
timestampRecent timestmap
filenameName of the interaction file to load
Returns
True, if succeeded

Implemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ name()

const std::string & Ocean::Interaction::Library::name ( ) const
inline

Returns the name of this library.

Returns
Library name

◆ onKeyPress()

virtual void Ocean::Interaction::Library::onKeyPress ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const std::string &  key,
const Timestamp  timestamp 
)
virtual

Key press function.

Parameters
userInterfaceThe application's UI elements
engineRendering engine currently used
keyKey which has been pressed
timestampEvent timestamp

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ onKeyRelease()

virtual void Ocean::Interaction::Library::onKeyRelease ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const std::string &  key,
const Timestamp  timestamp 
)
virtual

Key release function.

Parameters
userInterfaceThe application's UI elements
engineRendering engine currently used
keyKey which has been pressed
timestampEvent timestamp

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ onMouseMove()

virtual void Ocean::Interaction::Library::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 
)
virtual

Mouse move event function.

Parameters
userInterfaceThe application's UI elements
engineRendering engine currently used
buttonPressed mouse button
screenPosition2D screen position of the mouse cursor
ray3D picking ray
pickedObjectName of the possible picked object
pickedPositionPossible intersection point between mouse-pick-ray and 3D object
timestampEvent timestamp

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, and Ocean::Interaction::Experiences::ExperiencesLibrary.

◆ onMousePress()

virtual void Ocean::Interaction::Library::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 
)
virtual

Mouse press event function.

Parameters
userInterfaceThe application's UI elements
engineRendering engine currently used
buttonPressed mouse button
screenPosition2D screen position of the mouse cursor
ray3D picking ray
pickedObjectName of the possible picked object
pickedPositionPossible intersection point between mouse-pick-ray and 3D object
timestampEvent timestamp

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, and Ocean::Interaction::Experiences::ExperiencesLibrary.

◆ onMouseRelease()

virtual void Ocean::Interaction::Library::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 
)
virtual

Mouse release event function.

Parameters
userInterfaceThe application's UI elements
engineRendering engine currently used
buttonReleased mouse button
screenPosition2D screen position of the mouse cursor
ray3D picking ray
pickedObjectName of the possible picked object
pickedPositionPossible intersection point between mouse-pick-ray and 3D object
timestampEvent timestamp

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, and Ocean::Interaction::Experiences::ExperiencesLibrary.

◆ operator=()

Library& Ocean::Interaction::Library::operator= ( const Library library)
protecteddelete

Disabled copy operator.

Parameters
libraryObject which would be copied
Returns
Reference to this object

◆ postFileLoad()

virtual void Ocean::Interaction::Library::postFileLoad ( const UserInterface userInterface,
const std::string &  filename,
const bool  succeeded 
)
virtual

Post file load interaction function.

Parameters
userInterfaceThe application's UI elements
filenameFilename of the loaded filename
succeededState determining whether the file has been loaded successfully

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ postUpdate()

virtual void Ocean::Interaction::Library::postUpdate ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const Rendering::ViewRef view,
const Timestamp  timestamp 
)
virtual

Post update interaction function.

Parameters
userInterfaceThe application's UI elements
engineEngine which has been updated, must be valid
viewThe view which will be used to render, must be valid
timestampRecent update timestamp

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, and Ocean::Interaction::Experiences::ExperiencesLibrary.

◆ preFileLoad()

virtual void Ocean::Interaction::Library::preFileLoad ( const UserInterface userInterface,
const std::string &  filename 
)
virtual

Pre file load interaction function.

Parameters
userInterfaceThe application's UI elements
filenameFilename of the file to be loaded

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ preUpdate()

virtual Timestamp Ocean::Interaction::Library::preUpdate ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const Rendering::ViewRef view,
const Timestamp  timestamp 
)
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.

Parameters
userInterfaceThe application's UI elements
engineEngine to be updated, must be valid
viewThe view which will be used to render, must be valid
timestampRecent update timestmap
Returns
Timestamp which should be used for the update process, if the timestamp is null any timestamp can be used

Reimplemented in Ocean::Interaction::JavaScript::JSLibrary, and Ocean::Interaction::Experiences::ExperiencesLibrary.

◆ registeredFileExtensions()

Library::FileExtensions Ocean::Interaction::Library::registeredFileExtensions ( ) const
inlineprotected

Returns all registered file extensions.

Returns
Registered file extensions

◆ registerFactory()

static bool Ocean::Interaction::Library::registerFactory ( Library library)
staticprotected

Registers a library at the manager.

Each library should be registered at most once.

Parameters
libraryLibrary to register
Returns
True, if the library hasn't been registered before

◆ registerFileExtension()

void Ocean::Interaction::Library::registerFileExtension ( const std::string &  extension,
const std::string &  description 
)
protected

Registers an additional file extension.

Parameters
extensionNew file extension to register
descriptionDescription of the file type

◆ release()

virtual void Ocean::Interaction::Library::release ( )
virtual

Releases this library.

Reimplemented in Ocean::Interaction::Experiences::ExperiencesLibrary.

◆ unload() [1/2]

virtual void Ocean::Interaction::Library::unload ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const Timestamp  timestamp 
)
pure virtual

Unloads all loaded scripts.

Parameters
userInterfaceThe application's UI elements
engineCurrent engine
timestampRecent timestmap

Implemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ unload() [2/2]

virtual bool Ocean::Interaction::Library::unload ( const UserInterface userInterface,
const Rendering::EngineRef engine,
const Timestamp  timestamp,
const std::string &  filename 
)
pure virtual

Unloads one specific loaded interaction files.

Parameters
userInterfaceThe application's UI elements
engineCurrent engine
timestampRecent timestmap
filenameFilename of the interaction to be unloaded
Returns
True, if succeeded
See also
Manager::unload().

Implemented in Ocean::Interaction::JavaScript::JSLibrary, Ocean::Interaction::Experiences::ExperiencesLibrary, and Ocean::Interaction::Empty::EPYLibrary.

◆ unregisterLibrary()

static bool Ocean::Interaction::Library::unregisterLibrary ( const std::string &  library)
staticprotected

Unregisters a library at the manager.

Parameters
libraryName of the library to unregister
Returns
True, if succeeded

Friends And Related Function Documentation

◆ Manager

friend class Manager
friend

Field Documentation

◆ libraryFileExtensions

FileExtensions Ocean::Interaction::Library::libraryFileExtensions
protected

Map holding accepted file extensions supported by this library.

◆ libraryName

std::string Ocean::Interaction::Library::libraryName
protected

Library name.


The documentation for this class was generated from the following file: