GLIMSView Source Code Documentation

GlacierLineHistory Class Reference

#include <GlacierLineHistory.h>

List of all members.


Detailed Description

A container for holding and accessing the history of user actions (GlacierLineHistoryElements) on a GlacierLine.

Author:
deborah lee soltesz
Date:
2005-07-06
History:
2005-07-15 deborah lee soltesz push (GlacierLineHistoryElement * historyElement) was added to allow creation of a redo stack from GlacierLineHistoryElements stored on the history (undo) stack.
Todo:
2005-07-12 dls Tweak design to create abstract undo class, and reorganize as is appropriate, removing old undo structures (mUndoLL and mUndoXY).

Definition at line 162 of file GlacierLineHistory.h.


Public Member Functions

 GlacierLineHistory ()
virtual ~GlacierLineHistory ()
void push (GlacierLine &shp, int iline, int inode, HistoryAction action)
 Put a shape (GlacierLine) and information about the action that occurred to the shape on the history stack.
void push (Node &shp, int iline, int inode, HistoryAction action)
 Put a shape (Node) and information about the action that occurred to the shape on the history stack.
void push (GlacierLineHistoryElement *historyElement)
 Put a history element (modified node or line and info about the action that occurred to the shape) on the history stack.
GlacierLineHistoryElementpop ()
 Take a shape and information about the action that occurred to the shape off the history stack.
GlacierLineHistoryElementpeek ()
 Return the last action -- a shape and information about the action that occurred to the shape -- without popping it off the stack.
void clear ()
 Take a shape and information about the action that occurred to the shape off the history stack.
int size ()
 How many history items are stored in the history?

Private Attributes

stack
< GlacierLineHistoryElement * > 
mHistory
 A stack (last in, first out) of history elements.

Constructor & Destructor Documentation

GlacierLineHistory::GlacierLineHistory (  )  [inline]

Definition at line 168 of file GlacierLineHistory.h.

GlacierLineHistory::~GlacierLineHistory (  )  [inline, virtual]

Definition at line 169 of file GlacierLineHistory.h.


Member Function Documentation

void GlacierLineHistory::push ( GlacierLine shp,
int  iline,
int  inode,
HistoryAction  action 
) [inline]

Put a shape (GlacierLine) and information about the action that occurred to the shape on the history stack.

Parameters:
shp The shape (GlacierLine) modified by user action for which the class will store history information
iline The line's original position in the line set before modificaiton
inode The position of a node in the line (-1 for "not applicable)
action The action taken on this line by the user to cause a history element to be stored

Definition at line 181 of file GlacierLineHistory.h.

References mHistory.

Referenced by GLIMSLineData::addLine(), GLIMSLineData::breakLine(), GLIMSLineData::delLine(), GLIMSLineData::delLineNode(), GLIMSLineData::insertLineNode(), GLIMSLineData::joinLine(), GLIMSLineData::pop(), GLIMSLineData::pushSelection(), and GLIMSLineData::startMoveLineNode().

void GlacierLineHistory::push ( Node shp,
int  iline,
int  inode,
HistoryAction  action 
) [inline]

Put a shape (Node) and information about the action that occurred to the shape on the history stack.

Parameters:
shp The shape (Node) modified by user action for which the class will store history information
iline The line (referenced by index) the node belonged to before modificaiton
inode The position of the node in the line
action The action taken on this node by the user to cause a history element to be stored

Definition at line 196 of file GlacierLineHistory.h.

References mHistory.

void GlacierLineHistory::push ( GlacierLineHistoryElement historyElement  )  [inline]

Put a history element (modified node or line and info about the action that occurred to the shape) on the history stack.

Parameters:
historyElement An existing GlacierLineHistoryElement to add to the history stack

Definition at line 208 of file GlacierLineHistory.h.

References mHistory.

GlacierLineHistoryElement* GlacierLineHistory::pop (  )  [inline]

Take a shape and information about the action that occurred to the shape off the history stack.

Returns:
The top element in the history stack

Definition at line 219 of file GlacierLineHistory.h.

References mHistory.

Referenced by GLIMSLineData::pop().

GlacierLineHistoryElement* GlacierLineHistory::peek (  )  [inline]

Return the last action -- a shape and information about the action that occurred to the shape -- without popping it off the stack.

Returns:
The top element in the history stack

Definition at line 235 of file GlacierLineHistory.h.

References mHistory.

Referenced by GLIMSLineData::pop(), and GLIMSLineData::startMoveLineNode().

void GlacierLineHistory::clear (  )  [inline]

Take a shape and information about the action that occurred to the shape off the history stack.

Returns:
The top element in the history stack

Definition at line 250 of file GlacierLineHistory.h.

References mHistory.

Referenced by GLIMSLineData::addLine(), GLIMSLineData::breakLine(), GLIMSLineData::delLine(), GLIMSLineData::delLineNode(), GLIMSLineData::insertLineNode(), GLIMSLineData::joinLine(), GLIMSLineData::pushSelection(), and GLIMSLineData::startMoveLineNode().

int GlacierLineHistory::size (  )  [inline]

How many history items are stored in the history?

Returns:
Number of elements in the history

Definition at line 261 of file GlacierLineHistory.h.

References mHistory.

Referenced by GLIMSLineData::pop().


Member Data Documentation

A stack (last in, first out) of history elements.

Definition at line 165 of file GlacierLineHistory.h.

Referenced by clear(), peek(), pop(), push(), and size().


The documentation for this class was generated from the following files:

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov