Updraft
1.0
Open source glider flight visualisation tool.
|
Exposes core functionalities to plugins. More...
#include <coreinterface.h>
Public Member Functions | |
virtual | ~CoreInterface () |
virtual QMainWindow * | getMainWindow ()=0 |
Returns main window pointer. Used for example for modal dialogs. | |
virtual MenuInterface * | createMenu (QString title)=0 |
Create an entry in the main menu. | |
virtual MenuInterface * | getSystemMenu (SystemMenu menu)=0 |
Returns pointer to the instance of a system menu. | |
virtual const Util::Ellipsoid * | getEllipsoid () const =0 |
Returns the current Updraft::Util::Ellipsoid used for measurements. | |
virtual MapLayerGroupInterface * | createMapLayerGroup (const QString &title)=0 |
Creates map layer group and adds it to the tree view in the left pane. | |
virtual TabInterface * | createTab (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 ®istration)=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 SettingInterface * | addSetting (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. |
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)
virtual Updraft::CoreInterface::~CoreInterface | ( | ) | [inline, virtual] |
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.
settingId | Identifier 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. |
description | Description of the setting. This will be displayed in the settings dialog. |
initValue | This is the initial value for the setting if it is newly created. |
type | Whether the setting is being added to a visible, advanced or hidden group. |
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.
groupId | An identifier of the group to create or change description. |
description | Description of the group. This is displayed in the dialog next to the settings icon. |
type | Whether the group should be visible, advanced or hidden. |
icon | The 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.
title | label for the item in the tree view |
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.
content | The widget that represents content of the tab. |
title | Title 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.
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.
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.
virtual MenuInterface* Updraft::CoreInterface::getSystemMenu | ( | SystemMenu | menu | ) | [pure virtual] |
Returns pointer to the instance of a system menu.
menu | which 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.
registration | The structure containing information about the newly registered type. |
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.
node | The node that should be registered |
mapObject | The 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()
tab | The tab to be closed |
Implemented in Updraft::Core::CoreImplementation.