/** * Handler for one indirect fire single object * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include "aes_db.h" #include "object_base.h" #include #include #include using Trajectory = QPair>; 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 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 m_trajectory; Core::GeoPosition m_detonationLocation; }; }