Files
qt5-legatus-legacy/Lts/Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_edit.h
T
2026-08-13 18:33:10 +02:00

70 lines
1.8 KiB
C++
Executable File

/**
* @RDE_HEADER@
* AreaEffectSimulation - Explosion Edit Dialog
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2016-07-07
*/
#pragma once
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
#include <AreaEffectSimulation/aes_ftc.h>
class QDoubleSpinBox;
namespace Ui
{
class GasPipeEdit;
}
namespace AreaEffectSimulation
{
class GasPipeEdit final
: public BaseEdit
, protected AreaEffectSimulation::Interface::Ftc::GasPipeModifyReplyHandler
{
Q_OBJECT
public:
explicit GasPipeEdit(const QString &menuGroup, QWidget *parent = nullptr);
~GasPipeEdit();
QString dialogIdentifier() const override
{
return m_aesItem.id() <= 0 ? QStringLiteral("AddGasPipe") : QStringLiteral("EditGasPipe%1").arg(m_aesItem.id());
}
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
void onGasPipeModifyReply(const Core::FunctionReplyObject &replyObject) override final { onAesItemModifyReply(replyObject); }
private:
void retranslate() override;
std::vector<LtsCoordWidget::LtsCoordWidget *> coordWidgets() const override;
static constexpr int s_minWidth = 5;
static constexpr int s_maxWidth = 50;
static constexpr int s_stepWidth = 1;
static constexpr int s_maxLength = 1000;
static constexpr int s_maxSegments = 11;
void setData(const GasPipe &aesItem, bool copy);
void enableUiElements(bool enable) override;
AesItem aesItem(int aesItemId) const;
double getMaxLength() const override { return s_maxLength; }
private Q_SLOTS:
void getPolygon();
void onPolygonData(const double width, const QVector<QPointF> &polygon, const QPolygonF &bufferOutlinePolygon);
bool apply() override;
void showPreviewObject() override;
private:
Ui::GasPipeEdit *m_ui;
QPolygonF m_previewPolygon;
};
} //namespace AreaEffectSimulation