2016-05-12 21:11:21 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file dialogrotation.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 10 4, 2016
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2016-05-12 21:11:21 +02:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2016 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2016-05-12 21:11:21 +02:00
|
|
|
**
|
|
|
|
** 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 DIALOGROTATION_H
|
|
|
|
#define DIALOGROTATION_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <qcompilerdetection.h>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVector>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
#include "../vmisc/def.h"
|
2016-05-12 21:11:21 +02:00
|
|
|
#include "dialogtool.h"
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class DialogRotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
class DialogRotation : public DialogTool
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-02-11 12:25:27 +01:00
|
|
|
explicit DialogRotation(const VContainer *data, quint32 toolId, QWidget *parent = nullptr);
|
2016-05-12 21:11:21 +02:00
|
|
|
virtual ~DialogRotation();
|
|
|
|
|
|
|
|
quint32 GetOrigPointId() const;
|
2019-02-11 12:25:27 +01:00
|
|
|
void SetOrigPointId(quint32 value);
|
2016-05-12 21:11:21 +02:00
|
|
|
|
|
|
|
QString GetAngle() const;
|
|
|
|
void SetAngle(const QString &value);
|
|
|
|
|
|
|
|
QString GetSuffix() const;
|
|
|
|
void SetSuffix(const QString &value);
|
|
|
|
|
|
|
|
QVector<quint32> GetObjects() const;
|
|
|
|
|
2020-03-18 13:45:47 +01:00
|
|
|
QString GetVisibilityGroupName() const;
|
|
|
|
void SetVisibilityGroupName(const QString &name);
|
|
|
|
|
|
|
|
bool HasLinkedVisibilityGroup() const;
|
|
|
|
void SetHasLinkedVisibilityGroup(bool linked);
|
|
|
|
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual void ShowDialog(bool click) override;
|
2016-05-12 21:11:21 +02:00
|
|
|
|
|
|
|
public slots:
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual void ChosenObject(quint32 id, const SceneObject &type) override;
|
|
|
|
virtual void SelectedObject(bool selected, quint32 object, quint32 tool) override;
|
2016-05-12 21:11:21 +02:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
/** @brief DeployAngleTextEdit grow or shrink formula input */
|
|
|
|
void DeployAngleTextEdit();
|
|
|
|
void FXAngle();
|
|
|
|
void SuffixChanged();
|
2020-03-18 13:45:47 +01:00
|
|
|
void GroupNameChanged();
|
2019-02-11 12:25:27 +01:00
|
|
|
void EvalAngle();
|
2016-05-12 21:11:21 +02:00
|
|
|
|
|
|
|
protected:
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual void ShowVisualization() override;
|
2016-05-12 21:11:21 +02:00
|
|
|
|
|
|
|
/** @brief SaveData Put dialog data in local variables */
|
2018-06-26 14:53:48 +02:00
|
|
|
virtual void SaveData() override;
|
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
2019-02-11 12:25:27 +01:00
|
|
|
virtual bool IsValid() const final;
|
2016-05-12 21:11:21 +02:00
|
|
|
|
2016-05-18 15:57:17 +02:00
|
|
|
private slots:
|
|
|
|
void PointChanged();
|
|
|
|
|
2016-05-12 21:11:21 +02:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(DialogRotation)
|
|
|
|
Ui::DialogRotation *ui;
|
|
|
|
|
|
|
|
/** @brief timerAngle timer of check formula of angle */
|
|
|
|
QTimer *timerAngle;
|
|
|
|
|
|
|
|
/** @brief angle formula of angle */
|
|
|
|
QString formulaAngle;
|
|
|
|
|
|
|
|
/** @brief formulaBaseHeightAngle base height defined by dialogui */
|
|
|
|
int formulaBaseHeightAngle;
|
|
|
|
|
|
|
|
QList<quint32> objects;
|
|
|
|
|
|
|
|
bool stage1;
|
|
|
|
|
2016-05-24 12:29:13 +02:00
|
|
|
QString m_suffix;
|
|
|
|
|
2017-03-29 12:09:49 +02:00
|
|
|
bool m_firstRelease;
|
|
|
|
|
2019-02-11 12:25:27 +01:00
|
|
|
/** @brief flagAngle true if value of angle is correct */
|
|
|
|
bool flagAngle;
|
|
|
|
bool flagName;
|
2020-03-18 13:45:47 +01:00
|
|
|
bool flagGroupName;
|
2019-02-11 12:25:27 +01:00
|
|
|
bool flagError;
|
2016-05-12 21:11:21 +02:00
|
|
|
};
|
|
|
|
|
2019-02-11 12:25:27 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline bool DialogRotation::IsValid() const
|
|
|
|
{
|
2020-03-18 13:45:47 +01:00
|
|
|
return flagAngle && flagName && flagError && flagGroupName;
|
2019-02-11 12:25:27 +01:00
|
|
|
}
|
|
|
|
|
2016-05-12 21:11:21 +02:00
|
|
|
#endif // DIALOGROTATION_H
|