Updraft
1.0
Open source glider flight visualisation tool.
|
Map layer group used by plugins. More...
#include <maplayergroup.h>
Public Member Functions | |
MapLayerGroup (const QString &title) | |
Creates new map layer group. | |
MapLayerGroup (QTreeWidgetItem *item) | |
Create a new map layer group based on already existing tree item. | |
~MapLayerGroup () | |
Destroys MapLayerGroup Removes coresponding tree widget from GUI. | |
MapLayerGroupInterface * | createMapLayerGroup (const QString &title, int pos=-1) |
Create a single empty map layer group and add it as a child of this. | |
MapLayerInterface * | createMapLayer (osg::Node *layer, const QString &title, int pos=-1) |
Create a single map layer containing the node and add it as a child of this group. | |
void | insertMapLayer (MapLayerInterface *layer, int pos=-1) |
Insert the map layer as a child of this group. | |
void | removeMapLayer (MapLayerInterface *layer) |
Remove the map layer from this group, but don't delete it. | |
osg::Group * | getNodeGroup () |
Returns the osg group associated with this map layer group. | |
osgEarth::Util::ObjectPlacer * | getObjectPlacer () |
Returns the placer associated with the mapNode. | |
void | setVisibility (bool value) |
Displays/hides the map layer. | |
bool | isVisible () |
QByteArray | saveState () |
Save the state (check state and expanded state) of this layer (and possibly all children). | |
bool | restoreState (const QByteArray &state) |
Restore the previsously saved state. | |
Private Member Functions | |
void | addToScene (MapLayerGroup *group) |
Add the map layer to the osg group of the map layer group. | |
void | removeFromScene (MapLayerGroup *group) |
Remove the layer from the osg group of the map layer group. | |
void | inserted (Core::MapLayerGroup *parent) |
Sets the parent map layer group of this map layer. | |
void | setDisabled (bool disabled) |
Disables or enables the map layer. | |
MapLayerInterface * | createMapLayerNoInsert (osg::Node *mapLayer, const QString &title, int pos=-1) |
Add map layer without adding it to scene. | |
Private Attributes | |
QSet< MapLayerInterface * > | mapLayers |
osg::ref_ptr< osg::Group > | nodeGroup |
Pointer to the subtree of the scene associated with this layer. |
Map layer group used by plugins.
This class encapsulates handling of the map layer group. It provides methods for creating and deleting layers and automatically adding to/deleting from the GUI.
Updraft::Core::MapLayerGroup::MapLayerGroup | ( | const QString & | title | ) | [explicit] |
Creates new map layer group.
For creating new instances use CoreInterface or for creating sub groups use MapLayerGroup::createMapLayerGroup.
title | Displayed name of the widget. |
Updraft::Core::MapLayerGroup::MapLayerGroup | ( | QTreeWidgetItem * | item | ) | [explicit] |
Create a new map layer group based on already existing tree item.
Destroys MapLayerGroup Removes coresponding tree widget from GUI.
void Updraft::Core::MapLayerGroup::addToScene | ( | MapLayerGroup * | group | ) | [private, virtual] |
Add the map layer to the osg group of the map layer group.
Implements Updraft::MapLayerInterface.
MapLayerInterface * Updraft::Core::MapLayerGroup::createMapLayer | ( | osg::Node * | layer, |
const QString & | title, | ||
int | pos = -1 |
||
) | [virtual] |
Create a single map layer containing the node and add it as a child of this group.
Implements Updraft::MapLayerGroupInterface.
MapLayerGroupInterface * Updraft::Core::MapLayerGroup::createMapLayerGroup | ( | const QString & | title, |
int | pos = -1 |
||
) | [virtual] |
Create a single empty map layer group and add it as a child of this.
Implements Updraft::MapLayerGroupInterface.
MapLayerInterface * Updraft::Core::MapLayerGroup::createMapLayerNoInsert | ( | osg::Node * | layer, |
const QString & | title, | ||
int | pos = -1 |
||
) | [private, virtual] |
Add map layer without adding it to scene.
Implements Updraft::MapLayerGroupInterface.
osg::Group * Updraft::Core::MapLayerGroup::getNodeGroup | ( | ) | [virtual] |
Returns the osg group associated with this map layer group.
Implements Updraft::MapLayerGroupInterface.
osgEarth::Util::ObjectPlacer * Updraft::Core::MapLayerGroup::getObjectPlacer | ( | ) | [virtual] |
Returns the placer associated with the mapNode.
Implements Updraft::MapLayerGroupInterface.
void Updraft::Core::MapLayerGroup::inserted | ( | Core::MapLayerGroup * | parent | ) | [private, virtual] |
Sets the parent map layer group of this map layer.
parent | The new parent group of this map layer. |
Reimplemented from Updraft::Core::MapLayer.
void Updraft::Core::MapLayerGroup::insertMapLayer | ( | MapLayerInterface * | layer, |
int | pos = -1 |
||
) | [virtual] |
Insert the map layer as a child of this group.
Implements Updraft::MapLayerGroupInterface.
bool Updraft::Core::MapLayerGroup::isVisible | ( | ) | [virtual] |
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayerGroup::removeFromScene | ( | MapLayerGroup * | group | ) | [private, virtual] |
Remove the layer from the osg group of the map layer group.
Implements Updraft::MapLayerInterface.
void Updraft::Core::MapLayerGroup::removeMapLayer | ( | MapLayerInterface * | layer | ) | [virtual] |
Remove the map layer from this group, but don't delete it.
Ownership of the layer is transfered to caller of this method.
Implements Updraft::MapLayerGroupInterface.
bool Updraft::Core::MapLayerGroup::restoreState | ( | const QByteArray & | state | ) | [virtual] |
Restore the previsously saved state.
Reimplemented from Updraft::Core::MapLayer.
QByteArray Updraft::Core::MapLayerGroup::saveState | ( | ) | [virtual] |
Save the state (check state and expanded state) of this layer (and possibly all children).
Reimplemented from Updraft::Core::MapLayer.
void Updraft::Core::MapLayerGroup::setDisabled | ( | bool | disabled | ) | [private, virtual] |
Disables or enables the map layer.
disabled | Whether the layer should be disabled. |
Reimplemented from Updraft::Core::MapLayer.
void Updraft::Core::MapLayerGroup::setVisibility | ( | bool | value | ) | [virtual] |
Displays/hides the map layer.
value | The new state of visibility. |
Implements Updraft::Core::MapLayer.
QSet<MapLayerInterface*> Updraft::Core::MapLayerGroup::mapLayers [private] |
osg::ref_ptr<osg::Group> Updraft::Core::MapLayerGroup::nodeGroup [private] |
Pointer to the subtree of the scene associated with this layer.