Files
qt5-legatus-legacy/Lts/Plugins/CollateralDamageSimulation/Gui/CreateSimulation/cds_plan_creator.h
T
2026-08-13 18:33:10 +02:00

93 lines
2.9 KiB
C++
Executable File

/**
The PlanCreator class creates a tactical plan with the information given by a collateral damage simulation
* @RDE_HEADER@
* $Id: ppm_msdl_edit.h 52239 2020-10-05 11:33:12Z thoden $
* $HeadURL: svn://192.168.133.21/TDS/branches/product/features/3dws_devel/Lts/Plugins/ParticipantManagement/Gui/MSDL/ppm_msdl_edit.h $
* $Author: thoden $
* Created by Hannes Fritsche, ESZS, 2024-08-20
*/
#pragma once
#include <QObject>
#include <QVector>
#include <QMap>
#include <memory>
#include <SymbologyXML/symbol_types.h>
#include <ParticipantManagement/ppm_enums.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <SituationMap/GeometryModel/geometry_model.h>
namespace FileManagement
{
namespace Interface
{
class Ftc;
}
}
namespace InfrastructureManagement
{
namespace Interface
{
class Dtc;
}
}
namespace CollateralDamageSimulation
{
enum class ProtectionState
{
WithProtection = 2,
WithoutProtection = 4,
Underground = 5,
};
class PlanCreator : public QObject
{
Q_OBJECT
public:
explicit PlanCreator(QWidget *parent = nullptr);
~PlanCreator();
void init(const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc,
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
const std::shared_ptr<FileManagement::Interface::Ftc> &flmFtc);
void addBuildings(const QHash<int, QPolygonF> &buildingFootprints, const QVector<int> &directlyHitBuildings);
void addProtectionAreas(const QVector<QPolygonF> &protectionAreas);
void addDetonationArea(const QPointF &impactPosition, double lethalRadius, double nonLethalRadius = 0.0);
void addParticipantsWithProtection(const QVector<int> &participantIds);
void addParticipantsWithoutProtection(const QVector<int> &participantIds);
void addParticipantsInUnderground(const QVector<int> &participantIds);
void save(const QString &name, int folderId, int exerciseId);
void clear();
private: // methods
void warnSafeDidNotWork(const QString &message);
void addBuilding(const QPolygonF &footprint, bool isDirectlyHit);
void addParticipants(const QVector<int> &participantIds, ProtectionState protectionState);
void addParticipant(int participantId, ProtectionState protectionState);
void addProtectionArea(const QPolygonF &areaPolygon);
SymbologyXML::SymbolTypes::t_affil partyRoleToSymbolAffiliation(const ParticipantManagement::Role &partyRole) const;
private: // attributes
QList<SituationMap::GeometryModel::Node> m_protectionAreas;
QList<SituationMap::GeometryModel::Node> m_directlyHitBuildings;
SituationMap::GeometryModel *m_geometryModel { nullptr };
std::shared_ptr<FileManagement::Interface::Ftc> m_flmFtc;
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
QMap<int, ParticipantManagement::Party> m_partyCache;
};
} // namespace CollateralDamageSimulation