2016-03-16 19:07:50 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vabstractcubicbezierpath.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 16 3, 2016
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2016 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 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
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
class QPainterPath;
|
|
|
|
class QPointF;
|
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
|
|
|
|
2016-09-24 19:44:06 +02:00
|
|
|
class VAbstractCubicBezierPath : public VAbstractBezier
|
2016-03-16 19:07:50 +01:00
|
|
|
{
|
|
|
|
Q_DECLARE_TR_FUNCTIONS(VAbstractCubicBezierPath)
|
|
|
|
public:
|
|
|
|
VAbstractCubicBezierPath(const GOType &type, const quint32 &idObject = NULL_ID,
|
|
|
|
const Draw &mode = Draw::Calculation);
|
|
|
|
VAbstractCubicBezierPath(const VAbstractCubicBezierPath &curve);
|
|
|
|
VAbstractCubicBezierPath& operator= (const VAbstractCubicBezierPath &curve);
|
|
|
|
virtual ~VAbstractCubicBezierPath();
|
|
|
|
|
|
|
|
virtual qint32 CountSubSpl() const =0;
|
|
|
|
virtual qint32 CountPoints() const =0;
|
|
|
|
virtual void Clear() =0;
|
|
|
|
virtual VSpline GetSpline(qint32 index) const =0;
|
2016-03-22 16:14:53 +01:00
|
|
|
virtual QVector<VSplinePoint> GetSplinePath() const =0;
|
2016-03-16 19:07:50 +01:00
|
|
|
|
|
|
|
virtual QPainterPath GetPath(PathDirection direction = PathDirection::Hide) const Q_DECL_OVERRIDE;
|
|
|
|
virtual QVector<QPointF> GetPoints() const Q_DECL_OVERRIDE;
|
|
|
|
virtual qreal GetLength() const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
int Segment(const QPointF &p) const;
|
|
|
|
|
|
|
|
QPointF CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2,
|
|
|
|
QPointF &spl2p3) const;
|
|
|
|
|
2016-03-17 19:12:48 +01:00
|
|
|
virtual QString NameForHistory(const QString &toolName) const Q_DECL_OVERRIDE;
|
|
|
|
|
2016-03-16 19:07:50 +01:00
|
|
|
protected:
|
|
|
|
virtual void CreateName() Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
virtual VPointF FirstPoint() const =0;
|
|
|
|
virtual VPointF LastPoint() const =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VABSTRACTCUBICBEZIERPATH_H
|