history.h

Thu, 11 Apr 2013 01:35:30 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Thu, 11 Apr 2013 01:35:30 +0300
changeset 97
52bcca21579e
parent 96
2f175b3d8211
child 98
5dcc551f260a
permissions
-rw-r--r--

Fleshed out the history dialog further

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 {
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
33 HISTORY_Del,
96
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,
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
37 HISTORY_Add,
96
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 // =============================================================================
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
55 class DelHistory : public HistoryEntry {
85
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
56 public:
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
57 enum Type {
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
58 Cut, // were deleted with a cut operation
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
59 Other, // were deleted witout specific reason
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
60 };
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
61
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
62 IMPLEMENT_HISTORY_TYPE (Del)
85
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
63
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
64 vector<ulong> indices;
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
65 vector<LDObject*> cache;
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
66 const Type eType;
85
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
67
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
68 DelHistory (vector<ulong> indices, vector<LDObject*> cache, const Type eType = Other) :
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
69 indices (indices), cache (cache), eType (eType) {}
85
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
70 };
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
71
89
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
74 // =============================================================================
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
75 class SetColorHistory : public HistoryEntry {
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
76 public:
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
77 IMPLEMENT_HISTORY_TYPE (SetColor)
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
78
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
79 vector<ulong> ulaIndices;
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
80 vector<short> daColors;
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
81 short dNewColor;
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
82
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
83 SetColorHistory (vector<ulong> ulaIndices, vector<short> daColors, short dNewColor) :
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
84 ulaIndices (ulaIndices), daColors (daColors), dNewColor (dNewColor) {}
90
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
85 };
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
86
91
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
87 // =============================================================================
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
89 // =============================================================================
90
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
90 class SetContentsHistory : public HistoryEntry {
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
91 public:
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
92 IMPLEMENT_HISTORY_TYPE (SetContents)
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
93
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
94 ulong ulIndex;
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
95 LDObject* oldObj, *newObj;
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
96
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
97 SetContentsHistory (ulong ulIndex, LDObject* oldObj, LDObject* newObj) :
03f718ed5b33 Added history handling for set contents
Santeri Piippo <crimsondusk64@gmail.com>
parents: 89
diff changeset
98 ulIndex (ulIndex), oldObj (oldObj), newObj (newObj) {}
89
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
99 };
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
100
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
101 // =============================================================================
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5e6c08e98dbf Allow undo of set color
Santeri Piippo <crimsondusk64@gmail.com>
parents: 85
diff changeset
103 // =============================================================================
91
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
104 class ListMoveHistory : public HistoryEntry {
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
105 public:
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
106 IMPLEMENT_HISTORY_TYPE (ListMove)
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
107
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
108 std::vector<ulong> ulaIndices;
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
109 bool bUp;
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 std::vector<LDObject*> getObjects (short ofs);
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
112 ListMoveHistory (vector<ulong> ulaIndices, const bool bUp) :
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
113 ulaIndices (ulaIndices), bUp (bUp) {}
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
114 };
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
115
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
116 // =============================================================================
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
b4dda6348e7e History handling for list moving
Santeri Piippo <crimsondusk64@gmail.com>
parents: 90
diff changeset
118 // =============================================================================
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
119 class AddHistory : public HistoryEntry {
92
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
120 public:
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
121 enum Type {
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
122 Other, // was "just added"
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
123 Paste, // was added through a paste operation
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
124 };
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
125
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
126 IMPLEMENT_HISTORY_TYPE (Add)
92
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
127
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
128 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
129 std::vector<LDObject*> paObjs;
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
130 const Type eType;
92
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
131
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
132 AddHistory (std::vector<ulong> ulaIndices, std::vector<LDObject*> paObjs,
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
133 const Type eType = Other) :
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
134 ulaIndices (ulaIndices), paObjs (paObjs), eType (eType) {}
92
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
135 };
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
136
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
137 // =============================================================================
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
139 // =============================================================================
93
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
140 class QuadSplitHistory : public HistoryEntry {
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
141 public:
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
142 IMPLEMENT_HISTORY_TYPE (QuadSplit)
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
143
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
144 std::vector<ulong> ulaIndices;
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
145 std::vector<LDQuad*> paQuads;
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
146
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
147 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
148 ulaIndices (ulaIndices), paQuads (paQuads) {}
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
149 };
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
150
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
151 // =============================================================================
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
92682e6369e9 Added history handling for quad splitting.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 92
diff changeset
153 // =============================================================================
85
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
154 namespace History {
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
155 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
156
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
157 void addEntry (HistoryEntry* entry);
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
158 void undo ();
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
159 void redo ();
96
2f175b3d8211 Added history dialog, cannot display all types yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 93
diff changeset
160 void clear ();
92
586d294ca83f Added history management for auto-bordering (and mass-addition in general)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 91
diff changeset
161 void updateActions ();
97
52bcca21579e Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents: 96
diff changeset
162 long pos ();
85
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
163 };
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
164
b1541b547c8c Added undo/redo foundations. Capable of undoing and redoing delete operations
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
165 #endif // HISTORY_H

mercurial