- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
185 lines
5.1 KiB
C++
Executable File
185 lines
5.1 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
|
#include <NGLLogger/INGLLogger.h>
|
|
|
|
#include <QAbstractItemModel>
|
|
#include <QJsonObject>
|
|
|
|
|
|
namespace PlanOverlaysPlugin
|
|
{
|
|
|
|
class PlanOverlayModel final : public QAbstractItemModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum class ColumnSection
|
|
{
|
|
OrderButtons = 0,
|
|
PlanName,
|
|
MinScale,
|
|
MaxScale,
|
|
Opacity,
|
|
CustomSection,
|
|
ExerciseId,
|
|
PhaseId
|
|
};
|
|
|
|
PlanOverlayModel();
|
|
~PlanOverlayModel();
|
|
|
|
|
|
|
|
int columnCount(const QModelIndex &) const override;
|
|
int rowCount(const QModelIndex &) const override;
|
|
int size() const;
|
|
|
|
bool isEmpty() const;
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::ItemDataRole::DisplayRole) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::ItemDataRole::DisplayRole) const override;
|
|
|
|
QModelIndex index(int row, int column, const QModelIndex &) const override { return createIndex(row, column); }
|
|
QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); }
|
|
Qt::ItemFlags flags(const QModelIndex &modelIndex) const override;
|
|
QModelIndex index(int row, int column) const { return index(row, column, QModelIndex()); }
|
|
|
|
QStringList mimeTypes() const override;
|
|
|
|
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
|
|
|
Qt::DropActions supportedDragActions() const override { return Qt::CopyAction | Qt::MoveAction; }
|
|
Qt::DropActions supportedDropActions() const override { return Qt::CopyAction | Qt::MoveAction; }
|
|
|
|
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &) const override;
|
|
|
|
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &) override;
|
|
|
|
|
|
|
|
struct PlanItem
|
|
{
|
|
int m_keyId = -1;
|
|
int m_folderId = -1;
|
|
int m_fileId = -1;
|
|
int m_exerciseId = -1;
|
|
int m_phaseId = -1;
|
|
QString m_dirPath;
|
|
QString m_fileName;
|
|
double m_minScale = 0.0;
|
|
double m_maxScale = 0.0;
|
|
double m_opacity = 0.0;
|
|
bool m_visibility = true;
|
|
|
|
bool isValid() const { return m_keyId > 0; }
|
|
QJsonObject toJson() const
|
|
{
|
|
QJsonObject obj;
|
|
|
|
obj[QStringLiteral("keyId")] = m_keyId;
|
|
obj[QStringLiteral("folderId")] = m_folderId;
|
|
obj[QStringLiteral("fileId")] = m_fileId;
|
|
obj[QStringLiteral("fileName")] = m_fileName;
|
|
|
|
obj[QStringLiteral("exerciseId")] = m_exerciseId;
|
|
obj[QStringLiteral("phaseId")] = m_phaseId;
|
|
|
|
obj[QStringLiteral("opacity")] = m_opacity;
|
|
obj[QStringLiteral("maxScale")] = m_maxScale;
|
|
obj[QStringLiteral("minScale")] = m_minScale;
|
|
obj[QStringLiteral("visibility")] = m_visibility;
|
|
|
|
return obj;
|
|
}
|
|
|
|
static PlanItem fromJson(const QJsonObject &obj)
|
|
{
|
|
PlanItem pi;
|
|
|
|
pi.m_keyId = obj[QStringLiteral("keyId")].toInt();
|
|
pi.m_folderId = obj[QStringLiteral("folderId")].toInt();
|
|
pi.m_fileId = obj[QStringLiteral("fileId")].toInt();
|
|
pi.m_fileName = obj[QStringLiteral("fileName")].toInt();
|
|
|
|
pi.m_exerciseId = obj[QStringLiteral("exerciseId")].toInt();
|
|
pi.m_phaseId = obj[QStringLiteral("phaseId")].toInt();
|
|
|
|
pi.m_opacity = obj[QStringLiteral("opacity")].toDouble();
|
|
pi.m_maxScale = obj[QStringLiteral("maxScale")].toDouble();
|
|
pi.m_minScale = obj[QStringLiteral("minScale")].toDouble();
|
|
pi.m_visibility = obj[QStringLiteral("visibility")].toBool();
|
|
|
|
return pi;
|
|
}
|
|
|
|
};
|
|
|
|
QMap<unsigned int, PlanItem> planStore() const;
|
|
|
|
PlanItem planItem(int keyId);
|
|
|
|
PlanItem planItemValue(int keyId);
|
|
|
|
PlanItem planItemAtRow(int row);
|
|
|
|
PlanItem findPlanItemByFileId(int fileId);
|
|
|
|
int getRowOfId(int keyId) const;
|
|
|
|
void updatePlanItem(const PlanItem &planItem);
|
|
|
|
void renewPlanItem(const PlanItem &planItem);
|
|
|
|
void setMinScale(int row, double scale);
|
|
void setMaxScale(int row, double scale);
|
|
void setOpacity(int row, double opacity);
|
|
|
|
void swapRow(int row1, int row2);
|
|
|
|
void removeOverlay(int keyId);
|
|
|
|
void setFileDialogMimeType(const QString &mimeType);
|
|
|
|
void updateOverlay(int keyId);
|
|
|
|
bool reInitModel(int exerciseId, int phaseId);
|
|
|
|
void updateOrderOfPlans() const;
|
|
|
|
QJsonArray toJson() const;
|
|
|
|
signals:
|
|
|
|
void requestLoadPlan(int keyId);
|
|
void requestReloadPlan(int keyId);
|
|
void requestUpdatePlan(int keyId);
|
|
void requestRemovePlan(int keyId);
|
|
|
|
void requestReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayModel::PlanItem &planItem, int exerciseId, int phaseId, bool *removeFromModel);
|
|
|
|
void planMinScaleChanged(int keyId, double minScale);
|
|
void planMaxScaleChanged(int keyId, double maxScale);
|
|
void planOpacityChanged(int keyId, double opacity);
|
|
|
|
void planOrderChanged(const QVector<int> &newIdOrder);
|
|
|
|
void dropPlanAccepted();
|
|
|
|
private:
|
|
|
|
PlanItem &planItemRef(int keyId);
|
|
|
|
class InternalData;
|
|
|
|
InternalData *m_internal;
|
|
};
|
|
|
|
}
|