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

68 lines
1.7 KiB
C++
Executable File

/**
* @RDE_HEADER@
* AreaEffectSimulation - Functional Area Edit Dialog
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Dassow, SLEA, 2017-06-09
*/
#pragma once
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <QPolygonF>
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 &centerPoint, double width, double height, const QPolygonF &coordinates);
bool apply() override;
void showPreviewObject() override;
private:
Ui::TechnicalAreaEdit *m_ui;
QPolygonF m_previewPolygon;
};
} //namespace AreaEffectSimulation