Moka controlers
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
controler-undo-redo.hh
Go to the documentation of this file.
1
/*
2
* lib-controler : Un contrôleur générique de scène 3D.
3
* Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4
* http://www.sic.sp2mi.univ-poitiers.fr/
5
* Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6
* guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7
*
8
* This file is part of lib-controler
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU Lesser General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
19
*
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
24
//******************************************************************************
25
// Ce fichier est une partie de "controler.hh".
26
//******************************************************************************
28
29
public
:
30
31
// Accesseurs pour le nombre maximum d'undo possibles.
32
// Si -1 : pas de limite...
33
// Attention, le set vide eventuellement la pile des redo.
34
int
getNbMaxUndos
()
const
;
35
void
setNbMaxUndos
(
int
ANumber);
36
37
// Accesseurs pour savoir si on fait les undo-redo sur fichier
38
// Attention, le set vide tout les undo-redo.
39
bool
getUndoOnFile
()
const
;
40
void
setUndoOnFile
(
bool
ABool);
41
47
virtual
bool
undo
(
int
AStep = 1);
48
virtual
bool
redo
(
int
AStep = 1);
49
54
bool
emptyUndoRedo
();
55
56
protected
:
57
58
// Les méthodes appelées avant et après les opérations.
59
// A redéfinir pour ajouter des pré ou post traitements.
60
virtual
void
undoRedoPreSave
();
61
virtual
void
undoRedoPostSaveOk
();
62
virtual
void
undoRedoPostSaveFailed
();
63
64
//******************************************************************************
65
69
void
emptyUndoList
();
70
void
emptyRedoList
();
71
72
void
basicPreSave
();
73
void
basicPostSaveOk
();
74
void
basicPostSaveFailed
();
75
76
std::string
getUndoRedoStatus
()
const
;
77
78
std::string
getFilename
(
int
AIndex)
const
;
79
int
getNewFileIndex
();
80
81
virtual
std::ostringstream*
saveModel
();
82
virtual
bool
loadModel
(std::ostringstream* AStream);
83
84
bool
existsFile
(
const
std::string& AFilename);
85
void
recupLastUndoFromFile
();
86
void
saveLastUndoOnFile
();
87
void
recupFromFiles
();
88
89
bool
basicUndo
(
int
AStep = 1);
90
bool
basicRedo
(
int
AStep = 1);
92
93
protected
:
94
bool
FUndoOnFile
;
95
int
FNbMaxUndos
;
96
int
FLastFileIndex
;
97
std::list<std::ostringstream*>
FUndos
;
98
std::list<std::ostringstream*>
FRedos
;
99
std::ostringstream*
FActu
;
100
102
103
//******************************************************************************
lib-controler
controler-undo-redo.hh
Generated on Tue Apr 9 2013 09:51:16 for Moka controlers by
1.8.2