OpendTect  6.6
undo.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Kristofer Tingdahl
8  Date: 4-11-2002
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 
13 -*/
14 
15 #include "algomod.h"
16 #include "bufstringset.h"
17 #include "callback.h"
18 
19 class UndoEvent;
20 
41 mExpClass(Algo) Undo : public CallBacker
42 {
43 public:
44  Undo();
45  virtual ~Undo();
46 
47  void removeAll();
48  int maxLength() const;
54  void setMaxLength(int);
55  int addEvent(UndoEvent* event,
56  const char* description=0);
59  int currentEventID() const;
60  int firstEventID() const;
61  int lastEventID() const;
62 
65 
66  bool isUserInteractionEnd(int eventid) const;
67  void setUserInteractionEnd(int eventid,bool=true);
68  int getNextUserInteractionEnd(int start) const;
69 
70  BufferString getDesc(int eventid) const;
71  void setDesc(int eventid,const char* d);
76  bool canUnDo() const;
77  bool unDo(int nrtimes=1,bool userinteraction=true);
78 
79  bool canReDo() const;
80  bool reDo(int nrtimes=1,bool userinteraction=true);
81 
83  Notifier<Undo> undoredochange; //can**Do() or **DoDesc() change
84 
85 protected:
86  int indexOf(int eventid) const;
87 
92  int maxsize_;
93 
96 
98 };
99 
100 
104 {
105 public:
107  virtual ~UndoEvent();
108 
110  void setDesc(const char*);
111 
112  void setUserInteractionEnd(bool=true);
113  bool isUserInteractionEnd() const;
114 
115  virtual const char* getStandardDesc() const = 0;
116  virtual bool unDo() = 0;
117  virtual bool reDo() = 0;
118 
119 protected:
122 };
123 
124 
128 {
129 public:
130  virtual const BinID& getBinID() const;
131 };
132 
133 
Undo::~Undo
virtual ~Undo()
ObjectSet< UndoEvent >
Undo::maxLength
int maxLength() const
Undo::maxsize_
int maxsize_
Definition: undo.h:92
Undo::indexOf
int indexOf(int eventid) const
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Undo::firstEventID
int firstEventID() const
Undo::setDesc
void setDesc(int eventid, const char *d)
Undo::isUserInteractionEnd
bool isUserInteractionEnd(int eventid) const
Undo::firsteventid_
int firsteventid_
Definition: undo.h:91
UndoEvent::reDo
virtual bool reDo()=0
Undo::addEvent
int addEvent(UndoEvent *event, const char *description=0)
Undo::Undo
Undo()
Undo::lastEventID
int lastEventID() const
callback.h
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
Undo::currentEventID
int currentEventID() const
Undo::reDo
bool reDo(int nrtimes=1, bool userinteraction=true)
BinID
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:31
UndoEvent::getStandardDesc
virtual const char * getStandardDesc() const =0
UndoEvent
Holds the information on how to undo/redo something.
Definition: undo.h:104
Undo::removeAllAfterCurrentEvent
void removeAllAfterCurrentEvent()
Undo::canReDo
bool canReDo() const
Undo::setMaxLength
void setMaxLength(int)
Undo::removeAll
void removeAll()
BinIDUndoEvent::getBinID
virtual const BinID & getBinID() const
Undo::unDoDesc
BufferString unDoDesc() const
UndoEvent::isUserInteractionEnd
bool isUserInteractionEnd() const
BinIDUndoEvent
BinID UndoEvent.
Definition: undo.h:128
Notifier< Undo >
Undo::changenotifier
Notifier< Undo > changenotifier
Definition: undo.h:82
Undo::userendscount_
int userendscount_
Definition: undo.h:95
Undo::setUserInteractionEnd
void setUserInteractionEnd(int eventid, bool=true)
UndoEvent::desc_
BufferString * desc_
Definition: undo.h:120
Undo::currenteventid_
int currenteventid_
Definition: undo.h:90
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Undo::canUnDo
bool canUnDo() const
Undo::removeOldEvents
void removeOldEvents()
bufstringset.h
UndoEvent::getDesc
BufferString getDesc() const
UndoEvent::UndoEvent
UndoEvent()
UndoEvent::isuserinteractionend_
bool isuserinteractionend_
Definition: undo.h:121
UndoEvent::unDo
virtual bool unDo()=0
Undo::events_
ObjectSet< UndoEvent > events_
Definition: undo.h:94
Undo::reDoDesc
BufferString reDoDesc() const
Undo::addlock_
Threads::Lock addlock_
Definition: undo.h:97
Undo::removeAllBeforeCurrentEvent
void removeAllBeforeCurrentEvent()
Undo::getDesc
BufferString getDesc(int eventid) const
Undo::unDo
bool unDo(int nrtimes=1, bool userinteraction=true)
UndoEvent::setUserInteractionEnd
void setUserInteractionEnd(bool=true)
Threads::Lock
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class.
Definition: threadlock.h:53
Undo::removeStartToAndIncluding
void removeStartToAndIncluding(int)
UndoEvent::~UndoEvent
virtual ~UndoEvent()
Undo::undoredochange
Notifier< Undo > undoredochange
Definition: undo.h:83
UndoEvent::setDesc
void setDesc(const char *)
Undo::getNextUserInteractionEnd
int getNextUserInteractionEnd(int start) const
Undo
Class to handle undo/redo information.
Definition: undo.h:42

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021