Sun, 03 Nov 2019 12:56:42 +0200
added saving of splitter state and recent files
3 | 1 | /* |
2 | * LDForge: LDraw parts authoring CAD | |
3 | * Copyright (C) 2019 Teemu Piippo | |
4 | * | |
5 | * This program is free software: you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation, either version 3 of the License, or | |
8 | * (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #pragma once | |
8
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
7
diff
changeset
|
20 | #include <algorithm> |
3 | 21 | #include <cstdio> |
22 | #include <cstdlib> | |
8
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
7
diff
changeset
|
23 | #include <cstring> |
3 | 24 | #include <cmath> |
25 | #include <QMatrix4x4> | |
26 | #include <QObject> | |
27 | #include <QPointF> | |
28 | #include <QSet> | |
29 | #include <QString> | |
30 | #include <QStringList> | |
31 | #include <QVariant> | |
32 | #include <QVector> | |
33 | #include <QVector3D> | |
34 | ||
35 | using GLRotationMatrix = QMatrix4x4; | |
36 | ||
37 | enum Axis | |
38 | { | |
39 | X, | |
40 | Y, | |
41 | Z | |
42 | }; | |
43 | ||
44 | enum Winding | |
45 | { | |
46 | NoWinding, | |
8
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
7
diff
changeset
|
47 | Anticlockwise, |
3 | 48 | Clockwise, |
49 | }; | |
50 | ||
51 | /* | |
52 | * Special operator definition that implements the XOR operator for windings. | |
53 | * However, if either winding is NoWinding, then this function returns NoWinding. | |
54 | */ | |
55 | inline Winding operator^(Winding one, Winding other) | |
56 | { | |
57 | if (one == NoWinding or other == NoWinding) | |
58 | return NoWinding; | |
59 | else | |
60 | return static_cast<Winding>(static_cast<int>(one) ^ static_cast<int>(other)); | |
61 | } | |
62 | ||
63 | inline Winding& operator^=(Winding& one, Winding other) | |
64 | { | |
65 | one = one ^ other; | |
66 | return one; | |
67 | } | |
68 | ||
69 | static constexpr long double pi = M_PIl; |