Seamly2D
Code documentation
vmeasurement_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 vmeasurement_p.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 20 8, 2014
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) 2013-2015 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 VMEASUREMENT_P_H
53 #define VMEASUREMENT_P_H
54 
55 #include <QSharedData>
56 
57 #include "../vcontainer.h"
58 #include "../vmisc/diagnostic.h"
59 
60 QT_WARNING_PUSH
61 QT_WARNING_DISABLE_GCC("-Weffc++")
62 QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
63 
64 class VMeasurementData : public QSharedData
65 {
66 public:
67 
68  VMeasurementData(quint32 index, const QString &gui_text, const QString &tagName, qreal baseSize, qreal baseHeight,
69  qreal base, qreal ksize, qreal kheight )
70  : data(VContainer(nullptr, nullptr)),
71  index(index),
72  formula(),
73  gui_text(gui_text),
74  _tagName(tagName),
75  formulaOk(true),
76  currentSize(nullptr),
77  currentHeight(nullptr),
78  currentUnit(nullptr),
79  base(base),
80  ksize(ksize),
81  kheight(kheight),
82  baseSize(baseSize),
83  baseHeight(baseHeight)
84  {}
85 
86  VMeasurementData(VContainer *data, quint32 index, const QString &formula, bool ok, const QString &gui_text,
87  const QString &tagName, qreal base)
88  : data(*data),
89  index(index),
90  formula(formula),
91  gui_text(gui_text),
92  _tagName(tagName),
93  formulaOk(ok),
94  currentSize(nullptr),
95  currentHeight(nullptr),
96  currentUnit(nullptr),
97  base(base),
98  ksize(0),
99  kheight(0),
100  baseSize(0),
101  baseHeight(0)
102  {}
103 
105  : QSharedData(m),
106  data(m.data),
107  index(m.index),
108  formula(m.formula),
109  gui_text(m.gui_text),
110  _tagName(m._tagName),
111  formulaOk(m.formulaOk),
112  currentSize(m.currentSize),
113  currentHeight(m.currentHeight),
114  currentUnit(m.currentUnit),
115  base(m.base),
116  ksize(m.ksize),
117  kheight(m.kheight),
118  baseSize(m.baseSize),
119  baseHeight(m.baseHeight)
120  {}
121 
122  virtual ~VMeasurementData();
123 
125  quint32 index;
126  QString formula;
127  QString gui_text;
128  QString _tagName;
129  bool formulaOk;
130 
131  qreal *currentSize;
134 
135  /** @brief base value in base size and height */
136  qreal base;
137 
138  /** @brief ksize increment in sizes */
139  qreal ksize;
140 
141  /** @brief kgrowth increment in heights */
142  qreal kheight;
143 
144  qreal baseSize;
145  qreal baseHeight;
146 
147 private:
148  VMeasurementData &operator=(const VMeasurementData &) Q_DECL_EQ_DELETE;
149 };
150 
152 {}
153 
155 
156 #endif // VMEASUREMENT_P_H
The VContainer class container of all variables.
Definition: vcontainer.h:141
qreal base
base value in base size and height
VMeasurementData(const VMeasurementData &m)
VMeasurementData & operator=(const VMeasurementData &) Q_DECL_EQ_DELETE
qreal kheight
kgrowth increment in heights
VMeasurementData(quint32 index, const QString &gui_text, const QString &tagName, qreal baseSize, qreal baseHeight, qreal base, qreal ksize, qreal kheight)
virtual ~VMeasurementData()
qreal ksize
ksize increment in sizes
VMeasurementData(VContainer *data, quint32 index, const QString &formula, bool ok, const QString &gui_text, const QString &tagName, qreal base)
const Unit * currentUnit
Unit
Definition: def.h:105