82 lines
2.4 KiB
C++
Executable File
82 lines
2.4 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* AreaEffectSimulation - Mine Single Virtual Edit Dialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hanna E. Rathje, SLSE, 2023-07-14
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
|
#include <Plugins/ProjectDataManagement/pdm_gui_plugin_interface.h>
|
|
#include <LtsWidgets/lts_angle_edit.h>
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class BoobyTrapEdit;
|
|
}
|
|
|
|
namespace AreaEffectSimulation
|
|
{
|
|
|
|
class BoobyTrapEdit final
|
|
: public BaseEdit
|
|
, protected AreaEffectSimulation::Interface::Ftc::BoobyTrapModifyReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit BoobyTrapEdit(const QString &menuGroup, QWidget *parent = nullptr);
|
|
~BoobyTrapEdit();
|
|
|
|
using LtsAngleEditBase = LtsWidgets::LtsAngleEdit;
|
|
|
|
QString dialogIdentifier() const override
|
|
{
|
|
return m_aesItem.id() <= 0 ? QStringLiteral("AddBoobyTrap") : QStringLiteral("EditBoobyTrap%1").arg(m_aesItem.id());
|
|
}
|
|
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
|
|
|
|
void onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject) override final { onAesItemModifyReply(replyObject); }
|
|
|
|
private:
|
|
static double s_minTriggerRadius;
|
|
static double s_maxTriggerRadius;
|
|
static double s_defaultTriggerRadius;
|
|
static double s_minImpactRadius;
|
|
static double s_maxImpactRadius;
|
|
static double s_defaultImpactRadius;
|
|
static double s_stepRadius;
|
|
static int s_minDurationHours;
|
|
static int s_maxDurationHours;
|
|
static int s_defaultCentralAngle;
|
|
|
|
void retranslate() override;
|
|
void setData(const BoobyTrap &bt, bool copy);
|
|
void enableUiElements(bool enable) override;
|
|
void setPbDangerAreaText();
|
|
|
|
private Q_SLOTS:
|
|
void getPosition();
|
|
void onChargeTypeChanged(int index);
|
|
void onCircleData(const QPointF &position, double radius);
|
|
void onCircleSectorFixRadiusData(const QPointF &position, double radius, double rotationDeg, double centralAngleDeg);
|
|
void onCircleSectorData(const QPointF &position, double radius, double rotationDeg, double centralAngleDeg);
|
|
void onTwoCircleSectorData(const QPointF &position, double radius1, double radius2, double rotationDeg, double centralAngleDeg);
|
|
bool apply() override;
|
|
void showPreviewObject() override;
|
|
|
|
private:
|
|
QPointF m_previewCircleCenter;
|
|
double m_previewCircleRadius;
|
|
double m_previewRotationDeg;
|
|
double m_previewCentralAngleDeg;
|
|
Ui::BoobyTrapEdit *m_ui;
|
|
std::shared_ptr<ProjectDataManagement::ForeignGuiInterface> m_pdmGuiIfc;
|
|
};
|
|
|
|
} //namespace AreaEffectSimulation
|