Updraft  1.0
Open source glider flight visualisation tool.
Updraft::CoreInterface Class Reference

Exposes core functionalities to plugins. More...

#include <coreinterface.h>

Inheritance diagram for Updraft::CoreInterface:

List of all members.

Public Member Functions

virtual ~CoreInterface ()
virtual QMainWindow * getMainWindow ()=0
 Returns main window pointer. Used for example for modal dialogs.
virtual MenuInterfacecreateMenu (QString title)=0
 Create an entry in the main menu.
virtual MenuInterfacegetSystemMenu (SystemMenu menu)=0
 Returns pointer to the instance of a system menu.
virtual const Util::EllipsoidgetEllipsoid () const =0
 Returns the current Updraft::Util::Ellipsoid used for measurements.
virtual MapLayerGroupInterfacecreateMapLayerGroup (const QString &title)=0
 Creates map layer group and adds it to the tree view in the left pane.
virtual TabInterfacecreateTab (QWidget *content, QString title)=0
 Open a Tab with any widget.
virtual void removeTab (TabInterface *tab)=0
 Removes tab from the bottom pane The tab class given to this function is deleted! Equivalent to tab->close()
virtual void registerFiletype (const FileRegistration &registration)=0
 Register a filetype in Updraft.
virtual QDir getDataDirectory ()=0
 Gets path of the application data directory.
virtual QDir getResourcesDirectory ()=0
 Gets path of the immutable application data directory.
virtual void addSettingsGroup (const QString &groupId, const QString &description, SettingsGroupType type=GROUP_VISIBLE, const QString &icon=":/core/icons/configure.png")=0
 Adds a group into the settings dialog.
virtual SettingInterfaceaddSetting (const QString &settingId, const QString &description, QVariant initValue, SettingsGroupType type=GROUP_VISIBLE)=0
 Adds a setting into the settings dialog.
virtual osg::Group * getSimpleGroup ()=0
 Returns the pointer to the basic node group for drawing.
virtual void registerOsgNode (osg::Node *node, MapObject *mapObject)=0
 Registers the osg node into Updraft for mouse picking.
virtual
osgEarth::Util::ElevationManager * 
getElevationManager ()=0
 Returns an elevation manager for the scene, to request elevation data from.
virtual const osg::EllipsoidModel * getCurrentMapEllipsoid ()=0
 Returns the ellipsoid model associated with the active map.

Detailed Description

Exposes core functionalities to plugins.

A call to methods of this interface automagically contains a pointer to calling plugin (this is ensured in core/coreimplementation.cpp)


Constructor & Destructor Documentation

virtual Updraft::CoreInterface::~CoreInterface ( ) [inline, virtual]

Member Function Documentation

virtual SettingInterface* Updraft::CoreInterface::addSetting ( const QString &  settingId,
const QString &  description,
QVariant  initValue,
SettingsGroupType  type = GROUP_VISIBLE 
) [pure virtual]

Adds a setting into the settings dialog.

If the setting already exists, its value is not set to the provided value but instead, the value is read from the existing setting. Ownership of the setting interface is transfered to the caller of this function.

Parameters:
settingIdIdentifier for the setting, prepended with a ':' and the settings group identifier, where this setting will reside. If the group with the given identifier does not exist, a new one will be created with a default icon and name identical to the identifier.
descriptionDescription of the setting. This will be displayed in the settings dialog.
initValueThis is the initial value for the setting if it is newly created.
typeWhether the setting is being added to a visible, advanced or hidden group.
Returns:
Interface for setting and reading the setting value. In case of failure, NULL is returned.

Implemented in Updraft::Core::CoreImplementation.

virtual void Updraft::CoreInterface::addSettingsGroup ( const QString &  groupId,
const QString &  description,
SettingsGroupType  type = GROUP_VISIBLE,
const QString &  icon = ":/core/icons/configure.png" 
) [pure virtual]

Adds a group into the settings dialog.

If a setting group with the given ID already exists, its description and icon are changed to the new ones.

Parameters:
groupIdAn identifier of the group to create or change description.
descriptionDescription of the group. This is displayed in the dialog next to the settings icon.
typeWhether the group should be visible, advanced or hidden.
iconThe icon of the settings group. Default is a wrench icon.

Implemented in Updraft::Core::CoreImplementation.

virtual MapLayerGroupInterface* Updraft::CoreInterface::createMapLayerGroup ( const QString &  title) [pure virtual]

Creates map layer group and adds it to the tree view in the left pane.

The group returned by this function is a root group; for sub groups use MapLayerGroupInterface::createMapLayerGroup. To remove MapLayerGroup use C++ operator delete.

Parameters:
titlelabel for the item in the tree view
Returns:
Pointer to the new MapLayerGroup

Implemented in Updraft::Core::CoreImplementation.

virtual MenuInterface* Updraft::CoreInterface::createMenu ( QString  title) [pure virtual]

Create an entry in the main menu.

Implemented in Updraft::Core::CoreImplementation.

virtual TabInterface* Updraft::CoreInterface::createTab ( QWidget *  content,
QString  title 
) [pure virtual]

Open a Tab with any widget.

Takes ownership of content.

Parameters:
contentThe widget that represents content of the tab.
titleTitle string of the tab

Implemented in Updraft::Core::CoreImplementation.

virtual const osg::EllipsoidModel* Updraft::CoreInterface::getCurrentMapEllipsoid ( ) [pure virtual]

Returns the ellipsoid model associated with the active map.

Implemented in Updraft::Core::CoreImplementation.

virtual QDir Updraft::CoreInterface::getDataDirectory ( ) [pure virtual]

Gets path of the application data directory.

Returns:
QDir with the full path to the application directory

Implemented in Updraft::Core::CoreImplementation.

virtual osgEarth::Util::ElevationManager* Updraft::CoreInterface::getElevationManager ( ) [pure virtual]

Returns an elevation manager for the scene, to request elevation data from.

Implemented in Updraft::Core::CoreImplementation.

virtual const Util::Ellipsoid* Updraft::CoreInterface::getEllipsoid ( ) const [pure virtual]

Returns the current Updraft::Util::Ellipsoid used for measurements.

Implemented in Updraft::Core::CoreImplementation.

virtual QMainWindow* Updraft::CoreInterface::getMainWindow ( ) [pure virtual]

Returns main window pointer. Used for example for modal dialogs.

Implemented in Updraft::Core::CoreImplementation.

virtual QDir Updraft::CoreInterface::getResourcesDirectory ( ) [pure virtual]

Gets path of the immutable application data directory.

Returns:
QDir with the full path to the static data directory

Implemented in Updraft::Core::CoreImplementation.

virtual osg::Group* Updraft::CoreInterface::getSimpleGroup ( ) [pure virtual]

Returns the pointer to the basic node group for drawing.

Implemented in Updraft::Core::CoreImplementation.

Returns pointer to the instance of a system menu.

Parameters:
menuwhich system menu instance to return

Implemented in Updraft::Core::CoreImplementation.

virtual void Updraft::CoreInterface::registerFiletype ( const FileRegistration registration) [pure virtual]

Register a filetype in Updraft.

Whenever a file with the registered extension is opened by the core, the registering plugin will be notified.

Parameters:
registrationThe structure containing information about the newly registered type.
Returns:
Identifier of the newly registered filetype

Implemented in Updraft::Core::CoreImplementation.

virtual void Updraft::CoreInterface::registerOsgNode ( osg::Node *  node,
MapObject mapObject 
) [pure virtual]

Registers the osg node into Updraft for mouse picking.

Parameters:
nodeThe node that should be registered
mapObjectThe map object that this node represents when clicked

Implemented in Updraft::Core::CoreImplementation.

virtual void Updraft::CoreInterface::removeTab ( TabInterface tab) [pure virtual]

Removes tab from the bottom pane The tab class given to this function is deleted! Equivalent to tab->close()

Parameters:
tabThe tab to be closed

Implemented in Updraft::Core::CoreImplementation.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines