/** * @RDE_HEADER@ * AreaEffectSimulation - Functional Area Edit Dialog * $Id$ * $HeadURL$ * $Author$ * Created by Philipp Dassow, SLEA, 2017-06-09 */ #pragma once #include #include #include namespace Ui { class TechnicalAreaEdit; } namespace AreaEffectSimulation { class TechnicalAreaEdit final : public BaseEdit , protected AreaEffectSimulation::Interface::Ftc::TechnicalAreaModifyReplyHandler { Q_OBJECT public: explicit TechnicalAreaEdit(const QString &menuGroup, QWidget *parent = nullptr); ~TechnicalAreaEdit(); QString dialogIdentifier() const override { return m_aesItem.id() <= 0 ? QStringLiteral("AddTechnicalArea") : QStringLiteral("EditTechnicalArea%1").arg(m_aesItem.id()); } bool init(int areaId, bool copy, LtsSession::LtsSession *session); void onTechnicalAreaModifyReply(const Core::FunctionReplyObject &replyObject) override final { onAesItemModifyReply(replyObject); } private: void retranslate() override; static double s_minWidth; static double s_maxWidth; static double s_stepWidth; static double s_minHeight; static double s_maxHeight; static double s_stepHeight; void setData(const TechnicalArea &area, bool copy); void fillCbx(); void enableUiElements(bool enable) override; private Q_SLOTS: void getPosition(); void onRectData(const QPointF ¢erPoint, double width, double height, const QPolygonF &coordinates); bool apply() override; void showPreviewObject() override; private: Ui::TechnicalAreaEdit *m_ui; QPolygonF m_previewPolygon; }; } //namespace AreaEffectSimulation