Seamly2D
Code documentation
vabstractarc_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 VAbstractArcData.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 10 4, 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 VABSTRACTARC_P_H
53 #define VABSTRACTARC_P_H
54 
55 #include <QSharedData>
56 #include "vgeometrydef.h"
57 #include "../vmisc/vabstractapplication.h"
58 #include "../vmisc/diagnostic.h"
59 #include "vpointf.h"
60 
61 QT_WARNING_PUSH
62 QT_WARNING_DISABLE_GCC("-Weffc++")
63 QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
64 
65 class VAbstractArcData : public QSharedData
66 {
67 public:
69  VAbstractArcData(const VPointF &center, qreal f1, const QString &formulaF1,
70  qreal f2, const QString &formulaF2);
71  VAbstractArcData(const QString &formulaLength, const VPointF &center,
72  qreal f1, const QString &formulaF1);
73  VAbstractArcData(const VPointF &center, qreal f1);
74  VAbstractArcData(const VPointF &center, qreal f1, qreal f2);
76  virtual ~VAbstractArcData();
77 
78  qreal f1; /** @brief f1 start angle in degree. */
79  QString formulaF1; /** @brief formulaF1 formula for start angle. */
80  qreal f2; /** @brief f2 end angle in degree. */
81  QString formulaF2; /** @brief formulaF2 formula for end angle. */
82  VPointF center; /** @brief center center point of arc. */
83  bool isFlipped;
84  QString formulaLength;
85 
86 private:
87  VAbstractArcData &operator=(const VAbstractArcData &) Q_DECL_EQ_DELETE;
88 };
89 
90 //---------------------------------------------------------------------------------------------------------------------
92  : f1(0)
93  , formulaF1()
94  , f2(0)
95  , formulaF2()
96  , center()
97  , isFlipped(false)
98  , formulaLength()
99 {}
100 
101 //---------------------------------------------------------------------------------------------------------------------
102 VAbstractArcData::VAbstractArcData(const VPointF &center, qreal f1, const QString &formulaF1, qreal f2,
103  const QString &formulaF2)
104  : f1(f1)
105  , formulaF1(formulaF1)
106  , f2(f2)
107  , formulaF2(formulaF2)
108  , center(center)
109  , isFlipped(false)
110  , formulaLength()
111 {}
112 
113 //---------------------------------------------------------------------------------------------------------------------
114 VAbstractArcData::VAbstractArcData(const QString &formulaLength, const VPointF &center, qreal f1,
115  const QString &formulaF1)
116  : f1(f1)
117  , formulaF1(formulaF1)
118  , f2(0)
119  , formulaF2("0")
120  , center(center)
121  , isFlipped(false)
122  , formulaLength(formulaLength)
123 {}
124 
125 //---------------------------------------------------------------------------------------------------------------------
127  : f1(f1)
128  , formulaF1(QString().number(f1))
129  , f2(0)
130  , formulaF2("0")
131  , center(center)
132  , isFlipped(false)
133  , formulaLength()
134 {}
135 
136 //---------------------------------------------------------------------------------------------------------------------
137 VAbstractArcData::VAbstractArcData(const VPointF &center, qreal f1, qreal f2)
138  : f1(f1)
139  , formulaF1(QString().number(f1))
140  , f2(f2)
141  , formulaF2(QString().number(f2))
142  , center(center)
143  , isFlipped(false)
144  , formulaLength()
145 {}
146 
147 //---------------------------------------------------------------------------------------------------------------------
149  : QSharedData(arc)
150  , f1(arc.f1)
151  , formulaF1(arc.formulaF1)
152  , f2(arc.f2)
153  , formulaF2(arc.formulaF2)
154  , center(arc.center)
155  , isFlipped(arc.isFlipped)
156  , formulaLength(arc.formulaLength)
157 {}
158 
159 //---------------------------------------------------------------------------------------------------------------------
161 {}
162 
164 
165 #endif // VABSTRACTARCDATA_H
QString formulaF2
f2 end angle in degree.
QString formulaF1
f1 start angle in degree.
bool isFlipped
center center point of arc.
virtual ~VAbstractArcData()
VPointF center
formulaF2 formula for end angle.
qreal f2
formulaF1 formula for start angle.
VAbstractArcData & operator=(const VAbstractArcData &) Q_DECL_EQ_DELETE
The VPointF class keep data of point.
Definition: vpointf.h:75