2013-11-15 13:41:26 +01:00
|
|
|
/************************************************************************
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
** @file dialogspline.h
|
2014-04-30 07:38:52 +02:00
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
** @date November 15, 2013
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2013-11-15 13:41:26 +01:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-18 21:16:19 +02:00
|
|
|
** 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.
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
** 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/>.
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
*************************************************************************/
|
2013-09-18 21:16:19 +02:00
|
|
|
|
2013-08-05 10:37:56 +02:00
|
|
|
#ifndef DIALOGSPLINE_H
|
|
|
|
#define DIALOGSPLINE_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSharedPointer>
|
|
|
|
#include <QString>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2016-02-15 10:02:55 +01:00
|
|
|
#include "../vgeometry/vspline.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
#include "../vmisc/def.h"
|
|
|
|
#include "dialogtool.h"
|
|
|
|
|
2013-11-04 21:35:15 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
2023-07-13 16:49:20 +02:00
|
|
|
class DialogSpline;
|
2013-08-05 10:37:56 +02:00
|
|
|
}
|
|
|
|
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
|
|
|
* @brief The DialogSpline class dialog for ToolSpline. Help create spline and edit option.
|
|
|
|
*/
|
2024-03-02 14:24:09 +01:00
|
|
|
class DialogSpline final : public DialogTool
|
2013-11-04 21:35:15 +01:00
|
|
|
{
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_OBJECT // NOLINT
|
2023-07-13 16:49:20 +02:00
|
|
|
|
2013-08-05 10:37:56 +02:00
|
|
|
public:
|
2023-10-07 11:47:43 +02:00
|
|
|
DialogSpline(const VContainer *data, VAbstractPattern *doc, quint32 toolId, QWidget *parent = nullptr);
|
2023-07-13 16:49:20 +02:00
|
|
|
~DialogSpline() override;
|
2014-06-02 16:28:02 +02:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetSpline() const -> VSpline;
|
2023-07-13 16:49:20 +02:00
|
|
|
void SetSpline(const VSpline &spline);
|
2014-06-02 16:28:02 +02:00
|
|
|
|
2023-07-13 16:49:20 +02:00
|
|
|
void SetNotes(const QString ¬es);
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetNotes() const -> QString;
|
2020-10-28 13:09:56 +01:00
|
|
|
|
2013-08-05 10:37:56 +02:00
|
|
|
public slots:
|
2023-07-13 16:49:20 +02:00
|
|
|
void ChosenObject(quint32 id, const SceneObject &type) override;
|
|
|
|
void PointNameChanged() override;
|
|
|
|
void ShowDialog(bool click) override;
|
|
|
|
|
2014-08-13 12:20:30 +02:00
|
|
|
protected:
|
2023-07-13 16:49:20 +02:00
|
|
|
void ShowVisualization() override;
|
2014-08-13 12:20:30 +02:00
|
|
|
/**
|
|
|
|
* @brief SaveData Put dialog data in local variables
|
|
|
|
*/
|
2023-07-13 16:49:20 +02:00
|
|
|
void SaveData() override;
|
|
|
|
void closeEvent(QCloseEvent *event) override;
|
2023-08-05 16:51:23 +02:00
|
|
|
void changeEvent(QEvent *event) override;
|
2024-03-02 14:24:09 +01:00
|
|
|
auto IsValid() const -> bool override;
|
2023-07-13 16:49:20 +02:00
|
|
|
|
2016-02-25 20:23:16 +01:00
|
|
|
private slots:
|
|
|
|
void DeployAngle1TextEdit();
|
|
|
|
void DeployAngle2TextEdit();
|
|
|
|
void DeployLength1TextEdit();
|
|
|
|
void DeployLength2TextEdit();
|
|
|
|
|
|
|
|
void FXAngle1();
|
|
|
|
void FXAngle2();
|
|
|
|
void FXLength1();
|
|
|
|
void FXLength2();
|
2019-02-11 12:25:27 +01:00
|
|
|
|
|
|
|
void EvalAngle1();
|
|
|
|
void EvalAngle2();
|
|
|
|
void EvalLength1();
|
|
|
|
void EvalLength2();
|
2020-11-04 14:25:23 +01:00
|
|
|
|
|
|
|
void ValidateAlias();
|
2023-07-13 16:49:20 +02:00
|
|
|
|
2013-08-05 10:37:56 +02:00
|
|
|
private:
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_DISABLE_COPY_MOVE(DialogSpline) // NOLINT
|
2014-06-02 16:28:02 +02:00
|
|
|
|
|
|
|
/** @brief ui keeps information about user interface */
|
2013-08-05 10:37:56 +02:00
|
|
|
Ui::DialogSpline *ui;
|
2014-06-02 16:28:02 +02:00
|
|
|
|
2016-02-15 10:02:55 +01:00
|
|
|
/** @brief spl spline */
|
2023-07-13 16:49:20 +02:00
|
|
|
VSpline spl{};
|
2014-06-02 16:28:02 +02:00
|
|
|
|
2023-07-13 16:49:20 +02:00
|
|
|
qint32 newDuplicate{-1};
|
2016-02-15 15:30:48 +01:00
|
|
|
|
2016-02-25 20:23:16 +01:00
|
|
|
/** @brief formulaBaseHeight base height defined by dialogui */
|
2023-07-13 16:49:20 +02:00
|
|
|
int formulaBaseHeightAngle1{0};
|
|
|
|
int formulaBaseHeightAngle2{0};
|
|
|
|
int formulaBaseHeightLength1{0};
|
|
|
|
int formulaBaseHeightLength2{0};
|
2016-02-25 20:23:16 +01:00
|
|
|
|
|
|
|
/** @brief timerAngle1 timer of check first angle formula */
|
|
|
|
QTimer *timerAngle1;
|
|
|
|
QTimer *timerAngle2;
|
|
|
|
QTimer *timerLength1;
|
|
|
|
QTimer *timerLength2;
|
|
|
|
|
|
|
|
/** @brief flagAngle1 true if value of first angle is correct */
|
2023-07-13 16:49:20 +02:00
|
|
|
bool flagAngle1{false};
|
|
|
|
bool flagAngle2{false};
|
|
|
|
bool flagLength1{false};
|
|
|
|
bool flagLength2{false};
|
|
|
|
bool flagError{false};
|
2020-11-04 14:25:23 +01:00
|
|
|
bool flagAlias{true};
|
2016-02-25 20:23:16 +01:00
|
|
|
|
2020-11-07 10:18:13 +01:00
|
|
|
QString originAliasSuffix{};
|
|
|
|
|
2022-08-22 08:15:09 +02:00
|
|
|
/** @brief number number of handled objects */
|
|
|
|
qint32 number{0};
|
|
|
|
|
2024-04-16 16:34:23 +02:00
|
|
|
auto GetP1() const -> QSharedPointer<VPointF>;
|
|
|
|
auto GetP4() const -> QSharedPointer<VPointF>;
|
2016-02-25 20:23:16 +01:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto CurrentSpline() const -> VSpline;
|
2023-08-05 16:51:23 +02:00
|
|
|
|
|
|
|
void InitIcons();
|
2013-08-05 10:37:56 +02:00
|
|
|
};
|
|
|
|
|
2019-02-11 12:25:27 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
inline auto DialogSpline::IsValid() const -> bool
|
2019-02-11 12:25:27 +01:00
|
|
|
{
|
2020-11-04 14:25:23 +01:00
|
|
|
return flagAngle1 && flagAngle2 && flagLength1 && flagLength2 && flagError && flagAlias;
|
2019-02-11 12:25:27 +01:00
|
|
|
}
|
|
|
|
|
2013-08-05 10:37:56 +02:00
|
|
|
#endif // DIALOGSPLINE_H
|