valentina/src/libs/vtools/dialogs/tools/dialogcubicbezier.h

107 lines
3.1 KiB
C
Raw Normal View History

/************************************************************************
**
** @file dialogcubicbezier.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 3, 2016
**
** @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) 2016 Valentina project
** <https://gitlab.com/smart-pattern/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 DIALOGCUBICBEZIER_H
#define DIALOGCUBICBEZIER_H
#include <QMetaObject>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QtGlobal>
#include "../vgeometry/vcubicbezier.h"
#include "../vmisc/def.h"
#include "dialogtool.h"
namespace Ui
{
2023-07-13 16:49:20 +02:00
class DialogCubicBezier;
}
2024-03-02 14:24:09 +01:00
class DialogCubicBezier final : public DialogTool
{
2022-08-12 17:50:13 +02:00
Q_OBJECT // NOLINT
public:
2024-03-02 14:24:09 +01:00
explicit DialogCubicBezier(const VContainer *data, VAbstractPattern *doc, quint32 toolId,
QWidget *parent = nullptr);
2023-07-13 16:49:20 +02:00
~DialogCubicBezier() override;
2023-05-03 13:07:02 +02:00
auto GetSpline() const -> VCubicBezier;
2023-07-13 16:49:20 +02:00
void SetSpline(const VCubicBezier &spline);
2020-10-28 13:09:56 +01:00
2023-07-13 16:49:20 +02:00
void SetNotes(const QString &notes);
2023-05-03 13:07:02 +02:00
auto GetNotes() const -> QString;
2023-07-13 16:49:20 +02:00
public slots:
2023-07-13 16:49:20 +02:00
void ChosenObject(quint32 id, const SceneObject &type) override;
void PointNameChanged() override;
protected:
2023-07-13 16:49:20 +02:00
void ShowVisualization() override;
/**
* @brief SaveData Put dialog data in local variables
*/
2023-07-13 16:49:20 +02:00
void SaveData() override;
2024-03-02 14:24:09 +01:00
auto IsValid() const -> bool override;
2020-11-04 13:34:22 +01:00
private slots:
void ValidateAlias();
2023-07-13 16:49:20 +02:00
private:
2022-08-12 17:50:13 +02:00
Q_DISABLE_COPY_MOVE(DialogCubicBezier) // NOLINT
Ui::DialogCubicBezier *ui;
/** @brief spl spline */
VCubicBezier spl;
qint32 newDuplicate;
bool flagError;
2020-11-04 13:34:22 +01:00
bool flagAlias{true};
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};
2023-05-03 13:07:02 +02:00
auto GetP1() const -> const QSharedPointer<VPointF>;
auto GetP2() const -> const QSharedPointer<VPointF>;
auto GetP3() const -> const QSharedPointer<VPointF>;
auto GetP4() const -> const QSharedPointer<VPointF>;
};
//---------------------------------------------------------------------------------------------------------------------
2023-05-03 13:07:02 +02:00
inline auto DialogCubicBezier::IsValid() const -> bool
{
2020-11-04 13:34:22 +01:00
return flagError && flagAlias;
}
#endif // DIALOGCUBICBEZIER_H