2019-11-03 09:01:32 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vrawsapoint.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 31 10, 2019
|
|
|
|
**
|
|
|
|
** @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) 2019 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2019-11-03 09:01:32 +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 VRAWSAPOINT_H
|
|
|
|
#define VRAWSAPOINT_H
|
|
|
|
|
2022-10-28 15:16:02 +02:00
|
|
|
#include <QtGlobal>
|
2019-11-03 09:01:32 +01:00
|
|
|
|
2022-08-22 10:34:02 +02:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
2019-11-03 09:01:32 +01:00
|
|
|
#include "../vmisc/diagnostic.h"
|
2022-08-22 10:34:02 +02:00
|
|
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
2022-10-28 15:16:02 +02:00
|
|
|
#include "vlayoutpoint.h"
|
2019-11-03 09:01:32 +01:00
|
|
|
|
|
|
|
QT_WARNING_PUSH
|
|
|
|
QT_WARNING_DISABLE_GCC("-Weffc++")
|
2022-11-10 10:55:50 +01:00
|
|
|
// cppcheck-suppress unknownMacro
|
2019-11-03 09:01:32 +01:00
|
|
|
QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
2022-10-28 15:16:02 +02:00
|
|
|
QT_WARNING_DISABLE_CLANG("-Wnon-virtual-dtor")
|
2022-11-10 14:01:42 +01:00
|
|
|
QT_WARNING_DISABLE_CLANG("-Wdelete-non-virtual-dtor")
|
2019-11-03 09:01:32 +01:00
|
|
|
|
2022-11-10 14:01:42 +01:00
|
|
|
class VRawSAPoint final : public VLayoutPoint
|
2019-11-03 09:01:32 +01:00
|
|
|
{
|
|
|
|
public:
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR VRawSAPoint() = default;
|
2019-11-03 09:01:32 +01:00
|
|
|
Q_DECL_CONSTEXPR VRawSAPoint(qreal xpos, qreal ypos);
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR explicit VRawSAPoint(QPointF p);
|
|
|
|
Q_DECL_CONSTEXPR explicit VRawSAPoint(const VLayoutPoint &p);
|
|
|
|
Q_DECL_CONSTEXPR VRawSAPoint(QPointF p, bool curvePoint, bool turnPoint);
|
|
|
|
Q_DECL_CONSTEXPR VRawSAPoint(QPointF p, bool curvePoint, bool turnPoint, bool loopPoint);
|
2019-11-03 09:01:32 +01:00
|
|
|
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR auto LoopPoint() const -> bool;
|
2019-11-03 09:45:04 +01:00
|
|
|
Q_DECL_RELAXED_CONSTEXPR void SetLoopPoint(bool loopPoint);
|
2019-11-03 09:01:32 +01:00
|
|
|
|
2022-10-29 14:19:21 +02:00
|
|
|
Q_DECL_CONSTEXPR auto Primary() const -> bool;
|
|
|
|
Q_DECL_RELAXED_CONSTEXPR void SetPrimary(bool primary);
|
|
|
|
|
2022-10-28 15:16:02 +02:00
|
|
|
auto toJson() const -> QJsonObject override;
|
2019-11-03 09:01:32 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_loopPoint{false};
|
2022-10-29 14:19:21 +02:00
|
|
|
bool m_primary{false};
|
2019-11-03 09:01:32 +01:00
|
|
|
};
|
|
|
|
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECLARE_METATYPE(VRawSAPoint) // NOLINT
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_DECLARE_TYPEINFO(VRawSAPoint, Q_MOVABLE_TYPE); // NOLINT
|
2019-11-03 09:01:32 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR inline VRawSAPoint::VRawSAPoint(qreal xpos, qreal ypos)
|
|
|
|
: VLayoutPoint(xpos, ypos)
|
2019-11-03 09:01:32 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR inline VRawSAPoint::VRawSAPoint(QPointF p)
|
|
|
|
: VLayoutPoint(p)
|
2019-11-03 09:01:32 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR inline VRawSAPoint::VRawSAPoint(const VLayoutPoint &p)
|
|
|
|
: VLayoutPoint(p)
|
2020-07-31 15:15:00 +02:00
|
|
|
{}
|
2019-11-03 09:01:32 +01:00
|
|
|
|
2020-07-31 15:15:00 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR inline VRawSAPoint::VRawSAPoint(QPointF p, bool curvePoint, bool turnPoint)
|
|
|
|
: VLayoutPoint(p)
|
|
|
|
{
|
|
|
|
SetCurvePoint(curvePoint);
|
|
|
|
SetTurnPoint(turnPoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
Q_DECL_CONSTEXPR inline VRawSAPoint::VRawSAPoint(QPointF p, bool curvePoint, bool turnPoint, bool loopPoint)
|
|
|
|
: VLayoutPoint(p),
|
2020-07-31 15:15:00 +02:00
|
|
|
m_loopPoint(loopPoint)
|
2022-10-28 15:16:02 +02:00
|
|
|
{
|
|
|
|
SetCurvePoint(curvePoint);
|
|
|
|
SetTurnPoint(turnPoint);
|
|
|
|
}
|
2019-11-03 09:01:32 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-10-28 15:16:02 +02:00
|
|
|
Q_DECL_CONSTEXPR inline auto VRawSAPoint::LoopPoint() const -> bool
|
2019-11-03 09:01:32 +01:00
|
|
|
{
|
|
|
|
return m_loopPoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2019-11-03 09:45:04 +01:00
|
|
|
Q_DECL_RELAXED_CONSTEXPR inline void VRawSAPoint::SetLoopPoint(bool loopPoint)
|
2019-11-03 09:01:32 +01:00
|
|
|
{
|
|
|
|
m_loopPoint = loopPoint;
|
|
|
|
}
|
|
|
|
|
2022-10-29 14:19:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
Q_DECL_CONSTEXPR inline auto VRawSAPoint::Primary() const -> bool
|
|
|
|
{
|
|
|
|
return m_primary;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
Q_DECL_RELAXED_CONSTEXPR inline void VRawSAPoint::SetPrimary(bool primary)
|
|
|
|
{
|
|
|
|
m_primary = primary;
|
|
|
|
}
|
|
|
|
|
2019-11-03 09:01:32 +01:00
|
|
|
QT_WARNING_POP
|
|
|
|
|
|
|
|
#endif // VRAWSAPOINT_H
|