2016-11-03 16:59:53 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 3 11, 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 VPIECE_H
|
|
|
|
#define VPIECE_H
|
|
|
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
#include <QSharedDataPointer>
|
|
|
|
|
2016-11-03 19:15:53 +01:00
|
|
|
#include "../vlayout/vabstractpiece.h"
|
|
|
|
|
2016-11-05 09:56:44 +01:00
|
|
|
class QPainterPath;
|
2016-11-03 16:59:53 +01:00
|
|
|
class VPieceData;
|
|
|
|
class VPieceNode;
|
2016-11-03 19:15:53 +01:00
|
|
|
class QPointF;
|
|
|
|
class VContainer;
|
|
|
|
template <class T> class QVector;
|
2016-11-11 16:55:02 +01:00
|
|
|
template <class T>class QSharedPointer;
|
|
|
|
class VAbstractCurve;
|
2016-11-23 11:54:46 +01:00
|
|
|
class VPiecePath;
|
2016-11-03 16:59:53 +01:00
|
|
|
|
2016-11-03 19:15:53 +01:00
|
|
|
class VPiece : public VAbstractPiece
|
2016-11-03 16:59:53 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
VPiece();
|
|
|
|
VPiece(const VPiece &piece);
|
|
|
|
VPiece &operator=(const VPiece &piece);
|
|
|
|
virtual ~VPiece();
|
|
|
|
|
2016-11-23 11:54:46 +01:00
|
|
|
VPiecePath GetPath() const;
|
|
|
|
VPiecePath &GetPath();
|
|
|
|
void SetPath(const VPiecePath &path);
|
2016-11-03 19:15:53 +01:00
|
|
|
|
|
|
|
QVector<QPointF> MainPathPoints(const VContainer *data) const;
|
2016-11-05 09:56:44 +01:00
|
|
|
QVector<QPointF> MainPathNodePoints(const VContainer *data) const;
|
2016-11-10 13:06:09 +01:00
|
|
|
QVector<QPointF> SeamAllowancePoints(const VContainer *data) const;
|
2016-11-05 09:56:44 +01:00
|
|
|
|
|
|
|
QPainterPath MainPathPath(const VContainer *data) const;
|
2016-11-10 13:06:09 +01:00
|
|
|
QPainterPath SeamAllowancePath(const VContainer *data) const;
|
2016-11-03 19:15:53 +01:00
|
|
|
|
2016-11-08 11:53:14 +01:00
|
|
|
qreal GetMx() const;
|
|
|
|
void SetMx(qreal value);
|
|
|
|
|
|
|
|
qreal GetMy() const;
|
|
|
|
void SetMy(qreal value);
|
|
|
|
|
2016-11-09 14:53:22 +01:00
|
|
|
bool IsInLayout() const;
|
|
|
|
void SetInLayout(bool inLayout);
|
|
|
|
|
2016-11-23 17:40:27 +01:00
|
|
|
bool IsUnited() const;
|
|
|
|
void SetUnited(bool united);
|
|
|
|
|
2016-11-25 13:19:44 +01:00
|
|
|
QVector<CustomSARecord> GetCustomSARecords() const;
|
|
|
|
void SetCustomSARecords(const QVector<CustomSARecord> &records);
|
|
|
|
|
2016-11-09 13:11:58 +01:00
|
|
|
QVector<VPieceNode> Missing(const VPiece &det) const;
|
|
|
|
|
|
|
|
int indexOfNode(const quint32 &id) const;
|
|
|
|
|
2016-11-03 16:59:53 +01:00
|
|
|
private:
|
|
|
|
QSharedDataPointer<VPieceData> d;
|
2016-11-03 19:15:53 +01:00
|
|
|
|
2016-11-11 16:55:02 +01:00
|
|
|
void CurveSeamAllowanceSegment(QVector<VSAPoint> &pointsEkv, const VContainer *data,
|
|
|
|
const QSharedPointer<VAbstractCurve> &curve, int i, bool reverse) const;
|
2016-11-09 13:11:58 +01:00
|
|
|
|
|
|
|
static int indexOfNode(const QVector<VPieceNode> &list, quint32 id);
|
2016-11-03 16:59:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Q_DECLARE_TYPEINFO(VPiece, Q_MOVABLE_TYPE);
|
|
|
|
|
|
|
|
#endif // VPIECE_H
|