2017-10-15 11:25:20 +02:00
|
|
|
|
/************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** @file dialogplacelabel.h
|
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
|
** @date 14 10, 2017
|
|
|
|
|
**
|
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
|
|
|
|
** This source code is part of the Valentina project, a pattern making
|
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
|
** Copyright (C) 2017 Valentina project
|
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
|
**
|
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
#ifndef DIALOGPLACELABEL_H
|
|
|
|
|
#define DIALOGPLACELABEL_H
|
|
|
|
|
|
2017-10-24 13:14:59 +02:00
|
|
|
|
#include "../dialogtool.h"
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
|
{
|
|
|
|
|
class DialogPlaceLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VPlaceLabelItem;
|
|
|
|
|
|
|
|
|
|
class DialogPlaceLabel : public DialogTool
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit DialogPlaceLabel(const VContainer *data, quint32 toolId, QWidget *parent = nullptr);
|
|
|
|
|
virtual ~DialogPlaceLabel();
|
|
|
|
|
|
|
|
|
|
void EnbleShowMode(bool disable);
|
|
|
|
|
|
|
|
|
|
quint32 GetCenterPoint() const;
|
|
|
|
|
void SetCenterPoint(quint32 id);
|
|
|
|
|
|
|
|
|
|
PlaceLabelType GetLabelType() const;
|
|
|
|
|
void SetLabelType(PlaceLabelType type);
|
|
|
|
|
|
|
|
|
|
QString GetWidth() const;
|
|
|
|
|
void SetWidth(const QString &value);
|
|
|
|
|
|
|
|
|
|
QString GetHeight() const;
|
|
|
|
|
void SetHeight(const QString &value);
|
|
|
|
|
|
|
|
|
|
QString GetAngle() const;
|
|
|
|
|
void SetAngle(const QString &value);
|
|
|
|
|
|
|
|
|
|
quint32 GetPieceId() const;
|
|
|
|
|
void SetPieceId(quint32 id);
|
|
|
|
|
|
2018-07-20 09:30:05 +02:00
|
|
|
|
QString GetFormulaVisible() const;
|
|
|
|
|
void SetFormulaVisible(const QString &formula);
|
|
|
|
|
|
2018-06-26 14:53:48 +02:00
|
|
|
|
virtual void SetPiecesList(const QVector<quint32> &list) override;
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
public slots:
|
2018-06-26 14:53:48 +02:00
|
|
|
|
virtual void ChosenObject(quint32 id, const SceneObject &type) override;
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
protected:
|
2018-06-26 14:53:48 +02:00
|
|
|
|
virtual void ShowVisualization() override;
|
|
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
2019-02-11 12:25:27 +01:00
|
|
|
|
virtual bool IsValid() const final;
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void DeployFormulaWidthEdit();
|
|
|
|
|
void DeployFormulaHeightEdit();
|
|
|
|
|
void DeployFormulaAngleEdit();
|
2018-07-20 09:30:05 +02:00
|
|
|
|
void DeployVisibleFormulaTextEdit();
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
void EvalWidth();
|
|
|
|
|
void EvalHeight();
|
|
|
|
|
void EvalAngle();
|
2018-07-20 09:30:05 +02:00
|
|
|
|
void EvalVisible();
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
void FXWidth();
|
|
|
|
|
void FXHeight();
|
|
|
|
|
void FXAngle();
|
2018-07-20 09:30:05 +02:00
|
|
|
|
void FXVisible();
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Q_DISABLE_COPY(DialogPlaceLabel)
|
|
|
|
|
Ui::DialogPlaceLabel *ui;
|
|
|
|
|
bool m_showMode;
|
|
|
|
|
|
|
|
|
|
/** @brief formulaBaseHeight base height defined by dialogui */
|
|
|
|
|
int m_formulaBaseHeightWidth;
|
|
|
|
|
int m_formulaBaseHeightHeight;
|
|
|
|
|
int m_formulaBaseHeightAngle;
|
2018-07-20 09:30:05 +02:00
|
|
|
|
int m_formulaBaseVisible;
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
QTimer *timerAngle;
|
|
|
|
|
QTimer *timerWidth;
|
|
|
|
|
QTimer *timerHeight;
|
2018-07-20 09:30:05 +02:00
|
|
|
|
QTimer *m_timerVisible;
|
|
|
|
|
|
2019-02-11 12:25:27 +01:00
|
|
|
|
bool m_flagPoint;
|
|
|
|
|
bool m_flagWidth;
|
|
|
|
|
bool m_flagHeight;
|
|
|
|
|
bool m_flagAngle;
|
|
|
|
|
bool m_flagFormulaVisible;
|
|
|
|
|
bool m_flagError;
|
|
|
|
|
|
2018-07-20 09:30:05 +02:00
|
|
|
|
void InitPlaceLabelTab();
|
|
|
|
|
void InitControlTab();
|
2017-10-15 11:25:20 +02:00
|
|
|
|
|
|
|
|
|
void FillPlaceLabelTypes();
|
|
|
|
|
|
|
|
|
|
void CheckPieces();
|
|
|
|
|
void CheckPoint();
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-11 12:25:27 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
inline bool DialogPlaceLabel::IsValid() const
|
|
|
|
|
{
|
|
|
|
|
return m_flagPoint && m_flagError && m_flagWidth && m_flagHeight && m_flagAngle && m_flagFormulaVisible;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-15 11:25:20 +02:00
|
|
|
|
#endif // DIALOGPLACELABEL_H
|