Fri, 13 Dec 2013 00:28:24 +0200
- Reworked primitive listing. No longer uses multi-threading.
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) 2013 Santeri Piippo |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
4 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
9 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
14 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
541
0e38beeb050a
- Renamed common.h to main.h, split the PROPERTY macro and supporting macros to property.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
540
diff
changeset
|
19 | #include "main.h" |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #include "ldtypes.h" |
553
2418d5955421
- LDFile renamed to LDDocument, file.h -> document.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
551
diff
changeset
|
21 | #include "document.h" |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include "misc.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "gui.h" |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
24 | #include "history.h" |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
194
diff
changeset
|
25 | #include "gldraw.h" |
381
241f65769a57
restructure; removed g_BBox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
379
diff
changeset
|
26 | #include "colors.h" |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | |
464
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
28 | cfg (String, ld_defaultname, ""); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
29 | cfg (String, ld_defaultuser, ""); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
30 | cfg (Int, ld_defaultlicense, 0); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
31 | |
306
fef00a6cbff0
minor improvements to primitive handling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
32 | // List of all LDObjects |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
503
diff
changeset
|
33 | QList<LDObject*> g_LDObjects; |
306
fef00a6cbff0
minor improvements to primitive handling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
34 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | // LDObject constructors |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
37 | // ----------------------------------------------------------------------------- |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
38 | LDObject::LDObject() : |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
39 | m_Hidden (false), |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
40 | m_Selected (false), |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
41 | m_Parent (null), |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
42 | m_File (null), |
388
7ff483614aa1
Multiple file support works now! woo!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
381
diff
changeset
|
43 | qObjListEntry (null), |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
44 | m_glinit (false) |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
45 | { |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
46 | memset (m_coords, 0, sizeof m_coords); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
47 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
48 | // Determine ID |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
49 | int32 id = 1; // 0 is invalid |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
50 | |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
51 | for (LDObject* obj : g_LDObjects) |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
52 | if (obj->getID() >= id) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
53 | id = obj->getID() + 1; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
54 | |
376 | 55 | setID (id); |
307
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
56 | g_LDObjects << this; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
59 | // ============================================================================= |
376 | 60 | // Default implementations for LDObject's virtual methods. These should never be |
61 | // actually called, for a subclass-less LDObject should never come into existance. | |
62 | // These exist only to satisfy the linker. | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
63 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
64 | LDObject::Type LDObject::getType() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
65 | { return LDObject::Unidentified; |
376 | 66 | } |
67 | ||
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
68 | bool LDObject::hasMatrix() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
69 | { return false; |
376 | 70 | } |
71 | ||
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
72 | bool LDObject::isColored() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
73 | { return false; |
376 | 74 | } |
75 | ||
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
76 | bool LDObject::isScemantic() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
77 | { return false; |
376 | 78 | } |
79 | ||
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
80 | str LDObject::getTypeName() const |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
81 | { return ""; |
376 | 82 | } |
83 | ||
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
84 | int LDObject::vertices() const |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
85 | { return 0; |
376 | 86 | } |
87 | ||
88 | // ============================================================================= | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
89 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
90 | void LDObject::setVertexCoord (int i, Axis ax, double value) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
91 | { vertex v = getVertex (i); |
376 | 92 | v[ax] = value; |
93 | setVertex (i, v); | |
94 | } | |
95 | ||
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
96 | LDError::LDError() {} |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
98 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
99 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
100 | str LDComment::raw() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
101 | { return fmt ("0 %1", text); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
103 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
104 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
105 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
106 | str LDSubfile::raw() |
540
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
107 | { str val = fmt ("1 %1 %2 ", getColor(), getPosition()); |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
108 | val += getTransform().stringRep(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
109 | val += ' '; |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
110 | val += getFileInfo()->getName(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | return val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
112 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
113 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
114 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
115 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
116 | str LDLine::raw() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
117 | { str val = fmt ("2 %1", getColor()); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
118 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
119 | for (int i = 0; i < 2; ++i) |
376 | 120 | val += fmt (" %1", getVertex (i)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
121 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
122 | return val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
123 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
124 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
125 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
126 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
127 | str LDTriangle::raw() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
128 | { str val = fmt ("3 %1", getColor()); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
129 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
130 | for (int i = 0; i < 3; ++i) |
376 | 131 | val += fmt (" %1", getVertex (i)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
132 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
133 | return val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
134 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
135 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
136 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
137 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
138 | str LDQuad::raw() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
139 | { str val = fmt ("4 %1", getColor()); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
140 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
141 | for (int i = 0; i < 4; ++i) |
376 | 142 | val += fmt (" %1", getVertex (i)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
143 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
144 | return val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
145 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
146 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
147 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
148 | // ----------------------------------------------------------------------------- |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
149 | str LDCondLine::raw() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
150 | { str val = fmt ("5 %1", getColor()); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
151 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
152 | // Add the coordinates |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
153 | for (int i = 0; i < 4; ++i) |
376 | 154 | val += fmt (" %1", getVertex (i)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
155 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
156 | return val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
157 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
158 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
159 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
160 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
161 | str LDError::raw() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
162 | { return contents; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
163 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
164 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
165 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
166 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
167 | str LDVertex::raw() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
168 | { return fmt ("0 !LDFORGE VERTEX %1 %2", getColor(), pos); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
169 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
170 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
171 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
172 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
173 | str LDEmpty::raw() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
174 | { return ""; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
175 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
176 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
177 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
178 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
179 | const char* LDBFC::statements[] = |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
180 | { "CERTIFY CCW", |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
181 | "CCW", |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
182 | "CERTIFY CW", |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
183 | "CW", |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
184 | "NOCERTIFY", |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
185 | "INVERTNEXT", |
418
c435027ee5cd
added support for BFC CLIP/NOCLIP
Santeri Piippo <crimsondusk64@gmail.com>
parents:
409
diff
changeset
|
186 | "CLIP", |
c435027ee5cd
added support for BFC CLIP/NOCLIP
Santeri Piippo <crimsondusk64@gmail.com>
parents:
409
diff
changeset
|
187 | "CLIP CCW", |
c435027ee5cd
added support for BFC CLIP/NOCLIP
Santeri Piippo <crimsondusk64@gmail.com>
parents:
409
diff
changeset
|
188 | "CLIP CW", |
c435027ee5cd
added support for BFC CLIP/NOCLIP
Santeri Piippo <crimsondusk64@gmail.com>
parents:
409
diff
changeset
|
189 | "NOCLIP", |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
190 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
191 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
192 | str LDBFC::raw() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
193 | { return fmt ("0 BFC %1", LDBFC::statements[type]); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
194 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
195 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
196 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
197 | // ----------------------------------------------------------------------------- |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
503
diff
changeset
|
198 | QList<LDTriangle*> LDQuad::splitToTriangles() |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
199 | { // Create the two triangles based on this quadrilateral: |
376 | 200 | // 0---3 0---3 3 |
201 | // | | | / /| | |
202 | // | | ==> | / / | | |
203 | // | | |/ / | | |
204 | // 1---2 1 1---2 | |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
205 | LDTriangle* tri1 = new LDTriangle (getVertex (0), getVertex (1), getVertex (3)); |
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
206 | LDTriangle* tri2 = new LDTriangle (getVertex (1), getVertex (2), getVertex (3)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
207 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
208 | // The triangles also inherit the quad's color |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
209 | tri1->setColor (getColor()); |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
210 | tri2->setColor (getColor()); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
211 | |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
503
diff
changeset
|
212 | QList<LDTriangle*> triangles; |
252
3f9067022d74
Take the aforementioned operator<< into use
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
213 | triangles << tri1; |
3f9067022d74
Take the aforementioned operator<< into use
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
214 | triangles << tri2; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
215 | return triangles; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
216 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
217 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
218 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
219 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
220 | void LDObject::replace (LDObject* other) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
221 | { long idx = getIndex(); |
376 | 222 | assert (idx != -1); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
223 | |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
224 | // Replace the instance of the old object with the new object |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
225 | getFile()->setObject (idx, other); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
226 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
227 | // Remove the old object |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
228 | delete this; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
229 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
230 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
231 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
232 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
233 | void LDObject::swap (LDObject* other) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
234 | { int i = 0; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
235 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
236 | for (LDObject* obj : getFile()->getObjects()) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
237 | { if (obj == this) |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
238 | getFile()->setObject (i, other); |
376 | 239 | elif (obj == other) |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
240 | getFile()->setObject (i, this); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
241 | |
484
5b5c77c7f3dd
made LDFile interfacing a bit clearer
Santeri Piippo <crimsondusk64@gmail.com>
parents:
464
diff
changeset
|
242 | ++i; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
243 | } |
376 | 244 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
245 | getFile()->addToHistory (new SwapHistory (getID(), other->getID())); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
246 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
247 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
248 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
249 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
250 | LDLine::LDLine (vertex v1, vertex v2) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
251 | { setVertex (0, v1); |
376 | 252 | setVertex (1, v2); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
253 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
254 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
255 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
256 | // ----------------------------------------------------------------------------- |
506
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
257 | LDQuad::LDQuad (const vertex& v0, const vertex& v1, const vertex& v2, const vertex& v3) |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
258 | { setVertex (0, v0); |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
259 | setVertex (1, v1); |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
260 | setVertex (2, v2); |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
261 | setVertex (3, v3); |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
262 | } |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
263 | |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
264 | // ============================================================================= |
525f6c48db83
Added last-resort ring draw with quads
Santeri Piippo <crimsondusk64@gmail.com>
parents:
504
diff
changeset
|
265 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
266 | LDObject::~LDObject() |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
267 | { // If this object was selected, unselect it now |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
268 | if (isSelected()) |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
269 | unselect(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
270 | |
528
e38d199ef9aa
fixed: deleting objects would trigger a crash
Santeri Piippo <crimsondusk64@gmail.com>
parents:
527
diff
changeset
|
271 | // If this object was associated to a file, remove it off it now |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
272 | if (getFile()) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
273 | getFile()->forgetObject (this); |
528
e38d199ef9aa
fixed: deleting objects would trigger a crash
Santeri Piippo <crimsondusk64@gmail.com>
parents:
527
diff
changeset
|
274 | |
194
cfe9ae5f1124
Fixed coordconv3_2 algorithm, plane drawing works on any of the fixed cameras now.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
275 | // Delete the GL lists |
376 | 276 | GL::deleteLists (this); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
277 | |
307
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
278 | // Remove this object from the list of LDObjects |
503
bebe09014dd6
removed the List class in favor of QList
Santeri Piippo <crimsondusk64@gmail.com>
parents:
500
diff
changeset
|
279 | g_LDObjects.removeOne (this); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
280 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
281 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
282 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
283 | // ----------------------------------------------------------------------------- |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
284 | static void transformObject (LDObject* obj, matrix transform, vertex pos, int parentcolor) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
285 | { switch (obj->getType()) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
286 | { case LDObject::Line: |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
287 | case LDObject::CondLine: |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
288 | case LDObject::Triangle: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
289 | case LDObject::Quad: |
376 | 290 | |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
291 | for (int i = 0; i < obj->vertices(); ++i) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
292 | { vertex v = obj->getVertex (i); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
293 | v.transform (transform, pos); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
294 | obj->setVertex (i, v); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
295 | } |
376 | 296 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
297 | break; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
298 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
299 | case LDObject::Subfile: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
300 | { LDSubfile* ref = static_cast<LDSubfile*> (obj); |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
301 | matrix newMatrix = transform * ref->getTransform(); |
540
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
302 | vertex newpos = ref->getPosition(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
303 | |
376 | 304 | newpos.transform (transform, pos); |
305 | ref->setPosition (newpos); | |
306 | ref->setTransform (newMatrix); | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
307 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
308 | break; |
376 | 309 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
310 | default: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
311 | break; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
312 | } |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
313 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
314 | if (obj->getColor() == maincolor) |
376 | 315 | obj->setColor (parentcolor); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
316 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
317 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
318 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
319 | // ----------------------------------------------------------------------------- |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
503
diff
changeset
|
320 | QList<LDObject*> LDSubfile::inlineContents (InlineFlags flags) |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
321 | { QList<LDObject*> objs = getFileInfo()->inlineContents (flags); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
322 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
323 | // Transform the objects |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
324 | for (LDObject * obj : objs) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
325 | { // Set the parent now so we know what inlined this. |
376 | 326 | obj->setParent (this); |
540
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
327 | transformObject (obj, getTransform(), getPosition(), getColor()); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
328 | } |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
329 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
330 | return objs; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
331 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
332 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
333 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
334 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
335 | long LDObject::getIndex() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
336 | { |
388
7ff483614aa1
Multiple file support works now! woo!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
381
diff
changeset
|
337 | #ifndef RELEASE |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
338 | assert (getFile() != null); |
388
7ff483614aa1
Multiple file support works now! woo!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
381
diff
changeset
|
339 | #endif |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
340 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
341 | for (int i = 0; i < getFile()->getObjectCount(); ++i) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
342 | if (getFile()->getObject (i) == this) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
343 | return i; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
344 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
345 | return -1; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
346 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
347 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
348 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
349 | // ----------------------------------------------------------------------------- |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
503
diff
changeset
|
350 | void LDObject::moveObjects (QList<LDObject*> objs, const bool up) |
527
47c068f2e7e3
more minor changes
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
351 | { if (objs.isEmpty()) |
445
15c3af0b5cb7
fixed: LDObject's various methods still assumed that the current file wouldn't change
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
352 | return; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
353 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
354 | // If we move down, we need to iterate the array in reverse order. |
376 | 355 | const long start = up ? 0 : (objs.size() - 1); |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
356 | const long end = up ? objs.size() : -1; |
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
357 | const long incr = up ? 1 : -1; |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
503
diff
changeset
|
358 | QList<LDObject*> objsToCompile; |
553
2418d5955421
- LDFile renamed to LDDocument, file.h -> document.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
551
diff
changeset
|
359 | LDDocument* file = objs[0]->getFile(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
360 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
361 | for (long i = start; i != end; i += incr) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
362 | { LDObject* obj = objs[i]; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
363 | |
388
7ff483614aa1
Multiple file support works now! woo!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
381
diff
changeset
|
364 | const long idx = obj->getIndex(), |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
365 | target = idx + (up ? -1 : 1); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
366 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
367 | if ( (up && idx == 0) || (!up && idx == (long) (file->getObjects().size() - 1))) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
368 | { // One of the objects hit the extrema. If this happens, this should be the first |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
369 | // object to be iterated on. Thus, nothing has changed yet and it's safe to just |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
370 | // abort the entire operation. |
376 | 371 | assert (i == start); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
372 | return; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
373 | } |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
374 | |
252
3f9067022d74
Take the aforementioned operator<< into use
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
375 | objsToCompile << obj; |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
376 | objsToCompile << file->getObject (target); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
377 | |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
378 | obj->swap (file->getObject (target)); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
379 | } |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
380 | |
503
bebe09014dd6
removed the List class in favor of QList
Santeri Piippo <crimsondusk64@gmail.com>
parents:
500
diff
changeset
|
381 | removeDuplicates (objsToCompile); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
382 | |
217
cad8c046f27a
Fixed: moving objects up/down the object list messed up selection
Santeri Piippo <crimsondusk64@gmail.com>
parents:
216
diff
changeset
|
383 | // The objects need to be recompiled, otherwise their pick lists are left with |
cad8c046f27a
Fixed: moving objects up/down the object list messed up selection
Santeri Piippo <crimsondusk64@gmail.com>
parents:
216
diff
changeset
|
384 | // the wrong index colors which messes up selection. |
503
bebe09014dd6
removed the List class in favor of QList
Santeri Piippo <crimsondusk64@gmail.com>
parents:
500
diff
changeset
|
385 | for (LDObject* obj : objsToCompile) |
376 | 386 | g_win->R()->compileObject (obj); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
387 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
388 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
389 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
390 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
391 | str LDObject::typeName (LDObject::Type type) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
392 | { LDObject* obj = LDObject::getDefault (type); |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
393 | str name = obj->getTypeName(); |
357
9c954c222996
Removed the two string arrays containing object types and icon names, moved these as LDObjects' virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
319
diff
changeset
|
394 | delete obj; |
9c954c222996
Removed the two string arrays containing object types and icon names, moved these as LDObjects' virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
319
diff
changeset
|
395 | return name; |
9c954c222996
Removed the two string arrays containing object types and icon names, moved these as LDObjects' virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
319
diff
changeset
|
396 | } |
9c954c222996
Removed the two string arrays containing object types and icon names, moved these as LDObjects' virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
319
diff
changeset
|
397 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
398 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
399 | // ----------------------------------------------------------------------------- |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
400 | str LDObject::describeObjects (const QList<LDObject*>& objs) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
401 | { bool firstDetails = true; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
402 | str text = ""; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
403 | |
527
47c068f2e7e3
more minor changes
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
404 | if (objs.isEmpty()) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
405 | return "nothing"; // :) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
406 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
407 | for (long i = 0; i < LDObject::NumTypes; ++i) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
408 | { LDObject::Type objType = (LDObject::Type) i; |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
409 | int count = 0; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
410 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
411 | for (LDObject * obj : objs) |
376 | 412 | if (obj->getType() == objType) |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
413 | count++; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
414 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
415 | if (count == 0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
416 | continue; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
417 | |
376 | 418 | if (!firstDetails) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
419 | text += ", "; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
420 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
421 | str noun = fmt ("%1%2", typeName (objType), plural (count)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
422 | |
527
47c068f2e7e3
more minor changes
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
423 | // Plural of "vertex" is "vertices", correct that |
47c068f2e7e3
more minor changes
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
424 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
425 | if (objType == LDObject::Vertex && count != 1) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
426 | noun = "vertices"; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
427 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
428 | text += fmt ("%1 %2", count, noun); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
429 | firstDetails = false; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
430 | } |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
431 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
432 | return text; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
433 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
434 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
435 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
436 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
437 | LDObject* LDObject::topLevelParent() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
438 | { if (!getParent()) |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
439 | return this; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
440 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
441 | LDObject* it = this; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
442 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
443 | while (it->getParent()) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
444 | it = it->getParent(); |
376 | 445 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
446 | return it; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
447 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
448 | |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
449 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
450 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
451 | LDObject* LDObject::next() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
452 | { long idx = getIndex(); |
376 | 453 | assert (idx != -1); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
454 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
455 | if (idx == (long) getFile()->getObjectCount() - 1) |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
456 | return null; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
457 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
458 | return getFile()->getObject (idx + 1); |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
459 | } |
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
460 | |
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
461 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
462 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
463 | LDObject* LDObject::prev() const |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
464 | { long idx = getIndex(); |
376 | 465 | assert (idx != -1); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
466 | |
376 | 467 | if (idx == 0) |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
468 | return null; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
469 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
470 | return getFile()->getObject (idx - 1); |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
189
diff
changeset
|
471 | } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
472 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
473 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
474 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
475 | void LDObject::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
476 | { (void) vect; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
477 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
478 | void LDEmpty::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
479 | { (void) vect; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
480 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
481 | void LDBFC::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
482 | { (void) vect; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
483 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
484 | void LDComment::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
485 | { (void) vect; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
486 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
487 | void LDError::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
488 | { (void) vect; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
489 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
490 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
491 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
492 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
493 | void LDVertex::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
494 | { pos += vect; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
495 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
496 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
497 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
498 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
499 | void LDSubfile::move (vertex vect) |
540
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
500 | { setPosition (getPosition() + vect); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
501 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
502 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
503 | // ============================================================================= |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
504 | // ----------------------------------------------------------------------------- |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
505 | void LDLine::move (vertex vect) |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
506 | { for (int i = 0; i < 2; ++i) |
376 | 507 | setVertex (i, getVertex (i) + vect); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
508 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
509 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
510 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
511 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
512 | void LDTriangle::move (vertex vect) |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
513 | { for (int i = 0; i < 3; ++i) |
376 | 514 | setVertex (i, getVertex (i) + vect); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
515 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
516 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
517 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
518 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
519 | void LDQuad::move (vertex vect) |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
520 | { for (int i = 0; i < 4; ++i) |
376 | 521 | setVertex (i, getVertex (i) + vect); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
522 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
523 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
524 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
525 | // ----------------------------------------------------------------------------- |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
526 | void LDCondLine::move (vertex vect) |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
528
diff
changeset
|
527 | { for (int i = 0; i < 4; ++i) |
376 | 528 | setVertex (i, getVertex (i) + vect); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
529 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
530 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
531 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
532 | // ----------------------------------------------------------------------------- |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
533 | #define CHECK_FOR_OBJ(N) \ |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
534 | if (type == LDObject::N) \ |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
535 | return new LD##N; |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
536 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
537 | LDObject* LDObject::getDefault (const LDObject::Type type) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
538 | { CHECK_FOR_OBJ (Comment) |
376 | 539 | CHECK_FOR_OBJ (BFC) |
540 | CHECK_FOR_OBJ (Line) | |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
541 | CHECK_FOR_OBJ (CondLine) |
376 | 542 | CHECK_FOR_OBJ (Subfile) |
543 | CHECK_FOR_OBJ (Triangle) | |
544 | CHECK_FOR_OBJ (Quad) | |
545 | CHECK_FOR_OBJ (Empty) | |
546 | CHECK_FOR_OBJ (BFC) | |
377
271d1da66b7e
Appended 'Object' to the names of all LDObject derivatives so even though the LD prefix isn't reserved for just LDObjects anymore, these classes remain distinct
Santeri Piippo <crimsondusk64@gmail.com>
parents:
376
diff
changeset
|
547 | CHECK_FOR_OBJ (Error) |
376 | 548 | CHECK_FOR_OBJ (Vertex) |
549 | CHECK_FOR_OBJ (Overlay) | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
550 | return null; |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
551 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
552 | |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
553 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
554 | // ----------------------------------------------------------------------------- |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
555 | void LDObject::invert() {} |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
556 | void LDBFC::invert() {} |
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
557 | void LDEmpty::invert() {} |
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
558 | void LDComment::invert() {} |
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
559 | void LDError::invert() {} |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
560 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
561 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
562 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
563 | void LDTriangle::invert() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
564 | { // Triangle goes 0 -> 1 -> 2, reversed: 0 -> 2 -> 1. |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
565 | // Thus, we swap 1 and 2. |
376 | 566 | vertex tmp = getVertex (1); |
567 | setVertex (1, getVertex (2)); | |
568 | setVertex (2, tmp); | |
569 | ||
265
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
570 | return; |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
571 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
572 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
573 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
574 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
575 | void LDQuad::invert() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
576 | { // Quad: 0 -> 1 -> 2 -> 3 |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
577 | // rev: 0 -> 3 -> 2 -> 1 |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
578 | // Thus, we swap 1 and 3. |
376 | 579 | vertex tmp = getVertex (1); |
580 | setVertex (1, getVertex (3)); | |
581 | setVertex (3, tmp); | |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
582 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
583 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
584 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
585 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
586 | void LDSubfile::invert() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
587 | { // Subfiles are inverted when they're prefixed with |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
588 | // a BFC INVERTNEXT statement. Thus we need to toggle this status. |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
589 | // For flat primitives it's sufficient that the determinant is |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
590 | // flipped but I don't have a method for checking flatness yet. |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
591 | // Food for thought... |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
592 | |
498
791c831c8020
further cleansing - removed most uses of unsigned ints, removed list reversers
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
593 | int idx = getIndex(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
594 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
595 | if (idx > 0) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
596 | { LDBFC* bfc = dynamic_cast<LDBFC*> (prev()); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
597 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
598 | if (bfc && bfc->type == LDBFC::InvertNext) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
599 | { // This is prefixed with an invertnext, thus remove it. |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
600 | getFile()->forgetObject (bfc); |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
601 | delete bfc; |
265
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
602 | return; |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
603 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
604 | } |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
605 | |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
606 | // Not inverted, thus prefix it with a new invertnext. |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
607 | LDBFC* bfc = new LDBFC (LDBFC::InvertNext); |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
608 | getFile()->insertObj (idx, bfc); |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
609 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
610 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
611 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
612 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
613 | static void invertLine (LDObject* line) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
614 | { // For lines, we swap the vertices. I don't think that a |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
615 | // cond-line's control points need to be swapped, do they? |
376 | 616 | vertex tmp = line->getVertex (0); |
617 | line->setVertex (0, line->getVertex (1)); | |
618 | line->setVertex (1, tmp); | |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
619 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
620 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
621 | void LDLine::invert() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
622 | { invertLine (this); |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
623 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
624 | |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
625 | void LDCondLine::invert() |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
626 | { invertLine (this); |
192
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
627 | } |
c414924a647c
Split inverting into methods into LDObject and its subclasses, fixed a rather severe memory leak issue (GL display lists weren't being removed properly)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
191
diff
changeset
|
628 | |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
629 | void LDVertex::invert() {} |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
630 | |
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
631 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
632 | // ----------------------------------------------------------------------------- |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
633 | LDLine* LDCondLine::demote() |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
634 | { LDLine* repl = new LDLine; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
635 | |
376 | 636 | for (int i = 0; i < repl->vertices(); ++i) |
637 | repl->setVertex (i, getVertex (i)); | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
638 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
639 | repl->setColor (getColor()); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
640 | |
376 | 641 | replace (repl); |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
642 | return repl; |
275
7b5afec27688
Color changing is now logged into history
Santeri Piippo <crimsondusk64@gmail.com>
parents:
274
diff
changeset
|
643 | } |
7b5afec27688
Color changing is now logged into history
Santeri Piippo <crimsondusk64@gmail.com>
parents:
274
diff
changeset
|
644 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
645 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
646 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
647 | LDObject* LDObject::fromID (int id) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
648 | { for (LDObject * obj : g_LDObjects) |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
649 | if (obj->getID() == id) |
307
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
650 | return obj; |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
651 | |
307
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
652 | return null; |
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
653 | } |
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
654 | |
316
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
655 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
656 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
657 | str LDOverlay::raw() |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
658 | { return fmt ("0 !LDFORGE OVERLAY %1 %2 %3 %4 %5 %6", |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
659 | getFileName(), getCamera(), getX(), getY(), getWidth(), getHeight()); |
316
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
660 | } |
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
661 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
662 | void LDOverlay::move (vertex vect) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
663 | { Q_UNUSED (vect) |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
664 | } |
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
665 | |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
666 | void LDOverlay::invert() {} |
307
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
667 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
668 | // ============================================================================= |
376 | 669 | // Hook the set accessors of certain properties to this changeProperty function. |
670 | // It takes care of history management so we can capture low-level changes, this | |
671 | // makes history stuff work out of the box. | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
672 | // ----------------------------------------------------------------------------- |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
673 | template<class T> static void changeProperty (LDObject* obj, T* ptr, const T& val) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
674 | { long idx; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
675 | |
521
b85554206155
changeProperty(): don't change the property if the value would not change, this should save some procecssing..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
516
diff
changeset
|
676 | if (*ptr == val) |
b85554206155
changeProperty(): don't change the property if the value would not change, this should save some procecssing..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
516
diff
changeset
|
677 | return; |
b85554206155
changeProperty(): don't change the property if the value would not change, this should save some procecssing..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
516
diff
changeset
|
678 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
679 | if (obj->getFile() && (idx = obj->getIndex()) != -1) |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
680 | { str before = obj->raw(); |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
681 | *ptr = val; |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
682 | str after = obj->raw(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
683 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
684 | obj->getFile()->addToHistory (new EditHistory (idx, before, after)); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
685 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
686 | else |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
687 | *ptr = val; |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
688 | } |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
689 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
690 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
691 | // ----------------------------------------------------------------------------- |
540
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
692 | void LDObject::setColor (const int& val) |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
693 | { changeProperty (this, &m_Color, val); |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
694 | } |
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
695 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
696 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
697 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
698 | const vertex& LDObject::getVertex (int i) const |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
699 | { return m_coords[i]->data(); |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
700 | } |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
701 | |
542
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
702 | // ============================================================================= |
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
703 | // ----------------------------------------------------------------------------- |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
704 | void LDObject::setVertex (int i, const vertex& vert) |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
705 | { changeProperty (this, &m_coords[i], LDSharedVertex::getSharedVertex (vert)); |
359
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
706 | } |
bcdfc801658b
more restyle/refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
707 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
708 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
709 | // ----------------------------------------------------------------------------- |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
710 | void LDMatrixObject::setPosition (const vertex& a) |
542
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
711 | { changeProperty (getLinkPointer(), &m_Position, LDSharedVertex::getSharedVertex (a)); |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
712 | } |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
713 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
714 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
447
diff
changeset
|
715 | // ----------------------------------------------------------------------------- |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
716 | void LDMatrixObject::setTransform (const matrix& val) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
717 | { changeProperty (getLinkPointer(), &m_Transform, val); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
486
diff
changeset
|
718 | } |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
719 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
720 | // ============================================================================= |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
721 | // ----------------------------------------------------------------------------- |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
722 | static QMap<vertex, LDSharedVertex*> g_sharedVerts; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
723 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
724 | LDSharedVertex* LDSharedVertex::getSharedVertex (const vertex& a) |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
725 | { auto it = g_sharedVerts.find (a); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
726 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
727 | if (it == g_sharedVerts.end()) |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
728 | { LDSharedVertex* v = new LDSharedVertex (a); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
729 | g_sharedVerts[a] = v; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
730 | return v; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
731 | } |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
732 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
733 | return *it; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
734 | } |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
735 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
736 | // ============================================================================= |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
737 | // ----------------------------------------------------------------------------- |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
738 | void LDSharedVertex::addRef (LDObject* a) |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
739 | { m_refs << a; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
740 | } |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
741 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
742 | // ============================================================================= |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
743 | // ----------------------------------------------------------------------------- |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
744 | void LDSharedVertex::delRef (LDObject* a) |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
745 | { m_refs.removeOne (a); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
746 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
747 | if (m_refs.empty()) |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
748 | { g_sharedVerts.remove (m_data); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
749 | delete this; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
750 | } |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
751 | } |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
752 | |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
753 | // ============================================================================= |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
754 | // ----------------------------------------------------------------------------- |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
755 | void LDObject::select() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
756 | { if (!getFile()) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
757 | { log ("Warning: Object #%1 cannot be selected as it is not assigned a file!\n", getID()); |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
758 | return; |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
759 | } |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
760 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
761 | getFile()->addToSelection (this); |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
762 | } |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
763 | |
554
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
764 | // ============================================================================= |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
765 | // ----------------------------------------------------------------------------- |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
766 | void LDObject::unselect() |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
767 | { if (!getFile()) |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
768 | { log ("Warning: Object #%1 cannot be unselected as it is not assigned a file!\n", getID()); |
522
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
769 | return; |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
770 | } |
afa691788bdb
- migrated selection from ForgeWindow to individual LDFiles. Should've done this long ago.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
521
diff
changeset
|
771 | |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
772 | getFile()->removeFromSelection (this); |
554
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
773 | } |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
774 | |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
775 | // ============================================================================= |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
776 | // ----------------------------------------------------------------------------- |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
777 | str getLicenseText (int id) |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
778 | { switch (id) |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
779 | { case 0: |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
780 | return CALicense; |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
781 | |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
782 | case 1: |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
783 | return NonCALicense; |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
784 | |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
785 | case 2: |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
786 | return ""; |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
787 | } |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
788 | |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
789 | assert (false); |
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
790 | return ""; |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
791 | } |