SciDAVis
1.D4
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
scidavis
src
future
matrix
matrixcommands.h
Go to the documentation of this file.
1
/***************************************************************************
2
File : matrixcommands.h
3
Project : SciDAVis
4
Description : Commands used in Matrix (part of the undo/redo framework)
5
--------------------------------------------------------------------
6
Copyright : (C) 2008-2009 Tilman Benkert (thzs*gmx.net)
7
(replace * with @ in the email addresses)
8
9
***************************************************************************/
10
11
/***************************************************************************
12
* *
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
17
* *
18
* This program is distributed in the hope that it will be useful, *
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21
* GNU General Public License for more details. *
22
* *
23
* You should have received a copy of the GNU General Public License *
24
* along with this program; if not, write to the Free Software *
25
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26
* Boston, MA 02110-1301 USA *
27
* *
28
***************************************************************************/
29
30
#ifndef MATRIX_COMMANDS_H
31
#define MATRIX_COMMANDS_H
32
33
#include <QUndoCommand>
34
#include "
matrix/future_Matrix.h
"
35
37
// class MatrixInsertColumnsCmd
40
class
MatrixInsertColumnsCmd
:
public
QUndoCommand
41
{
42
public
:
43
MatrixInsertColumnsCmd
(
future::Matrix::Private
* private_obj,
int
before,
int
count, QUndoCommand * parent = 0 );
44
~MatrixInsertColumnsCmd
();
45
46
virtual
void
redo
();
47
virtual
void
undo
();
48
49
private
:
51
future::Matrix::Private
*
d_private_obj
;
53
int
d_before
;
55
int
d_count
;
56
};
57
59
// end of class MatrixInsertColumnsCmd
61
63
// class MatrixInsertRowsCmd
66
class
MatrixInsertRowsCmd
:
public
QUndoCommand
67
{
68
public
:
69
MatrixInsertRowsCmd
(
future::Matrix::Private
* private_obj,
int
before,
int
count, QUndoCommand * parent = 0 );
70
~MatrixInsertRowsCmd
();
71
72
virtual
void
redo
();
73
virtual
void
undo
();
74
75
private
:
77
future::Matrix::Private
*
d_private_obj
;
79
int
d_before
;
81
int
d_count
;
82
};
83
85
// end of class MatrixInsertRowsCmd
87
89
// class MatrixRemoveColumnsCmd
92
class
MatrixRemoveColumnsCmd
:
public
QUndoCommand
93
{
94
public
:
95
MatrixRemoveColumnsCmd
(
future::Matrix::Private
* private_obj,
int
first,
int
count, QUndoCommand * parent = 0 );
96
~MatrixRemoveColumnsCmd
();
97
98
virtual
void
redo
();
99
virtual
void
undo
();
100
101
private
:
103
future::Matrix::Private
*
d_private_obj
;
105
int
d_first
;
107
int
d_count
;
109
QVector< QVector<qreal> >
d_backups
;
110
};
111
113
// end of class MatrixRemoveColumnsCmd
115
117
// class MatrixRemoveRowsCmd
120
class
MatrixRemoveRowsCmd
:
public
QUndoCommand
121
{
122
public
:
123
MatrixRemoveRowsCmd
(
future::Matrix::Private
* private_obj,
int
first,
int
count, QUndoCommand * parent = 0 );
124
~MatrixRemoveRowsCmd
();
125
126
virtual
void
redo
();
127
virtual
void
undo
();
128
129
private
:
131
future::Matrix::Private
*
d_private_obj
;
133
int
d_first
;
135
int
d_count
;
137
QVector< QVector<qreal> >
d_backups
;
138
};
139
141
// end of class MatrixRemoveRowsCmd
143
145
// class MatrixClearCmd
148
class
MatrixClearCmd
:
public
QUndoCommand
149
{
150
public
:
151
MatrixClearCmd
(
future::Matrix::Private
* private_obj, QUndoCommand * parent = 0 );
152
~MatrixClearCmd
();
153
154
virtual
void
redo
();
155
virtual
void
undo
();
156
157
private
:
159
future::Matrix::Private
*
d_private_obj
;
161
QVector< QVector<qreal> >
d_backups
;
162
};
163
165
// end of class MatrixClearCmd
167
169
// class MatrixClearColumnCmd
172
class
MatrixClearColumnCmd
:
public
QUndoCommand
173
{
174
public
:
175
MatrixClearColumnCmd
(
future::Matrix::Private
* private_obj,
int
col, QUndoCommand * parent = 0 );
176
~MatrixClearColumnCmd
();
177
178
virtual
void
redo
();
179
virtual
void
undo
();
180
181
private
:
183
future::Matrix::Private
*
d_private_obj
;
185
int
d_col
;
187
QVector<qreal>
d_backup
;
188
};
189
191
// end of class MatrixClearColumnCmd
193
195
// class MatrixSetCellValueCmd
198
class
MatrixSetCellValueCmd
:
public
QUndoCommand
199
{
200
public
:
201
MatrixSetCellValueCmd
(
future::Matrix::Private
* private_obj,
int
row,
int
col,
double
value, QUndoCommand * parent = 0 );
202
~MatrixSetCellValueCmd
();
203
204
virtual
void
redo
();
205
virtual
void
undo
();
206
207
private
:
209
future::Matrix::Private
*
d_private_obj
;
211
int
d_row
;
213
int
d_col
;
215
double
d_value
;
217
double
d_old_value
;
218
};
219
221
// end of class MatrixSetCellValueCmd
223
225
// class MatrixSetCoordinatesCmd
228
class
MatrixSetCoordinatesCmd
:
public
QUndoCommand
229
{
230
public
:
231
MatrixSetCoordinatesCmd
(
future::Matrix::Private
* private_obj,
double
x1,
double
x2,
double
y1,
double
y2, QUndoCommand * parent = 0 );
232
~MatrixSetCoordinatesCmd
();
233
234
virtual
void
redo
();
235
virtual
void
undo
();
236
237
private
:
239
future::Matrix::Private
*
d_private_obj
;
240
double
d_new_x1
;
241
double
d_new_x2
;
242
double
d_new_y1
;
243
double
d_new_y2
;
244
double
d_old_x1
;
245
double
d_old_x2
;
246
double
d_old_y1
;
247
double
d_old_y2
;
248
};
249
251
// end of class MatrixSetCoordinatesCmd
253
255
// class MatrixSetFormatCmd
258
class
MatrixSetFormatCmd
:
public
QUndoCommand
259
{
260
public
:
261
MatrixSetFormatCmd
(
future::Matrix::Private
* private_obj,
char
new_format);
262
263
virtual
void
redo
();
264
virtual
void
undo
();
265
266
private
:
268
future::Matrix::Private
*
d_private_obj
;
269
char
d_other_format
;
270
};
272
// end of class MatrixSetFormatCmd
274
276
// class MatrixSetDigitsCmd
279
class
MatrixSetDigitsCmd
:
public
QUndoCommand
280
{
281
public
:
282
MatrixSetDigitsCmd
(
future::Matrix::Private
* private_obj,
int
new_digits);
283
284
virtual
void
redo
();
285
virtual
void
undo
();
286
287
private
:
289
future::Matrix::Private
*
d_private_obj
;
290
int
d_other_digits
;
291
};
293
// end of class MatrixSetDigitsCmd
295
297
// class MatrixSetFormulaCmd
300
class
MatrixSetFormulaCmd
:
public
QUndoCommand
301
{
302
public
:
303
MatrixSetFormulaCmd
(
future::Matrix::Private
* private_obj, QString formula);
304
305
virtual
void
redo
();
306
virtual
void
undo
();
307
308
private
:
310
future::Matrix::Private
*
d_private_obj
;
311
QString
d_other_formula
;
312
};
314
// end of class MatrixSetFormulaCmd
316
318
// class MatrixSetColumnCellsCmd
321
class
MatrixSetColumnCellsCmd
:
public
QUndoCommand
322
{
323
public
:
324
MatrixSetColumnCellsCmd
(
future::Matrix::Private
* private_obj,
int
col,
int
first_row,
int
last_row,
const
QVector<qreal> & values, QUndoCommand * parent = 0 );
325
~MatrixSetColumnCellsCmd
();
326
327
virtual
void
redo
();
328
virtual
void
undo
();
329
330
private
:
332
future::Matrix::Private
*
d_private_obj
;
334
int
d_col
;
336
int
d_first_row
;
338
int
d_last_row
;
340
QVector<qreal>
d_values
;
342
QVector<qreal>
d_old_values
;
343
};
344
346
// end of class MatrixSetColumnCellsCmd
348
350
// class MatrixSetRowCellsCmd
353
class
MatrixSetRowCellsCmd
:
public
QUndoCommand
354
{
355
public
:
356
MatrixSetRowCellsCmd
(
future::Matrix::Private
* private_obj,
int
row,
int
first_column,
int
last_column,
const
QVector<qreal> & values, QUndoCommand * parent = 0 );
357
~MatrixSetRowCellsCmd
();
358
359
virtual
void
redo
();
360
virtual
void
undo
();
361
362
private
:
364
future::Matrix::Private
*
d_private_obj
;
366
int
d_row
;
368
int
d_first_column
;
370
int
d_last_column
;
372
QVector<qreal>
d_values
;
374
QVector<qreal>
d_old_values
;
375
};
376
378
// end of class MatrixSetRowCellsCmd
380
382
// class MatrixTransposeCmd
385
class
MatrixTransposeCmd
:
public
QUndoCommand
386
{
387
public
:
388
MatrixTransposeCmd
(
future::Matrix::Private
* private_obj, QUndoCommand * parent = 0 );
389
~MatrixTransposeCmd
();
390
391
virtual
void
redo
();
392
virtual
void
undo
();
393
394
private
:
396
future::Matrix::Private
*
d_private_obj
;
397
};
398
400
// end of class MatrixTransposeCmd
402
404
// class MatrixMirrorHorizontallyCmd
407
class
MatrixMirrorHorizontallyCmd
:
public
QUndoCommand
408
{
409
public
:
410
MatrixMirrorHorizontallyCmd
(
future::Matrix::Private
* private_obj, QUndoCommand * parent = 0 );
411
~MatrixMirrorHorizontallyCmd
();
412
413
virtual
void
redo
();
414
virtual
void
undo
();
415
416
private
:
418
future::Matrix::Private
*
d_private_obj
;
419
};
420
422
// end of class MatrixMirrorHorizontallyCmd
424
426
// class MatrixMirrorVerticallyCmd
429
class
MatrixMirrorVerticallyCmd
:
public
QUndoCommand
430
{
431
public
:
432
MatrixMirrorVerticallyCmd
(
future::Matrix::Private
* private_obj, QUndoCommand * parent = 0 );
433
~MatrixMirrorVerticallyCmd
();
434
435
virtual
void
redo
();
436
virtual
void
undo
();
437
438
private
:
440
future::Matrix::Private
*
d_private_obj
;
441
};
442
444
// end of class MatrixMirrorVerticallyCmd
446
447
448
449
#endif // MATRIX_COMMANDS_H
Generated by
1.8.1