Updraft  1.0
Open source glider flight visualisation tool.
maplayergroup.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_CORE_UI_MAPLAYERGROUP_H_
00002 #define UPDRAFT_SRC_CORE_UI_MAPLAYERGROUP_H_
00003 
00004 #pragma warning(push)
00005 #pragma warning(disable:4250)
00006 
00007 #include <QtGui>
00008 #include <osg/ref_ptr>
00009 #include "../../maplayergroupinterface.h"
00010 #include "../maplayer.h"
00011 
00012 
00013 namespace osg {
00014   class Group;
00015 }
00016 
00017 namespace Updraft {
00018 namespace Core {
00019 
00024 class MapLayerGroup : public MapLayer, public MapLayerGroupInterface {
00025   Q_OBJECT
00026 
00027  public:
00032   explicit MapLayerGroup(const QString &title);
00033 
00036   explicit MapLayerGroup(QTreeWidgetItem *item);
00037 
00040   ~MapLayerGroup();
00041 
00044   MapLayerGroupInterface* createMapLayerGroup(const QString &title,
00045     int pos = -1);
00046 
00050   MapLayerInterface* createMapLayer(osg::Node* layer, const QString& title,
00051     int pos = -1);
00052 
00054   void insertMapLayer(MapLayerInterface* layer, int pos = -1);
00055 
00058   void removeMapLayer(MapLayerInterface* layer);
00059 
00061   osg::Group* getNodeGroup();
00062 
00063   osgEarth::Util::ObjectPlacer* getObjectPlacer();
00064 
00065   void setVisibility(bool value);
00066   bool isVisible();
00067 
00078   QByteArray saveState();
00079 
00082   bool restoreState(const QByteArray &state);
00083 
00084  private:
00085   void addToScene(MapLayerGroup* group);
00086   void removeFromScene(MapLayerGroup* group);
00087   void inserted(Core::MapLayerGroup* parent);
00088 
00089   void setDisabled(bool disabled);
00090 
00091   QSet<MapLayerInterface*> mapLayers;
00092 
00094   osg::ref_ptr<osg::Group> nodeGroup;
00095 
00096   MapLayerInterface* createMapLayerNoInsert
00097     (osg::Node* mapLayer, const QString& title, int pos = -1);
00098 };
00099 
00100 }  // End namespace Core
00101 }  // End namespace Updraft
00102 
00103 #pragma warning(pop)  // C2450
00104 
00105 #endif  // UPDRAFT_SRC_CORE_UI_MAPLAYERGROUP_H_
00106 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines