valentina/src/libs/vpatterndb/vpiecenode.h

139 lines
4.4 KiB
C
Raw Normal View History

/************************************************************************
**
** @file
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 3 11, 2016
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2016 Valentina project
** <https://gitlab.com/smart-pattern/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 VPIECENODE_H
#define VPIECENODE_H
#include <QMetaType>
2023-07-15 09:58:28 +02:00
#include <QSharedDataPointer>
#include <QtGlobal>
#include "../vmisc/def.h"
class VPieceNodeData;
class VContainer;
class VPieceNode
{
public:
VPieceNode();
VPieceNode(quint32 id, Tool typeTool, bool reverse = false);
VPieceNode(const VPieceNode &node);
~VPieceNode();
2023-05-03 13:07:02 +02:00
auto operator=(const VPieceNode &node) -> VPieceNode &;
2024-02-19 10:14:02 +01:00
2023-07-13 16:49:20 +02:00
VPieceNode(VPieceNode &&node) noexcept;
2023-07-15 09:58:28 +02:00
auto operator=(VPieceNode &&node) noexcept -> VPieceNode &;
2023-05-03 13:07:02 +02:00
friend auto operator<<(QDataStream &out, const VPieceNode &p) -> QDataStream &;
friend auto operator>>(QDataStream &in, VPieceNode &p) -> QDataStream &;
2023-05-03 13:07:02 +02:00
auto GetId() const -> quint32;
2023-05-08 16:50:22 +02:00
void SetId(quint32 id);
2023-05-03 13:07:02 +02:00
auto GetTypeTool() const -> Tool;
void SetTypeTool(Tool value);
2023-05-03 13:07:02 +02:00
auto GetReverse() const -> bool;
void SetReverse(bool reverse);
2023-05-03 13:07:02 +02:00
auto IsExcluded() const -> bool;
void SetExcluded(bool exclude);
2023-05-03 13:07:02 +02:00
auto GetSABefore(const VContainer *data) const -> qreal;
auto GetSABefore(const VContainer *data, Unit unit) const -> qreal;
2023-05-03 13:07:02 +02:00
auto GetFormulaSABefore() const -> QString;
2023-05-08 16:50:22 +02:00
void SetFormulaSABefore(const QString &formula);
2023-05-03 13:07:02 +02:00
auto GetSAAfter(const VContainer *data) const -> qreal;
auto GetSAAfter(const VContainer *data, Unit unit) const -> qreal;
2023-05-03 13:07:02 +02:00
auto GetFormulaSAAfter() const -> QString;
2023-05-08 16:50:22 +02:00
void SetFormulaSAAfter(const QString &formula);
2023-05-03 13:07:02 +02:00
auto GetFormulaPassmarkLength() const -> QString;
2023-05-08 16:50:22 +02:00
void SetFormulaPassmarkLength(const QString &formula);
auto GetFormulaPassmarkWidth() const -> QString;
void SetFormulaPassmarkWidth(const QString &formula);
auto GetFormulaPassmarkAngle() const -> QString;
void SetFormulaPassmarkAngle(const QString &formula);
2023-05-03 13:07:02 +02:00
auto GetPassmarkLength(const VContainer *data, Unit unit) const -> qreal;
auto GetPassmarkWidth(const VContainer *data, Unit unit) const -> qreal;
auto GetPassmarkAngle(const VContainer *data) const -> qreal;
2023-05-03 13:07:02 +02:00
auto GetAngleType() const -> PieceNodeAngle;
2023-05-08 16:50:22 +02:00
void SetAngleType(PieceNodeAngle type);
2023-05-03 13:07:02 +02:00
auto IsPassmark() const -> bool;
void SetPassmark(bool passmark);
2023-05-03 13:07:02 +02:00
auto IsMainPathNode() const -> bool;
void SetMainPathNode(bool value);
2023-05-03 13:07:02 +02:00
auto GetPassmarkLineType() const -> PassmarkLineType;
2023-05-08 16:50:22 +02:00
void SetPassmarkLineType(PassmarkLineType lineType);
2023-05-03 13:07:02 +02:00
auto GetPassmarkAngleType() const -> PassmarkAngleType;
2023-05-08 16:50:22 +02:00
void SetPassmarkAngleType(PassmarkAngleType angleType);
2023-05-03 13:07:02 +02:00
auto IsShowSecondPassmark() const -> bool;
void SetShowSecondPassmark(bool value);
auto IsPassmarkClockwiseOpening() const -> bool;
void SetPassmarkClockwiseOpening(bool value);
2023-05-03 13:07:02 +02:00
auto IsCheckUniqueness() const -> bool;
void SetCheckUniqueness(bool value);
2023-05-03 13:07:02 +02:00
auto IsManualPassmarkLength() const -> bool;
void SetManualPassmarkLength(bool value);
2022-10-28 15:16:02 +02:00
auto IsManualPassmarkWidth() const -> bool;
void SetManualPassmarkWidth(bool value);
auto IsManualPassmarkAngle() const -> bool;
void SetManualPassmarkAngle(bool value);
2023-05-03 13:07:02 +02:00
auto IsTurnPoint() const -> bool;
2022-10-28 15:16:02 +02:00
void SetTurnPoint(bool value);
2023-07-15 09:58:28 +02:00
private:
QSharedDataPointer<VPieceNodeData> d;
};
2023-07-15 09:58:28 +02:00
Q_DECLARE_METATYPE(VPieceNode) // NOLINT
2022-08-12 17:50:13 +02:00
Q_DECLARE_TYPEINFO(VPieceNode, Q_MOVABLE_TYPE); // NOLINT
#endif // VPIECENODE_H