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
|
2015-01-21 19:56:59 +01:00
|
|
|
** <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 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();
|
|
|
|
VContour(int height, int width);
|
|
|
|
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
|
|
|
|
VContour &operator=(VContour &&contour) Q_DECL_NOTHROW { Swap(contour); return *this; }
|
|
|
|
#endif
|
|
|
|
|
2018-04-22 12:32:06 +02:00
|
|
|
inline void Swap(VContour &contour) Q_DECL_NOTHROW
|
2017-04-19 12:27:17 +02:00
|
|
|
{ std::swap(d, contour.d); }
|
|
|
|
|
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;
|
|
|
|
|
2015-10-26 09:36:07 +01:00
|
|
|
quint32 GetShift() const;
|
2016-03-28 10:22:15 +02:00
|
|
|
void SetShift(quint32 shift);
|
2015-01-21 19:56:59 +01:00
|
|
|
|
|
|
|
int GetHeight() const;
|
|
|
|
void SetHeight(int height);
|
|
|
|
|
|
|
|
int GetWidth() const;
|
|
|
|
void SetWidth(int width);
|
|
|
|
|
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;
|
|
|
|
|
2016-03-28 10:22:15 +02:00
|
|
|
QRectF BoundingRect() const;
|
|
|
|
|
2016-03-28 10:53:02 +02:00
|
|
|
QPainterPath ContourPath() const;
|
|
|
|
|
2015-01-21 19:56:59 +01:00
|
|
|
private:
|
|
|
|
QSharedDataPointer<VContourData> d;
|
|
|
|
|
2017-01-22 10:02:02 +01:00
|
|
|
void AppendWhole(QVector<QPointF> &contour, const VLayoutPiece &detail, int detJ) 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
|