95 lines
2.5 KiB
C++
Executable File
95 lines
2.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* MapLayer
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Own
|
|
#include <Map/situation_map_types.h>
|
|
#include <Common/situation_map_logging.h>
|
|
|
|
//----------------------------------------------------------------------------
|
|
namespace SituationMap
|
|
{
|
|
|
|
class MapImpl;
|
|
|
|
|
|
class MapLayer
|
|
{
|
|
public:
|
|
|
|
explicit MapLayer(const QString &logicalName = QString(),
|
|
LayerType layerType = LayerType::Undefined);
|
|
|
|
bool isValid() const;
|
|
|
|
// for some read-only values :
|
|
QString name() const;
|
|
LayerType type() const;
|
|
// : for some read-only values
|
|
|
|
protected:
|
|
QString m_name;
|
|
LayerType m_layerType = LayerType::Undefined;
|
|
|
|
};
|
|
|
|
/**
|
|
* @brief The MapLayerOrderedList class will store an ordered List of the MapLayer.
|
|
* The List can be used to get the orderedList of layernames as well as
|
|
* control the parameters like on/off, brightness etc.
|
|
*/
|
|
class MapLayerOrderedList final : public QObject
|
|
{
|
|
Q_OBJECT
|
|
using BaseClass = QObject;
|
|
|
|
public:
|
|
MapLayerOrderedList() = default;
|
|
~MapLayerOrderedList() = default;
|
|
|
|
|
|
/**
|
|
* @brief addLayer add Layername. Will NOT be added if name already exists (regardless layerType)
|
|
* !All LayerType::Basemap will below all other!
|
|
* @param name Layername to be added. Must be unique!
|
|
* @param layerType layerType to be added (Undefined is NOT allowed)
|
|
* @return true on success, otherwise false
|
|
*/
|
|
bool addLayer(const QString &name, LayerType layerType);
|
|
bool contains(const QString &name, LayerType layerType) const;
|
|
MapLayer getLayer(const QString &name) const;
|
|
bool removeLayer(const QString &name); // layername has to be unique
|
|
int count() const;
|
|
int count(LayerType layerType) const;
|
|
|
|
/**
|
|
* @brief Order layer according new list
|
|
* @param orderedLayernamesReq requested new order
|
|
* @param bRequestedOrderIsValid if set just a check will be performed. The result bool contains the check result.
|
|
* @return true on success, otherwise false
|
|
*/
|
|
bool orderLayerTo(const QStringList &orderedLayernamesReq, bool *bRequestedOrderIsValid = nullptr);
|
|
|
|
|
|
QStringList layerNamesOrdered() const;
|
|
QStringList layerNamesOrdered(LayerType layerType) const;
|
|
|
|
|
|
protected:
|
|
QStringList layernamesOfType(const QStringList &layernames, LayerType layerType);
|
|
QStringList layernamesOfTypeOther(const QStringList &layernames);
|
|
QList<MapLayer> m_mapLayerList; ///< using logical layernames
|
|
};
|
|
|
|
|
|
|
|
} // namespace SituationMap
|
|
|
|
|