79 lines
1.9 KiB
C++
Executable File
79 lines
1.9 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* PresentationManangement - Script Overview Dialog Model
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*
|
|
* Created by Mike Wille, SLSE, 2017-03-15
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Common/situation_map_logging.h>
|
|
#include <Map/map.h>
|
|
#include <QAbstractTableModel>
|
|
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
namespace SituationMap
|
|
{
|
|
struct LayerInfo
|
|
{
|
|
QString layerName;
|
|
QString displayName;
|
|
LayerType layerType = LayerType::Undefined;
|
|
int index = -1;
|
|
int opacity = 0;
|
|
int brightness = 0;
|
|
int contrast = 0;
|
|
int gamma = 0;
|
|
bool isVisible = false;
|
|
};
|
|
|
|
|
|
class LayersModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum Columns
|
|
{
|
|
Layer,
|
|
Opacity,
|
|
Brightness,
|
|
Contrast,
|
|
Gamma
|
|
};
|
|
|
|
explicit LayersModel(LtsSession::LtsSession *session, QObject *parent = nullptr);
|
|
|
|
bool initModel(Map *situationMap);
|
|
|
|
QVariant data(const QModelIndex &, int) const override final;
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
int rowCount(const QModelIndex &parent) const override final;
|
|
int columnCount(const QModelIndex &parent) const override final;
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override final;
|
|
LayerInfo getRowData(int row) const;
|
|
bool insertRow(const LayerInfo &item);
|
|
QModelIndex moveRow(const QModelIndex &sourceIndex, int destinationRow);
|
|
bool canBeMovedUp(const QModelIndex &idx) const;
|
|
bool canBeMovedDown(const QModelIndex &idx) const;
|
|
QStringList orderLayerNames() const;
|
|
|
|
bool isDisplayNameInFilter(const QString &displayName);
|
|
|
|
Q_SIGNALS:
|
|
void layerDataChanged(const QString &layerName, int newValue, int column);
|
|
void isVisibleChanged(const QString &layerName, bool isVisible);
|
|
private:
|
|
LtsSession::LtsSession *m_session{nullptr};
|
|
QVector<LayerInfo> m_vecData;
|
|
LOGGER_T m_logger;
|
|
QStringList m_layerDisplayNameFilterList{};
|
|
};
|
|
}
|