Seamly2D
Code documentation
vabstractpiece_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 9 11, 2016
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2016 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 #ifndef VABSTRACTPIECE_P_H
53 #define VABSTRACTPIECE_P_H
54 
55 #include <QSharedData>
56 #include <QString>
57 #include <QCoreApplication>
58 
59 #include "../vmisc/diagnostic.h"
60 
61 QT_WARNING_PUSH
62 QT_WARNING_DISABLE_GCC("-Weffc++")
63 QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
64 
65 class VAbstractPieceData : public QSharedData
66 {
67  Q_DECLARE_TR_FUNCTIONS(VAbstractPieceData)
68 public:
70  : m_name(tr("Piece"))
71  , m_color("white")
72  , m_fill()
73  , m_pieceLock(false)
74  , m_forbidFlipping(false)
75  , m_seamAllowance(false)
76  , m_seamAllowanceBuiltIn(false)
77  , m_hideMainPath(false)
78  , m_width(0)
79  , m_mx(0)
80  , m_my(0)
81  {}
82 
84  : QSharedData(piece)
85  , m_name(piece.m_name)
86  , m_color(piece.m_color)
87  , m_fill(piece.m_fill)
88  , m_pieceLock(piece.m_pieceLock)
89  , m_forbidFlipping(piece.m_forbidFlipping)
90  , m_seamAllowance(piece.m_seamAllowance)
91  , m_seamAllowanceBuiltIn(piece.m_seamAllowanceBuiltIn)
92  , m_hideMainPath(piece.m_hideMainPath)
93  , m_width(piece.m_width)
94  , m_mx(piece.m_mx)
95  , m_my(piece.m_my)
96  {}
97 
98  ~VAbstractPieceData() Q_DECL_EQ_DEFAULT;
99 
100  QString m_name;
101  QString m_color;
102  QString m_fill;
103  bool m_pieceLock;
104  /** @brief forbidFlipping forbid piece be mirrored in a layout. */
105  bool m_forbidFlipping;
106  bool m_seamAllowance;
107  bool m_seamAllowanceBuiltIn;
108  bool m_hideMainPath;
109  qreal m_width;
110  qreal m_mx;
111  qreal m_my;
112 
113 private:
114  VAbstractPieceData &operator=(const VAbstractPieceData &) Q_DECL_EQ_DELETE;
115 };
116 
118 
119 #endif // VABSTRACTPIECE_P_H
VAbstractPieceData(const VAbstractPieceData &piece)
~VAbstractPieceData() Q_DECL_EQ_DEFAULT