Files
qt5-legatus-legacy/Lts/Services/AreaEffectSimulation/_object_explosion_single_central.h
T
2026-08-13 18:33:10 +02:00

64 lines
1.8 KiB
C++
Executable File

/**
* Handler for one indirect fire single object
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "aes_db.h"
#include "object_base.h"
#include <CentralEffectSimulation/ces_ftc.h>
#include <LtsUtilsCore/qpoint3d.h>
#include <QObject>
using Trajectory = QPair<QPolygonF, QVector<double>>;
using DetonationLocationRequest = CentralEffectSimulation::DetonationLocationRequest;
using DetonationLocationReply = CentralEffectSimulation::DetonationLocationReply;
namespace AreaEffectSimulation
{
class ObjectExplosionSingleCentral final
: protected CentralEffectSimulation::Interface::Ftc::DetonationLocationReplyHandler
{
Q_OBJECT
public:
explicit ObjectExplosionSingleCentral(MainHandler *mainHandler, QObject *parent = nullptr);
~ObjectExplosionSingleCentral();
Core::FunctionReplyObject updateObject(const Database::AesExplosionSingleCentral &data) override;
std::vector<Core::GeoPosition> form() const override { return m_aivTrajectory.form(); }
QPolygonF generateForm() override;
AesType aesType() const override { return AesType::AtExplosionSingleCentral; }
bool isCentral() const override { return m_data.isCentral; }
void removeTopics();
protected slots:
void onPublishData() override;
void onDetonationLocationReply(const DetonationLocationReply &reply) override;
protected:
double chargeRadius() const;
void adjustTrajectoryToDetonationLocation(const Core::GeoPosition &detonationLocation);
void publishTrajectoryAiv();
void publishDetonationAiv();
private:
QPointF positionOf(int participantId);
DetonationLocationRequest detonationLocationRequest(const Trajectory &trajectory) const;
private:
AesItemView m_aivDetonation;
AesItemView m_aivTrajectory;
std::vector<Core::GeoPosition> m_trajectory;
Core::GeoPosition m_detonationLocation;
};
}