Seamly2D
Code documentation
vsplinepoint.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 vsplinepoint.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date November 15, 2013
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 VSPLINEPOINT_H
53 #define VSPLINEPOINT_H
54 
55 #include <QMetaType>
56 #include <QSharedDataPointer>
57 #include <QString>
58 #include <QTypeInfo>
59 #include <QtGlobal>
60 
61 #include "vpointf.h"
62 
63 class VFSplinePointData;
64 
65 /**
66  * @brief The VFSplinePoint class keep information about point in spline path. Each point have two angles and two
67  * coefficient. Point represent at the same time first and last point of a spline.
68  */
70 {
71 public:
72  VFSplinePoint();
73  VFSplinePoint(const VPointF &pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
74  VFSplinePoint(const VFSplinePoint &point);
76 
77  VFSplinePoint &operator=(const VFSplinePoint &point);
78 #ifdef Q_COMPILER_RVALUE_REFS
79  VFSplinePoint &operator=(VFSplinePoint &&point) Q_DECL_NOTHROW;
80 #endif
81 
82  void Swap(VFSplinePoint &point) Q_DECL_NOTHROW;
83 
84  VPointF P() const;
85  void SetP(const VPointF &value);
86  qreal Angle1() const;
87  void SetAngle1(const qreal &value);
88  void SetAngle2(const qreal &value);
89  qreal Angle2() const;
90  qreal KAsm1() const;
91  void SetKAsm1(const qreal &value);
92  qreal KAsm2() const;
93  void SetKAsm2(const qreal &value);
94 protected:
95  QSharedDataPointer<VFSplinePointData> d;
96 };
97 
98 Q_DECLARE_METATYPE(VFSplinePoint)
100 
101 class VSplinePointData;
102 
103 /**
104  * @brief The VSplinePoint class keep information about point in spline path. Each point have two angles and two
105  * lengths. Point represent at the same time first and last point of a spline.
106  */
108 {
109 public:
110  VSplinePoint();
111  VSplinePoint(const VPointF &pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F,
112  qreal length1, const QString &length1F, qreal length2, const QString &length2F);
113  VSplinePoint(const VSplinePoint &point);
114  ~VSplinePoint();
115 
116  VSplinePoint &operator=(const VSplinePoint &point);
117 #ifdef Q_COMPILER_RVALUE_REFS
118  VSplinePoint &operator=(VSplinePoint &&point) Q_DECL_NOTHROW;
119 #endif
120 
121  void Swap(VSplinePoint &point) Q_DECL_NOTHROW;
122 
123  VPointF P() const;
124  void SetP(const VPointF &value);
125 
126  qreal Angle1() const;
127  QString Angle1Formula() const;
128  void SetAngle1(const qreal &value, const QString &angle1F);
129 
130  qreal Angle2() const;
131  QString Angle2Formula() const;
132  void SetAngle2(const qreal &value, const QString &angle2F);
133 
134  qreal Length1() const;
135  QString Length1Formula() const;
136  void SetLength1(const qreal &value, const QString &length1F);
137 
138  qreal Length2() const;
139  QString Length2Formula() const;
140  void SetLength2(const qreal &value, const QString &length2F);
141 
142  bool IsMovable() const;
143 protected:
144  QSharedDataPointer<VSplinePointData> d;
145 };
146 
147 Q_DECLARE_METATYPE(VSplinePoint)
149 
150 #endif // VSPLINEPOINT_H
The VFSplinePoint class keep information about point in spline path. Each point have two angles and t...
Definition: vsplinepoint.h:70
void SetKAsm1(const qreal &value)
SetKAsm1 set coefficient of length first control line.
void Swap(VFSplinePoint &point) Q_DECL_NOTHROW
VPointF P() const
P return point.
void SetP(const VPointF &value)
SetP set point.
void SetAngle2(const qreal &value)
SetAngle2 set second angle of spline.
void SetKAsm2(const qreal &value)
SetKAsm2 set coefficient of length second control line.
VFSplinePoint & operator=(const VFSplinePoint &point)
VFSplinePoint()
VFSplinePoint default constructor.
qreal Angle1() const
Angle1 return first angle of spline.
void SetAngle1(const qreal &value)
SetAngle1 set first angle of spline.
QSharedDataPointer< VFSplinePointData > d
Definition: vsplinepoint.h:95
qreal KAsm1() const
KAsm1 return coefficient of length first control line.
qreal Angle2() const
Angle2 return second angle of spline.
qreal KAsm2() const
KAsm2 return coefficient of length second control line.
The VPointF class keep data of point.
Definition: vpointf.h:75
The VSplinePoint class keep information about point in spline path. Each point have two angles and tw...
Definition: vsplinepoint.h:108
QSharedDataPointer< VSplinePointData > d
Definition: vsplinepoint.h:144
Q_DECLARE_TYPEINFO(VFSplinePoint, Q_MOVABLE_TYPE)