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

Implements the core functionalities avaliable to plugins. More...

#include <coreimplementation.h>

Inheritance diagram for Updraft::Core::CoreImplementation:
Collaboration diagram for Updraft::Core::CoreImplementation:

List of all members.

Public Member Functions

 CoreImplementation (PluginBase *pl)
QMainWindow * getMainWindow ()
 Returns main window pointer. Used for example for modal dialogs.
MenuInterfacecreateMenu (QString title)
 Create an entry in the main menu.
MenuInterfacegetSystemMenu (SystemMenu menu)
 Returns pointer to the instance of a system menu.
const Util::EllipsoidgetEllipsoid () const
 Returns the current Updraft::Util::Ellipsoid used for measurements.
MapLayerGroupInterfacecreateMapLayerGroup (const QString &title)
 Creates map layer group and adds it to the tree view in the left pane.
TabInterfacecreateTab (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 &registration)
 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.
SettingInterfaceaddSetting (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

PluginBaseplugin

Detailed Description

Implements the core functionalities avaliable to plugins.

There is an instance of this class for every loaded plugin.


Constructor & Destructor Documentation


Member Function Documentation

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.

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.

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.

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.

Implements Updraft::CoreInterface.

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

Implements Updraft::CoreInterface.

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.

Parameters:
contentThe widget that represents content of the tab.
titleTitle 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.

Gets path of the application data directory.

Returns:
QDir with the full path to the application 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.

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

Implements Updraft::CoreInterface.

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

Implements Updraft::CoreInterface.

Gets path of the immutable application data directory.

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

Implements Updraft::CoreInterface.

Returns the pointer to the basic node group for drawing.

Implements Updraft::CoreInterface.

Returns pointer to the instance of a system menu.

Parameters:
menuwhich system menu instance to return

Implements Updraft::CoreInterface.

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

Implements Updraft::CoreInterface.

void Updraft::Core::CoreImplementation::registerOsgNode ( osg::Node *  node,
MapObject mapObject 
) [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

Implements Updraft::CoreInterface.

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

Implements Updraft::CoreInterface.


Member Data Documentation


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