Updraft
1.0
Open source glider flight visualisation tool.
|
Implements the core functionalities avaliable to plugins. More...
#include <coreimplementation.h>
Public Member Functions | |
CoreImplementation (PluginBase *pl) | |
QMainWindow * | getMainWindow () |
Returns main window pointer. Used for example for modal dialogs. | |
MenuInterface * | createMenu (QString title) |
Create an entry in the main menu. | |
MenuInterface * | getSystemMenu (SystemMenu menu) |
Returns pointer to the instance of a system menu. | |
const Util::Ellipsoid * | getEllipsoid () const |
Returns the current Updraft::Util::Ellipsoid used for measurements. | |
MapLayerGroupInterface * | createMapLayerGroup (const QString &title) |
Creates map layer group and adds it to the tree view in the left pane. | |
TabInterface * | createTab (QWidget *content, QString title) |
Open a Tab with any widget. | |
void | removeTab (TabInterface *tab) |
Removes tab from the bottom pane The tab class given to this function is deleted! Equivalent to tab->close() | |
void | registerFiletype (const FileRegistration ®istration) |
Register a filetype in Updraft. | |
QDir | getDataDirectory () |
Gets path of the application data directory. | |
QDir | getResourcesDirectory () |
Gets path of the immutable application data directory. | |
void | addSettingsGroup (const QString &groupId, const QString &description, SettingsGroupType type, const QString &icon) |
Adds a group into the settings dialog. | |
SettingInterface * | addSetting (const QString &settingId, const QString &description, QVariant initValue, SettingsGroupType type) |
Adds a setting into the settings dialog. | |
osg::Group * | getSimpleGroup () |
Returns the pointer to the basic node group for drawing. | |
void | registerOsgNode (osg::Node *node, MapObject *mapObject) |
Registers the osg node into Updraft for mouse picking. | |
osgEarth::Util::ElevationManager * | getElevationManager () |
Returns an elevation manager for the scene, to request elevation data from. | |
const osg::EllipsoidModel * | getCurrentMapEllipsoid () |
Returns the ellipsoid model associated with the active map. | |
Private Attributes | |
PluginBase * | plugin |
Implements the core functionalities avaliable to plugins.
There is an instance of this class for every loaded plugin.
Updraft::Core::CoreImplementation::CoreImplementation | ( | PluginBase * | pl | ) | [explicit] |
SettingInterface * Updraft::Core::CoreImplementation::addSetting | ( | const QString & | settingId, |
const QString & | description, | ||
QVariant | initValue, | ||
SettingsGroupType | type | ||
) | [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. |
Implements Updraft::CoreInterface.
void Updraft::Core::CoreImplementation::addSettingsGroup | ( | const QString & | groupId, |
const QString & | description, | ||
SettingsGroupType | type, | ||
const QString & | icon | ||
) | [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. |
Implements Updraft::CoreInterface.
MapLayerGroupInterface * Updraft::Core::CoreImplementation::createMapLayerGroup | ( | const QString & | title | ) | [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 |
Implements Updraft::CoreInterface.
MenuInterface * Updraft::Core::CoreImplementation::createMenu | ( | QString | title | ) | [virtual] |
Create an entry in the main menu.
Implements Updraft::CoreInterface.
TabInterface * Updraft::Core::CoreImplementation::createTab | ( | QWidget * | content, |
QString | title | ||
) | [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 |
Implements Updraft::CoreInterface.
const osg::EllipsoidModel * Updraft::Core::CoreImplementation::getCurrentMapEllipsoid | ( | ) | [virtual] |
Returns the ellipsoid model associated with the active map.
Implements Updraft::CoreInterface.
QDir Updraft::Core::CoreImplementation::getDataDirectory | ( | ) | [virtual] |
Gets path of the application data directory.
Implements Updraft::CoreInterface.
osgEarth::Util::ElevationManager * Updraft::Core::CoreImplementation::getElevationManager | ( | ) | [virtual] |
Returns an elevation manager for the scene, to request elevation data from.
Implements Updraft::CoreInterface.
const Util::Ellipsoid * Updraft::Core::CoreImplementation::getEllipsoid | ( | ) | const [virtual] |
Returns the current Updraft::Util::Ellipsoid used for measurements.
Implements Updraft::CoreInterface.
QMainWindow * Updraft::Core::CoreImplementation::getMainWindow | ( | ) | [virtual] |
Returns main window pointer. Used for example for modal dialogs.
Implements Updraft::CoreInterface.
QDir Updraft::Core::CoreImplementation::getResourcesDirectory | ( | ) | [virtual] |
Gets path of the immutable application data directory.
Implements Updraft::CoreInterface.
osg::Group * Updraft::Core::CoreImplementation::getSimpleGroup | ( | ) | [virtual] |
Returns the pointer to the basic node group for drawing.
Implements Updraft::CoreInterface.
MenuInterface * Updraft::Core::CoreImplementation::getSystemMenu | ( | SystemMenu | menu | ) | [virtual] |
Returns pointer to the instance of a system menu.
menu | which system menu instance to return |
Implements Updraft::CoreInterface.
void Updraft::Core::CoreImplementation::registerFiletype | ( | const FileRegistration & | registration | ) | [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. |
Implements Updraft::CoreInterface.
void Updraft::Core::CoreImplementation::registerOsgNode | ( | osg::Node * | node, |
MapObject * | mapObject | ||
) | [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 |
Implements Updraft::CoreInterface.
void Updraft::Core::CoreImplementation::removeTab | ( | TabInterface * | tab | ) | [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 |
Implements Updraft::CoreInterface.