Updraft
1.0
Open source glider flight visualisation tool.
|
A class that represents one logical layer in map. More...
#include <maplayer.h>
Public Slots | |
void | setVisibility (bool value)=0 |
Displays/hides the map layer. | |
Signals | |
void | checked (bool value, MapLayerInterface *sender) |
Emited when the map layer is checked or unchecked (before it is displayed or hidden). | |
void | contextMenuRequested (QPoint pos, MapLayerInterface *sender) |
Emited when a context menu is requested on this map layer. | |
Public Member Functions | |
MapLayer (const QString &title) | |
~MapLayer () | |
void | connectSignalChecked (const QObject *receiver, const char *method) |
Connects the checkbox signal to a given slot. | |
void | connectSignalContextMenuRequested (const QObject *receiver, const char *method) |
Connects the context menu signal to a given slot. | |
void | connectSlotSetVisibility (const QObject *sender, const char *method) |
Connects the given signal to the slot that sets visibility of this map layer. | |
void | connectCheckedToVisibility () |
A convenience method that connects the checked signal of this map layer. | |
void | setId (const QByteArray &id) |
Sets the identification of the map layer. | |
QByteArray | getId () |
Returns this map layer's id. | |
void | setTitle (const QString &title) |
Sets the title of this map layer. | |
QTreeWidgetItem * | getTreeItem () |
Returns the root tree item that represents this map layer. | |
void | setDisabled (bool disabled) |
Disables or enables the map layer. | |
void | setChecked (bool value) |
Checks or unchecks the map layer's check-box. | |
void | setCheckable (bool value) |
Enables or disables the checkability of the map layer's check-box. | |
void | inserted (MapLayerGroup *parent) |
Sets the parent map layer group of this map layer. | |
void | setFilePath (const QString &path) |
Sets the file path of the file associated to this layer to the given string. | |
QAction * | getDeleteAction () |
Returns pointer to the action that deletes the associated file. | |
QByteArray | saveState () |
Save the state (check state and expanded state) of this layer. | |
bool | restoreState (const QByteArray &state) |
Restore the previsously saved state. | |
Protected Member Functions | |
void | emitChecked (bool value) |
Emits the checked signal. | |
void | emitContextMenuRequested (const QPoint &pos) |
Emits the context menu request signal. | |
MapLayer (QTreeWidgetItem *item) | |
Protected Attributes | |
QByteArray | id |
Identificiation of the map layer, used in saving and restoring state. | |
QAction * | deleteAction |
Action for getDeleteAction. | |
QString | deleteFilePath |
File path for delete action. | |
QTreeWidgetItem * | treeItem |
Tree item representing this map layer. | |
bool | ownsTreeItem |
If this is true, then the treeItem is deleted together with the mapLayer. | |
MapLayerGroup * | parent |
Parent map layer group. | |
Private Slots | |
void | deleteActionSlot () |
The slot that is executed by the delete action. |
A class that represents one logical layer in map.
Map layer in osgEarth can be of different types, and this class encapsulates all of the types, and creates a common interface. The type of the map layer determines which value of the union Layer is valid.
Updraft::Core::MapLayer::MapLayer | ( | const QString & | title | ) | [explicit] |
Updraft::Core::MapLayer::MapLayer | ( | QTreeWidgetItem * | item | ) | [explicit, protected] |
void Updraft::Core::MapLayer::checked | ( | bool | value, |
MapLayerInterface * | sender | ||
) | [signal] |
Emited when the map layer is checked or unchecked (before it is displayed or hidden).
value | Whether the layer was checked |
sender | The pointer to this object |
void Updraft::Core::MapLayer::connectCheckedToVisibility | ( | ) | [virtual] |
A convenience method that connects the checked signal of this map layer.
directly to its visiblity toggling slot.
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::connectSignalChecked | ( | const QObject * | receiver, |
const char * | method | ||
) | [virtual] |
Connects the checkbox signal to a given slot.
receiver | The object on which the slot should be called |
method | The slot that should be called |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::connectSignalContextMenuRequested | ( | const QObject * | receiver, |
const char * | method | ||
) | [virtual] |
Connects the context menu signal to a given slot.
receiver | The object on which the slot should be called |
method | The slot that should be called |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::connectSlotSetVisibility | ( | const QObject * | sender, |
const char * | method | ||
) | [virtual] |
Connects the given signal to the slot that sets visibility of this map layer.
sender | The object whose signal should be connected to the visibility toggling slot. |
method | The signal that should be connected |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::contextMenuRequested | ( | QPoint | pos, |
MapLayerInterface * | sender | ||
) | [signal] |
Emited when a context menu is requested on this map layer.
pos | The position where the context menu should appear. |
sender | Pointer to this object. |
void Updraft::Core::MapLayer::deleteActionSlot | ( | ) | [private, slot] |
The slot that is executed by the delete action.
This method deleted the associated file.
void Updraft::Core::MapLayer::emitChecked | ( | bool | value | ) | [protected, virtual] |
Emits the checked signal.
Called from MainWindow.
value | Whether the check-box was checked |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::emitContextMenuRequested | ( | const QPoint & | pos | ) | [protected, virtual] |
Emits the context menu request signal.
pos | The position of the context menu. |
Implements Updraft::MapLayerInterface.
QAction * Updraft::Core::MapLayer::getDeleteAction | ( | ) | [virtual] |
Returns pointer to the action that deletes the associated file.
Implements Updraft::MapLayerInterface.
QByteArray Updraft::Core::MapLayer::getId | ( | ) | [virtual] |
Returns this map layer's id.
Implements Updraft::MapLayerInterface.
QTreeWidgetItem * Updraft::Core::MapLayer::getTreeItem | ( | ) | [virtual] |
Returns the root tree item that represents this map layer.
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::inserted | ( | MapLayerGroup * | parent | ) | [virtual] |
Sets the parent map layer group of this map layer.
parent | The new parent group of this map layer. |
Implements Updraft::MapLayerInterface.
Reimplemented in Updraft::Core::MapLayerGroup.
bool Updraft::Core::MapLayer::restoreState | ( | const QByteArray & | state | ) | [virtual] |
Restore the previsously saved state.
state | The state that was previously obtained from the saveState() method. |
Implements Updraft::MapLayerInterface.
Reimplemented in Updraft::Core::MapLayerGroup.
QByteArray Updraft::Core::MapLayer::saveState | ( | ) | [virtual] |
Save the state (check state and expanded state) of this layer.
Implements Updraft::MapLayerInterface.
Reimplemented in Updraft::Core::MapLayerGroup.
void Updraft::Core::MapLayer::setCheckable | ( | bool | value | ) | [virtual] |
Enables or disables the checkability of the map layer's check-box.
value | Whether the check-box should be checkable. |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::setChecked | ( | bool | value | ) | [virtual] |
Checks or unchecks the map layer's check-box.
value | The new check state of the check-box. |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::setDisabled | ( | bool | disabled | ) | [virtual] |
Disables or enables the map layer.
disabled | Whether the layer should be disabled. |
Implements Updraft::MapLayerInterface.
Reimplemented in Updraft::Core::MapLayerGroup.
void Updraft::Core::MapLayer::setFilePath | ( | const QString & | path | ) | [virtual] |
Sets the file path of the file associated to this layer to the given string.
path | The path to the associated file |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::setId | ( | const QByteArray & | id | ) | [virtual] |
Sets the identification of the map layer.
id | The id in the local 8bit encoding, identifying the map layer. |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::setTitle | ( | const QString & | title | ) | [virtual] |
Sets the title of this map layer.
title | The new title to be set. |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayer::setVisibility | ( | bool | value | ) | [pure virtual, slot] |
Displays/hides the map layer.
value | The new state of visibility. |
Implements Updraft::MapLayerInterface.
Implemented in Updraft::Core::MapLayerGroup, and Updraft::Core::NodeMapLayer.
QAction* Updraft::Core::MapLayer::deleteAction [protected] |
Action for getDeleteAction.
QString Updraft::Core::MapLayer::deleteFilePath [protected] |
File path for delete action.
QByteArray Updraft::Core::MapLayer::id [protected] |
Identificiation of the map layer, used in saving and restoring state.
by default the id is the title encoded to local 8bit encoding.
bool Updraft::Core::MapLayer::ownsTreeItem [protected] |
If this is true, then the treeItem is deleted together with the mapLayer.
This is only false for the top level group.
MapLayerGroup* Updraft::Core::MapLayer::parent [protected] |
Parent map layer group.
Used when using operator delete on the layer. This is set by the parent group.
QTreeWidgetItem* Updraft::Core::MapLayer::treeItem [protected] |
Tree item representing this map layer.