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"
|
2023-02-09 16:23:11 +01:00
|
|
|
#include "../vmisc/defglobal.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
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto operator=(const VContour &contour) -> VContour &;
|
2017-04-19 12:27:17 +02:00
|
|
|
#ifdef Q_COMPILER_RVALUE_REFS
|
2023-07-13 16:49:20 +02:00
|
|
|
VContour(VContour &&contour) noexcept;
|
|
|
|
auto operator=(VContour &&contour) noexcept->VContour &;
|
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);
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetContour() const -> QVector<QPointF>;
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetShift() const -> qreal;
|
2019-03-29 18:52:37 +01:00
|
|
|
void SetShift(qreal shift);
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetHeight() const -> int;
|
2015-01-21 19:56:59 +01:00
|
|
|
void SetHeight(int height);
|
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetWidth() const -> int;
|
2015-01-21 19:56:59 +01:00
|
|
|
void SetWidth(int width);
|
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto IsPortrait() const -> bool;
|
2019-01-03 18:35:04 +01:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto GetSize() const -> QSizeF;
|
2015-05-08 12:10:56 +02:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto UniteWithContour(const VLayoutPiece &detail, int globalI, int detJ, BestFrom type) const -> QVector<QPointF>;
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto EmptySheetEdge() const -> QLineF;
|
|
|
|
auto GlobalEdgesCount() const -> vsizetype;
|
|
|
|
auto GlobalEdge(int i) const -> QLineF;
|
|
|
|
auto CutEdge(const QLineF &edge) const -> QVector<QPointF>;
|
|
|
|
auto CutEmptySheetEdge() const -> QVector<QPointF>;
|
2015-01-21 19:56:59 +01:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto at(int i) const -> const QPointF &;
|
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;
|
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();
|
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto EmptySheetEdgesCount() const -> int;
|
2015-01-21 19:56:59 +01:00
|
|
|
};
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_DECLARE_TYPEINFO(VContour, Q_MOVABLE_TYPE); // NOLINT
|
2015-11-25 19:56:17 +01:00
|
|
|
|
2015-01-21 19:56:59 +01:00
|
|
|
#endif // VCONTOUR_H
|