Wed, 10 Apr 2013 19:26:14 +0300
Added history dialog, cannot display all types yet
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
1 | /* | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
2 | * LDForge: LDraw parts authoring CAD | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
3 | * Copyright (C) 2013 Santeri `arezey` Piippo | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
4 | * | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
5 | * This program is free software: you can redistribute it and/or modify | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
6 | * it under the terms of the GNU General Public License as published by | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
7 | * the Free Software Foundation, either version 3 of the License, or | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
8 | * (at your option) any later version. | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
9 | * | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
10 | * This program is distributed in the hope that it will be useful, | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
13 | * GNU General Public License for more details. | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
14 | * | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
15 | * You should have received a copy of the GNU General Public License | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
17 | */ | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
18 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
19 | #ifndef HISTORY_H | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
20 | #define HISTORY_H | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
21 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
22 | #include "common.h" | 
| 
93
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
23 | #include "ldtypes.h" | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
24 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
25 | #define IMPLEMENT_HISTORY_TYPE(N) \ | 
| 
90
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
26 | virtual ~N##History (); \ | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
27 | virtual void undo (); \ | 
| 
96
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
28 | virtual void redo (); \ | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
29 | virtual HistoryType type () { return HISTORY_##N; } | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
30 | |
| 
96
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
31 | // ============================================================================= | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
32 | enum HistoryType { | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
33 | HISTORY_Delete, | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
34 | HISTORY_SetColor, | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
35 | HISTORY_SetContents, | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
36 | HISTORY_ListMove, | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
37 | HISTORY_Addition, | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
38 | HISTORY_QuadSplit, | 
| 
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
39 | }; | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
40 | |
| 
89
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
41 | // ============================================================================= | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
42 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
43 | // ============================================================================= | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
44 | class HistoryEntry { | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
45 | public: | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
46 | virtual void undo () {} | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
47 | virtual void redo () {} | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
48 | virtual ~HistoryEntry () {} | 
| 
96
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
49 | virtual HistoryType type () { return (HistoryType)(0); } | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
50 | }; | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
51 | |
| 
89
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
52 | // ============================================================================= | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
53 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
54 | // ============================================================================= | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
55 | class DeleteHistory : public HistoryEntry { | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
56 | public: | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
57 | IMPLEMENT_HISTORY_TYPE (Delete) | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
58 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
59 | vector<ulong> indices; | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
60 | vector<LDObject*> cache; | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
61 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
62 | DeleteHistory (vector<ulong> indices, vector<LDObject*> cache) : | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
63 | indices (indices), cache (cache) {} | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
64 | }; | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
65 | |
| 
89
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
66 | // ============================================================================= | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
67 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
68 | // ============================================================================= | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
69 | class SetColorHistory : public HistoryEntry { | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
70 | public: | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
71 | IMPLEMENT_HISTORY_TYPE (SetColor) | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
72 | |
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
73 | vector<ulong> ulaIndices; | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
74 | vector<short> daColors; | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
75 | short dNewColor; | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
76 | |
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
77 | SetColorHistory (vector<ulong> ulaIndices, vector<short> daColors, short dNewColor) : | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
78 | ulaIndices (ulaIndices), daColors (daColors), dNewColor (dNewColor) {} | 
| 
90
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
79 | }; | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
80 | |
| 
91
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
81 | // ============================================================================= | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
82 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
83 | // ============================================================================= | 
| 
90
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
84 | class SetContentsHistory : public HistoryEntry { | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
85 | public: | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
86 | IMPLEMENT_HISTORY_TYPE (SetContents) | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
87 | |
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
88 | ulong ulIndex; | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
89 | LDObject* oldObj, *newObj; | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
90 | |
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
91 | SetContentsHistory (ulong ulIndex, LDObject* oldObj, LDObject* newObj) : | 
| 
 
03f718ed5b33
Added history handling for set contents
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
89 
diff
changeset
 | 
92 | ulIndex (ulIndex), oldObj (oldObj), newObj (newObj) {} | 
| 
89
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
93 | }; | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
94 | |
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
95 | // ============================================================================= | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
96 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
5e6c08e98dbf
Allow undo of set color
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
85 
diff
changeset
 | 
97 | // ============================================================================= | 
| 
91
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
98 | class ListMoveHistory : public HistoryEntry { | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
99 | public: | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
100 | IMPLEMENT_HISTORY_TYPE (ListMove) | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
101 | |
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
102 | std::vector<ulong> ulaIndices; | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
103 | bool bUp; | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
104 | |
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
105 | std::vector<LDObject*> getObjects (short ofs); | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
106 | ListMoveHistory (vector<ulong> ulaIndices, const bool bUp) : | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
107 | ulaIndices (ulaIndices), bUp (bUp) {} | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
108 | }; | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
109 | |
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
110 | // ============================================================================= | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
111 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
b4dda6348e7e
History handling for list moving
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
90 
diff
changeset
 | 
112 | // ============================================================================= | 
| 
92
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
113 | class AdditionHistory : public HistoryEntry { | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
114 | public: | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
115 | IMPLEMENT_HISTORY_TYPE (Addition) | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
116 | |
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
117 | std::vector<ulong> ulaIndices; | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
118 | std::vector<LDObject*> paObjs; | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
119 | |
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
120 | AdditionHistory (std::vector<ulong> ulaIndices, std::vector<LDObject*> paObjs) : | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
121 | ulaIndices (ulaIndices), paObjs (paObjs) {} | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
122 | }; | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
123 | |
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
124 | // ============================================================================= | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
125 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
126 | // ============================================================================= | 
| 
93
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
127 | class QuadSplitHistory : public HistoryEntry { | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
128 | public: | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
129 | IMPLEMENT_HISTORY_TYPE (QuadSplit) | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
130 | |
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
131 | std::vector<ulong> ulaIndices; | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
132 | std::vector<LDQuad*> paQuads; | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
133 | |
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
134 | QuadSplitHistory (std::vector<ulong> ulaIndices, std::vector<LDQuad*> paQuads) : | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
135 | ulaIndices (ulaIndices), paQuads (paQuads) {} | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
136 | }; | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
137 | |
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
138 | // ============================================================================= | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
139 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| 
 
92682e6369e9
Added history handling for quad splitting.
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
92 
diff
changeset
 | 
140 | // ============================================================================= | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
141 | namespace History { | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
142 | extern std::vector<HistoryEntry*> entries; | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
143 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
144 | void addEntry (HistoryEntry* entry); | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
145 | void undo (); | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
146 | void redo (); | 
| 
96
 
2f175b3d8211
Added history dialog, cannot display all types yet
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
93 
diff
changeset
 | 
147 | void clear (); | 
| 
92
 
586d294ca83f
Added history management for auto-bordering (and mass-addition in general)
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents: 
91 
diff
changeset
 | 
148 | void updateActions (); | 
| 
85
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
149 | }; | 
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
150 | |
| 
 
b1541b547c8c
Added undo/redo foundations. Capable of undoing and redoing delete operations
 
Santeri Piippo <crimsondusk64@gmail.com> 
parents:  
diff
changeset
 | 
151 | #endif // HISTORY_H |