2015-01-21 19:56:59 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vcontour.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 21 1, 2015
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2015-01-21 19:56:59 +01:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2015-01-21 19:56:59 +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 VCONTOUR_H
|
|
|
|
#define VCONTOUR_H
|
|
|
|
|
|
|
|
#include <QSharedDataPointer>
|
2015-05-08 12:10:56 +02:00
|
|
|
#include <QSizeF>
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QTypeInfo>
|
|
|
|
#include <QVector>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
#include "vlayoutdef.h"
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2017-02-18 10:22:59 +01:00
|
|
|
class VContourData;
|
2016-08-08 13:44:49 +02:00
|
|
|
class QPointF;
|
2017-02-18 10:22:59 +01:00
|
|
|
class QLineF;
|
2016-08-08 13:44:49 +02:00
|
|
|
class QRectF;
|
2017-02-18 10:22:59 +01:00
|
|
|
class QPainterPath;
|
2017-01-22 10:02:02 +01:00
|
|
|
class VLayoutPiece;
|
2015-01-21 19:56:59 +01:00
|
|
|
|
|
|
|
class VContour
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VContour();
|
2019-03-27 08:03:19 +01:00
|
|
|
VContour(int height, int width, qreal layoutWidth);
|
2015-01-21 19:56:59 +01:00
|
|
|
VContour(const VContour &contour);
|
2017-04-19 12:27:17 +02:00
|
|
|
|
2015-07-03 15:36:54 +02:00
|
|
|
~VContour();
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2017-04-19 12:27:17 +02:00
|
|
|
VContour &operator=(const VContour &contour);
|
|
|
|
#ifdef Q_COMPILER_RVALUE_REFS
|
2019-12-30 16:13:18 +01:00
|
|
|
VContour(const VContour &&contour) Q_DECL_NOTHROW;
|
2019-12-30 12:00:57 +01:00
|
|
|
VContour &operator=(VContour &&contour) Q_DECL_NOTHROW;
|
2017-04-19 12:27:17 +02:00
|
|
|
#endif
|
|
|
|
|
2019-03-27 08:03:19 +01:00
|
|
|
void CeateEmptySheetContour();
|
|
|
|
|
2016-03-28 10:22:15 +02:00
|
|
|
void SetContour(const QVector<QPointF> &contour);
|
2015-01-21 19:56:59 +01:00
|
|
|
QVector<QPointF> GetContour() const;
|
|
|
|
|
2019-03-29 18:52:37 +01:00
|
|
|
qreal GetShift() const;
|
|
|
|
void SetShift(qreal shift);
|
2015-01-21 19:56:59 +01:00
|
|
|
|
|
|
|
int GetHeight() const;
|
|
|
|
void SetHeight(int height);
|
|
|
|
|
|
|
|
int GetWidth() const;
|
|
|
|
void SetWidth(int width);
|
|
|
|
|
2019-01-03 18:35:04 +01:00
|
|
|
bool IsPortrait() const;
|
|
|
|
|
2015-05-08 12:10:56 +02:00
|
|
|
QSizeF GetSize() const;
|
|
|
|
|
2017-01-22 10:02:02 +01:00
|
|
|
QVector<QPointF> UniteWithContour(const VLayoutPiece &detail, int globalI, int detJ, BestFrom type) const;
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2015-05-15 17:15:14 +02:00
|
|
|
QLineF EmptySheetEdge() const;
|
2016-03-27 21:53:41 +02:00
|
|
|
int GlobalEdgesCount() const;
|
2015-01-21 19:56:59 +01:00
|
|
|
QLineF GlobalEdge(int i) const;
|
|
|
|
QVector<QPointF> CutEdge(const QLineF &edge) const;
|
2016-03-27 21:53:41 +02:00
|
|
|
QVector<QPointF> CutEmptySheetEdge() const;
|
2015-01-21 19:56:59 +01:00
|
|
|
|
|
|
|
const QPointF & at(int i) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QSharedDataPointer<VContourData> d;
|
|
|
|
|
2017-01-22 10:02:02 +01:00
|
|
|
void AppendWhole(QVector<QPointF> &contour, const VLayoutPiece &detail, int detJ) const;
|
2019-03-26 18:10:13 +01:00
|
|
|
void InsertDetail(QVector<QPointF> &contour, const VLayoutPiece &detail, int detJ) const;
|
2019-04-02 14:30:31 +02:00
|
|
|
|
|
|
|
void ResetAttributes();
|
|
|
|
|
|
|
|
int EmptySheetEdgesCount() const;
|
2015-01-21 19:56:59 +01:00
|
|
|
};
|
|
|
|
|
2015-11-25 19:56:17 +01:00
|
|
|
Q_DECLARE_TYPEINFO(VContour, Q_MOVABLE_TYPE);
|
|
|
|
|
2015-01-21 19:56:59 +01:00
|
|
|
#endif // VCONTOUR_H
|