1 /************************************************************************
2 **
3 ** @file
4 ** @author Roman Telezhynskyi <dismine(at)gmail.com>
5 ** @date 3 11, 2016
6 **
7 ** @brief
8 ** @copyright
9 ** This source code is part of the Valentina project, a pattern making
10 ** program, whose allow create and modeling patterns of clothing.
11 ** Copyright (C) 2016 Valentina project
12 ** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
13 **
14 ** Valentina is free software: you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License as published by
16 ** the Free Software Foundation, either version 3 of the License, or
17 ** (at your option) any later version.
18 **
19 ** Valentina is distributed in the hope that it will be useful,
20 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ** GNU General Public License for more details.
23 **
24 ** You should have received a copy of the GNU General Public License
25 ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
26 **
27 *************************************************************************/
28
29 #ifndef VPIECE_P_H
30 #define VPIECE_P_H
31
32 #include <QSharedData>
33 #include <QVector>
34
35 #include "../vmisc/diagnostic.h"
36 #include "../vmisc/def.h"
37 #include "vpiecenode.h"
38 #include "vpiecepath.h"
39 #include "floatItemData/vpiecelabeldata.h"
40 #include "floatItemData/vpatternlabeldata.h"
41 #include "floatItemData/vgrainlinedata.h"
42
43 QT_WARNING_PUSH
44 QT_WARNING_DISABLE_GCC("-Weffc++")
45 QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
46
47 class VPieceData : public QSharedData
48 {
49 public:
VPieceData(PiecePathType type)50 explicit VPieceData(PiecePathType type)
51 : m_path(type),
52 m_inLayout(true),
53 m_united(false),
54 m_customSARecords(),
55 m_internalPaths(),
56 m_pins(),
57 m_placeLabels(),
58 m_ppData(),
59 m_piPatternInfo(),
60 m_glGrainline(),
61 m_formulaWidth('0')
62 {}
63
VPieceData(const VPieceData & detail)64 VPieceData(const VPieceData &detail)
65 : QSharedData(detail),
66 m_path(detail.m_path),
67 m_inLayout(detail.m_inLayout),
68 m_united(detail.m_united),
69 m_customSARecords(detail.m_customSARecords),
70 m_internalPaths(detail.m_internalPaths),
71 m_pins(detail.m_pins),
72 m_placeLabels(detail.m_placeLabels),
73 m_ppData(detail.m_ppData),
74 m_piPatternInfo(detail.m_piPatternInfo),
75 m_glGrainline(detail.m_glGrainline),
76 m_formulaWidth(detail.m_formulaWidth)
77 {}
78
79 ~VPieceData();
80
81 /** @brief nodes list detail nodes. */
82 VPiecePath m_path;
83
84 bool m_inLayout;
85 bool m_united;
86
87 QVector<CustomSARecord> m_customSARecords;
88 QVector<quint32> m_internalPaths;
89 QVector<quint32> m_pins;
90 QVector<quint32> m_placeLabels;
91
92 /** @brief Pattern piece data */
93 VPieceLabelData m_ppData;
94
95 /** @brief Pattern info coordinates */
96 VPatternLabelData m_piPatternInfo;
97
98 /** @brief m_glGrainline grainline geometry object*/
99 VGrainlineData m_glGrainline;
100
101 QString m_formulaWidth;
102
103 private:
104 Q_DISABLE_ASSIGN(VPieceData)
105 };
106
~VPieceData()107 VPieceData::~VPieceData()
108 {}
109
110 QT_WARNING_POP
111
112 #endif // VPIECE_P_H
113
114