2016-03-16 19:07:50 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vabstractcubicbezierpath.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 16 3, 2016
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2016-03-16 19:07:50 +01: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-03-16 19:07:50 +01: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 VABSTRACTCUBICBEZIERPATH_H
|
|
|
|
#define VABSTRACTCUBICBEZIERPATH_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <qcompilerdetection.h>
|
2016-03-16 19:07:50 +01:00
|
|
|
#include <QCoreApplication>
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QPointF>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVector>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2016-09-24 19:44:06 +02:00
|
|
|
#include "vabstractbezier.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
#include "vgeometrydef.h"
|
2016-03-16 19:07:50 +01:00
|
|
|
|
|
|
|
class VPointF;
|
|
|
|
class VSpline;
|
2016-03-22 16:14:53 +01:00
|
|
|
class VSplinePoint;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2021-09-25 11:57:15 +02:00
|
|
|
QT_WARNING_PUSH
|
|
|
|
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
2021-09-25 16:18:33 +02:00
|
|
|
QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
2021-09-25 11:57:15 +02:00
|
|
|
|
2016-09-24 19:44:06 +02:00
|
|
|
class VAbstractCubicBezierPath : public VAbstractBezier
|
2016-03-16 19:07:50 +01:00
|
|
|
{
|
2022-05-20 16:08:32 +02:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(VAbstractCubicBezierPath) // NOLINT
|
2016-03-16 19:07:50 +01:00
|
|
|
public:
|
2022-05-20 16:08:32 +02:00
|
|
|
explicit VAbstractCubicBezierPath(const GOType &type, const quint32 &idObject = NULL_ID,
|
|
|
|
const Draw &mode = Draw::Calculation);
|
|
|
|
VAbstractCubicBezierPath(const VAbstractCubicBezierPath &curve) = default;
|
|
|
|
auto operator= (const VAbstractCubicBezierPath &curve) -> VAbstractCubicBezierPath&;
|
|
|
|
~VAbstractCubicBezierPath() override;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
virtual auto CountSubSpl() const -> qint32 =0;
|
|
|
|
virtual auto CountPoints() const -> qint32 =0;
|
|
|
|
virtual void Clear() =0;
|
|
|
|
virtual auto GetSpline(qint32 index) const -> VSpline =0;
|
|
|
|
virtual auto GetSplinePath() const -> QVector<VSplinePoint> =0;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
auto GetPath() const -> QPainterPath override;
|
|
|
|
auto GetPoints() const -> QVector<QPointF> override;
|
|
|
|
auto GetLength() const -> qreal override;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
auto DirectionArrows() const -> QVector<DirectionArrow> override;
|
2017-06-23 13:18:31 +02:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
auto Segment(const QPointF &p) const -> int;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
auto CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2,
|
|
|
|
QPointF &spl2p3, const QString &pointName) const -> QPointF;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
auto NameForHistory(const QString &toolName) const -> QString override;
|
2016-03-17 19:12:48 +01:00
|
|
|
|
2016-03-16 19:07:50 +01:00
|
|
|
protected:
|
2022-05-20 16:08:32 +02:00
|
|
|
void CreateName() override;
|
|
|
|
void CreateAlias() override;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
2022-05-20 16:08:32 +02:00
|
|
|
virtual auto FirstPoint() const -> VPointF =0;
|
|
|
|
virtual auto LastPoint() const -> VPointF =0;
|
2016-03-16 19:07:50 +01:00
|
|
|
};
|
|
|
|
|
2021-09-25 11:57:15 +02:00
|
|
|
QT_WARNING_POP
|
|
|
|
|
2016-03-16 19:07:50 +01:00
|
|
|
#endif // VABSTRACTCUBICBEZIERPATH_H
|