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-03 16:59:53 +01:00
|
|
|
class VPieceData;
|
|
|
|
class VPieceNode;
|
2016-11-03 19:15:53 +01:00
|
|
|
template <class T> class QVector;
|
2016-11-11 16:55:02 +01:00
|
|
|
template <class T>class QSharedPointer;
|
2016-11-23 11:54:46 +01:00
|
|
|
class VPiecePath;
|
2017-01-12 14:51:08 +01:00
|
|
|
class VPatternInfoGeometry;
|
|
|
|
class VPatternPieceData;
|
|
|
|
class VGrainlineGeometry;
|
2017-02-18 10:22:59 +01:00
|
|
|
class VContainer;
|
|
|
|
class QPainterPath;
|
|
|
|
class VPointF;
|
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-30 14:26:40 +01:00
|
|
|
QVector<VPointF> 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);
|
|
|
|
|
2017-01-21 14:24:40 +01:00
|
|
|
QString GetFormulaSAWidth() const;
|
|
|
|
void SetFormulaSAWidth(const QString &formula, qreal value);
|
|
|
|
|
2016-12-03 17:01:39 +01:00
|
|
|
QVector<quint32> GetInternalPaths() const;
|
2017-01-31 15:26:28 +01:00
|
|
|
QVector<quint32> &GetInternalPaths();
|
2016-12-03 17:01:39 +01:00
|
|
|
void SetInternalPaths(const QVector<quint32> &iPaths);
|
|
|
|
|
2016-11-25 13:19:44 +01:00
|
|
|
QVector<CustomSARecord> GetCustomSARecords() const;
|
2017-01-31 15:26:28 +01:00
|
|
|
QVector<CustomSARecord> &GetCustomSARecords();
|
2016-11-25 13:19:44 +01:00
|
|
|
void SetCustomSARecords(const QVector<CustomSARecord> &records);
|
2017-01-31 15:26:28 +01:00
|
|
|
|
|
|
|
QVector<quint32> GetPins() const;
|
|
|
|
QVector<quint32> &GetPins();
|
|
|
|
void SetPins(const QVector<quint32> &pins);
|
2016-11-25 13:19:44 +01:00
|
|
|
|
2016-11-25 15:12:33 +01:00
|
|
|
QVector<quint32> MissingNodes(const VPiece &det) const;
|
|
|
|
QVector<quint32> MissingCSAPath(const VPiece &det) const;
|
2016-12-03 17:01:39 +01:00
|
|
|
QVector<quint32> MissingInternalPaths(const VPiece &det) const;
|
2017-01-31 17:09:18 +01:00
|
|
|
QVector<quint32> MissingPins(const VPiece &det) const;
|
2016-11-09 13:11:58 +01:00
|
|
|
|
2017-01-12 14:51:08 +01:00
|
|
|
void SetPatternPieceData(const VPatternPieceData &data);
|
|
|
|
VPatternPieceData& GetPatternPieceData();
|
|
|
|
const VPatternPieceData& GetPatternPieceData() const;
|
|
|
|
|
|
|
|
void SetPatternInfo(const VPatternInfoGeometry &info);
|
|
|
|
VPatternInfoGeometry& GetPatternInfo();
|
|
|
|
const VPatternInfoGeometry& GetPatternInfo() const;
|
|
|
|
|
|
|
|
VGrainlineGeometry& GetGrainlineGeometry();
|
|
|
|
const VGrainlineGeometry& GetGrainlineGeometry() const;
|
|
|
|
|
2016-11-03 16:59:53 +01:00
|
|
|
private:
|
|
|
|
QSharedDataPointer<VPieceData> d;
|
2016-11-03 19:15:53 +01:00
|
|
|
|
2016-11-29 13:10:53 +01:00
|
|
|
QVector<CustomSARecord> GetValidRecords() const;
|
|
|
|
|
|
|
|
static int IsCSAStart(const QVector<CustomSARecord> &records, quint32 id);
|
2016-11-03 16:59:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Q_DECLARE_TYPEINFO(VPiece, Q_MOVABLE_TYPE);
|
|
|
|
|
|
|
|
#endif // VPIECE_H
|